Tuning the torque loop


I am developing a force-controlled robot. I tested the performance of the ODrive torque control mode after configuration. I simply measured the output torque using a torque sensor. While the result shows me that it takes about 300 ms to reach a new reference value, as shown in this figure:

I would like to know if it’s possible to improve its convergency speed by tuning any parameters.
And also, how can I change the kp, ki for the torque control loop?

Best regards,

You sure your sensor isn’t doing that filtering?

You can’t change them manually, but you can change them by changing the motor.config.current_control_bandwidth (they always maintain a critically damped configuration according to the inductance and resistance measurement)

Yes, there is a filter set for the sensor. I tried increasing the current_control_bandwidth but no luck, the convergency speed didn’t increase with that. Then, I increased the pos_gain, vel_gain, and vel_integrator_gain in addition, and it showed me a better result. Now, it takes about 50ms to reach a new reference.

Maybe my initial pos_gain, vel_gain and vel_integrator_gain is too small. I don’t know what exactly happen :joy:

Sorry, the convergency speed is about 100-110 ms now, instead of 50 ms.

That shouldn’t have any effect in torque control mode, but position/velocity yes of course