seegongsik
SC · Control

Lead and Lag Compensation

A compensator inserts into the loop a small transfer function made of one pole and one zero, reshaping the phase and gain of the Bode plot the way you want. A lead compensator places its zero closer to the origin than its pole to raise the phase near the crossover frequency and enlarge the phase margin, while a lag compensator places its pole closer to the origin than its zero to raise the low-frequency gain and reduce steady-state error. In this lesson you set the phase bump of a lead compensator near the crossover frequency and follow how a thin phase margin is raised to a good value.

Raise the phase margin with lead compensation

This is the Bode plot of the open loop L(s) = 2·C(s)/(s(s + 1)(s + 2)), the same plant as in the F1 ~ F4 units with a gain of 2. The top is gain (dB), the bottom is phase (degrees), the gray dashed curves are before compensation (C = 1), and the gold solid curves are after adding the lead compensator C(s) = (1 + αTs)/(1 + Ts). Before compensation the phase margin is about 33°, short of the 45° target. Raising α widens the gap between zero and pole and raises a bump in the phase, whose maximum height is φ_max = asin((α − 1)/(α + 1)). Move the center frequency ω_m to set that bump near the gold dot, the crossover frequency where the gain passes 0 dB, and the phase lifts right there, enlarging the phase margin. For example, α = 4 with ω_m = 1.5 gives a phase margin of about 53°, and with the two knobs you can find settings between 45° ~ 60°.

gain (dB) · dashed before, solid after
phase (deg) · the gold vertical dotted line marks ω_m; put the bump at crossover
α (zero/pole ratio)1.0
center frequency ω_m1.50
Compensator and phase margin
α = 1.0 · ω_m = 1.50 · φ_max = 0°
PM: 33° → 33° · gain xover ω = 0.75
The phase margin is still below 45°. The phase bump of the lead compensator is too low or sits away from the crossover frequency. Raising α makes the bump taller, and moving ω_m near the crossover frequency lifts the phase right there. The gain the compensator adds shifts the crossover frequency slightly to the right, so ω_m has to follow it by about as much.
Thin margin (under-compensated)

One pole, one zero, a reshaped phase

A lead compensator has the form C(s) = (1 + αTs)/(1 + Ts) with α > 1, placing its zero at s = −1/(αT) and its pole at s = −1/T. Because the zero is closer to the origin than the pole, it acts first, at lower frequencies, so between the two corner frequencies the phase lifts positive. On the Bode plot, the phase tries to climb toward +90° at the zero until the pole pulls it back down, so the phase peaks at ω_m = 1/(T√α), the geometric mean of the two corners. That maximum depends only on the spacing ratio α, φ_max = asin((α − 1)/(α + 1)): about 37° for α = 4 and about 55° for α = 10. The larger α, the taller the bump, but the compensator's gain at that ω_m also rises by √α, so lead compensation is a trade that borrows phase in exchange for high-frequency gain.

Observea lead compensator lifts the phase near crossover
A lead compensator lifts the phase near the crossover frequency to enlarge the phase margin.
Choosethe peak phase φmax depends only on ?
The peak phase φmax = asin((α − 1)/(α + 1)) depends only on the spacing ratio α.
Fill into cut steady-state error, use a ? compensator
A lag compensator raises the low-frequency gain to reduce steady-state error.
On your ownlead raises high-frequency gain, so it amplifies ?
Lead raises high-frequency gain and amplifies noise (the same weakness as the derivative term).

Lag is the mirror image

A lag compensator has the same form but with α < 1, so its pole is closer to the origin than its zero. This time the phase dips slightly negative, and in exchange the gain drops by a factor of α going from low to high frequencies. Put the other way, relative to high frequencies it raises the low-frequency gain by 1/α, so you can raise the loop gain by 1/α while leaving the gain near the crossover frequency unchanged, and the larger DC gain reduces the steady-state error seen in the F5 unit. The cost of the phase dip is avoided by placing both corners far below the crossover frequency, because by the time the crossover frequency is reached the dip has nearly returned to 0 and barely touches the phase margin. If lead adds phase and speed like the derivative term, lag adds low-frequency gain and reduces error like the integral term, and using both together is lead-lag compensation.

Compensators built from circuits, and their limits

The appeal of a compensator is that it needs only one pole and one zero, so it turns directly into a circuit with an op amp and a few resistors and capacitors. A lead compensator resembles a differentiator, but thanks to its pole the high-frequency gain stops rising at α, which eases the problem of a pure derivative amplifying noise without limit. In fact, a practical PID and lead-lag compensation are close relatives. The integral term is a pole placed at the origin (the extreme case of lag), and a derivative term with a filter attached is a lead compensator, so the two do the same job in different languages. Choosing three gains in the time domain is PID tuning, and placing poles and zeros to shape the Bode plot in the frequency domain is compensator design. The limits are clear as well: lead raises high-frequency gain and is vulnerable to noise and saturation, and lag adds a slow pole that lengthens the settling time. So the knack of design is to borrow phase with lead and fill in accuracy with lag, using each only as much as truly needed.

Back to the first screen

On the first screen, you added a lead compensator to an open loop that had a phase margin of only about 33°. Raising α built a bump in the phase, and moving the center frequency ω_m near the crossover frequency where the gain passes 0 dB lifted the phase right there, far from −180°, raising the phase margin to a good value. With just one pole and one zero, the compensator lifted the phase of the Bode plot exactly where you wanted. If lead borrowed phase to add speed and stability, lag adds low-frequency gain to fill in accuracy. The phase margin you could only read in the F3 unit, you have now created yourself by designing a compensator.

A compensator C(s) = (1 + αTs)/(1 + Ts) shapes the open-loop Bode plot with one pole and one zero. Lead compensation (α > 1, zero closer to the origin) lifts the phase at ωm = 1/(T√α) by φmax = asin((α − 1)/(α + 1)), enlarging the phase margin (adding speed and stability like the derivative term, but raising high-frequency gain by up to α and amplifying noise). Lag compensation (α < 1, pole closer to the origin) raises the low-frequency gain by a relative 1/α, reducing steady-state error (like the integral term, with both corners placed below the crossover frequency to avoid phase loss). Setting the phase bump on the crossover frequency is the core of the design, and a practical PID and lead-lag compensation do the same job in different languages.
On to the next unit

We said a lag compensator raises the low-frequency gain to reduce steady-state error, but what exactly determines that error? The next unit, Steady-State Error, covers how the number of poles the open loop has at the origin, the system type (type 0, type 1, type 2), determines the final error for step, ramp, and parabolic inputs. The position error constant Kp, the velocity error constant Kv, and the acceleration error constant Ka each set that error, and a single pole at the origin drives the error for one kind of input all the way to 0. What the lag compensator did by raising the DC gain and what the integral term did by adding a pole at the origin are summed up there in a single table.