Design with the Root Locus
The position loop of the previous lesson, , reaches a damping ratio of at , but its dominant poles sit at : the envelope needs about to settle. The specification says and a settling time of . No gain can do that, because the locus simply does not pass through the required poles. Root-locus design is the art of adding poles and zeros to the controller so that it does.
Turning a specification into a target point
A dominant pair gives
where is the angle from the negative real axis (Second-Order Systems). The specification , means , and the target
The angle deficit
The point is on the locus of only if (mod ). The angle that misses is the angle deficit the compensator must supply:
For at the pole angles are (from ), (from ) and (from ), so and the compensator must add . A zero to the left of adds positive angle; a pole subtracts it. Three classic choices:
| Compensator | Form | Effect |
|---|---|---|
| PD (ideal zero) | adds the whole angle with one zero; amplifies noise, needs a filter in practice | |
| lead | , | net angle = angle of zero − angle of pole; the pole limits high-frequency gain |
| PI or lag | or , , near the origin | adds almost no angle at , raises low-frequency gain for steady-state accuracy (Lag and Lead-Lag) |
After the angle is right, the magnitude condition fixes the gain.
Worked example: PD and lead for the position loop
Given: , target .
Find: a PD zero and a lead compensator that put the dominant poles at , their gains, the remaining poles, and the step overshoot and settling time.
Solve:
- PD: the zero alone supplies : . Magnitude: . The third closed-loop pole is at .
- Lead: put the zero on the plant pole at (it supplies ), so the pole must take away : . Gain . The other poles are at and at , the latter cancelled by the zero.
- Velocity constant (steady-state error to a ramp, Steady-State Error): , for alone, with the lead.
Check: with the program, which also simulates the steps.
import numpy as np
import control as ct
G = ct.tf([1], [1, 7, 10, 0])
sd = -2 + 3.4641j
Gsd = 1 / (sd * (sd + 2) * (sd + 5))
phi = -180 - np.degrees(np.angle(Gsd)) % 360 + 360
print(f"angle of G at sd: {np.degrees(np.angle(Gsd)) - 360:.1f} deg, deficit {phi:.1f} deg")
z = 2 + 3.4641 / np.tan(np.radians(phi))
designs = {"P K=11.37": ct.tf([11.37], [1])}
designs["PD zero"] = ct.tf([1 / abs(Gsd * (sd + z)), z / abs(Gsd * (sd + z))], [1])
p = 2 + 3.4641 / np.tan(np.radians(90 - phi))
Kl = 1 / abs(Gsd * (sd + 2) / (sd + p))
designs["lead"] = ct.tf([Kl, 2 * Kl], [1, p])
print(f"PD zero at -{z:.3f}, lead pole at -{p:.2f}, lead gain {Kl:.1f}")
t = np.linspace(0, 10, 20001)
for name, C in designs.items():
T = ct.feedback(C * G, 1)
pl = np.sort_complex(ct.poles(T))
info = ct.step_info(T, T=t)
print(f"{name:12s}: poles {', '.join(f'{q.real:.2f}{q.imag:+.2f}j' for q in pl)}")
print(f"{'':12s} overshoot {info['Overshoot']:5.1f} %, settling {info['SettlingTime']:.2f} s")angle of G at sd: -259.1 deg, deficit 79.1 deg
PD zero at -2.667, lead pole at -20.00, lead gain 336.0
P K=11.37 : poles -5.57+0.00j, -0.71-1.24j, -0.71+1.24j
overshoot 15.7 %, settling 5.81 s
PD zero : poles -3.00+0.00j, -2.00-3.46j, -2.00+3.46j
overshoot 20.0 %, settling 2.04 s
lead : poles -21.00+0.00j, -2.00+0.00j, -2.00-3.46j, -2.00+3.46j
overshoot 16.0 %, settling 2.06 s
Both designs place the pair where it was asked. The PD loop overshoots instead of the of a pure pair: its closed-loop zero at sits close to the dominant poles and adds a derivative kick to the response (Higher-Order Systems). The lead design keeps the extra pole far away at , and its zero cancels a pole, so it behaves almost exactly like the pure pair. A designer then checks what the spec sheet did not say: the lead's high-frequency gain is against for the PD (plus a filter), which matters for sensor noise and actuator saturation.
Intuition with the PID lab
Derivative action is a zero, and a zero pulls the locus towards itself. In the lab's loop with a P controller, the poles stay on the line (previous lesson). Add and the characteristic polynomial becomes : the real part moves to .
With and the poles are ; the lab shows an overshoot of (against with ) and a settling time of . The final value stays : derivative action changes the transient, not the steady state.
Guided lab: lead compensation on a motor position loop
Hand calculation. Work through the angle deficit for your own motor model (from the DC motor lesson, with the measured mechanical time constant). Predict the gain, the dominant poles and the overshoot.
Simulation. Replace the plant numbers in the program with yours; check that the third pole stays at least five times farther left than .
What you would measure. On the potentiometer-feedback motor from the previous lab, implement the lead as a difference equation (see Discrete PID) at . Step by and compare overshoot and settling with the prediction. Expect agreement within a few percentage points of overshoot when the motor stays out of current limit; larger steps saturate the driver and settle more slowly than the linear design.
Hazards and safe setup. Current-limited supply at , motor clamped, end stops or a software angle limit, an enable switch within reach; the lead's high gain amplifies potentiometer noise, so watch the motor current for chatter.
Pitfalls
- Choosing a target point no compensator can reach cheaply: a deficit above about per lead stage calls for two stages or a different plant (a faster sensor, a smaller load).
- Forgetting that a zero placed for angle also appears in the closed loop and raises overshoot.
- Cancelling a slow or unstable plant pole with a compensator zero: the cancelled mode still exists and shows up in the response to disturbances (or grows, if unstable).
- Judging a design by the dominant poles alone; always simulate the step, the disturbance response and the control effort.
Practice
- For , which gain gives with P control, and what is the settling time?
- With the same , where must a PD zero go to put the poles at ?
- A lead has , . What angle does it add at ?
Answer
- Poles ; needs , so ; .
- Angle of : , deficit ; .
- Zero: ; pole: ; net .
Test yourself
The angle deficit at a target point is
- the phase margin
Why did the PD design overshoot more than the 16.3 % a pure pair with would give?
- its gain was too high
- its zero also appears in the closed loop near the dominant poles
- the third pole was unstable
- of actuator saturation
Adding derivative gain to the lab's P loop ()
- changes the final value
- moves the real part of the poles to
- makes the loop type 1
- has no effect on the poles
After the angle condition places the locus through , the gain is found from
- Routh–Hurwitz
- the centroid
- the final-value theorem