3.5.42 · D2Guidance, Navigation & Control (GNC)

Visual walkthrough — Gain margin, phase margin — stability margins

2,413 words11 min readBack to topic

We build everything on one drawing: the complex plane for the loop's frequency response. Let's earn every piece of it.


Step 1 — The plane, the dot, and what "loop response" even means

WHAT. Draw a flat sheet with two number lines crossing at a centre. The horizontal line is the real axis (ordinary numbers left/right of zero). The vertical line is the imaginary axis — it just measures a second, sideways amount. Any point on this sheet is written : go right, then up. (Engineers write for the sideways unit; mathematicians write . Same thing.)

WHY. A feedback loop takes a wiggling signal, sends it around, and hands back another wiggle. At each wiggle-speed (frequency) the returned wiggle is scaled by some amount and shifted in time by some amount. Those two facts — how big and how shifted — are exactly what one dot on this plane records:

  • distance from centre = how big the return is (the scale factor),
  • angle from the positive-real axis = how shifted the return is (the phase).

We call this dot — the loop response at wiggle-speed . Sweep from slow to fast and the dot traces a curve.

PICTURE. The plane, the centre , and one sample dot with its distance and angle labelled.

Figure — Gain margin, phase margin — stability margins

Step 2 — The one deadly point:

WHAT. Mark the point exactly one step left of centre: the number . Its distance from centre is ; its angle is (straight left). Because we care about lag (clockwise), we usually name that angle — same direction, just counted the negative way.

WHY. Feedback subtracts the return from the input. If the returned wiggle comes back the same size () and flipped upside-down ( shift), then "input minus return" adds the wiggle to itself every cycle instead of cancelling it. That is a swing pushed in perfect rhythm — it grows without bound. Algebraically this is where the closed-loop denominator becomes , and dividing by zero is the mathematical face of "blows up".

PICTURE. The plane again, with circled in pink and a small swing-cartoon reminder of "pushed in rhythm".

Figure — Gain margin, phase margin — stability margins

Step 3 — Splitting one worry into two questions

WHAT. Instead of chasing the rare frequency where both conditions hit at once, we ask two easier one-at-a-time questions:

  1. At the frequency where the phase is already the deadly — how far is the size from the deadly ? → this becomes Gain Margin.
  2. At the frequency where the size is already the deadly — how far is the phase from the deadly ? → this becomes Phase Margin.

WHY. Each condition is easy to locate on its own. "Where is phase ?" and "where is size ?" are two separate frequencies we can hunt for. Then we only need to check the other quantity there. This is the mnemonic GaP: Gain margin at the Phase crossover; Phase margin at the Gain crossover.

PICTURE. The curve sweeping across the plane, with the two special crossing points flagged.

Figure — Gain margin, phase margin — stability margins

Step 4 — Gain Margin: how much can I scale up before I hit ?

WHAT. Sit at . Here the phase is , so the dot lies on the negative-real axis — it is a pure negative number, . It sits somewhere between and (if we're stable). Question: multiply the whole loop's gain by a factor — how big must be to slide this dot exactly onto ?

WHY. Scaling the loop gain by stretches every dot's distance by (the angle doesn't change — a positive multiplier doesn't rotate anything). So the dot slides straight along the negative-real axis toward . It reaches when its size becomes :

That threshold is the gain margin: the largest factor you can crank the gain by before instability.

PICTURE. Zoom on the negative-real axis: the dot at , an arrow showing it sliding out to as gain grows, the gap labelled GM.

Figure — Gain margin, phase margin — stability margins

Step 5 — Phase Margin: how much can I lag before I hit ?

WHAT. Now sit at . Here the size is , so the dot lies on the circle of radius 1, at some angle (a lagging, negative angle like ). Question: how much extra clockwise rotation (extra lag) would swing this dot all the way around to , i.e. onto ?

WHY. A pure time delay or extra phase lag rotates every dot clockwise without changing its size (delay reshuffles timing, not strength). So on the unit circle the dot slides along the circle toward . The remaining sweep from where it is now down to is the safety angle:

PICTURE. Zoom on the unit circle: the dot at angle , an arc sweeping clockwise to , the arc labelled PM.

Figure — Gain margin, phase margin — stability margins

Step 6 — The degenerate & edge cases (never leave a gap)

WHAT & WHY — walk every scenario the curve can throw at you.

Case A — the curve never reaches (no ). The phase bottoms out above forever. Then no finite scaling puts the dot on the negative-real axis at — the gain margin is infinite. A first-order or well-behaved second-order loop does this. Perfectly stable in gain.

Case B — the curve never reaches size (no ). Either the loop's gain is below at all speeds (dot never touches the unit circle) — phase margin is undefined/infinite, no gain crossover to worry about — or the loop stays above everywhere, which is a different design flag. Always check whether a crossover exists before quoting a margin.

Case C — the dot is exactly on . Both conditions hit together: GM (0 dB) and PM . This is marginal stability: a steady, un-growing, un-shrinking oscillation. The knife-edge.

Case D — multiple crossings (conditionally stable systems). The curve can cross the negative-real axis more than once, or loop around. Then the simple "one GM, one PM" reading can lie. The honest test is the full Nyquist criterion — count how the curve encircles . Margins are a fast summary, not the whole truth.

Case E — sign of the margins. GM in dB and PM in degrees are positive when stable, negative when already unstable. A negative PM means the dot has slid past on the circle; a negative GM(dB) means the dot has slid past on the axis.

PICTURE. A 2×2 board of tiny curves: infinite-GM curve, marginal on- curve, negative-margin curve, and a looping conditionally-stable curve.

Figure — Gain margin, phase margin — stability margins

Step 7 — Grounding it in a real number (tie to the worked example)

WHAT. Take from the parent note and find where the dot crosses the unit circle, then read its angle.

WHY. To prove the pictures give real numbers, not just arrows.

The size equals when There the phase is

  • The is the lag from the lone in the denominator (an integrator always lags a quarter-turn).
  • The is the extra lag from the factor at this speed.
  • Adding turns "current angle" into "gap to the danger angle" — the safety cushion.

PICTURE. The unit-circle zoom for this exact system with and the arc drawn to scale.

Figure — Gain margin, phase margin — stability margins

The one-picture summary

Everything above is a single drawing: the loop curve on the complex plane, the deadly point , and two rulers — one straight (gain, along the negative axis) and one curved (phase, along the unit circle) — both measuring how far the curve stays from catastrophe.

Figure — Gain margin, phase margin — stability margins

One dot L at each frequency

Deadly point minus one

Need both size one and phase minus 180

Split into two easy questions

At phase crossover measure size gap

At gain crossover measure angle gap

Gain Margin equals one over size

Phase Margin equals 180 plus angle

Recall Feynman retelling — the whole walk in plain words

Picture a big flat table with a bullseye dot painted one step to the left of centre; that dot is disaster. Your control loop draws a curly line across this table, one point per speed of wiggling. The point tells you two things by where it sits: how far from the middle (how strong the echo is) and which way it leans (how late the echo is). Disaster happens only when the line touches that painted dot — echo just as strong and perfectly flipped, like pushing a swing in perfect rhythm until it flies off. Chasing that exact touch is hard, so we split the job. First, find where the line crosses straight through the left — its lean is already "disaster lean" there; now just ask how much you'd have to blow the line up to reach the dot. That blow-up factor is the gain margin. Second, find where the line crosses the ring one step out from the middle — it's already "disaster distance" there; now just ask how much extra late-lean would swing it around onto the dot. That leftover swing is the phase margin. Big straight-ruler and big curved-ruler mean the line stays far from the painted dot in both directions — you're safe. If the line ever loops around the dot, the two rulers can fib, so you count loops the Nyquist way instead. That's the entire idea, twice as a picture and once as a swing.


Question — Which axis does the gain margin slide the dot along, and why?
The negative-real axis; at phase crossover the phase is already so the dot is a pure negative number, and scaling gain moves it straight toward without rotating.
Question — Which curve does the phase margin sweep the dot along, and why?
The unit circle (radius 1); at gain crossover the size is already 1, and extra lag rotates the dot along that circle toward without changing its size.
Question — What does an infinite gain margin mean geometrically?
The loop curve never reaches phase , so it never crosses the negative-real axis — no finite scaling can push it onto .
Question — When both margins are zero, what is the system doing?
The dot sits exactly on : marginal stability, a sustained oscillation that neither grows nor decays.