The Motion That Jittered at High Speed: Servo Tuning, From Symptom to Fix
A linear axis on a gantry. At low speed (100 mm/s), motion was smooth. At 500 mm/s, the carriage vibrated — a visible jitter along the direction of travel. The position error trace showed a 200 Hz oscillation. The servo was tuned too aggressively. This is the tuning process that got rid of the jitter.
What the jitter looked like
Not a mechanical rattle — a fine, high-frequency vibration along the axis. The carriage hummed at about 200 Hz. The position loop error was ±0.05 mm at the target, oscillating around the setpoint. The servo wasn’t hunting for position — it was resonating. The position loop gain was set too high, and the mechanical system had a natural frequency that the loop was exciting.
The tuning hierarchy
Servo loops have three gains: position loop, velocity loop, current loop. The position loop is outermost, velocity in the middle, current innermost. If the position loop gain is too high, it commands the velocity loop to overcorrect. The velocity loop overshoots. The position loop corrects back. Oscillation.
| Gain | What it controls | Too high | Too low |
|---|---|---|---|
| Position loop (Kp) | How aggressively it hunts position | Oscillation, jitter | Sluggish, overshoot |
| Velocity loop (Kv) | How tightly it holds speed | Whine at high speed | Speed droop under load |
| Velocity integral (Ki) | Long-term speed accuracy | Oscillation (integral windup) | Steady-state error |
| Notch filter | Damps mechanical resonance | Too wide = lost bandwidth | Too narrow = doesn’t help |
The fix, step by step
1. Lower the position loop gain. We halved Kp from 400 to 200 s⁻¹. The jitter stopped immediately. The axis was less stiff — it took slightly longer to settle — but it didn’t vibrate. This is the first thing to try. If the jitter disappears when Kp drops, you’re at the edge of the loop bandwidth.
2. Add a notch filter. The servo drive has a notch filter that can be tuned to the resonance frequency. We measured the resonance at 200 Hz (from the position error trace). We set the notch filter to 200 Hz, width 50 Hz, depth -10 dB. The filter attenuates the loop’s response at that frequency without killing the overall bandwidth. We could then raise Kp back to 350 — higher than the original 400 — without the jitter.
3. Tune the velocity loop. With Kp at 350, we checked the velocity loop. The Kv was set at the factory. We ran a step response: commanded a speed change and watched the velocity trace. The response had a small overshoot. We lowered Kv by 20%. The overshoot disappeared. The axis settled faster.
The mechanical side
The jitter wasn’t purely a tuning problem. The axis had a 2 m belt drive, which is less stiff than a ball screw. The belt’s natural frequency is about 200 Hz at that tension. The servo loop was exciting the belt’s resonance. The tuning fix (notch filter + lower Kp) worked, but the real long-term fix is stiffer mechanics.
For a future build, we’d use a ball screw (stiffer than a belt) or a linear motor (no mechanical transmission at all). The belt was the cost compromise. The servo tuning made it acceptable. A stiffer mechanical system lets you run higher loop gains, which means faster settling and better accuracy.
The numbers that worked
| Parameter | Factory setting | After tuning |
|---|---|---|
| Position loop Kp | 400 s⁻¹ | 350 s⁻¹ |
| Velocity loop Kv | 80 V·s/rad | 65 V·s/rad |
| Notch filter | None | 200 Hz, -10 dB |
| Settle time | 80 ms | 40 ms |
| Jitter at 500 mm/s | ±0.05 mm | ±0.005 mm |
When to tune and when to replace mechanics
If the jitter is below 100 Hz, it’s likely a mechanical resonance (belt, coupling, frame). Tuning can mask it, but the mechanical system is the problem. If the jitter is above 300 Hz, it’s almost always a tuning issue — the loop is too aggressive. Measure the resonance frequency. If it’s below 100 Hz, spend money on stiffer mechanics. If it’s 200 Hz or above, tune the loop and add a notch filter.
The tuning rule: High-speed jitter is almost always the position loop exciting a mechanical resonance. Lower Kp first. Add a notch filter at the measured resonance. Raise Kp back up. If the resonance is below 100 Hz, no amount of tuning will fix it — replace the belt with a screw, or the coupling with a stiffer one.