I’m using the ODrive in an application which needs to do a number of fast step changes (sudden movements of up to 2 revolutions in ~50ms). I was getting some spinout errors early on in tuning, which I assumed were spurious and due to the high accelerations, and have raised the spinout thresholds to avoid these.
I’m encountering problems whilst tuning and want to double check that it’s from an incorrect gain and not the motor spinning out.
I’ve followed the tuning guide and have gradually raised the velocity gain until the motor exhibited some vibration. I then reduced the velocity gain by 50% and started raising the position gain. I’ve not getting any overshoot with the higher position gain but occasionally (maybe one time in ten) I get violent oscillations where the axis oscillates back and forth rapidly. These oscillations have only appeared at high position gains.
What could be causing this? Could this be due to spinout? I’m not sure what a motor spinout would look like. If it’s too high a velocity gain - are there any tips/tricks for tuning the controller for this high speed step change application? Are there any parameters other than velocity gain, position gain and velocity integrator gain that I really should be looking at? If it’s of any use, for all intents and purposes the load the motor is driving can be modelled as a spring.
As an aside - one of the reasons I’m concerned about spinout is that when the motor has errored during the tuning, the axis has been driven against an endstop and I worry each time this has happened the encoder has slipped slightly. What would the symptoms be of gradual encoder drift?
I was getting some spinout errors early on in tuning, which I assumed were spurious and due to the high accelerations, and have raised the spinout thresholds to avoid these.
I agree – 2 revolutions in 50ms is quite a bit, I’d expect a spurious spinout error without a very very high resolution encoder.
occasionally (maybe one time in ten) I get violent oscillations where the axis oscillates back and forth rapidly
This could be just due to a really marginal tuning situation, especially if you have a variable load (which it seems like yours is, as a spring).
Could this be due to spinout? I’m not sure what a motor spinout would look like.
Spinout typically won’t look like this – the effect of spinout (e.g. motor phase / encoder phase mismatch/slippage) usually looks like extremely high currents for very low torque output, or uncontrolled motor spinning in a given direction.
As an aside - one of the reasons I’m concerned about spinout is that when the motor has errored during the tuning, the axis has been driven against an endstop and I worry each time this has happened the encoder has slipped slightly
Hmm, I see. Gradual encoder drift will likely start just as the motor not outputting enough torque. What encoder specifically are you using, and could you share some pictures as to how it’s mounted?
raising encoder_bandwidth – I’d probably keep it at about 1500-2000 if using a magnetic encoder, but a high-resolution low-noise encoder could go up to 3000-4000 I’d bet.
Enabling wL_ff and bEMF_ff – these are mostly for higher speed transient performance, also note the latter requires an accurate motor kv measurement (I never trust the manufacturer’s numbers for that) – happy to recommend some methods