The Axis That Overshot Every Move
We commissioned a servo axis. The motor and screw were sized right. On the first move, the axis overshot the target — it moved past the position and settled with a little oscillation. The following error was 0.2 mm. The customer wanted 0.02 mm. The problem: the loop gains weren’t tuned. The drive ran on default gains (too soft). The axis lagged (following error) and overshot. We tuned the gains: increased the position loop gain, added a little velocity feed-forward, and damped the oscillation. The following error dropped to 0.02 mm. No overshoot. The mistake was assuming the default tuning would work. Servo loops need tuning.
Servo loop tuning basics sets the gains so the axis follows the command accurately and without oscillation. This article covers the concepts.
The Three Loops
A servo drive has three control loops (nested):
- Current loop (innermost): Controls the motor current (torque). Fastest (kHz). Usually auto-tuned, don’t touch.
- Velocity loop (middle): Controls the motor speed. Tuned for smoothness and response.
- Position loop (outermost): Controls the position. Tuned for accuracy (low following error).
Tuning adjusts the velocity and position loop gains. The current loop is handled by the drive.
Step 1: Following Error
Following error is the difference between the commanded position and the actual position (during the move). The axis lags behind the command. It’s:
FE = v / K_p
Where v is the velocity (mm/s) and K_p is the position loop gain (1/s). For v = 100 mm/s and K_p = 20 /s: FE = 100 / 20 = 5 mm. That’s huge. For K_p = 100 /s: FE = 1 mm. For K_p = 500 /s: FE = 0.2 mm. Higher K_p = lower following error.
But K_p can’t be too high (the axis oscillates). The limit is the mechanical resonance (the screw, the coupling, the load). Tune K_p to the highest value without oscillation.
The tuning rule: Raise the position loop gain (K_p) until the axis oscillates (buzzes, overshoots). Then back off 20%. That’s the tuned K_p. The axis that overshot had K_p too low. Raise it until it’s stiff (low following error), then dial back for stability.
Step 2: Stiffness and Damping
A servo loop is like a spring (the gain) with damping. Too stiff (high gain) and the axis oscillates (rings). Too soft (low gain) and it’s slow (high following error). The tuning balances stiffness (accuracy) against damping (stability).
- High gain (stiff): Low following error. But risks oscillation (mechanical resonance).
- Low gain (soft): Stable, but the axis lags (high following error).
- Damping: Velocity loop gain (or a notch filter) reduces the oscillation. Damp the resonance.
Step 3: Auto-Tune vs Manual
Modern servo drives have an auto-tune (the drive wiggles the motor, measures the response, sets the gains). It’s a good starting point. But it might not be optimal (it can’t know the application). After auto-tune, manually adjust:
- Raise K_p (position gain) for lower following error (until oscillation).
- Add velocity feed-forward (reduces following error during moves).
- Add a notch filter (if there’s a resonance frequency).
Step 4: Mechanical Resonance
The mechanical system (screw, coupling, load) has a resonance frequency. If the loop gain excites it, the axis buzzes. The resonance comes from:
- Coupling wind-up (article 89): A flexible coupling twists, creating a spring-mass system. Use a stiff (bellows) coupling.
- Screw critical speed (article 131): A long screw resonates. Check N_c.
- Loose mechanics: Backlash (article 68, 101), a loose coupling, a bent shaft. Fix the mechanics before tuning.
If the mechanics are loose, no tuning fixes it. Tighten everything first.
| Symptom | Cause | Fix |
|---|---|---|
| Overshoot on every move | Too soft (low K_p) | Raise K_p |
| Oscillation (buzzing) | Too stiff (high K_p) or resonance | Lower K_p, add damping/notch filter |
| High following error | Low K_p, or no feed-forward | Raise K_p, add velocity feed-forward |
| Backlash (lost motion) | Mechanical (article 68) | Fix the mechanics (preload), not the tuning |
A Tuning Checklist
- Are the mechanics tight? (Coupling, screw preload?)
- Did you run auto-tune? (Starting point?)
- What is the following error? (FE = v/K_p?)
- Raise K_p until oscillation? (Then back off 20%?)
- Is there a resonance? (Buzzing at a certain frequency?)
- Is a notch filter needed? (For the resonance?)
- Is velocity feed-forward added? (Reduces FE during moves?)
- Is the axis stable over the whole speed range? (Not just at one speed?)
- Is the move smooth? (No jerk?)
- Is the final following error within spec? (0.02 mm?)
The Bottom Line
Servo loop tuning basics sets the gain for stiffness without oscillation. The axis that overshot had low K_p. Raise the position gain until it oscillates, then back off 20%. Add velocity feed-forward to reduce following error during moves. Use a notch filter if there’s a mechanical resonance. But first, fix the mechanics (tight coupling, preloaded screw) — no tuning fixes loose hardware. The axis that moves accurately and smoothly wasn’t the default tuning — it was tuned.