Change friction/resistance


Is it possible to change the “friction” of a stepper motor when having the user back drive it? When the user back drives it I have the motor in torque mode with setpoint 0.

I need to do this in software or in hardware where software would be the preferred solution :slight_smile:

Hi Luca,

I think it can be done in software… sounds like you’re already detecting when its being back-driven, so for example if you set it to velocity mode with target 0, it should oppose any motion. If you use position mode with a set-point of the position when beginning back-driving, it will oppose motion and snap back to the initial position when the user lets go.
In these modes you can limit the torque (amount of “friction”) as well by limiting the voltage or current.

Can I just change the modes on the fly in my loop?

Thanks for your input!

In principle, yes. Outside of the function loopFOC() and move() you should be able to update most of the parameters.
You have to take care as the target values have quite different meanings in the different modes, and also I think the PID tuning does not have to be the same for different modes.

So it sounds a bit simpler than it is in practice, but should be quite possible.

1 Like