Inertia compensation with torque control

I have a motor connected to a 200/1 gearbox that is controlled by the torque feedback (axial strain gauges). Works perfectly with smooth motions, but if moved suddenly the system cavities. I think this is a product of the motors inertia.
I was going to try to compensate in my code but saw odrive has a built in inertia compensation function, would this work in my application and how do I calculate the value (I’m using the odrive 330kv motor).

Hi there,

The inertia compensation is primarily for enhanced control in VEL_RAMP/POS_FILTER/TRAP_TRAJ input modes, and probably won’t help here.

Can you provide some more information as to your system? How’s the data from the torque feedback returning to the ODrive?

The torque feedback is processed via a teensy which calculates a new motor torque based on the strain gauges output and a desired output torque value (and current motor torque), (for testing a desired output torque of zero is used though in use this will not be the main case).

My strain gauges are sub optimal and this does not help but its the motors inertia that is causing the problem (a fast adjustment to the arm in an opposite direction causes the motor and arm to shudder as the inertia causes it to overshoot the desired torque in one direction then the other) I have tried coding it out but I cant figure the correct way I can only get slight improvements.

I’m about to try a better strain gauge amplifier (better response time) but as I’m having this issue at 20% speed i don’t think it will be enough for full functionality.

Thanks I know this is an odd use case

Just tried the better amplifier (still only 80hz) and problem is mostly gone, I would like to have a better solution than just brute forcing it with sampling rate but I think that might be the correct solution.