Feedback, and the margin

What is left at crossover

A feedback loop is stable or not according to one number read at one frequency — how much phase remains before −180° at the point where the loop gain passes unity. The loop gain here is obtained the way it is obtained on a bench: cut the loop, drive one side of the cut, and measure what comes back to the other.

Negative feedback works by comparing an output with what was wanted and driving the difference to zero. That works if the comparison is still a comparison by the time the signal has travelled round the loop — and every element in the loop delays it a little. Far enough round, the correction arrives late enough to be a reinforcement, and a circuit built to hold something steady starts producing a signal of its own.

Whether that happens is decided by one number, read at one frequency.

Loop gain of a three-pole amplifier closed for a gain of 100Unity loop gain at 5.73 kHz, where 34.9° of phase remains before −180°. The phase reaches −180° at 89.6 kHz, where the loop gain is 46.1 dB below unity.-40-200204060loop gain (decibels)unity loop gaincrossover 5.73 kHz46.1 dB of gain margin-180-135-901101001k10k100k1M10M100Mfrequency (hertz)loop phase (degrees)−180°34.9° of marginsolved, then checked — the loop cut and injected34.9° of phase margin at 5.73 kHz
Fig. 1 The loop gain of a three-pole amplifier closed for a gain of 100, magnitude above and phase below. It crosses unity at 5.73 kHz with 34.9° of phase left before −180°, and reaches −180° at a frequency where the loop gain is 46.1 dB below unity. The slider moves the second pole, and both margins move with it.

The loop gain, obtained rather than written

The quantity that decides stability is the loop gain: what a signal is multiplied by on one complete trip round the loop. In a textbook it is written as the product of the forward gain and the feedback fraction, and that expression is correct when the feedback network does not load the amplifier and the amplifier’s output impedance is zero — neither of which is true.

Here it is measured instead, by the method a bench measurement uses. The loop is cut at one point. A signal is injected on one side of the cut and what arrives at the other side is measured. The ratio, with a sign, is the loop gain, and it accounts automatically for every loading effect the product formula assumes away.

Concretely: the amplifier’s inverting input is disconnected from the feedback network and driven by a one-volt source; the input the circuit would normally see is grounded; and the feedback network’s output — which now goes nowhere — is read. Everything in the loop is still present, still loading whatever it loads, and the only thing that has changed is that the signal no longer arrives back where it started.

This matters more than it looks. The two netlists in the figure — the cut one and the closed one — share their forward path element for element, so the comparison later in this field between a margin computed from one and an overshoot computed from the other is a comparison of one circuit rather than of two descriptions of one.

The two margins

Phase margin is how much phase is left at the frequency where the loop gain is unity. If the loop gain is 1 and the phase is −180°, a signal returns to its starting point exactly inverted and subtracted, which is addition, and the circuit sustains an oscillation with nothing driving it. The margin is the distance from that condition, measured in degrees at the crossover.

Gain margin is the other coordinate: how far below unity the loop gain has fallen by the time the phase reaches −180°. It answers the question of how much extra gain could be inserted before the same condition is met.

The two are not redundant. A loop can have a comfortable phase margin and a small gain margin, or the reverse, and which one is small says something different about what will go wrong. Together they are two distances from a single point, which is what the Nyquist essay in this field makes visible.

Found by bisection, not by looking

The crossover frequency in the figure is not the nearest sample of the sweep. It is located by bisecting on the solved loop gain until the magnitude is unity to fifteen digits, and the phase is then evaluated there.

That is not fussiness. A sweep at sixty points per decade puts samples about four per cent apart in frequency, and near a crossover the phase is changing at something like forty-five degrees per decade — so picking the nearest sample can be several degrees out. Several degrees of phase margin is the difference between a response that settles and one that rings for a dozen cycles, which the next essay measures directly.

The check that the bisection worked is stated in the figure: the loop gain at the reported crossover must be unity to within 10−9. That is an assertion about the search rather than about the circuit, and it is the sort of thing that fails silently if the bracket is wrong.

The pole that is not in the way

The most useful thing this figure teaches is how far a pole’s influence reaches, and the slider is there to make it unmistakable.

A pole contributes −45° of phase at its own frequency, and the intuition most readers carry is that its effect is confined to a neighbourhood of it. It is not. A pole contributes about −6° a full decade below itself and about −84° a decade above, and the approach to both asymptotes is slow.

So a second pole placed a decade above the crossover — comfortably “out of the way” by any casual reading — still removes about six degrees of margin. Placed at the crossover it removes forty-five. The measured family from the slider:

Second pole Crossover Phase margin Overshoot that follows
1 kHz 3.08 kHz 18.1° 61.9%
2 kHz 4.25 kHz 25.2° 48.9%
4 kHz 5.73 kHz 34.9° 35.1%
8 kHz 7.36 kHz 47.3° 20.8%
20 kHz 9.10 kHz 65.3° 4.5%
60 kHz 9.87 kHz 80.4° none
200 kHz 9.99 kHz 86.9° none

Notice that the crossover frequency itself moves relatively little — from 3.1 kHz to 10 kHz across a two-hundred-fold change in the pole’s position — while the margin moves from 18° to 87°. The pole is not changing where the loop runs out of gain; it is changing how much phase has been spent by the time it gets there.

Why the first pole is deliberate

Something in that table looks like a mistake and is not: the loop has a pole at ten hertz, which is an absurdly low frequency for an amplifier meant to work at kilohertz.

It is there on purpose, and it is the single most important design decision in the whole subject. An amplifier with three poles at, say, ten kilohertz, two hundred kilohertz and two megahertz would have an enormous loop gain up to ten kilohertz and would accumulate −270° of phase not far above it — with the loop gain still far above unity. It would oscillate in almost any feedback configuration.

Deliberately adding a pole far below all the others — dominant-pole compensation — makes the loop gain fall at twenty decibels per decade from very low frequency, so that it reaches unity while only one pole is contributing significant phase and the margin is close to 90°. The cost is bandwidth: the amplifier’s open-loop gain is falling from ten hertz upward, and the closed-loop bandwidth is whatever is left when the loop gain reaches unity.

That is the trade the whole field is built on. Stability is bought with bandwidth, at a rate set by the pole placement, and the general-purpose amplifier every reader has met is one that has bought a great deal of stability.

The same loop gain as one path, and the point that decides stabilityThe locus passes 46.1 dB inside the critical point on the negative real axis and crosses the unit circle 34.9° away from it. Both margins are distances from the same point on the same curve, which the split Bode pair cannot show.−1unity gain, 34.9° of marginrealimaginarythe unit circle, drawn faintthe locus, and its mirror for negative frequencysolved, then checked — the loop gain as one path46.1 dB and 34.9° from the critical point
Fig. 2 The same loop gain drawn as a single path in the complex plane instead of as two graphs. The two margins are two distances from one point: where the locus crosses the unit circle, and where it crosses the negative real axis. The split into magnitude and phase is a convenience that hides that they are the same measurement.

Why the sweep is not enough on its own

A loop-gain sweep is a picture and the margin is a number, and the gap between them is worth one paragraph because it is the reason this figure does more than plot two curves.

Reading a margin off a plot requires finding where the magnitude crosses unity and then reading the phase there. On a printed plot that is a ruler operation with an accuracy of a degree or two, which happens to be adequate. On a computed plot it is worse, not better, unless the crossover is found properly: the samples are at fixed intervals in log frequency, the true crossover falls between two of them, and taking the nearer sample introduces an error equal to the phase change over half a sample interval.

At sixty points per decade and a phase slope of forty-five degrees per decade, that is about half a degree — tolerable. At the twenty-six points per decade this figure actually sweeps at, chosen to keep the drag payload small, it would be over a degree, and near a second pole where the phase slope is steeper it would be several.

So the crossover is bisected rather than sampled, and the sweep is used only for drawing. That separation — a coarse sweep for the picture, an exact search for the number — recurs throughout the collection, and it is why the numbers quoted in captions are more precise than the curves beneath them look.

The loop gain and the closed-loop gain are different curves

One confusion is worth heading off, since both are plotted in this field and they are easy to conflate.

The loop gain is what a signal is multiplied by on one trip round the loop. It is large at low frequency — a thousand, in this circuit — falls at twenty decibels a decade, and passes through unity at the crossover. It is not a gain anybody measures at a terminal; it is a property of the loop.

The closed-loop gain is what the circuit does: a hundred, flat, until the loop gain runs out.

The relation between them is that the closed-loop gain follows its ideal value as long as the loop gain is large, and departs from it as the loop gain approaches unity. So the closed-loop bandwidth is the crossover frequency — the two are the same point on the frequency axis, seen on two different plots.

That identity is worth holding because it makes the whole field’s trade visible at once. More loop gain means a more accurate closed-loop response and a higher crossover; a higher crossover means the loop’s poles contribute more phase before it; more phase means less margin. Accuracy and stability are the same resource, and the crossover frequency is where it is spent.

What the margins are worth

A phase margin is not a binary. Below zero the circuit oscillates; above zero it does not, and how far above decides everything about what it does instead.

The rough correspondence, measured in the next essay rather than quoted here: 45° gives about twenty per cent overshoot and a few cycles of ringing; 60° gives a few per cent and settles quickly; 90° is a single exponential with no ringing at all and the slowest arrival. The usual design target of 45° to 60° is a compromise between speed and tidiness rather than a safety rule.

There is also a reason to want margin that has nothing to do with the nominal circuit. Every quantity in the calculation moves — with temperature, with the particular part fitted, with the load capacitance somebody adds later. A loop designed with 60° of margin can lose twenty of them to reality and still be well behaved; one designed with 15° cannot lose any.

Capacitive load is the commonest way it is lost, and it is worth naming because it catches people who have done everything else right. An amplifier’s output resistance and a load capacitance form a pole, that pole is inside the feedback loop, and a few nanofarads on the output of a circuit that was stable without them can move the margin by tens of degrees. Nothing in the schematic changed; something was connected to it.

A gain of 100 asked of an amplifier with 1.00 MHz of gain–bandwidthThe ideal amplifier — a nullor, so the two golden rules exactly — holds 100 at every frequency. The real one is 0.10% low at direct current, 1% low by 1.35 kHz, and 3 dB down at 10.0 kHz. Above 10.0 kHz there is no loop gain left and the ideal answer is not an approximation to anything.010203040501101001k10k100k1Mfrequency (hertz)closed-loop gain (decibels)the ideal amplifier: two resistors, no frequencythe circuit+1% low at 1.35 kHz3 dB down at 10.0 kHzsolved, then checked — a nullor against a real devicethe ideal answer is 1% wrong above 1.35 kHz
Fig. 3 Where the loop gain has gone. The closed-loop response of a real amplifier follows the ideal answer only while there is loop gain left to enforce it — and above the frequency where the loop gain reaches unity, the ideal answer is not an approximation to anything.
One loop, two measurements of the same marginThe loop gain crosses unity at 5.73 kHz with 34.9° of phase left. The closed-loop step overshoots by 35.1%, which the second-order relation says corresponds to 35.0°. They differ by 0.1°, and the difference is the third pole.0501001500200400600closed-loop output (volts) for a 1 V stepthe 100× the divider asks for35.1% overphase margin, measured two waysfrom the loop gain34.9°from the overshoot35.0°apart by 0.1° — the relation assumes two poles and this loop has threesolved, then checked — margin against overshootthe second-order relation is 0.1° out here
Fig. 4 What the margin in this figure is worth, measured. The same loop’s closed-loop step response, with the phase margin computed from the loop gain set against the one implied by the measured overshoot — the subject of the next essay in this field.

What goes wrong when the margin is gone

A loop with no margin does not fail gently, and the two ways it fails are worth distinguishing because they are diagnosed differently.

Sustained oscillation. The loop gain reaches unity at a frequency where the phase is −180°, and the circuit produces a signal of its own at that frequency, growing until something saturates. On an oscilloscope it is a clean waveform at a frequency unrelated to anything in the input, present with the input disconnected — which is the diagnostic test, and the reason it is worth doing before anything else.

Conditional stability. The subtler case, and the one that catches experienced designers. A loop whose phase dips past −180° at a frequency where the gain is still above unity, and comes back before the crossover, is stable by the full Nyquist criterion and is unstable if the gain is reduced — which happens during start-up, during saturation recovery, or whenever a nonlinearity temporarily lowers the loop gain. The circuit works on the bench and oscillates when the supply comes up.

Both are visible in a Nyquist plot and only the first is obvious in a Bode pair, which is the main practical argument for the locus. A phase that dips below −180° and recovers is a locus that passes to the left of the critical point and comes back, and the encirclement count catches it while a casual reading of “the margin at crossover” does not.

Where the phase actually comes from

One accounting that makes the numbers in this essay less mysterious. Every source of phase in a loop falls into three kinds, and they behave very differently.

Poles. Each contributes up to −90°, approached slowly: −45° at its own frequency, −6° a decade below, −84° a decade above. Poles are what a compensated amplifier’s phase is made of, and their slowness is why a pole a decade out still costs six degrees.

Right-half-plane zeros. These contribute phase like a pole while contributing gain like a zero — the magnitude rises and the phase falls. They are the worst thing that can happen to a loop, because the usual remedy of reducing the crossover does not help as quickly as it does for a pole. They arise in switching converters and in some amplifier topologies, and they are the reason certain circuits are much harder to compensate than their pole count suggests.

Delay. A pure delay contributes phase proportional to frequency with no effect on magnitude at all, so it takes margin away without ever helping the loop reach unity gain sooner. Any loop with a propagation delay in it — a digital control loop, a long cable, a modulator — has a hard ceiling on crossover frequency set by that delay alone: at a crossover where the delay is a quarter of a period, the delay has consumed the entire ninety degrees.

The measurement and the model

One last observation about the method, since it is what separates this figure from a derivation.

Cutting a loop and injecting into it is a real laboratory technique, done with a small transformer or a dedicated injection point, and it is used precisely because the product formula cannot be trusted in a real circuit. Doing the same thing in a solver rather than deriving the expression means the figure has the same relationship to the circuit that a measurement would.

It also means the method extends to loops where no product formula exists at all. A circuit with two interacting feedback paths, or one where the “feedback network” is a filter that loads the output substantially, has a loop gain that is perfectly well defined and no tidy expression. The cut and the injection work identically. That is the usual pattern in this collection: the definition is computable where the formula is not, and the definition is what the figure uses.