A servo axis that oscillated after auto-tune. The axis was a ball screw drive, 400W motor, moving a 20 kg load. The drive’s auto-tune ran for 30 seconds and set the gains. At low speed (10 mm/s), the axis was smooth. At high speed (500 mm/s), it oscillated — the load buzzed audibly. The customer re-ran auto-tune. It set different gains. The oscillation moved to a different speed. The auto-tune couldn’t find a stable compromise. This is about servo tuning and why auto-tune is a starting point, not a final setting.
The three loops
A servo drive has three nested control loops. The innermost is the current loop (bandwidth ~1000 Hz). The middle is the velocity loop (~100 Hz). The outermost is the position loop (~20 Hz). Each loop must be tuned before the outer loop. If the velocity loop oscillates, the position loop can’t be stable. Auto-tune measures the load inertia and sets all three loops at once. It works for 80% of applications. The remaining 20% need manual tuning.
The oscillating axis had a velocity loop gain of 120 Hz. At 500 mm/s (motor at 2500 RPM = 42 Hz), the velocity loop gain at 120 Hz was 3x the resonant frequency. The load’s mechanical resonance (the ball screw and coupling) was at 80 Hz. The velocity loop excited the resonance. The buzz at 500 mm/s was the load vibrating at 80 Hz.
What was changed
1. Lowered the velocity loop gain to 60 Hz. The gain was reduced by half. The oscillation disappeared. The axis was slightly less stiff (position error doubled) but stable at all speeds. The customer traded 0.02 mm of stiffness for zero oscillation. For a pick-and-place axis, that’s the right tradeoff.
2. Added a notch filter. The drive’s digital notch filter was set to 80 Hz with a Q of 5. The filter attenuates the velocity loop’s response at the resonance frequency. The gain at 80 Hz dropped from 120 Hz to 20 Hz. The loop could be set to 100 Hz without exciting the resonance. The axis was both stiff and stable. The notch filter is the standard fix for mechanical resonance — it’s better than just lowering the gain.
3. Set feedforward gains. The position error during motion was 0.05 mm (the controller lagged behind the command). A velocity feedforward gain of 95% eliminated most of this error. The axis now tracks the command within 0.005 mm during motion. The settle time (waiting for the position error to clear at the end of the move) dropped from 200 ms to 50 ms. The cycle time improved by 150 ms per move.
The tuning procedure
A manual servo tuning follows this sequence:
- Set current loop: this is automatic. The drive knows the motor parameters. Skip.
- Measure inertia ratio: run auto-tune or use the inertia measurement. The ratio should be under 10:1. If it’s 30:1, upsizing the motor or gearbox is the real fix — tuning can’t compensate.
- Set velocity loop gain: start low (20 Hz). Increase until the axis buzzes at high speed, then back off 30%. This is the maximum stable gain.
- Add notch filters: if there’s a mechanical resonance, set a notch at the buzz frequency. Then increase the velocity gain further.
- Set position loop gain: start at 10 Hz. Increase until the axis overshoots at the end of a move, then back off 20%.
- Set feedforward: velocity feedforward to 95%, acceleration feedforward to 50%. Measure the position error during motion. Tune the feedforward to minimize it.
- Test at all speeds: run the axis from 1 mm/s to max speed. Listen for buzz. If it buzzes at a specific speed, there’s a resonance at that frequency. Add another notch.
The settle time vs stiffness tradeoff
Higher position loop gain means stiffer positioning but longer settle time (the axis overshoots and oscillates before settling). Lower gain means soft positioning but fast settle. For a palletizing axis (100 ms settle acceptable), high gain is fine. For a dispensing axis (continuous motion), feedforward matters more than loop gain. The tuning goal isn’t maximum gain — it’s the minimum gain that meets the application’s accuracy and cycle time requirements.
| Application | Position loop gain | Feedforward | Settle time |
|---|---|---|---|
| Pick and place | 20 Hz | 80% velocity | 50 ms |
| Dispensing (continuous) | 10 Hz | 95% velocity + 50% accel | 10 ms |
| Milling (high stiffness) | 50 Hz | 50% velocity | 100 ms |
| Welding (path accuracy) | 15 Hz | 95% velocity + 80% accel | 20 ms |
The tuning rule: auto-tune is a starting point, not the final answer. The buzzing axis had velocity loop gain 3x the mechanical resonance frequency. Lower the gain or add a notch filter. Set feedforward to minimize position error during motion. Test at all speeds. A stable axis at 10 Hz beats an oscillating axis at 100 Hz. Tuning is the art of finding the stability/performance compromise.