Appearance
6.5 — Bode Plots, Gain Margin and Phase Margin
The methods of Chapter 6.4 need a transfer function. Often you do not have one. You have a machine, and you can drive it with a sine wave and measure what comes out.
Frequency response methods work entirely from that measurement. No model, no equations, no assumptions about order. Hendrik Bode developed them at Bell Labs in the 1930s while working on feedback amplifiers, and they remain the way most industrial loops are actually tuned.
1. The Bode plot
Two graphs against frequency on a logarithmic axis:
- Magnitude in decibels: 20\log_{10}|G(j\omega)|
- Phase in degrees: \angle G(j\omega)
Why logarithmic on both axes. Because of the logarithm's defining property:
20\log|G_1G_2|=20\log|G_1|+20\log|G_2|
Cascaded systems multiply their responses, and logarithms turn multiplication into addition. So a complicated system's Bode plot is the sum of its factors' plots, and each factor's plot is a straight line or two. The whole method exists because of that.
Phase adds directly, needing no logarithm.
The building blocks
Every transfer function factors into these, and each has a simple asymptotic shape.
Constant gain K. Magnitude is a horizontal line at 20\log K dB. Phase is 0° (or 180° if K is negative).
A pole at the origin, 1/s. Magnitude -20\log\omega: a straight line falling at 20 dB per decade, passing through 0 dB at \omega=1. Phase is a constant -90°.
A zero at the origin, s. Rising at 20 dB per decade, phase +90°.
A real pole, \dfrac{1}{1+s/\omega_c}.
- Well below \omega_c: magnitude 0 dB, phase 0°.
- Well above: falling at 20 dB per decade, phase -90°.
- At \omega_c: magnitude exactly -3 dB, phase exactly -45°.
The asymptotic approximation — flat until \omega_c, then falling at 20 dB/decade — is wrong by only 3 dB at the corner and less than 1 dB an octave away. That is why the sketch is good enough for design.
The phase, though, is slower. It starts moving a decade before the corner and does not finish until a decade after. That spread is what causes most stability surprises, because a pole you thought was far away is still contributing phase lag where it matters.
A real zero is the mirror image: rising at 20 dB/decade, phase going to +90°.
A complex pole pair, \dfrac{\omega_n^2}{s^2+2\zeta\omega_ns+\omega_n^2}.
- Below \omega_n: 0 dB, 0°.
- Above: falling at 40 dB per decade, phase -180°.
- At \omega_n: phase exactly -90°, and the magnitude is
|G(j\omega_n)|=\frac{1}{2\zeta}
A resonant peak, and its height is set entirely by the damping. \zeta=0.1 gives 1/0.2=5, which is +14 dB. \zeta=0.5 gives 0 dB. \zeta=0.707 gives the flattest response with no peak at all, which is why that value keeps appearing as a design target.
Sketching, in five steps
G(s)=\frac{100(s+1)}{s(s+10)(s+100)}
Step 1 — normalise to the standard form, so each factor is 1 at DC:
G(s)=\frac{100\times1\times(1+s)}{s\times10(1+s/10)\times100(1+s/100)}=\frac{0.1(1+s)}{s(1+s/10)(1+s/100)}
Step 2 — list the corners. Zero at 1, poles at 10 and 100, plus the integrator.
Step 3 — start at low frequency. Below \omega=1, only the integrator and the gain act:
|G|\approx\frac{0.1}{\omega}
At \omega=0.1: |G|=1, which is 0 dB. So the low-frequency asymptote passes through 0 dB at \omega=0.1, falling at 20 dB/decade.
Step 4 — change slope at each corner.
| Range | Slope |
|---|---|
| below 1 | -20 dB/dec (integrator) |
| 1 to 10 | 0 (zero cancels it) |
| 10 to 100 | -20 |
| above 100 | -40 |
Step 5 — the phase. Integrator contributes -90° throughout. The zero adds +90° across the decade either side of 1. Each pole subtracts 90° across the decade either side of its corner.
At \omega=10: -90° (integrator) +84° (zero, nearly complete) -45° (first pole, at its corner) -6° (second pole, starting) = -57°.
2. Stability from the Bode plot
The key idea: instability happens when the loop gain has magnitude 1 with 180° of phase shift — the Barkhausen condition of Chapter 2.6 again. So plot the open-loop response GH and see how close it comes to that point.
Two frequencies matter:
- Gain crossover \omega_{gc}, where |GH|=1 (0 dB).
- Phase crossover \omega_{pc}, where \angle GH = -180°.
Phase margin:
PM = 180° + \angle GH(j\omega_{gc})
How much extra phase lag the system can tolerate before it oscillates, measured at the frequency where the gain is 1.
Gain margin:
GM=\frac{1}{|GH(j\omega_{pc})|} \qquad\text{or in dB} \qquad -20\log|GH(j\omega_{pc})|
How much extra gain the system can tolerate before it oscillates, measured at the frequency where the phase is -180°.
\boxed{\text{Stable when both margins are positive.}}
Worked example
GH(s)=\frac{10}{s(s+1)(s+5)}
Find the gain crossover. Rewrite as \dfrac{2}{s(1+s)(1+s/5)}.
At \omega=1: |GH| = \dfrac{2}{1\times\sqrt2\times1.02}=1.39, so +2.9 dB.
At \omega=1.5: |GH|=\dfrac{2}{1.5\times1.80\times1.044}=0.71, so -3 dB.
Interpolating, \omega_{gc}\approx1.23 rad/s.
Phase there:
\angle GH = -90°-\arctan(1.23)-\arctan(1.23/5)=-90-50.9-13.8=-154.7°
PM=180-154.7=25.3°
Find the phase crossover. Need -\arctan\omega-\arctan(\omega/5)=-90°.
Try \omega=2.24: \arctan(2.24)=65.9°, \arctan(0.448)=24.1°, sum =90° ✓.
|GH(j2.24)|=\frac{2}{2.24\times2.45\times1.096}=0.332
GM=\frac{1}{0.332}=3.01, \text{ or } 9.6\ \text{dB}
Assessment: stable, but the 25° phase margin is poor. Expect substantial overshoot and a system that will misbehave if anything adds delay.
Check against Routh. Characteristic equation s^3+6s^2+5s+10=0:
\begin{array}{c|cc}s^3&1&5\\s^2&6&10\\s^1&\frac{30-10}{6}=3.33&\\s^0&10&\end{array}
Stable ✓. The critical gain is where \frac{6\times5-K}{6}=0, so K=30, and our K=10 is a factor of 3 below it — matching the gain margin of 3.01 exactly ✓. The two methods agree, as they must.
3. What the margins mean in the time domain
The connection is what makes frequency methods useful for time-domain specifications.
\boxed{\zeta \approx \frac{PM}{100}} \qquad\text{for } PM \lt 70°
A rule of thumb, accurate to about 10%, and it is the single most-used approximation in control engineering.
| Phase margin | \zeta | Overshoot |
|---|---|---|
| 20° | 0.20 | 53% |
| 30° | 0.30 | 37% |
| 45° | 0.45 | 20% |
| 60° | 0.60 | 9.5% |
| 70° | 0.70 | 4.6% |
The industry targets:
- Phase margin 45° to 60°. Below 30° the response rings badly; above 70° it is sluggish and you are wasting available performance.
- Gain margin 6 to 12 dB, meaning the gain can double or quadruple before trouble.
And bandwidth relates to gain crossover:
\omega_{bandwidth}\approx1.5\,\omega_{gc}
so
t_s\approx\frac{4}{\zeta\omega_n}\approx\frac{35}{PM\cdot\omega_{gc}}\ \text{(with PM in degrees)}
Read that: to make a loop faster, raise the gain crossover frequency. To make it better damped, raise the phase margin. Those two knobs are what Chapter 6.6's compensators turn.
4. Why the margins are not enough on their own
A system can have good margins and still be fragile. Consider a loop whose phase curve dips towards -180° at some frequency well below crossover, and comes back up. Both margins measure well, and yet a small change in the plant pushes that dip past -180° with gain above 1.
The honest measure is the vector margin — the shortest distance from the Nyquist plot to the -1 point, which accounts for gain and phase deviation together:
VM = \min_\omega |1+GH(j\omega)|
And notice that 1/VM is the peak of the sensitivity function from Chapter 6.2. So the vector margin and sensitivity peaking are the same statement, and keeping the sensitivity peak below about 2 (6 dB) is a more reliable robustness criterion than either classical margin.
Where this matters in practice: any plant with a lightly damped resonance — a flexible robot arm, a long drive shaft, a hard disk actuator — has exactly this shape of phase curve, and classical margins will lie to you about it.
5. The Nyquist plot and criterion
The same information plotted differently: the locus of GH(j\omega) in the complex plane as \omega runs from -\infty to +\infty.
The Nyquist stability criterion:
Z = N + P
where Z is the number of unstable closed-loop poles, P the number of unstable open-loop poles, and N the number of clockwise encirclements of the -1 point.
For a stable open-loop system (P=0): stable if the plot does not encircle -1.
Why bother when Bode plots are easier to read? Three reasons, and each is a real case.
1. Unstable open-loop plants. A Bode plot cannot tell you whether such a system is stabilised; the Nyquist criterion can, by counting encirclements. An inverted pendulum, a magnetic bearing, and an aircraft designed to be aerodynamically unstable for manoeuvrability all fall here. Modern fighter aircraft are deliberately unstable and rely entirely on the flight control computer, and this criterion is how that design is verified.
2. Systems with multiple gain crossings. If the magnitude crosses 0 dB more than once, "the phase margin" is ambiguous. The Nyquist plot has no such ambiguity.
3. Conditional stability. Some systems are stable at a given gain, unstable at lower gain, and stable again lower still. This is genuinely dangerous because start-up, saturation or a soft limit can momentarily reduce the effective gain and trip the system into oscillation. The Bode plot will not show this; the Nyquist plot makes it obvious.
6. Measuring a real plant
The great practical advantage of this chapter: you can get a Bode plot from hardware without any model.
Swept sine. Inject a sinusoid at the loop input, measure amplitude and phase at the output, step the frequency. Accurate and slow.
Chirp or noise excitation. Inject a broadband signal and compute the transfer function from the cross-spectrum:
H(f)=\frac{S_{xy}(f)}{S_{xx}(f)}
Fast, and needs the Welch averaging of Chapter 5.3 to be reliable.
The coherence function is the quality check, and it is the thing people forget:
\gamma^2(f)=\frac{|S_{xy}(f)|^2}{S_{xx}(f)S_{yy}(f)}
Coherence near 1 means the output at that frequency really is caused by your input. Below about 0.9 means noise, nonlinearity or an unmeasured disturbance dominates, and the measured response at that frequency is not trustworthy.
Always plot the coherence alongside the response. A beautiful Bode plot with a coherence of 0.3 at the frequency you care about is telling you nothing at all, and acting on it is how loops get tuned into instability.
Measuring a loop that is already closed requires care, because you cannot break it. The standard technique injects a small signal at a point in the loop and measures on both sides of the injection, computing the loop gain from the ratio — a loop gain injection measurement, done with a transformer or a high-impedance summing point.
7. Delay, seen from the frequency domain
Chapter 6.1 said delay is the enemy of feedback. Here is exactly why.
A delay T_d has
|G|=1 \text{ at every frequency}, \qquad \angle G = -\omega T_d
Unity magnitude and phase lag that grows without limit. It costs you nothing in gain and everything in phase.
Worked example. A loop with \omega_{gc}=10 rad/s and a phase margin of 60°. How much delay can it tolerate?
\Delta\phi=\omega_{gc}T_d \;\Rightarrow\; T_d=\frac{PM \text{ in radians}}{\omega_{gc}}=\frac{60\times\pi/180}{10}=\frac{1.047}{10}=105\ \text{ms}
More than 105 ms of delay and the loop oscillates.
And the relationship is the useful part: the tolerable delay is inversely proportional to the crossover frequency. Double the loop's speed and you halve the delay it can survive. That is why fast loops must be implemented with fast sampling, short computation and low-latency communication — and why a control loop routed over a network is a genuinely hard engineering problem.
Chapter 6.6 uses everything above to design the controller that almost every industrial loop actually uses, and explains why three terms turn out to be enough.
Every formula above, built from scratch
None of the results in this chapter are worth memorising, because each one can be rebuilt in under a minute from something simpler. What follows is that rebuilding, one result at a time, so the formula and the reason for it sit on the same page as the explanation that needed them.
Bode plots
|G|_{dB}=20\log_{10}|G(j\omega)|
| Factor | Magnitude slope | Phase |
|---|---|---|
| K | 0 | 0° |
| s | +20 dB/dec | +90° |
| 1/s | -20 dB/dec | -90° |
| 1+s/\omega_c | 0\to+20 at \omega_c | 0\to+90° |
| \dfrac{1}{1+s/\omega_c} | 0\to-20 at \omega_c | 0\to-90° |
| 2nd-order pole pair | 0\to-40 at \omega_n | 0\to-180° |
At a first-order corner: exactly -3 dB and -45°.
At a complex pole pair's \omega_n: phase exactly -90°, magnitude 1/2\zeta.
Stability margins
PM=180°+\angle GH(j\omega_{gc}) \qquad\text{where }|GH(j\omega_{gc})|=1
GM=\frac{1}{|GH(j\omega_{pc})|} \qquad\text{where }\angle GH(j\omega_{pc})=-180°
Approximations linking to the time domain:
\zeta\approx\frac{PM}{100} \quad (PM\lt70°)
\omega_{BW}\approx1.5\,\omega_{gc}
Targets: PM = 45° to 60°, GM = 6 to 12 dB.
Vector margin (more honest than either):
VM=\min_\omega|1+GH(j\omega)|=\frac{1}{\max|S|}
Keep the sensitivity peak below about 6 dB.
Delay tolerance:
T_{d,max}=\frac{PM \text{ (radians)}}{\omega_{gc}}
Halving the delay budget every time you double the loop bandwidth.
Nyquist criterion: Z=N+P, with Z unstable closed-loop poles, N clockwise encirclements of -1, P unstable open-loop poles.
What the next chapter fixes
Everything so far analyses a controller someone has already chosen. Chapter 6.6 chooses one: the three-term controller that runs the overwhelming majority of industrial loops, what each term fixes, what each one costs, and how to tune it without a model.