Vel_integrator_current not returning to 0 when motor idle

I’m working on a power assistant robot project where I detect changes in the position of an odrive motor and add power to assist in the movement. And while I’m far from perfecting this at the moment, I’ve noticed that when the motor comes to a halt (and no other forces are acting on it), the vel_integrator_current does not return to 0 (or a close approximation of zero). Looking at the code I see why this might occur, as once the velocity error is 0, the integrator value won’t change. This means that the motor will then resist a change in movement if it happens to be in the opposite direction.

I wondered if anyone had any thoughts on how I might decay the integrator value? I’d rather not just disable it by setting the gain to 0.


That’s not true.

However, you have reminded me that we should reset the integrator current when switching into AXIS_STATE_CLOSED_LOOP_CONTROL.

Then I’m not quite sure what’s going on. If I zero out the integrator when the motor comes to rest it’s easy to deflect it in either direction; if I don’t, then it’s easy in one direction and hard in the other. Any thoughts? I realize what I’m doing is not what this was designed for.

What control mode are you in when you’re doing this?