---
title: Lead and lag compensators on the root locus
heading: Reshaping the root locus with a lead compensator to place dominant poles where the specification wants them, using the angle deficiency, then raising the error constant with a lag compensator that barely moves those poles
eyebrow: S9 · Lesson 14 · Lead and lag compensators on the root locus
xp: 50
---

::: hook
Gain alone moves the closed-loop poles only along the locus, so if the locus never passes through the region the specification asks for, no gain will do. The cure is to change the locus itself by adding a zero and a pole to the controller. A lead compensator adds phase and pulls the locus left, making the loop faster at the same damping; a lag compensator adds gain at low frequencies to cut steady-state error while leaving the transient alone. Together they're the classical controller, and an analog op-amp circuit implements either one.
:::

::: play
- The locus of $L = K(s + z)/(s(s + 1)(s + p))$: the plant $1/(s(s + 1))$ with a lead compensator, zero at −z and pole at −p.
- The target is ζ = 0.5 with $\omega_n$ = 4: poles at $-2 \pm j3.46$. The readout shows the angle the lead contributes there; the design needs 46.1°.
- With z = 2 and p = 5.6 the locus passes through the target, and K = 20.8 puts the poles on it. Try moving the zero to −1 or −3 and find the p that works.
:::

```sim plot
view: splane
x: sigma = -8..1 rad/s
y: omega = -5..5 rad/s
slider: z = 0.5..5 = 2
slider: p = 2..15 = 5.6
slider: K = 0..60 = 20.8 step 0.1
num: s + z
den: s*(s + 1)*(s + p)
locus: K = 0..300
pole: -2 + 3.4641*j | label: target
readout: lead angle at the target, ° = (arg(z - 2 + 3.4641*j) - arg(p - 2 + 3.4641*j))*180/pi | digits: 3
```

::: predict
## The plant $1/(s(s + 1))$ under gain alone gives ζ = 0.5 only at K = 1 ($\omega_n$ = 1). Why can't more gain make it faster at the same damping?

- [ ] More gain makes it unstable
- [x] The closed-loop poles' real part is stuck at −0.5 for every K above 0.25
- [ ] The poles move right as K rises
- [ ] Gain only affects steady-state error

::: reveal
The characteristic equation $s^2 + s + K = 0$ has roots $-0.5 \pm j\sqrt{K - 0.25}$: the locus is a vertical line at −0.5. More gain raises the frequency but never the decay rate, so settling stays near 8 s and damping falls. Only a compensator that bends the locus left can do better.
:::
:::

::: nameit
## Lead and lag

$$C(s) = K_c\frac{s + z}{s + p}$$

- **Lead** (z < p): the zero is nearer the origin, so the compensator adds positive phase, pulling the locus left. Its DC gain is $K_cz/p$.
- **Lag** (p < z, both near the origin): it adds gain $z/p$ at low frequency and only a few degrees of phase lag near the dominant poles.

## Lead design by angle deficiency

1. From the specification, pick the target dominant pole $s_d$ (lesson 7).
2. Compute the plant's angle there. The compensator must supply the **deficiency** $\phi = -180° - \angle G(s_d)$ so the angle condition holds.
3. Place the zero (a common choice is directly below $s_d$ on the real axis, or on a plant pole you want to neutralize) and put the pole where its angle is the zero's angle minus φ.
4. Find K from the magnitude condition, $K = 1/|C(s_d)G(s_d)|$ with $K_c$ folded in.
5. Check the other closed-loop poles and zeros by simulation: a compensator zero near the dominant poles adds overshoot.

## Lag design

Choose $z/p$ equal to the factor by which the error constant must rise, and put z about a tenth of $|s_d|$ from the origin so the pair shifts the dominant poles by only a degree or so. The pole–zero pair leaves a small, slow tail (lesson 8).
:::

::: example
## Design a lead for $G = 1/(s(s + 1))$ to give ζ = 0.5 and $\omega_n$ = 4.

::: solution
1. **Target point.**
   $$s_d = -2 + j3.464$$
2. **Angle deficit.** The plant's angle there is
   $$\begin{aligned} \angle G &= -(120° + 106.1°) \\ &= -226.1° \end{aligned}$$
   so the lead must add 46.1°.
3. **Place the pole.** With the zero at −2, directly below the target, its angle is 90°, so the pole must be seen at 90° − 46.1° = 43.9°:
   $$\begin{aligned} p &= 2 + \frac{3.464}{\tan 43.9°} \\ &= 5.6 \end{aligned}$$
4. **Gain.** The magnitude condition gives
   $$\begin{aligned} K &= \frac{|s||s + 1||s + 5.6|}{|s + 2|} \\ &= 20.8 \end{aligned}$$
   with the third closed-loop pole at −2.6.
5. **Check by simulation.** It settles in 2.05 s (four times faster than gain alone could manage at this damping) but overshoots 27% instead of 16%, because the closed-loop zero at −2 sits right under the dominant poles.
6. **Velocity constant.**
   $$\begin{aligned} K_v &= 20.8 \times 2/5.6 \\ &= 7.43 \end{aligned}$$

**Answer:** the lead $20.8\,(s + 2)/(s + 5.6)$, which settles in 2.05 s with 27% overshoot and gives $K_v$ = 7.43.
:::
:::

::: example
## Add a lag to the design above to raise $K_v$ fivefold.

::: solution
1. **Place the lag.** Put its zero at −0.1 (a twentieth of $|s_d|$) and its pole at −0.02, a ratio of 5.
2. **Effect at the target.** It contributes −1.0° of phase and a gain of 0.990, so the dominant poles barely move, to
   $$s = -1.94 \pm j3.44$$
3. **The new slow pole.** A new closed-loop pole at −0.101 sits almost on the zero at −0.1, leaving a tiny slow tail.
4. **Result.** $K_v$ rises to 37.1, the ramp lag drops five times, and the step response still settles in 2.0 s with 30% overshoot.

**Answer:** a lag with its zero at −0.1 and pole at −0.02 raises $K_v$ to 37.1, and the step response still settles in 2.0 s, with 30% overshoot.
:::
:::

::: example
## Design a lead for $G = 1/(s(s + 2))$ by cancelling its pole at −2, to put the closed-loop poles at −4 ± j4.

::: solution
1. **Cancel the pole.** With the zero at −2,
   $$L = \frac{K_c}{s(s + p)}$$
   and the closed loop is $s^2 + ps + K_c$.
2. **Match the target.** The target polynomial is
   $$(s + 4)^2 + 16 = s^2 + 8s + 32$$
   so p = 8 and $K_c$ = 32.
3. **The controller.**
   $$C = 32\,\frac{s + 2}{s + 8}$$
4. **Check the result.** It has ζ = 0.707 and $\omega_n$ = 5.66 rad/s, and
   $$\begin{aligned} K_v &= 32/8 \\ &= 4\ \text{s}^{-1} \end{aligned}$$
5. **Why cancelling is clean here.** The cancelled pole at −2 is fast enough that the disturbance mode it hides dies quickly.

**Answer:** $C = 32(s + 2)/(s + 8)$, giving ζ = 0.707, $\omega_n$ = 5.66 rad/s and $K_v$ = 4 s⁻¹.
:::
:::

::: check
given: c = 1 | 2; w = 2 | 4; z = 0.5 | 3; p = 6 | 12
answer: (arg(z - c + j*w) - arg(p - c + j*w))*180/pi
unit: °
tolerance: 0.5%

## A lead compensator has its zero at −{z} and pole at −{p}. How much phase does it add at $s = -\given{c} + j\given{w}$?

::: right
Right. The zero's angle minus the pole's: {answer}°.
:::

::: misses
- [(arg(p - c + j*w) - arg(z - c + j*w))*180/pi] Zeros add angle and poles subtract it.
- [any] Not yet. Measure the angle of $s + z$ and of $s + p$ at that point.
:::
:::

::: check
given: a = 1 | 2; c = 2 | 3; w = 2 | 4
answer: (arg(-c + j*w) + arg(a - c + j*w))*180/pi - 180
unit: °
tolerance: 0.5%

## The plant $1/(s(s + \given{a}))$ should have closed-loop poles at $-\given{c} \pm j\given{w}$. How much phase must a lead compensator add there?

::: right
Right. The plant's angle is −(∠s + ∠(s + a)), so the deficiency is their sum minus 180°: {answer}°.
:::

::: misses
- [(arg(-c + j*w) + arg(a - c + j*w))*180/pi] Subtract the 180° the angle condition allows.
- [any] Not yet. The total angle must be −180°.
:::
:::

::: check
given: f = 20 | 40; c = 2 | 4; w = 3 | 6
answer: c + w/tan((90 - f)*pi/180)
unit: rad/s
tolerance: 0.5%

## A lead must add {f}° at $-\given{c} + j\given{w}$, with its zero at −{c}. Where does its pole go?

::: right
Right. The zero is seen at 90°, so the pole must be seen at 90° − {f}°: p = {answer}.
:::

::: misses
- [c + w/tan(f*pi/180)] The pole's angle is 90° minus the lead, not the lead itself.
- [any] Not yet. Solve $\tan^{-1}(\omega/(p - c)) = 90° - \phi$.
:::
:::

::: check
given: a = 1 | 2; c = 2 | 3; w = 2 | 4; z = 1.5 | 3; p = 6 | 10
answer: abs(-c + j*w)*abs(a - c + j*w)*abs(p - c + j*w)/abs(z - c + j*w)
tolerance: 0.5%

## $L = K(s + \given{z})/(s(s + \given{a})(s + \given{p}))$. What K puts a closed-loop pole at $-\given{c} + j\given{w}$, assuming the angle condition holds there?

::: right
Right. $K = |s||s + a||s + p|/|s + z|$ = {answer}.
:::

::: misses
- [abs(-c + j*w)*abs(a - c + j*w)*abs(p - c + j*w)*abs(z - c + j*w)] The zero's distance goes in the denominator.
- [any] Not yet. The magnitude condition, $|L| = 1$.
:::
:::

::: check
given: K = 2 | 5 | 8; z = 0.05 | 0.1; p = 0.005 | 0.02
answer: K*z/p
unit: s^-1
tolerance: 0.5%

## A loop has $K_v$ = {K} s⁻¹. A lag compensator with its zero at −{z} and pole at −{p} (unity gain at high frequency) is added. What's the new $K_v$?

::: right
Right. The lag multiplies the DC gain by $z/p$: {answer}.
:::

::: misses
- [K*p/z] A lag's low-frequency gain is z/p, which is above 1.
- [any] Not yet. Evaluate $(s + z)/(s + p)$ at s = 0.
:::
:::

::: check
given: z = 0.1 | 0.2; p = 0.01 | 0.02; c = 1 | 2; w = 2 | 3
answer: (arg(z - c + j*w) - arg(p - c + j*w))*180/pi
unit: °
tolerance: 1%

## A lag with its zero at −{z} and pole at −{p}: what phase does it add at the dominant pole $-\given{c} + j\given{w}$?

::: right
Right. {answer}°: a small lag, which is why the dominant poles barely move.
:::

::: misses
- [any] Not yet. The zero's angle minus the pole's, at that point.
:::
:::

::: check
kind: parts
given: a = 1 | 2 | 3; c = 4 | 6; w = 3 | 5

## A lead's zero cancels the pole at −{a} of $G = 1/(s(s + \given{a}))$, and the closed-loop poles must sit at $-\given{c} \pm j\given{w}$.

::: part
answer: 2*c
tolerance: 0.5%

### Where does the lead's pole go?

::: misses
- [any] Match $s^2 + ps + K_c$ to $(s + c)^2 + w^2$.
:::
:::

::: part
answer: c^2 + w^2
tolerance: 0.5%

### What gain $K_c$?

::: misses
- [any] $K_c = c^2 + w^2$.
:::
:::

::: part
answer: (c^2 + w^2)/(2*c)
unit: s⁻¹
tolerance: 0.5%

### What velocity constant results, in s⁻¹?

::: misses
- [any] $K_v = K_c/p$ once the cancellation leaves $K_c/(s(s + p))$.
:::
:::
:::

::: check
kind: derivation
vars: c = 0.5..10, w = 0.5..10

## A cancellation lead turns $1/(s(s + a))$ into $K_c/(s(s + p))$, to place poles at $-c \pm jw$.

::: step
answer: 2*c

### What is p?
:::

::: step
answer: c^2 + w^2

### What is $K_c$?
:::

::: step
answer: c/sqrt(c^2 + w^2)

### What damping ratio results?
:::

::: right
Right. With the plant pole cancelled, the lead's pole and gain alone set the closed-loop polynomial.
:::
:::

::: explain
## Why is a lag compensator's pole–zero pair placed close to the origin?

::: model
The lag's job is to raise the loop gain at very low frequencies, which multiplies the error constant by the ratio z/p, without disturbing the poles that set the transient. Seen from the dominant poles, a zero and a pole that are both close to the origin and close to each other subtend almost the same angle and are almost the same distance away, so the pair contributes only a degree or so of phase and a gain very near one. The locus near the dominant poles is nearly unchanged. The cost is a new closed-loop pole near the lag's zero, which leaves a small, slow tail, so the zero can't be put too close to the origin either.
:::
:::

::: practice

::: check
given: c = 1.5 | 3; w = 2 | 5; z = 1 | 2.5; p = 8 | 15
answer: (arg(z - c + j*w) - arg(p - c + j*w))*180/pi
unit: °
tolerance: 0.5%

## Lead angle at $-\given{c} + j\given{w}$ with zero −{z}, pole −{p}?

::: misses
- [any] Angle of the zero minus angle of the pole.
:::
:::

::: check
given: f = 15 | 30 | 50; c = 1 | 3; w = 2 | 5
answer: c + w/tan((90 - f)*pi/180)
unit: rad/s
tolerance: 0.5%

## Lead pole for {f}° at $-\given{c} + j\given{w}$, zero at −{c}?

::: misses
- [any] Pole seen at 90° − φ.
:::
:::

::: check
given: K = 1.5 | 10; z = 0.02 | 0.2; p = 0.002 | 0.01
answer: K*z/p
unit: s^-1
tolerance: 0.5%

## New $K_v$ after a lag (zero −{z}, pole −{p}) on $K_v$ = {K}?

::: misses
- [any] Multiply by z/p.
:::
:::
:::
