S9 · Lesson 26 · Loop shaping with lead and lag compensators
Designing in the frequency domain by choosing a crossover and the phase there, the lead compensator's maximum phase and where it occurs, the lag compensator's low-frequency gain and its small phase cost, and the type II compensator used in switching power supplies
In the frequency domain a design becomes a drawing exercise: decide where the loop gain should cross 0 dB (that sets the speed), make sure the phase there leaves enough margin (that sets the damping), and keep the gain high at low frequencies (that sets the accuracy). A lead compensator adds phase near crossover, a lag compensator adds gain far below it. This is how most analog loops are compensated, from servo amplifiers to the error amplifier inside every switching regulator.
- The motor position loop with a lead compensator .
- With the defaults ( = 2.94, = 13.1, α = 2.32) the loop crosses at 20 rad/s, 2.5 times faster than the plain loop's 7.9, with the same 50° phase margin.
- The lead's phase bump peaks at . Centering it on the crossover gets the most phase for the least gain.
Predict
A lead compensator with = α = 10 adds the most phase at one frequency. How much?
At the lead adds = 54.9°, while raising the gain by = 3.16 (10 dB). More than about 60° from one lead stage costs too much high-frequency gain, so designs needing more use two.
Name it
Specifications in the frequency domain
- Crossover sets speed: rise time is roughly to .
- Phase margin sets damping (lesson 25): 45 to 60° is typical.
- Low-frequency gain sets accuracy: or (lesson 10), and disturbance rejection.
- High-frequency roll-off keeps noise and unmodeled dynamics out.
Lead
adds up to at , where its gain is (10 log α dB above ). For a needed phase φ, .
Design: pick ; find the plant's phase there and the lead φ needed for the margin (plus about 5° if a lag will be added); compute α; set , ; choose so that .
Lag
has gain at DC and 1 at high frequency. With about a decade below crossover, it costs only a few degrees there.
The type II compensator
A switching regulator's error amplifier is usually an integrator with one zero and one pole, : the integrator gives zero steady error, and the zero–pole pair is a lead centered on the crossover. A type III compensator adds a second zero–pole pair for plants, like a voltage-mode buck converter's LC filter, that lose 180° of phase.
Worked example
Design a lead so that crosses at 20 rad/s with a 50° phase margin.
Show the solution
- Plant at 20 rad/s. (−13.0 dB), and the phase is −153.4°.
- Phase the lead must add. A 50° margin needs −130°, so
- Lead ratio.
- Zero, pole and gain. Centered on 20 rad/s, with :
- Check. The loop crosses at 20 rad/s with PM = 50.0°.
- Step response. It overshoots 19% and settles in 0.32 s, against 0.81 s before, and rises from 10 to 29.4.
Answer a lead with α = 2.32, its zero at 13.1 rad/s, its pole at 30.5 rad/s and = 2.94, which crosses at 20 rad/s with a 50.0° phase margin.
Worked example
Add a lag to that design for five times more .
Show the solution
- Place the lag. Put its zero a decade below crossover, at 2 rad/s, and its pole at 0.4.
- Its cost at crossover. At 20 rad/s it adds and changes the gain by only 0.5%.
- New margin.
- New velocity constant.
- Step response. It now overshoots 27% and settles in 0.53 s, slower because of the lag's slow tail.
- A better plan. Designing the lead for 55° in the first place would have absorbed the lag's cost.
Answer a lag with its zero at 2 rad/s and pole at 0.4 rad/s raises to 147, and the phase margin falls to 45.4°.
Worked example
A loop crosses over at 50 rad/s with a 55° phase margin. Integral action is added by a PI whose zero sits a decade lower, at 5 rad/s. What does it cost?
Show the solution
- Phase cost. At crossover the PI factor has phase leaving a 49.3° margin.
- Gain change. Its magnitude is , a 0.04 dB rise that barely moves the crossover.
- What it buys. The loop becomes type 1 and rejects constant disturbances completely.
- Where to put the zero. A decade below crossover is the usual compromise; at a factor of 3 the cost would be 18°.
Answer it costs 5.7° of phase margin (leaving 49.3°) and raises the gain at crossover by only 0.04 dB.
Check
A lead compensator has = 5. What's the most phase it adds?
Check
A lead must add 35° at its peak. What ratio does it need?
Check
A lead has its zero at 10 rad/s and its pole 3 times higher. Where does it add the most phase?
Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.
Check
A lead with α = 6 is centered on 40 rad/s to make cross there. What does that take?
Check
A lag with its zero at 1 rad/s and pole at 0.5 rad/s: how much phase does it cost at a 10 rad/s crossover?
Check
How much gain does a lead with α = 3 add at its center frequency, relative to its DC gain?
Check
A loop crosses over with a 45° phase margin, and a PI zero is placed a factor 5 below the crossover.
(a)
What phase margin remains?
(b)
How much does it raise the gain at the old crossover?
Check
A lead with pole-to-zero ratio a is centered on frequency w.
Step 1
What is its maximum phase, in degrees?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
Where is its zero?
Step 3
And its pole?
Step 4
How many decibels above its DC gain is it at the center?
Explain why
Why is a lead compensator centered on the crossover frequency?
The lead exists to supply phase where the margin is measured, which is the crossover. Its phase bump peaks at the geometric mean of its zero and pole, so that's where it gives the most phase per unit of the high-frequency gain it adds. If the bump sits below the crossover, its phase is wasted at frequencies where the loop gain is already large; if it sits above, the crossover sees little of it. Putting the peak exactly at the intended crossover, and then setting the gain so the loop crosses there, gets the needed phase with the smallest α and so the least amplification of high-frequency noise.
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.