New dfu firmware, can't spin turnigy sk3 sensorless


#1

Motor is turnigy SK3 4250-350kv
using 12A bench supply set to 16V.

Make dfu succeeded. Tried a fresh start, erased config
power up with default settings, motor spins approx 90 deg.

In [9]: my_odrive.motor0.error
Out[9]: 22

my_odrive.axis0.config.do_calibration_at_start = 0

In [3]: my_odrive.axis0.config.enable_control_at_start
Out[3]: True
typedef enum {
    CTRL_MODE_VOLTAGE_CONTROL = 0,
    CTRL_MODE_CURRENT_CONTROL = 1,
    CTRL_MODE_VELOCITY_CONTROL = 2,
    CTRL_MODE_POSITION_CONTROL = 3
} Motor_control_mode_t;
my_odrive.motor0.config.control_mode = 2
typedef enum {
    ROTOR_MODE_ENCODER,
    ROTOR_MODE_SENSORLESS,
    ROTOR_MODE_RUN_ENCODER_TEST_SENSORLESS //Run on encoder, but still run estimator for testing
} Rotor_mode_t;
my_odrive.motor0.config.rotor_mode = 1

In [7]: my_odrive.motor0.config.vel_gain
Out[7]: 0.0005000000237487257

(left this at default value)

In [8]: my_odrive.motor0.config.vel_limit
Out[8]: 20000.0

(did not change from default value)

left all other settings at default

my_odrive.save_configuration()
my_odrive.reboot()

motor does not spin on powerup now. good, settings stuck.

In [3]: my_odrive.motor0.error
Out[3]: 0

In [4]: my_odrive.motor0.set_vel_setpoint(1000,0)

(nothing happens)

In [8]: my_odrive.motor1.vel_setpoint = 100

(also does nothing)

confirming settings are still correct

In [5]: my_odrive.motor0.config.control_mode
Out[5]: 2

In [6]: my_odrive.motor0.config.rotor_mode
Out[6]: 1

In [12]: my_odrive.motor0.error
Out[12]: 0

What am I missing to make this motor spin up?

Thanks,
Bill


Sensorless mode
Motor & encoder problem
#2

You must do calibration at startup: it should automatically skip the encoder calibration if you are in control_mode = ROTOR_MODE_SENSORLESS, but you still need to run the resistance and inductance measurements. So you still need do_calibration_at_start = True.

Don’t do this, the default gains are not appropriate for sensorless mode. Sorry we don’t have appropriate documentation for running sensorless by config over python. Maybe you can help us add it to the readme?
You need to set the gains to the recommended sensorless values, see here. You can set it over Python, that’s fine, but you should use those values (and tweak from there).
You also need to set sensorless.pm_flux_linkage, which has a comment how to calculate here.