A Positioning Loop That Overshoots After the PLC Was Added
A machine-tool axis uses a DC servo with a current-mode drive, a 1000-line incremental encoder and a PLC-based position loop. From the command to the encoder output, the axis behaves as G(s) = K / (s(1 + 0.1s)) with K = 20 s⁻¹ - the product of motor gain, encoder scaling and proportional controller gain. The PLC samples the position error every 20 ms, and the zero-order hold together with the drive's current-loop response adds an effective lag of about 30 ms. Using the model as written, the design file reports a gain crossover at 12.5 rad/s with 38.7° of phase margin, which the designer accepted as adequate. On the machine, a 100 mm step over 0.5 s produces 55% overshoot with visible oscillation near 2 Hz. The maintenance team wants to fit a larger motor, arguing the axis is under-torqued. Logged drive current saturates only for the first 40 ms of the step, which argues against a torque limit.
1. Verify the reported 12.5 rad/s crossover and 38.7° phase margin, then show quantitatively that the loop's effective lag explains the observed 55% overshoot.
Read the worked answer
Crossover: |KG(jω)| = K / (ω√(1 + (0.1ω)²)) = 1 with K = 20:
ω²(1 + 0.01ω²) = 400 → 0.01u² + u − 400 = 0 with u = ω² → u = (−1 + √17)/0.02 = 156.2 → ω = 12.50 rad/s ✓
Phase at crossover: −90° − tan⁻¹(1.25) = −90° − 51.3° = −141.3°, so phase margin is 38.7° ✓. Using ζ ≈ PM/100 = 0.387, predicted overshoot is exp(−π(0.387)/√(1−0.15)) = exp(−1.319) = 0.267, about 27%. The machine gives 55%, so the model is missing something.
The missing term is the 30 ms of effective lag (ZOH plus current loop). Its phase contribution at 12.5 rad/s is ωτ = 12.5 × 0.030 = 0.375 rad = 21.5°. It does not change the magnitude appreciably, so the crossover stays near 12.5 rad/s but the phase margin collapses to 38.7° − 21.5° = 17.2°. Then ζ ≈ 0.17 and predicted overshoot = exp(−π(0.17)/√(1−0.029)) = exp(−0.548) = 0.578, i.e. 58%, against 55% measured. The oscillation frequency is consistent too: ωd ≈ 12.5 rad/s gives about 12.5/2π ≈ 2 Hz, matching the visible 2 Hz ring. The model is not wrong, it is incomplete; the axis is not under-torqued, so a bigger motor would change nothing.
2. Choose the proportional gain that restores 45° of phase margin, and quantify what it costs.
Read the worked answer
With phase margin 45°, the total open-loop phase at the new crossover must be −135°:
−90° − tan⁻¹(0.1ω) − (0.030ω rad)(180/π) = −135°
Equivalently tan⁻¹(0.1ω) + 1.719ω = 45° (ω in rad/s). Try values:
- ω = 6: tan⁻¹(0.6) = 31.0°, plus 1.719(6) = 10.3° → 41.3°
- ω = 7: 35.0° + 12.0° = 47.0°
Interpolating, ωc ≈ 6.6 rad/s. Magnitude at that frequency:
|G(jωc)| = 1 / (6.6√(1 + 0.436)) = 1 / (6.6 × 1.198) = 1/7.91 = 0.126
so required K = 1/0.126 = ≈ 7.9 s⁻¹, down from 20.
The cost is bandwidth: crossover falls from 12.5 to 6.6 rad/s, a factor of 1.9, so the closed-loop response time roughly doubles. For a 100 mm move this shows up directly as a longer settling time - halving the move time is no longer possible on this axis without changing the lag. Note also that the overshoot specification, not the steady-state error, drives the answer: with a type-1 loop, proportional gain sets both, and lowering K raises the velocity-error constant only by lowering 1/Kv, i.e. it degrades following error during the move.
3. Compare the maintenance team's proposal with reducing the loop lag or adding compensation, and recommend a course of action.
Read the worked answer
Bigger motor. The current log shows saturation for only the first 40 ms; after that the drive is in linear control and the response is governed by the loop's phase margin. A larger motor changes gain and inertia somewhat but leaves the 30 ms lag untouched, so it cannot remove the 17° of phase margin. It would add cost, may worsen the inertia mismatch, and would require retuning anyway. Reject.
Reduce the lag. This attacks the root cause. Cutting the effective lag from 30 ms to 10 ms (raise the PLC scan from 20 ms to 5 ms, or move the position loop into the drive where it runs at the current-loop rate) gives a phase contribution at 12.5 rad/s of only 7.2° instead of 21.5°, so phase margin returns to about 31.5° with K = 20 - and the 10 ms lag would allow K to be raised past 20. If the PLC must stay, feedforward of velocity and acceleration from the motion profile removes most of the following error during the move, letting the feedback gain stay low without the move taking longer.
Compensation. A lead network or a PD term can add the missing 20–25° of phase, but it amplifies encoder quantisation noise (1000 lines giving 0.36 mm per count at typical pitch is already coarse) and needs a filter, so it is the third choice. A Smith predictor is theoretically attractive for known dead time but is fragile to plant changes.
Recommendation: move the position loop to the drive or cut the scan to 5 ms, add velocity feedforward, then retune for 45–50° phase margin, keeping K as high as the lag allows. Do not change the motor.