TExcelTAD
Home › Control Systems & Automation › Lead Compensation

Lead Compensation

A positioning stage driven by the course's small DC motor must follow a ramp command (a constant-speed move) with a following error of at most the distance travelled in 2 ms2\ \text{ms} (error == speed/Kv/K_v), i.e. a velocity constant Kv≥500 s−1K_v \ge 500\ \text{s}^{-1}. Turning up the proportional gain until Kv=500K_v = 500 works for accuracy, but the loop then has a phase margin of about 19∘19^\circ and overshoots by almost 60 %. The usual fix is a lead compensator: a zero followed by a pole at a higher frequency, which adds phase exactly where the loop crosses 0 dB0\ \text{dB}. The root-locus view of the same idea is in Design with the Root Locus; this lesson designs in the frequency domain, where the specifications are margins and error constants.

The lead network

C(s)=Kc s/z+1s/p+1=Kc Ts+1αTs+1,z=1T, p=1αT, 0<α<1C(s) = K_c\,\frac{s/z + 1}{s/p + 1} = K_c\,\frac{T s + 1}{\alpha T s + 1}, \qquad z = \frac{1}{T},\ p = \frac{1}{\alpha T},\ 0 < \alpha < 1

Its phase is positive between the zero and the pole, with a maximum

ϕmax=arcsin⁡1−α1+αatωm=z p=1Tα,∣C(jωm)∣=Kcα\phi_\text{max} = \arcsin\frac{1 - \alpha}{1 + \alpha} \quad \text{at} \quad \omega_m = \sqrt{z\,p} = \frac{1}{T\sqrt{\alpha}}, \qquad \lvert C(j\omega_m) \rvert = \frac{K_c}{\sqrt{\alpha}}

So a lead with p=5zp = 5z (α=0.2\alpha = 0.2) adds up to 41.8∘41.8^\circ and raises the gain at ωm\omega_m by 10log⁡10(1/α)=7.0 dB10\log_{10}(1/\alpha) = 7.0\ \text{dB}; its high-frequency gain is 1/α1/\alpha (14 dB14\ \text{dB}) above its DC gain. The price of phase lead is high-frequency gain: more noise into the actuator. Leads beyond about 60∘60^\circ (α<0.07\alpha < 0.07) become noisy; two stages are then better than one.

0 7 14 |C| dB 0.01 0.1 1 10 100 0 20 41.8 w / z phase deg zero pole w_m = sqrt(zp)

The design procedure

  1. Choose the controller DC gain KcK_c to meet the steady-state requirement (KvK_v, KpK_p or KaK_a, see Steady-State Error).
  2. With that gain, find the phase margin PM0PM_0 of KcGK_c G.
  3. Required lead: ϕmax=PMreq−PM0+(5 to 12∘)\phi_\text{max} = PM_\text{req} - PM_0 + \text{(5 to 12}^\circ); the extra covers the phase that is lost because the lead's gain pushes crossover to a higher frequency, where the plant has more lag.
  4. α=1−sin⁡ϕmax1+sin⁡ϕmax\alpha = \frac{1 - \sin\phi_\text{max}}{1 + \sin\phi_\text{max}}.
  5. Put ωm\omega_m at the new crossover: the frequency where ∣KcG∣=−10log⁡10(1/α) dB\lvert K_c G \rvert = -10\log_{10}(1/\alpha)\ \text{dB}; then z=ωmαz = \omega_m\sqrt{\alpha}, p=ωm/αp = \omega_m/\sqrt{\alpha}.
  6. Check the margin; if it falls short, add a few degrees and repeat. Then simulate the step and the control effort.

Worked example: a Kv=500K_v = 500 position loop

Given: the reference motor, voltage to angle: G(s)=ks [(Js+b)(Las+Ra)+k2]G(s) = \frac{k}{s\,[(Js + b)(L_a s + R_a) + k^2]}, DC velocity gain 49.75 (rad/s)/V49.75\ \text{(rad/s)/V}; specification Kv=500 s−1K_v = 500\ \text{s}^{-1}, PM≥50∘PM \ge 50^\circ.

Find: KcK_c, the lead zero and pole, the resulting margin and step overshoot.

Solve:

  • Kv=lim⁡s→0s KcG(s)=49.75 Kc=500K_v = \lim_{s \to 0} s\,K_c G(s) = 49.75\,K_c = 500 gives Kc=10.05 V/radK_c = 10.05\ \text{V/rad}.
  • Uncompensated: crossover 217.7 rad/s217.7\ \text{rad/s}, PM0=19.4∘PM_0 = 19.4^\circ.
  • First try: ϕmax=50−19.4+10=40.6∘\phi_\text{max} = 50 - 19.4 + 10 = 40.6^\circ, α=0.212\alpha = 0.212, new crossover where ∣KcG∣=−6.7 dB\lvert K_c G \rvert = -6.7\ \text{dB}: ωm=328.7 rad/s\omega_m = 328.7\ \text{rad/s}, z=151.3z = 151.3, p=714.1 rad/sp = 714.1\ \text{rad/s}. Result: PM=48.6∘PM = 48.6^\circ, just short, because the crossover moved up by half an octave.
  • Second try with 15∘15^\circ extra: α=0.167\alpha = 0.167, z=142.8z = 142.8, p=856.0 rad/sp = 856.0\ \text{rad/s}, crossover 349.6 rad/s349.6\ \text{rad/s}, PM=52.0∘PM = 52.0^\circ, gain margin 16.8 dB16.8\ \text{dB}, overshoot 17.3 %17.3\,\%.

Check:

python · try it yourself
import numpy as np
import control as ct

J, b, Ra, La, k = 2e-6, 1e-6, 2.0, 1e-3, 0.02
G = ct.tf([k], np.polymul([1, 0], np.polyadd(np.polymul([J, b], [La, Ra]), [k * k])))
Kc = 500 / (k / (Ra * b + k * k))                  # Kv = Kc * 49.75 = 500
gm0, pm0, _, wc0 = ct.margin(Kc * G)
print(f"Kc = {Kc:.2f} V/rad: crossover {wc0:.1f} rad/s, PM {pm0:.1f} deg")

w = np.logspace(1, 4, 30001)
mag_dB = 20 * np.log10(abs(Kc * G(1j * w)))
for extra in (10, 15):
    phi = np.radians(50 - pm0 + extra)
    a = (1 - np.sin(phi)) / (1 + np.sin(phi))
    wm = w[np.argmin(abs(mag_dB + 10 * np.log10(1 / a)))]
    z, p = wm * np.sqrt(a), wm / np.sqrt(a)
    L = Kc * ct.tf([1 / z, 1], [1 / p, 1]) * G
    gm, pm, _, wc = ct.margin(L)
    info = ct.step_info(ct.feedback(L, 1), T=np.linspace(0, 0.1, 20001))
    print(f"extra {extra:2d} deg: alpha {a:.3f}, zero {z:6.1f}, pole {p:6.1f} rad/s -> "
          f"crossover {wc:.1f} rad/s, PM {pm:.1f} deg, GM {20 * np.log10(gm):.1f} dB, overshoot {info['Overshoot']:.1f} %")
info0 = ct.step_info(ct.feedback(Kc * G, 1), T=np.linspace(0, 0.1, 20001))
print(f"no lead     : overshoot {info0['Overshoot']:.1f} %")
Kc = 10.05 V/rad: crossover 217.7 rad/s, PM 19.4 deg
extra 10 deg: alpha 0.212, zero  151.3, pole  714.1 rad/s -> crossover 328.8 rad/s, PM 48.6 deg, GM 16.6 dB, overshoot 21.2 %
extra 15 deg: alpha 0.167, zero  142.8, pole  856.0 rad/s -> crossover 349.6 rad/s, PM 52.0 deg, GM 16.8 dB, overshoot 17.3 %
no lead     : overshoot 57.9 %

The lead raised the phase margin from 19∘19^\circ to the specification, cut the overshoot from 57.9 %57.9\,\% to 17.3 %17.3\,\%, and moved the crossover up, so the loop is also faster. The steady-state accuracy is untouched because the lead has unit DC gain. What it cost: the controller's gain from position error to voltage rises from 10.0510.05 at low frequency to 10.05/α10.05/\alpha at high frequency, so encoder noise drives the motor six times harder.

Intuition with the Bode lab

The lab's loop at K=30 dBK = 30\ \text{dB} (poles at 1010, 100100, 1000 Hz1000\ \text{Hz}) has a phase margin of 25.8∘25.8^\circ. Its optional zero is an ideal lead (a lead whose pole has gone to infinity). Switch the zero on at 400 Hz400\ \text{Hz}: the phase margin becomes 47.1∘47.1^\circ with crossover at 170.9 Hz170.9\ \text{Hz}. At 200 Hz200\ \text{Hz}: 63.2∘63.2^\circ at 196.9 Hz196.9\ \text{Hz}. At 100 Hz100\ \text{Hz}: 75.1∘75.1^\circ, but the crossover jumps to 302.5 Hz302.5\ \text{Hz}, because the zero also raises the gain. A real lead adds its pole a few times above the zero to stop that gain from growing for ever.

6040200-20-40-60-80|L| (dB)-270-180-90090100m1101001k10k100k1Mf (Hz)phase (deg)PM 63.2 deg|L| exactphase exactasymptotesunity-feedback closed loop: stable

Guided lab: an op-amp lead network

Hand calculation. A passive lead R1∥CR_1 \parallel C in series, R2R_2 to ground, has VoVi=αTs+1αTs+1\frac{V_o}{V_i} = \alpha\frac{T s + 1}{\alpha T s + 1} with T=R1CT = R_1 C, α=R2R1+R2\alpha = \frac{R_2}{R_1 + R_2}. With R1=39 kΩR_1 = 39\ \text{k}\Omega, R2=10 kΩR_2 = 10\ \text{k}\Omega, C=100 nFC = 100\ \text{nF}: α=0.204\alpha = 0.204, zero at 1/(R1C)=256 rad/s1/(R_1 C) = 256\ \text{rad/s} (40.8 Hz40.8\ \text{Hz}), pole at 1256 rad/s1256\ \text{rad/s} (200 Hz200\ \text{Hz}), ϕmax=41.4∘\phi_\text{max} = 41.4^\circ at ωm=567 rad/s\omega_m = 567\ \text{rad/s} (90 Hz90\ \text{Hz}).

Simulation. Compute ct.tf([0.204 * 39e3 * 100e-9, 0.204], [0.204 * 39e3 * 100e-9, 1]) and read its phase at 90 Hz90\ \text{Hz}, or put the network into the ee-netlist lab with an AC source.

What you would measure. A 1 V1\ \text{V} peak sine from a generator into the network, followed by a unity-gain op-amp buffer on a current-limited ±12 V\pm 12\ \text{V} supply; sweep 5 Hz5\ \text{Hz} to 2 kHz2\ \text{kHz} on a two-channel scope. Expect a maximum phase lead of about 41∘±3∘41^\circ \pm 3^\circ near 90 Hz90\ \text{Hz} and a gain rising from 0.2040.204 (−13.8 dB-13.8\ \text{dB}) to 11 (0 dB0\ \text{dB}), with 5 % capacitor tolerance moving the frequencies by about 5 %.

Hazards and safe setup. Low-voltage bench work only; connect the op-amp supplies before the signal.

Pitfalls

  • Placing ωm\omega_m at the old crossover: the lead's gain moves the crossover up, and the peak phase is wasted.
  • Asking one lead for more than about 60∘60^\circ; use two stages or reconsider the bandwidth.
  • Forgetting the plant's high-frequency resonances, which a lead amplifies.
  • Ignoring actuator limits: a lead's large high-frequency gain saturates the driver on step commands.

Practice

  1. What α\alpha gives a maximum phase lead of 30∘30^\circ, and how much gain does the lead add at ωm\omega_m?
  2. A lead has z=20 rad/sz = 20\ \text{rad/s}, p=180 rad/sp = 180\ \text{rad/s}. Find ωm\omega_m and ϕmax\phi_\text{max}.
  3. Why does a lead not change the steady-state error to a ramp?
Answer
  1. α=(1−0.5)/(1+0.5)=0.333\alpha = (1 - 0.5)/(1 + 0.5) = 0.333; 10log⁡103=4.8 dB10\log_{10} 3 = 4.8\ \text{dB}.
  2. ωm=20×180=60 rad/s\omega_m = \sqrt{20 \times 180} = 60\ \text{rad/s}; α=1/9\alpha = 1/9, ϕmax=arcsin⁡(0.8)=53.1∘\phi_\text{max} = \arcsin(0.8) = 53.1^\circ.
  3. In the form Kcs/z+1s/p+1K_c\frac{s/z + 1}{s/p + 1} its DC gain is KcK_c, chosen for KvK_v; the lead only changes the response near and above zz.

Test yourself

A lead compensator with α=0.2\alpha = 0.2 gives a maximum phase lead of about

  1. 19.5∘19.5^\circ
  2. 30∘30^\circ
  3. 41.8∘41.8^\circ
  4. 60∘60^\circ

Where should the lead's maximum-phase frequency ωm\omega_m be placed?

  1. at the old gain crossover
  2. at the new gain crossover, where ∣KcG∣=−10log⁡10(1/α)\lvert K_c G \rvert = -10\log_{10}(1/\alpha) dB
  3. at the plant's first pole
  4. at the phase crossover

The main cost of a strong lead compensator is

  1. a larger steady-state error
  2. more high-frequency gain, so more noise and actuator activity
  3. a lower crossover frequency
  4. loss of the integrator

In the Bode lab, adding a zero at 100 Hz to the K=30K = 30 dB loop raised the phase margin to 75∘75^\circ and moved crossover to 302 Hz. Why did the crossover move?

  1. the zero lowers the gain
  2. the zero raises ∣L∣\lvert L \rvert above its frequency
  3. the DC gain changed
  4. the lab switched to second order