New Firmware Migration Issue

I just got the new 0.5.1 Firmware and am having trouble running my motor in sensorless mode.

Here is the code that worked for me with 4.12 firmware :

odrv0.axis0.motor.config.current_lim = 15
odrv0.axis0.motor.config.calibration_current = 10
odrv0.axis0.motor.config.pole_pairs = 2
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT

odrv0.axis0.controller.config.vel_gain = 0.01
odrv0.axis0.controller.config.vel_integrator_gain = 0.05
odrv0.axis0.controller.config.control_mode = 2
odrv0.axis0.motor.config.direction = 1
odrv0.axis0.sensorless_estimator.config.pm_flux_linkage = 5.51328895422 / (3800)
    #3800 is 2 pole pairs * 1900kv

odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
odrv0.axis0.motor.is_calibrated 
   #this returned true
odrv0.axis0.motor.config.pre_calibrated = True
odrv0.save_configuration()
odrv0.reboot()

odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis0.controller.vel_setpoint = 400
odrv0.axis0.requested_state = AXIS_STATE_SENSORLESS_CONTROL

Here is the code that I adjusted to be compatible with the new (0.5.1) Firmware:

odrv0.axis0.motor.config.current_lim = 20
odrv0.axis0.motor.config.calibration_current = 10
odrv0.axis0.motor.config.pole_pairs = 2
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT

odrv0.axis0.controller.config.vel_gain = 0.01
odrv0.axis0.controller.config.vel_integrator_gain = 0.05
odrv0.axis0.controller.config.control_mode = 2
odrv0.axis0.controller.config.vel_limit = 500
odrv0.axis0.motor.config.current_lim = 20
odrv0.axis0.config.sensorless_ramp.current = 10
odrv0.axis0.motor.config.direction = 1
odrv0.axis0.sensorless_estimator.config.pm_flux_linkage = 5.51328895422 / 3800

odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
odrv0.axis0.motor.is_calibrated 
   #this returned true
odrv0.axis0.motor.config.pre_calibrated = True
odrv0.save_configuration()
odrv0.reboot()

odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis0.controller.input_vel = 10
odrv0.axis0.requested_state = AXIS_STATE_SENSORLESS_CONTROL

Please let me know if you notice any issues with my commands. Thanks!
Additional question: Is input_vel calculated the same way that vel_setpoint was on the old firmware? (i.e. if I set input_vel = 400 will it run the motor at the same speed as it was on v4.12 when I set vel_setpoint = 400?)

Thank you for your help!

SOLVED: Don’t forget to write the command odrv0.erase_configuration() after the firmware update!

2 Likes