TExcelTAD
Home › Control Systems & Automation › Design with the Root Locus

Design with the Root Locus

The position loop of the previous lesson, L(s)=Ks(s+2)(s+5)L(s) = \frac{K}{s(s + 2)(s + 5)}, reaches a damping ratio of 0.50.5 at K=11.37K = 11.37, but its dominant poles sit at −0.714±j1.237-0.714 \pm j1.237: the envelope e−0.714te^{-0.714 t} needs about 4/0.714=5.6 s4/0.714 = 5.6\ \text{s} to settle. The specification says ζ=0.5\zeta = 0.5 and a settling time of 2 s2\ \text{s}. 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 s=−σ±jωds = -\sigma \pm j\omega_d gives

ζ=cos⁡θ,σ=ζωn,ts≈4σ (2 %),Mp=e−πζ/1−ζ2\zeta = \cos\theta, \quad \sigma = \zeta\omega_n, \quad t_s \approx \frac{4}{\sigma}\ (2\,\%), \quad M_p = e^{-\pi\zeta/\sqrt{1 - \zeta^2}}

where θ\theta is the angle from the negative real axis (Second-Order Systems). The specification ζ=0.5\zeta = 0.5, ts=2 st_s = 2\ \text{s} means σ=2\sigma = 2, ωn=σ/ζ=4 rad/s\omega_n = \sigma/\zeta = 4\ \text{rad/s} and the target

sd=−2±j 41−0.25=−2±j3.464s_d = -2 \pm j\,4\sqrt{1 - 0.25} = -2 \pm j3.464

The angle deficit

The point sds_d is on the locus of C(s)G(s)C(s)G(s) only if ∠C(sd)+∠G(sd)=−180∘\angle C(s_d) + \angle G(s_d) = -180^\circ (mod 360∘360^\circ). The angle that GG misses is the angle deficit the compensator must supply:

ϕc=−180∘−∠G(sd)\phi_c = -180^\circ - \angle G(s_d)

For G=1s(s+2)(s+5)G = \frac{1}{s(s + 2)(s + 5)} at sd=−2+j3.464s_d = -2 + j3.464 the pole angles are 120∘120^\circ (from 00), 90∘90^\circ (from −2-2) and 49.1∘49.1^\circ (from −5-5), so ∠G=−259.1∘\angle G = -259.1^\circ and the compensator must add ϕc=79.1∘\phi_c = 79.1^\circ. A zero to the left of sds_d adds positive angle; a pole subtracts it. Three classic choices:

Compensator Form Effect
PD (ideal zero) K(s+z)K(s + z) adds the whole angle with one zero; amplifies noise, needs a filter in practice
lead Ks+zs+pK\frac{s + z}{s + p}, p>zp > z net angle = angle of zero − angle of pole; the pole limits high-frequency gain
PI or lag Ks+zsK\frac{s + z}{s} or Ks+zs+pK\frac{s + z}{s + p}, zz, pp near the origin adds almost no angle at sds_d, raises low-frequency gain for steady-state accuracy (Lag and Lead-Lag)

After the angle is right, the magnitude condition ∣C(sd)G(sd)∣=1\lvert C(s_d)G(s_d) \rvert = 1 fixes the gain.

Worked example: PD and lead for the position loop

Given: G(s)=1s(s+2)(s+5)G(s) = \frac{1}{s(s + 2)(s + 5)}, target sd=−2±j3.464s_d = -2 \pm j3.464.

Find: a PD zero and a lead compensator that put the dominant poles at sds_d, their gains, the remaining poles, and the step overshoot and settling time.

Solve:

  • PD: the zero alone supplies 79.1∘79.1^\circ: z=2+3.464tan⁡79.1∘=2.667z = 2 + \frac{3.464}{\tan 79.1^\circ} = 2.667. Magnitude: K=∣sd∣∣sd+2∣∣sd+5∣∣sd+2.667∣=4×3.464×4.5833.528=18.0K = \frac{\lvert s_d \rvert \lvert s_d + 2 \rvert \lvert s_d + 5 \rvert}{\lvert s_d + 2.667 \rvert} = \frac{4 \times 3.464 \times 4.583}{3.528} = 18.0. The third closed-loop pole is at −3-3.
  • Lead: put the zero on the plant pole at −2-2 (it supplies 90∘90^\circ), so the pole must take away 10.9∘10.9^\circ: p=2+3.464tan⁡10.9∘=20.0p = 2 + \frac{3.464}{\tan 10.9^\circ} = 20.0. Gain K=336K = 336. The other poles are at −21-21 and at −2-2, the latter cancelled by the zero.
  • Velocity constant (steady-state error to a ramp, Steady-State Error): Kv=lim⁡s→0s CGK_v = \lim_{s \to 0} s\,C G, 1.137 s−11.137\ \text{s}^{-1} for K=11.37K = 11.37 alone, 336×2/(10×20)=3.36 s−1336 \times 2/(10 \times 20) = 3.36\ \text{s}^{-1} with the lead.

Check: with the program, which also simulates the steps.

python · try it yourself
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 20 %20\,\% instead of the 16.3 %16.3\,\% of a pure pair: its closed-loop zero at −2.667-2.667 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 −21-21, 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 K=336K = 336 against 1818 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 Re⁡(s)=−1.5\operatorname{Re}(s) = -1.5 (previous lesson). Add KdK_d and the characteristic polynomial becomes s2+(3+2Kd)s+2+2Kps^2 + (3 + 2K_d)s + 2 + 2K_p: the real part moves to −(1.5+Kd)-(1.5 + K_d).

r = 1+C(s): Kp 10, Ki 0, Kd 1P(s) = 1/((1s+1)(0.5s+1))y-T(s) = (1.000 s + 10.000) / (0.500 s^2 + 2.500 s + 11.000)closed-loop poles: -2.50+j3.97, -2.50-j3.970.00.51.000.5 s1.0 s1.5 s2.0 sty(t)t_s 1.56 s+15.9 %y(t)setpoint10-90 % rise

With Kp=10K_p = 10 and Kd=1K_d = 1 the poles are −2.5±j3.97-2.5 \pm j3.97; the lab shows an overshoot of 15.93 %15.93\,\% (against 34.63 %34.63\,\% with Kd=0K_d = 0) and a settling time of 1.560 s1.560\ \text{s}. The final value stays 0.90910.9091: 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 σ\sigma.

What you would measure. On the potentiometer-feedback motor from the previous lab, implement the lead as a difference equation (see Discrete PID) at 1 kHz1\ \text{kHz}. Step by 30∘30^\circ 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 12 V12\ \text{V}, 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 60∘60^\circ 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

  1. For G=1s(s+4)G = \frac{1}{s(s + 4)}, which gain gives ζ=0.5\zeta = 0.5 with P control, and what is the settling time?
  2. With the same GG, where must a PD zero go to put the poles at −4±j6.93-4 \pm j6.93?
  3. A lead has z=1z = 1, p=10p = 10. What angle does it add at s=−2+j2s = -2 + j2?
Answer
  1. Poles −2±jK−4-2 \pm j\sqrt{K - 4}; ζ=0.5\zeta = 0.5 needs ωd=23=3.46\omega_d = 2\sqrt{3} = 3.46, so K=16K = 16; ts≈4/2=2 st_s \approx 4/2 = 2\ \text{s}.
  2. Angle of GG: −(120∘+90∘)=−210∘-(120^\circ + 90^\circ) = -210^\circ, deficit 30∘30^\circ; z=4+6.93/tan⁡30∘=16.0z = 4 + 6.93/\tan 30^\circ = 16.0.
  3. Zero: 180∘−arctan⁡(2/1)=116.6∘180^\circ - \arctan(2/1) = 116.6^\circ; pole: arctan⁡(2/8)=14.0∘\arctan(2/8) = 14.0^\circ; net 102.5∘102.5^\circ.

Test yourself

The angle deficit at a target point sds_d is

  1. ∠G(sd)\angle G(s_d)
  2. −180∘−∠G(sd)-180^\circ - \angle G(s_d)
  3. 1/∣G(sd)∣1/\lvert G(s_d) \rvert
  4. the phase margin

Why did the PD design overshoot more than the 16.3 % a pure pair with ζ=0.5\zeta = 0.5 would give?

  1. its gain was too high
  2. its zero also appears in the closed loop near the dominant poles
  3. the third pole was unstable
  4. of actuator saturation

Adding derivative gain KdK_d to the lab's P loop (s2+(3+2Kd)s+2+2Kps^2 + (3 + 2K_d)s + 2 + 2K_p)

  1. changes the final value
  2. moves the real part of the poles to −(1.5+Kd)-(1.5 + K_d)
  3. makes the loop type 1
  4. has no effect on the poles

After the angle condition places the locus through sds_d, the gain is found from

  1. Routh–Hurwitz
  2. ∣C(sd)G(sd)∣=1\lvert C(s_d) G(s_d) \rvert = 1
  3. the centroid
  4. the final-value theorem