A new ODrive feature is ready for testing: Sensorless mode. This mode lets you run motors without and enocder. To do this we sacrifice two things: reduced accuracy as compared to an optical encoder, and lack of precise control at low speeds.
On the accuracy side, very preliminary results on this seems to indicate around 0.5 degrees 1-sigma error on my 7 pole pair motor.
On the low speed control: The minimum speed that supports good control is not yet established, but it will depend on the kv of the motor (rpm/v), and will probably be established in volts. My guess is that we could go down to around 500mV (so about 135 RPM for a 270 kv motor).
The other thing to consider is that we need to spin the motor up to the minimum controllable speed. Right now this is done by using an open-loop current that spins up with a fixed acceleration, with no feedback on the rotor position. That is, we simply hope that we don’t lose the rotor as it get’s pulled up to speed by the current vector. The startup current, acceleration, and the target speed for enabling closed loop are all configurable.
There will be a mechanism to check that we think we managed to get the rotor up to speed, and that the closed loop is working, so we can fail or start over if we lost the rotor on our way up to full speed. This mechanism will consist of checking that the velocity tracking PLL is reporting a speed that matches the final speed we hope the rotor to be in by the time we wish to enable sensorless closed loop control. This mechanism is not implemented yet.
The open-loop startup speed-ramp followed by switching to closed loop FOC velocity control is demonstrated in this video:
Note that position control is not available in this mode, and that the tuning parameters that used to have units of
counts/s (reffering to encoder counts/s), now have
rad/s, reffering to radians per second electrical. Note that
electrical frequency = mechanical frequency / pole pairs.
For example, to get my motor to spin at 500 RPM, and it has 14 magnets in the rotor (so 7 pole pairs), I would set the velocity setpoint to
500/60 * 2 * pi * 7 = 366.5 rad/s electrical. Similarly, if previously I had my machine well-tuned with a 2400CPR encoder, and the velocity gain was
x [A/(count/s)], it would now be
Four new parameters must be set:
motor.sensorless.pm_flux_linkage: this should be set to
5.51328895422 / (<pole pairs> * <rpm/v>). The
<rpm/v>is the kv of the motor.
motor.sensorless.spinup_current: motor current during spinup, in amps.
motor.sensorless.spin_up_acceleration: acceleration (slope) of the spin-up velocity ramp, in rad/s^2 electrical.
motor.sensorless.spin_up_target_vel: the speed at the end of the velocity spin-up ramp, where we switch over to sensorless closed loop. In rad/s electrical.