The formula
Everything is measured on the open-loop transfer function — the controller times the plant, with the loop broken:
L(jω) = C(jω)·G(jω) — the signal path a perturbation sees going once around the loop.
Two special frequencies define the margins:
|L(jω_gc)| = 1 — the gain crossover ω_gc, where loop gain passes through 0 dB.
PM = 180° + ∠L(jω_gc) — phase margin: how far the phase sits above −180° at the frequency where gain is exactly unity.
∠L(jω_pc) = −180° — the phase crossover ω_pc, where the fed-back signal comes around fully inverted.
GM = 1 / |L(jω_pc)| or GM_dB = −20·log₁₀|L(jω_pc)| — gain margin: the factor you could multiply the loop gain by before the −180° point reaches unity gain.
τ_max = PM_rad / ω_gc — delay margin: the pure transport delay, in seconds, that would eat the entire phase margin.
s_m = 1 / M_s where M_s = max over ω of |1/(1 + L(jω))| — the vector margin: the closest approach of the Nyquist curve to the −1 point, and the honest single-number version of both margins.
Where you meet it
- On the power-supply bench, measuring a DC-DC converter's control loop: injection transformer across a small resistor in the feedback divider, network analyzer sweeping from a few hundred hertz up past crossover, and a marker parked on the 0 dB point reading out phase margin. A converter that rings after every load step usually confesses right there.
- On a servo test stand: a hydraulic or electromechanical actuator under closed-loop position control, frequency response analyzer driving the command input. The acceptance report quotes crossover frequency, GM, and PM, and the customer's spec says what they must exceed.
- At a design review, where the stability analysis charts show gain and phase margin across the tolerance corners — cold day, hot day, low battery, worn actuator, heavy payload. Flight-control and launch-vehicle programs commonly require margins in the neighborhood of 6 dB and 30° at every corner, not just nominal.
- On an op-amp breadboard driving a capacitive load. The extra pole from the cable capacitance against the amplifier's output impedance eats phase margin, and the step response on the scope grows overshoot and ring-down that a margin calculation would have predicted.
How it works
Both numbers are the same question asked two ways: how close does the open-loop frequency response come to the point where feedback stops fighting the error and starts feeding it. On a Nyquist plot that point is −1. A loop sitting exactly at −1 has unity gain and −180° of phase — the feedback returns the signal at full strength, inverted twice (once by design, once by lag), so it reinforces itself. Gain margin measures the distance to −1 along the real axis; phase margin measures it along the unit circle.
The margins earn their keep because they map onto real hardware behavior:
- Phase margin predicts damping. For a loop that behaves like a second-order system near crossover,
ζ ≈ PM/100for phase margins under about 60° (PM of 25° gives ζ near 0.23; PM of 60° gives ζ near 0.6 — verified against the exact relation). Low phase margin means an underdamped closed loop: overshoot, ringing, a resonant hump in the closed-loop response. - Gain margin covers the things that scale gain: component tolerance, plant gain that varies with operating point, an actuator that's stronger cold than hot. A 6 dB gain margin means the loop tolerates a factor of two (10^(6/20) ≈ 1.995) before oscillation.
- Delay margin converts phase margin into time. A 45° margin at a 10 rad/s crossover buys
(π/4)/10 ≈ 79 msof unmodeled delay. Transport delay is the quiet killer — every millisecond of it costsω·τradians of phase, more at higher frequency, with no effect on the gain plot at all.
A worked example, numbers checked: take L(s) = 10 / ( s·(s+1)·(s+5) ). The phase reaches −180° at ω_pc = √5 ≈ 2.24 rad/s, where the magnitude is exactly 1/3, so GM = 3, or 9.5 dB. Gain crosses 0 dB at ω_gc ≈ 1.23 rad/s, where the phase is −154.6°, so PM ≈ 25°. That loop is stable but it will ring hard, and about 0.36 s of added delay ends the discussion.
Reading the numbers off a Bode plot pair is mechanical: find where the magnitude trace crosses 0 dB, drop down to the phase trace, and measure up from −180° — that's PM. Find where the phase trace crosses −180°, go up to the magnitude trace, and measure down to 0 dB — that's GM. Crossover frequency itself is worth quoting alongside the margins, because it approximates the closed-loop bandwidth: it says how fast the loop is, while the margins say how close to the edge it runs at that speed.
Now the gotchas, which is where the real engineering lives:
- The two margins can both look healthy while the loop is one notch filter away from disaster. GM and PM sample the Nyquist curve at exactly two frequencies. A curve can pass those checks and still skim close to −1 somewhere between them — common when a structural-mode notch or a resonant plant puts a loop in the response. The peak sensitivity
M_scatches this; keepingM_s ≤ 2guarantees at least 6 dB of gain margin and about 29° of phase margin, which is roughly where the classic rules of thumb come from. - Margins read off a Bode plot assume the simple case: open loop stable, gain crossing 0 dB once. Conditionally stable loops — multiple crossovers, common in high-gain motion control with notches — can be destabilized by reducing gain. So can loops around unstable plants. For those you go back to Nyquist and count encirclements; the Bode-plot shortcut is not a theorem, it's a special case.
- Margins are defined on the open loop, but you measure operating hardware closed-loop. The injection point matters: break the loop where every signal of interest passes through once, at a point with low source impedance looking back and high impedance looking forward, or the measured
Lisn't theLin your analysis. - Digital control spends phase margin on sampling. A zero-order hold contributes roughly
ω·T/2radians of lag, so sampling at ten times the crossover frequency costs about 18° of phase margin before the control law does anything. Engineers get surprised by this exactly once. - The whole framework is linear. Saturation, backlash, stiction, and quantization are outside it. A loop with 60° of paper margin can still limit-cycle against an actuator rate limit — margins are necessary, not sufficient.
- Classical margins perturb one thing at a time: GM assumes phase stays put while gain drifts, PM assumes the reverse. Real hardware drifts both together — a warm amplifier changes gain and adds lag in the same afternoon. That's why modern analysis supplements GM/PM with disk margins, which sweep gain and phase perturbations simultaneously, and why multi-loop systems get checked loop-by-loop with the other loops closed rather than trusting a single pair of numbers.
The mistake people make: quoting margins as if bigger is free. Margin is bought with bandwidth. Backing crossover down to fatten the phase margin also slows disturbance rejection, and a servo that never oscillates but can't hold position under load has failed differently, not better.
History
The margins come out of a telephone problem. Harold Black, at Bell's Western Electric and then Bell Labs, invented the negative feedback amplifier in 1927 to kill distortion in long-haul repeater chains [4][7]. It worked, and it also handed the Bell System a new failure mode: wrap enough gain in a feedback loop and some builds would sing — oscillate — for reasons the designers couldn't predict from the schematic.
Harry Nyquist, a Swedish-born engineer in the same organization, settled it. His paper "Regeneration Theory," in the January 1932 Bell System Technical Journal, showed that stability could be read off a plot of the loop's frequency response in the complex plane: trace L(jω) and watch its behavior around the point −1 [2][3][4]. No differential equations for the whole loop, no trial builds — a curve and a critical point. Gain margin and phase margin fall straight out of that picture as the two natural distances from the curve to −1.
Hendrik Bode, also at Bell Labs, turned the criterion into a design method. Through the late 1930s he developed the asymptotic magnitude and phase plots that carry his name, published the key theory in "Relations Between Attenuation and Phase in Feedback Amplifier Design" in the July 1940 Bell System Technical Journal, and consolidated it in his 1945 book Network Analysis and Feedback Amplifier Design [5][6]. Bode's contribution was the working procedure every controls engineer still follows: shape the open-loop gain plot, keep track of the phase that shaping implies, and hold a stated margin against the −1 point instead of designing to the edge. The vocabulary of margins as a design requirement — the thing you write into a spec and defend at a review — is his legacy as much as the plots are [1][6][8].
Related tools
- /tools/db-converter — margins are quoted in dB; this is the ratio arithmetic behind them
- /tools/opamp-gain — the loop gain whose phase margin decides whether the amplifier rings
- /tools/rc-filter — every RC pole in the loop is 20 dB/decade of rolloff and up to 90° of the phase lag that margins budget for
- /tools/q-factor-bandwidth — the resonant peaking that low phase margin produces in the closed loop
- /tools/vibration-natural-freq — the structural modes that show up inside servo loops and eat gain margin
Sources
- https://en.wikipedia.org/wiki/Phase_margin
- https://en.wikipedia.org/wiki/Nyquist_stability_criterion
- https://archive.org/details/bstj11-1-126
- https://en.wikipedia.org/wiki/Harry_Nyquist
- https://archive.org/details/bstj19-3-421
- https://en.wikipedia.org/wiki/Hendrik_Wade_Bode
- https://en.wikipedia.org/wiki/Harold_Stephen_Black
- https://fbswiki.org/wiki/index.php/Main_Page