Sensorless mode in v0.6.8 - bug?

I have a project that uses sensorless velocity control mode. It has been working with an Odrive Pro and fw 0.6.6 for several months. Tried to get it running on a new unit today with a fw 0.6.8 controller, and it reliably throws error 0x2 at the switchover velocity (from sensorless ramp to closed-loop velocity control). Reverted to fw 0.6.6 and it works again…

This is great to know, thank you! Can you please test whether or not sensorless works in your application on 0.6.7?

How did you set up the 0.6.8 ODrive? Some parameters have changed, so odrivetool backup-config/restore-config may not be the most reliable.

How are you monitoring the error? Are you reading axis0.procedure_result, axis0.active_errors, or axis0.disarm_reason?

Error reporting comes off of [drive].axis0.active_errors

The system we got running needs to stay running now, so I won’t be able to test at fw 0.6.7 until we bring the next one up.

Setup for the 0.6.8 was initially done by pulling a saved json file from a working 0.6.6 system. On the encoder-based axes that I have migrated 0.6.6 → 0.6.8 I have noted that the encoder config variables changed naming/structure, and thus needed some direct adjustments. But in the case of the sensorless axis, all seemed well. The following were all set at runtime, so they were taken care of:

    prop_axis_ramp_rpss = 1
    prop_axis_ramp_targ_rps = 8  # use negative if wanting to go other direction

    prop_axis.controller.config.vel_ramp_rate = 15  # 8

    prop_axis.config.motor.pole_pairs = 21

    prop_axis.controller.config.vel_gain = .2  
    prop_axis.controller.config.vel_integrator_gain = .5

    prop_axis.controller.config.control_mode = ControlMode.VELOCITY_CONTROL
    prop_axis.controller.config.input_mode = InputMode.VEL_RAMP
    prop_axis.config.sensorless_ramp.vel = round( prop_axis_ramp_targ_rps *  prop_axis.config.motor.pole_pairs, 1 )
    prop_axis.config.sensorless_ramp.accel = round( prop_axis_ramp_rpss * prop_axis.config.motor.pole_pairs, 1 )

    prop_axis.config.sensorless_ramp.current = 26
    prop_drive.config.dc_max_negative_current = -8

    prop_axis.controller.input_vel = prop_axis_ramp_targ_rps
    
    prop_axis.controller.config.vel_limit = 40
    prop_axis.config.motor.current_soft_max = 2 * prop_axis.config.sensorless_ramp.current
    prop_axis.config.load_encoder = EncoderId.SENSORLESS_ESTIMATOR
    prop_axis.config.commutation_encoder = EncoderId.SENSORLESS_ESTIMATOR

changing the value of prop_axis_ramp_targ_rps, which then feeds into prop_axis.config.sensorless_ramp.vel would reliably set the speed at which the v0.6.8 system would throw the 0x2 error code.