D37 of 10
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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, L(s)=K/(s+1)3, like a heater feeding three thermal masses in a row.
  • The phase reaches −180° at ω=3 rad/s, where the gain is K/8: the gain margin is 8/K.
  • The gain crosses one at ωc=K2/3−1, 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 K/(s+1)3 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?

Name it

Crossovers and margins

On the Bode plot of the loop gain L(jω):

  • the gain crossover ωc is where |L|=1 (0 dB). The phase margin is PM=180°+∠L(jωc);
  • the phase crossover ω180 is where ∠L=−180°. The gain margin is GM=1/|L(jω180)|, or −20log10⁡|L(jω180)| 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 ζ≈PM/100° 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 e−jωT, which costs phase ωT (in radians) at every frequency without changing the gain. The largest tolerable delay is

Tmax=PM(rad)ωc

Worked example

Find the margins of K/(s+1)3 at K = 4.

Show the solution
  1. Gain margin. 8/4=2 or 6.0 dB.
  2. Crossover. ωc=42/3−1=1.233rad/s
  3. Phase margin. The phase at crossover is ϕ=−3arctan⁡1.233=−152.9° so PM = 27.1°.
  4. Delay margin. Td=27.1×π/1801.233=0.38s
  5. 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
  1. Gain margin. 1/0.25=4 or 12 dB.
  2. Phase margin. 180−130=50° so ζ ≈ 0.5.
  3. Overshoot. e−π×0.5/0.866=16%

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
  1. What delay costs. A delay Td subtracts ωTd radians at the crossover.
  2. Delay that uses up the margin. Td=45×π/18010=78.5ms
  3. 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 L(s)=3/(s+1)3?

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 K/(s+1)3 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?

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.