gain margin
Gain margin is the second safety cushion against oscillation, the companion to phase margin. Where phase margin asks how much extra phase lag you can stand, gain margin asks the flip question: how much more loop gain could you add before the amplifier breaks into oscillation? It is the headroom in gain, measured at the worst-case frequency, and a healthy amplifier needs both cushions to be comfortable.
To read it, find the frequency where the loop's phase lag has reached the dangerous 180 degrees — the point where feedback would become positive. At that frequency, gain margin is how many decibels the loop gain sits BELOW 1 (0 dB). Example: if at the 180-degree frequency the loop gain is -12 dB, the gain margin is 12 dB, meaning you have a factor of four of headroom before the gain would reach unity and the loop would oscillate. If instead the loop gain were above 0 dB at that frequency, the gain margin would be negative and the circuit is already unstable.
Why this matters: gain margin and phase margin describe the same Bode plot from two angles, and both must be healthy for a robust design — typical targets are a phase margin of 45 to 60 degrees and a gain margin of at least 10 dB. Gain margin is especially telling when something might raise the loop gain unexpectedly — a hotter op-amp, a higher-gain batch, or a resistor at the wrong tolerance. Checking both numbers, not just one, is how you avoid a design that is stable on the bench but marginal in production.
A loop's Bode plot shows the phase hitting -180 degrees at 4 MHz, where the loop gain is -10 dB. That 10 dB gain margin means the loop gain would have to triple (about 3.2x) before the circuit oscillates — a comfortable, though not generous, cushion.
Gain margin = how far the loop gain is below 0 dB at the -180-degree phase frequency.
Either margin alone can mislead. A loop can have a fine gain margin yet a thin phase margin (or vice versa), so a stable design demands healthy values for BOTH, not a trade between them.