D3 · Lesson 7 · Gain and phase margin
Judging a loop's stability from the Bode plot of its loop gain, the crossover where the gain falls to one, the phase there and the phase margin, the gain margin at the frequency where the phase reaches −180°, the delay a loop can tolerate, and the link between phase margin and damping
A loop goes unstable when a signal travels around it and comes back the same size and exactly inverted, because the subtraction at the input then turns into an addition and the signal sustains itself. Engineers rarely solve for poles to check this. They measure or plot the loop gain's Bode plot and ask two questions: how far is the gain below one where the phase reaches −180°, and how far is the phase from −180° where the gain is one? Those two numbers, the gain margin and the phase margin, say how robust a loop is, and they can be measured on real hardware.
- The loop gain of a plant with three equal lags, , like a heater feeding three thermal masses in a row.
- The phase reaches −180° at rad/s, where the gain is K/8: the gain margin is 8/K.
- The gain crosses one at , and the phase margin is how far the phase there sits above −180°. Raising K shrinks both margins; at K = 8 the loop oscillates.
Predict
With K = 2, the loop crosses unity gain at 0.766 rad/s with 67.6° of phase margin. How much pure time delay could be added before it goes unstable?
A delay T doesn't change the gain but subtracts radians of phase. The loop goes unstable when that eats the whole margin at the crossover: T = (67.6° × π/180)/0.766 = 1.18/0.766 = 1.54 s. Delay is the classic way a well-behaved loop is pushed into oscillation, which is why fast loops need fast sensors.
Name it
Crossovers and margins
On the Bode plot of the loop gain :
- the gain crossover is where (0 dB). The phase margin is ;
- the phase crossover is where . The gain margin is , or dB.
For a typical loop whose gain falls steadily, the closed loop is stable when both margins are positive. Common targets are a phase margin of 45° to 60° and a gain margin of at least 6 dB.
Margins and the response
For a loop that behaves like a second-order system, the closed-loop damping ratio is roughly for margins up to about 70°: 60° of margin gives about 10% overshoot, 30° gives a ringing response with about 37%.
Delay margin
A time delay T multiplies L by , which costs phase (in radians) at every frequency without changing the gain. The largest tolerable delay is
Worked example
Find the margins of at K = 4.
Show the solution
- Gain margin. or 6.0 dB.
- Crossover.
- Phase margin. The phase at crossover is so PM = 27.1°.
- Delay margin.
- How it behaves. This loop rings badly: ζ is roughly 0.27.
Answer a gain margin of 2 (6.0 dB), a phase margin of 27.1° and a delay margin of 0.38 s.
Worked example
A loop's gain is 0.25 where its phase reaches −180°, and its phase is −130° where its gain is 1. What are its margins, and roughly what overshoot should you expect?
Show the solution
- Gain margin. or 12 dB.
- Phase margin. so ζ ≈ 0.5.
- Overshoot.
Answer a gain margin of 4 (12 dB) and a phase margin of 50°, so expect about 16% overshoot.
Worked example
A loop crosses over at 10 rad/s with 45° of phase margin. How much pure delay can it tolerate?
Show the solution
- What delay costs. A delay subtracts radians at the crossover.
- Delay that uses up the margin.
- Where delay comes from. Networked or sampled controllers add delay, and this is the budget it comes out of.
Answer it can tolerate 78.5 ms of delay.
Check
A loop's gain is 0.3 at the frequency where its phase reaches −180°. What's its gain margin?
Check
A loop's phase is −135° at the frequency where its gain is 1. What's its phase margin?
Check
A loop has 45° of phase margin at a crossover of 0.5 rad/s. How much time delay can it tolerate before going unstable?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
What's the gain margin of ?
Check
A loop crosses over at 10 rad/s with 30° of phase margin.
(a)
What delay margin does it have?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
(b)
Roughly what damping ratio does the rule of thumb ζ ≈ PM/100 give?
Check
The loop has gain 4.
(a)
What is its gain margin, as a ratio?
(b)
What is its phase margin?
Explain why
Why does a time delay in a feedback loop push it toward instability?
A delay passes every frequency at the same size but shifts it later in time, which is a phase lag that grows in proportion to frequency. Around the gain crossover, where the loop's gain is one, the phase margin measures how far the loop is from turning its negative feedback into positive feedback. The delay's extra lag eats into that margin, and once the lag at the crossover equals the margin, a signal at that frequency returns around the loop the same size and inverted, so it sustains itself as an oscillation. Fast loops have high crossover frequencies, so even a short delay costs them a lot of phase.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.