Position drifting when using odrive pro with hallsensors

I use the odrive pro and a brushless dc motor with hall sensors for position control of a rotary axis. The axis has an encoder mounted, and we can se after a while - the reported position from the odrive starts to drift away from the actual position reported by the encoder on the axis. This start to be a problem after 10 000 + rounds (rotations of the motor). I saw in an old changelog that:

  • Fix scaling of hall and sensorless mode, reported speed / position was too high by a factor of motor.pole_pairs
    Note: Due to this fix, position control may drift over time in hall mode (sensorless does not support position control mode)

I belive it is the pos_abs value that starts to drift after a while. Is there any way around this problems?

Im using Trajectory Control, so sadly circular setpoints is not an option from what I understand.

Hi! This is interesting, we made some changes to hall behavior recently that I thought addressed issues like this, but I’ll check in with our software guy.

Also, does this only happen when pos_abs is large? e.g. if you reset axis0.pos_estimate = 0 before each move, does this issue still persist?

You are right, we were running an older firmware version - did some testing and the motor do not seem to drift any more. Will do some more proper testing with the actual rig later.

Just spun the motor a couple thousands time now with the old firmware and then with the new. Did full rotations and with the old firmware the motor did not return to the starting position after 1000+ rounds. With the new firmware it always ended up at the same place.

Thank you!

Great to hear! Please let me know if you have any other issues!