Lecture 18: From PD Control to Lead Compensator and Steady-State Error Improvement with Lag Compensator
We now have tools to shape the transient (PD control, Lecture 17) and a way to measure steady-state accuracy (Lecture 12). This lecture connects the two sides. It first places the root-locus compensators in one framework, lead and lag, and then shows exactly how a lag compensator reduces the steady-state error, ending with a complete numerical design.
Video lecture
The lecture is presented in one video, From PD Control to Lead Compensator and Steady-State Error Improvement with Lag Compensator.
Chapters: 0:00 Two goals: transient and steady state · 1:26 Why it is called lead · 1:57 Lag compensator and PI control · 4:05 Steady-state error for any controller · 6:32 What the lag compensator changes · 9:40 Design example: gain for zeta = 0.5 · 12:58 Matching the characteristic polynomial: K = 13 · 14:29 Steady-state error of the P design · 15:49 Lag design: alone vs on top of the gain
Lecture materials
- Fill-in skeleton slides, to print or annotate and fill in while watching the video: PDF
The lecture notes are on this page. The text below follows the video, then adds a lead design by matching the characteristic polynomial, what a compensator does to the overshoot and to the control effort, and the slow closed-loop pole that a lag compensator leaves behind. Exercises with answers are at the end.
Lead and lag: practical PD and PI
The two ideal controllers of classical control each have a practical approximation:
| Ideal | Practical approximation | Improves | Pole–zero placement |
|---|---|---|---|
| PD: $K(s+z)$ | lead: $K\dfrac{s+z_c}{s+p_c}$ | transient | $\lvert z_c\rvert \lt \lvert p_c\rvert$ (pole further left) |
| PI: $K\dfrac{s+z}{s}$ | lag: $K\dfrac{s+z_c}{s+p_c}$ | steady state | $\lvert z_c\rvert \gt \lvert p_c\rvert$ (pole near origin) |
Why approximate? A pure derivative needs an active circuit and is costly, so a lead compensator adds a pole far to the left, which makes it realizable while keeping most of the zero’s effect. A pure integrator is also costly, so a lag compensator moves the pole slightly off the origin.
The names describe phase. At a point $s$ on the locus, the compensator contributes phase $\theta_z - \theta_p$, the angle from its zero minus the angle from its pole:
With the pole further left than the zero, $\theta_z \gt \theta_p$ and the compensator adds phase: it leads. With the zero further left, the contribution is negative, though small: it lags. A PI controller, with its pole exactly at the origin, raises the system type by one and, by Lecture 12, improves the steady state. The lag compensator approximates that effect.
How a lag compensator reduces the error
Extending Lecture 12 to a loop with controller $C$ and plant $G$, the error is $E = R/(1 + GC)$. If the closed loop is stable,
$$e_{ss}^{\text{step}} = \frac{1}{1 + \lim_{s\to0} G(s)C(s)},\quad e_{ss}^{\text{ramp}} = \frac{1}{\lim_{s\to0} sG(s)C(s)},\quad e_{ss}^{\text{parabola}} = \frac{1}{\lim_{s\to0} s^2G(s)C(s)}.$$In each case only the DC value of the compensator matters. For $C(s) = K\dfrac{s+z_c}{s+p_c}$,
$$C(0) = K\,\frac{z_c}{p_c},\qquad \frac{z_c}{p_c} \gt 1,$$since the pole and zero are both real and negative and the zero lies further left. The lag therefore multiplies the loop’s DC gain by $z_c/p_c \gt 1$. The denominator of $e_{ss}$ grows, so $e_{ss}$ shrinks. Placing the pair close to the origin keeps the transient nearly unchanged; Lecture 22 explains why.
The mechanism is the same for every input type. For a ramp input and the type-1 plant $G(s) = \dfrac{1}{s(s+1)}$, $e_{ss} = \dfrac{1}{\lim_{s\to0}\frac{C(s)}{s+1}} = \dfrac{1}{C(0)}$, and again a larger $C(0)$ means a smaller error. The parabolic case is left as an exercise.
A complete design
We now put these ideas to work on the plant
$$G(s) = \frac{1}{(s+1)(s+3)}.$$The design has two parts: first find the proportional gain $K$ that gives a closed-loop damping ratio $\zeta = 0.5$; then add a lag compensator that reduces the unit-step steady-state error by a factor of ten.
Part 1: the proportional design. The root locus of $KG$ has branches that meet at the centroid $-2$ and go vertically:
The desired pole lies where the $\zeta = 0.5$ line crosses the vertical branch. With $\tan\alpha = \sqrt{1-\zeta^2}/\zeta$ and a horizontal distance of $2$ from the origin,
$$\frac{L}{2} = \frac{\sqrt{1 - 0.25}}{0.5} = \sqrt3 \;\Longrightarrow\; L = 2\sqrt3,\qquad s_{1,2} = -2 \pm j2\sqrt3.$$The gain follows from matching characteristic polynomials:
$$(s+1)(s+3) + K = s^2 + 4s + 3 + K \overset{!}{=} (s+2)^2 + 12 = s^2 + 4s + 16 \;\Longrightarrow\; K = 13.$$The plant is type 0 with $G(0) = 1/3$, so the steady-state error to a unit step is
$$e_{ss} = \frac{1}{1 + K\,G(0)} = \frac{1}{1 + 13/3} = \frac{3}{16}.$$Part 2: the lag design. The target is $\tilde e_{ss} = 3/160$. If the lag compensator is used alone, with unit gain,
$$\frac{1}{1 + \frac{z_c}{p_c}\cdot\frac13} = \frac{3}{160} \;\Longrightarrow\; \frac{z_c}{p_c} = 3\left(\frac{160}{3} - 1\right) = 157,$$which is a very aggressive ratio. If instead we keep the proportional gain $K = 13$ and add the lag on top,
$$\frac{1}{1 + 13\cdot\frac{z_c}{p_c}\cdot\frac13} = \frac{3}{160} \;\Longrightarrow\; \frac{z_c}{p_c} = \frac{157}{13} \approx 12.08.$$Keeping the proportional gain relaxes the requirement considerably. Placing the pole near the origin, $p_c = 0.01$, gives:
| Design | $z_c/p_c$ | $z_c$ | Compensator |
|---|---|---|---|
| lag only | $157$ | $1.57$ | $\dfrac{s+1.57}{s+0.01}$ |
| $K = 13$ plus lag | $12.08$ | $0.1208$ | $13\,\dfrac{s+0.1208}{s+0.01}$ |
A quick check confirms the second design: $1/(1 + 13\cdot12.08/3) = 0.01875 = 3/160$.
Designing a lead by matching the characteristic polynomial
The PD design of Lecture 17 used the angle condition. The same coefficient matching used for $K = 13$ above also designs a PD or a lead directly. Take the same plant $G(s) = 1/[(s+1)(s+3)]$ and the target poles $-3 \pm 3j$, that is $s^2 + 6s + 18$ ($\zeta = 0.707$, $\omega_n = 4.24$).
PD, $C = K(s+z)$. The closed loop stays second order:
$$(s+1)(s+3) + K(s+z) = s^2 + (4+K)s + (3+Kz) \overset{!}{=} s^2 + 6s + 18,$$so $4 + K = 6$ gives $K = 2$, and $3 + Kz = 18$ gives $z = 7.5$.
Lead, $C = K\dfrac{s+z}{s+10}$. The compensator pole adds a third closed-loop pole, so the target must be third order, $(s^2 + 6s + 18)(s + a)$:
$$(s+1)(s+3)(s+10) + K(s+z) = s^3 + 14s^2 + (43+K)s + (30+Kz),$$$$(s^2 + 6s + 18)(s+a) = s^3 + (6+a)s^2 + (18+6a)s + 18a.$$
The $s^2$ coefficients do not contain $K$ or $z$, so they fix the third pole: $6 + a = 14$, $a = 8$. (The sum of the closed-loop poles equals the sum of the open-loop poles whenever the loop has at least two more poles than zeros.) Then $43 + K = 66$ gives $K = 23$, and $30 + Kz = 144$ gives $z = 114/23 = 4.957$. Since $z = 4.957 \lt 10$, the zero is closer to the origin than the pole: the controller is a lead. Always check where the extra pole lands; here $-8$ is well to the left of $-3 \pm 3j$.
Steady state. Both loops are type 0, so only the DC gain matters:
$$\text{PD: } e_{ss} = \frac{1}{1 + \frac{2\cdot 7.5}{3}} = \frac16 = 0.167,\qquad \text{lead: } e_{ss} = \frac{1}{1 + \frac{23\cdot 4.957}{10\cdot 3}} = \frac{1}{4.8} = 0.208.$$The lead’s pole divides its DC gain by 10, so with the same dominant poles it leaves a slightly larger error.
The overshoot formula assumes no zeros and no extra poles
The target $\zeta = 0.707$ predicts $\%OS = 100\,e^{-\pi\zeta/\sqrt{1-\zeta^2}} = 4.3\%$. The closed loops are
$$T_{\mathrm{PD}} = \frac{2(s+7.5)}{s^2 + 6s + 18},\qquad T_{\mathrm{lead}} = \frac{23(s+4.957)}{(s^2 + 6s + 18)(s+8)}.$$The controller zero appears in $T$, and a zero speeds up the rise and adds overshoot (Lecture 9); the lead’s extra pole at $-8$ partly offsets it. Simulated overshoot, relative to the final value: 5.6 % (PD) and 6.8 % (lead), both above the 4.3 % formula. Placing the poles fixes $\zeta$ and $\omega_n$, but the formula holds only for the zero-free second-order system, so check a design by simulation.
Control effort: why ideal PD needs a smooth reference
The control signal is $U = CE$ with $E = R/(1+CG)$:
$$\frac{U}{R} = \frac{C}{1 + CG}.$$For the ideal PD, $U/R = \dfrac{2(s+7.5)(s+1)(s+3)}{s^2 + 6s + 18}$ has a numerator of higher degree than its denominator: it is improper. A unit step makes the error jump from 0 to 1 at $t = 0$, and the derivative term turns that jump into an impulse: $u(t)$ contains $K\,\delta(t)$. No actuator can deliver it, and a simulation of a step response cannot show it. The lead network is proper: its effort jumps only to the finite value $u(0^+) = K = 23$ (the compensator’s high-frequency gain times $e(0^+) = 1$).
To compare the two controllers fairly, use a smooth reference with no jump, such as $r(t) = 1 - e^{-t}$. Both efforts are then finite:
The outputs are nearly the same. The PD effort starts at $u(0) = K\,\dot e(0) = 2$, since $r$ starts with slope 1, and the lead effort starts at 0. Both settle at $u = 3\,y_{ss}$, because $G(0) = 1/3$.
The lag’s slow closed-loop pole
The lag pair is placed near the origin so that the transient barely changes. It does not disappear, though. With $C = 13\,\dfrac{s+0.1208}{s+0.01}$ the closed loop has three poles,
$$-1.95 \pm 3.44j \quad\text{(close to the P design's } -2 \pm 3.46j\text{)},\qquad -0.102,$$and keeps the zero at $-0.1208$. By the real-axis rule, the segment between the lag pole $-0.01$ and the lag zero $-0.1208$ is on the root locus. The new closed-loop pole lies on it and approaches the zero only as $K \to \infty$: no finite gain puts it exactly on the zero. Choosing $z_c = p_c$ would cancel the pair, but it would also cancel the DC boost $z_c/p_c$, which is the reason for the lag.
The almost-cancelled pair gives a mode with a small amplitude and a slow decay:
$$y(t) \approx 0.981 - 0.154\,e^{-0.102t} + (\text{fast terms}).$$
The fast part of the response looks like the P design. The output then creeps from about 0.87 (at $t \approx 3$ s) to the new final value 0.981 with a time constant of about $1/0.102 \approx 10$ s. The 2 % settling time, measured relative to each final value, grows from 2.0 s (P) to 20.1 s (lag), since $0.154\,e^{-0.102t} \lt 0.02\cdot0.981$ needs $t \gt 20$ s.
The tail’s amplitude is roughly the improvement the lag must deliver (from the P design’s 0.81 to 0.98), so it stays near 0.15 wherever the pair sits for a fixed ratio $z_c/p_c$. Moving the pair closer to the origin only makes the tail slower: with $p_c = 0.005$, $z_c = 0.0604$ the slow pole is at $-0.051$ (time constant 20 s). Simulate long enough to see the tail.
Summary and outlook
- Lead and lag compensators are realizable versions of PD and PI: lead improves the transient, lag the steady state.
- A lag compensator scales the loop’s DC gain by $z_c/p_c \gt 1$, which reduces the steady-state error for step, ramp and parabolic inputs alike.
- Keep the proportional gain, add the lag on top, and place the pole–zero pair near the origin.
- A lead adds a closed-loop pole: match a third-order target, and let the $s^2$ coefficient tell you where the extra pole goes.
- Placed poles fix $\zeta$ and $\omega_n$, but the controller zero (and any extra pole) changes the overshoot: check by simulation.
- The effort is $U/R = C/(1+CG)$. Ideal PD gives an impulse for a step reference, so compare it with a lead using a smooth reference.
- A lag leaves a slow closed-loop pole near its zero: a small, slow tail that sets the settling time.
The next lecture combines both kinds of compensation in a complete PID design, carried out both by hand and in Python.
Exercises
Try each exercise before opening its answer.
Exercise 1. Classify $C_1 = 4\,\dfrac{s+2}{s+20}$ and $C_2 = 4\,\dfrac{s+0.5}{s+0.05}$ as lead or lag, and find each DC gain $C(0)$.
Answer
$C_1$: the pole ($-20$) is further left than the zero ($-2$), so it is a lead; $C_1(0) = 4\cdot 2/20 = 0.4$. $C_2$: the zero ($-0.5$) is further left than the pole ($-0.05$), so it is a lag; $C_2(0) = 4\cdot 0.5/0.05 = 40$, ten times the gain 4.
Exercise 2. (The parabolic case.) For the type-2 plant $G(s) = \dfrac{s+4}{s^2(s+2)}$ and a lag $C(s) = K\dfrac{s+z_c}{s+p_c}$, assume the closed loop is stable. Find the steady-state error to a unit parabola $r(t) = t^2/2$.
Answer
$e_{ss} = \dfrac{1}{\lim_{s\to0} s^2 G(s)C(s)} = \dfrac{1}{2\,C(0)} = \dfrac{p_c}{2Kz_c}$. As for the step and the ramp, the lag reduces the error by the factor $z_c/p_c$.
Exercise 3. For $G(s) = \dfrac{1}{s(s+2)}$, design a lead $C = K\dfrac{s+z}{s+8}$ whose dominant closed-loop poles are $-2 \pm 2j$. Where is the third pole? Find the unit-ramp steady-state error.
Answer
$s(s+2)(s+8) + K(s+z) = s^3 + 10s^2 + (16+K)s + Kz$ and $(s^2 + 4s + 8)(s+a) = s^3 + (4+a)s^2 + (8+4a)s + 8a$. The $s^2$ terms give $a = 6$ (third pole at $-6$); then $16 + K = 32$, $K = 16$, and $Kz = 48$, $z = 3 \lt 8$ (a lead). The loop is type 1: $K_v = \lim_{s\to0} sGC = \dfrac{16\cdot3}{8\cdot2} = 3$, so $e_{ss} = 1/3$. The simulated step overshoot is 8.3 %, compared with 4.3 % predicted for $\zeta = 0.707$ alone.
Exercise 4. For the lead of Exercise 3, is $U/R$ proper? What is $u(0^+)$ for a unit-step reference? What happens with an ideal PD $C = K(s+z)$ on the same plant?
Answer
$\dfrac{U}{R} = \dfrac{C}{1+CG} = \dfrac{16(s+3)\,s(s+2)}{(s^2+4s+8)(s+6)}$: degree 3 over degree 3, proper. At $t = 0^+$ only the high-frequency gain acts: $u(0^+) = 16$. With the ideal PD, $U/R = K(s+z)\,s(s+2)/(s^2 + \dots)$ has degree 3 over degree 2: improper. A step reference then produces an impulse $K\delta(t)$ in $u$, so use a smooth reference to compare the two controllers.
Exercise 5. In the lag design above, move the pair twice as far from the origin, keeping the ratio: $C = 13\,\dfrac{s+0.2416}{s+0.02}$. What happens to the steady-state error, the slow pole and the 2 % settling time?
Answer
The ratio, and so the DC gain, is unchanged: $e_{ss} = 0.01875$ as before. The closed-loop poles are $-1.91 \pm 3.41j$ and $-0.2095$, so the slow time constant halves to about 4.8 s, and the 2 % settling time drops from 20.1 s to 9.3 s. The cost is a larger effect on the fast part: the dominant pair moves further from the P design, and the response now overshoots its final value by 3.4 %.
References
- N. S. Nise, Control Systems Engineering, 6th ed.: §9.2 Improving Steady-State Error via Cascade Compensation (p. 459); §9.3 Improving Transient Response via Cascade Compensation (p. 469); §9.4 Improving Steady-State Error and Transient Response (p. 482); §9.6 Physical Realization of Compensation (p. 503).
- Original classroom recording of this lecture: YouTube.