Feedback, and the margin

Stable, and unstable with less gain

A three-pole loop with two lead sections is stable for gains between 1.81 × 10⁶ and 3.36 × 10⁷ and unstable on both sides of that window. Turning its gain *down* is what breaks it. Neither margin can see this, because a phase margin describes the loop at one frequency and a gain margin at one other, and this loop's phase crosses −180° at three: 189 Hz, 3.46 kHz and 23.5 kHz.

Assumes: What is left at crossover · Two measurements of one margin · One solve, read four ways

The feedback field has so far asked one question of every loop it has drawn: how much phase is left when the gain has fallen to unity. The answer is a number in degrees, it predicts the overshoot of a step the frequency domain never sees, and the agreement between the two is the strongest construction on this site.

It also carries a piece of advice that every reader will already have absorbed, and that this essay exists to break. The advice is: if a loop rings, turn the gain down. It is not a theorem. It is a property of loops whose phase falls once and keeps falling, which is what a chain of poles does, and which is what every loop in this field has been until now. For such a loop, reducing the gain walks the crossover backwards down the phase curve to somewhere with more margin, and the advice is not merely good but automatic.

This essay builds a loop that does not have that property, and measures what happens instead.

A loop whose phase comes back, at a gain of 1.0e+7computed by solving, not by drawing. Three identical poles take the phase to −270°, two lead sections bring it back to −158°, and their own poles take it down again — so ∠L = −180° at 189 Hz, 3.46 kHz and 23.5 kHz. The gain moves the magnitude curve and not those three frequencies, so it decides only which side of each the unity-gain point falls. At 1.00e+7 the crossover is 10.6 kHz, in the recovered band, and the loop is stable.-120-60060120180|L| (dB)unity gain-300-240-180-120-601101001k10k100k1M10Mfrequency∠L (degrees)−180°gain1.00e+7crossover10.6 kHz−180° at189 Hz, 3.46 kHz, 23.5 kHzstable window1.81e+6 … 3.36e+7this gain isstablesolved, then checked — one network, three crossingsstable only between 1.81e+6 and 3.36e+7
Fig. 1 The loop gain of three identical poles followed by two lead sections. The phase falls to −270°, the two zeros bring it back to −158°, and the leads’ own poles take it down again — so ∠L = −180° at three separate frequencies, marked. The shaded band is where the phase is above −180°, which is the only band a crossover may safely land in. The slider is the gain, and it moves the magnitude curve bodily up and down while touching none of the three marks.

What the loop is made of

Nothing here is written as a transfer function. The loop is a netlist, and every part of it is a component:

  • the gain, as a voltage-controlled voltage source whose controlling pair is the input and the feedback node — so the same netlist is the open loop when that node is grounded and the closed loop when it is joined to the output;
  • each pole, as a resistor into a capacitor with an ideal follower behind it;
  • each lead, as a resistor with a capacitor across it feeding a resistor to ground, which is one zero and one pole a fixed factor above it.

Three poles at 100 Hz take the phase to −270°. Two zeros at 3 kHz bring it back up. Their own poles, a factor of ten higher at 30 kHz, take it down again. The result is a phase that dips below −180°, recovers into a band where it is safe, and then leaves that band for good.

A lead section pays for its phase in gain: it attenuates at direct current by exactly the ratio of its pole to its zero, so two of them throw away a factor of a hundred before the loop does anything at all. That is not an artefact of the construction — it is what a lead network costs — and it is left in the netlist rather than normalised away, which is why the gains in this essay are large.

The three crossings, and what a margin is a summary of

Here is the whole difficulty in one sentence. L = −180° at three frequencies, and a gain margin is a statement about one of them.

The function that computes a gain margin on this site does what every such function does: it brackets a sign change in the phase and bisects. Given a loop that crosses once, that is exactly right and the answer is the answer. Given this loop, the bisection converges to whichever crossing the bracket it was handed happens to contain, and which crossing that is has nothing to do with the circuit. The number that comes back is a true statement about a frequency and a false statement about the loop.

So all three are found instead, and the way they are found is worth stating because it makes the rest of the essay cheap. The loop is evaluated once at unit gain. Scaling the gain multiplies |L| everywhere and changes ∠L nowhere, so the three crossing frequencies are properties of the network that no gain can move; and at a crossing the locus sits at −|L₁| on the negative real axis, so the gain that puts it exactly on −1 is 1/|L₁|. Three crossings, three critical gains, computed by solving ∠L = −180° at three points:

L = −180° at the gain that puts −1 there
189 Hz 9.79 × 10²
3.46 kHz 1.81 × 10⁶
23.5 kHz 3.36 × 10⁷

Every gain at which this loop’s stability can change is in that column and nowhere else. That is a strong statement and it is only half an answer: it says where the boundaries are, not which side of each is stable.

Where this loop is stable, on the gain axis (lead ratio 10). computed by solving, not by drawing. The 3 gains at which ∠L = −180° — 9.79e+2, 1.81e+6, 3.36e+7 — are the only gains at which stability can change, so they cut the axis into 4 regions. The encirclement count, computed independently at a probe gain inside each, agrees in 4 of them. The conditionally stable window is 1.81e+6 to 3.36e+7, a factor of 18.6, and the loop is unstable both above and below it.
Fig. 2 The gain axis, cut into four regions by the three critical gains. Stability alternates between them and the first is stable, because a loop with vanishing gain encircles nothing. The dots underneath are the independent verdicts — the encirclement count computed from scratch at a probe gain inside each region. The slider is the lead ratio, and it walks from a loop with no window at all up to one whose window the arithmetic can no longer certify.

The other route, which is the definition

The criterion the two margins are a summary of is Nyquist’s, and it is not about distances at all:

Z=N+PZ = N + P

where N is the number of clockwise encirclements of −1 by the locus of L, P is the number of open-loop poles in the right half-plane, and Z is the number of closed-loop poles there. Stable means Z = 0 and nothing else does.

N is computed here as the accumulated turning of 1 + L along the contour rather than by counting axis crossings, and the reason is that a crossing count needs a rule for which crossings matter while the turning needs nothing: it is one integral, and it comes back an integer or the sampling was too coarse — which is a check in itself rather than a thing to round away. The negative-frequency half of the contour is the mirror of the positive half, so it is included by doubling; the closing semicircle contributes nothing, because this loop gain falls off at infinity.

The two routes share the netlist and no arithmetic whatever. One solves for a phase at three points. The other never looks at the phase, and integrates over six thousand solved frequencies. They agree at every gain tested, which is the only reason the table above is worth printing.

And the answer is:

gain
below 9.79 × 10² stable — the crossover is below the dip entirely
9.79 × 10² to 1.81 × 10⁶ unstable — the crossover is inside the dip
1.81 × 10⁶ to 3.36 × 10⁷ stable — the crossover is in the recovered band
above 3.36 × 10⁷ unstable — the leads’ own poles have taken over

Two disjoint stable regions, which is one more than the phrase “conditionally stable” suggests. The upper one is a window 18.6 times wide, and both of its edges are edges of instability. A loop sitting comfortably in the middle of it at 10⁷ is made unstable by multiplying its gain by 3.4 and by dividing it by 5.5.

The conditionally stable loop as one path, at a gain of 1.0e+7. computed by solving, not by drawing. The locus crosses the negative real axis three times, at -10217.897, -5.532, -0.297 for this gain. 2 of the three fall to the left of −1, and an even number of them is a stable loop — which is the encirclement count arrived at by looking rather than by integrating. Changing the gain scales the whole curve about the origin and rotates it not at all, so the three crossing frequencies never move and only their distance from −1 does.
Fig. 3 The same loop drawn as one path, at a gain inside the window. The locus crosses the negative real axis three times; two of those crossings are to the left of −1 and one is to the right, and an even number inside is a stable loop. This is the encirclement count arrived at by looking rather than by integrating. The slider scales the whole curve about the origin without rotating it at all.

Why the picture makes it obvious and the numbers do not

The Nyquist plot is where conditional stability stops being surprising. The locus spirals in, and it crosses the negative real axis three times on the way. What decides stability is not how far any one crossing is from −1 but whether the point ends up enclosed, and enclosure is a property of the whole curve.

At a gain of 10⁷ the three crossings sit on the real axis at −10 220, −5.532 and −0.2973. Two of them are beyond −1 and one is short of it, the count is even, and the loop is stable. Reduce the gain tenfold and the whole curve shrinks toward the origin: the three crossings become −1 022, −0.5532 and −0.02973, the middle one has walked inside the critical point, only one crossing is left beyond it, and the count is odd. The loop that was settling now oscillates, and nothing about the circuit has changed except its size on the page.

Raise the gain tenfold instead and the crossings become −102 200, −55.32 and −2.973. Now all three are beyond −1, the count is odd again, and the loop oscillates for the opposite reason. The two failures are indistinguishable from a distance and have opposite cures.

The reason a margin cannot see this is now plain. Both margins are distances from −1 measured at one place each. The phase margin is measured where the curve crosses the unit circle, the gain margin where it crosses the axis, and between those two places the curve is free to do anything at all — including go round the far side of the critical point and come back.

A loop whose phase comes back, at a gain of 1.0e+6. computed by solving, not by drawing. Three identical poles take the phase to −270°, two lead sections bring it back to −158°, and their own poles take it down again — so ∠L = −180° at 189 Hz, 3.46 kHz and 23.5 kHz. The gain moves the magnitude curve and not those three frequencies, so it decides only which side of each the unity-gain point falls. At 1.00e+6 the crossover is 2.58 kHz, inside the dip, and the loop is unstable.
Fig. 4 The same loop with its gain divided by ten, at 10⁶. The crossover has come down to 2.58 kHz, which is inside the phase dip, and the loop is unstable there. Nothing about the amplifier changed and nothing was added: the gain was reduced, and a stable design became an oscillator.
A loop whose phase comes back, at a gain of 1.0e+8. computed by solving, not by drawing. Three identical poles take the phase to −270°, two lead sections bring it back to −158°, and their own poles take it down again — so ∠L = −180° at 189 Hz, 3.46 kHz and 23.5 kHz. The gain moves the magnitude curve and not those three frequencies, so it decides only which side of each the unity-gain point falls. At 1.00e+8 the crossover is 40.1 kHz, past the leads' own poles, and the loop is unstable.
Fig. 5 And the gain multiplied by ten instead, at 10⁸. The crossover is at 40.1 kHz, past the lead sections’ own poles, where the three original poles are back in charge of the phase — and the loop is unstable again. The stable region is a window, with instability above it and below it, which is the whole of what “conditionally stable” means.

The slider that walks out of the reachable

The lead ratio — how far each lead section’s pole sits above its zero — is what buys the phase back, and it decides whether there is a window at all.

At a ratio of four, two lead sections do not lift the phase above −180° anywhere. The phase crosses once, the gain axis has two regions, and the ordinary picture holds completely: stable below, unstable above, and turning the gain down always helps. At a ratio of six a window appears, 3.2 times wide. By ten it is 18.6, by twenty 64.7, by fifty 212.7.

So the phenomenon does not switch on; it opens. And it opens because each lead section’s phase contribution grows with its ratio, which is the same trade every compensation network makes and the reason a designer reaches for two of them.

A loop whose phase comes back, at a gain of 1.0e+3. computed by solving, not by drawing. Three identical poles take the phase to −270°, two lead sections bring it back to −158°, and their own poles take it down again — so ∠L = −180° at 189 Hz, 3.46 kHz and 23.5 kHz. The gain moves the magnitude curve and not those three frequencies, so it decides only which side of each the unity-gain point falls. At 1.00e+3 the crossover is 191 Hz, inside the dip, and the loop is unstable.
Fig. 6 A thousand — four decades below the design point. The crossover is at 191 Hz, still inside the dip, still unstable. There is no amount of gain reduction that reaches safety from below without passing all the way out of the loop’s useful range, which is why “turn the gain down” is not a remedy here and is a remedy nearly everywhere else.
A loop whose phase comes back, at a gain of 3.0e+7. computed by solving, not by drawing. Three identical poles take the phase to −270°, two lead sections bring it back to −158°, and their own poles take it down again — so ∠L = −180° at 189 Hz, 3.46 kHz and 23.5 kHz. The gain moves the magnitude curve and not those three frequencies, so it decides only which side of each the unity-gain point falls. At 3.00e+7 the crossover is 22.0 kHz, in the recovered band, and the loop is stable.
Fig. 7 Three times the design gain, at 3×10⁷: crossover 22.0 kHz, in the recovered band, stable. Set the four settings against each other — 10³ and 10⁶ unstable inside the dip, 10⁷ and 3×10⁷ stable in the recovered band, 10⁸ unstable past the leads’ poles — and the margin quoted at the design point describes none of it. A phase margin is a distance measured at one crossover, and this loop has three.

Where the arithmetic gives out, and why that is drawn rather than hidden

The two lead sections cost the loop a factor of ratio² of direct-current gain before it does anything. At a ratio of 100 that is 10⁴, and the window moves up with it: 1.12 × 10⁸ to 5.20 × 10¹⁰.

At which point the solver stops answering.

A voltage-controlled source of 10¹⁰ sitting in a matrix beside conductances of 10⁻⁴ is a matrix whose smallest pivot is 10⁻¹³ of its norm, and in double precision that is not a hard problem but an undetermined one. solveAt refuses it by name rather than returning a large plausible number, which is the behaviour the networks field established on its first day and the reason the refusal is worth something here.

So at a lead ratio of fifty the figure shows two verdicts and two refusals, and the two refusals are drawn as refusals. They are not gaps in the argument: the cheap route still gives the window, and the assertion the figure makes about them is a real one — every refusal is above every gain that was answered, so the limit is the arithmetic’s and not the loop’s. Had a refusal ever appeared below a gain that solved, the refusal would have been about the circuit and this figure would be reporting the wrong thing entirely.

That is also why the default construction in the library is a lead ratio of ten rather than the hundred it was first written with. At a hundred the interesting answer exists, is computable by the cheap route, and cannot be certified by the definition — and a figure whose central claim rests on a route the site declines to check is not a figure this site should draw. At ten, every gain in the window solves, and the encirclement count confirms all four regions.

Why anybody would build one on purpose

It would be reasonable to read all of the above as a description of a mistake, and it is not. Loops like this are built deliberately, and the reason is visible in the first figure.

What a designer wants from feedback is loop gain: the error a feedback loop leaves behind is the error the forward path would have made divided by 1 + L, so every decibel of loop gain at the frequencies the signal occupies is a decibel less distortion, a decibel less supply sensitivity and a decibel less dependence on a component nobody controls. Three cascaded poles are the cheapest way to buy a great deal of it at low frequency — 60 dB per decade of it — and the price is that the phase arrives at −270° long before the magnitude arrives at unity.

The lead sections buy the phase back where it is needed and only there. The result is a loop with enormous gain at low frequency, a crossover placed in a deliberately manufactured window of recovered phase, and a stretch of frequency in between where the phase is below −180° and the magnitude is above unity — which is precisely the condition the ordinary rule says must never occur. The rule is wrong, the design is standard, and the price of the design is that it has a lower gain limit as well as an upper one.

The practical consequence has a name and it is not stability at all: it is start-up. A loop that is conditionally stable in its intended operating point passes through every gain below that point on its way there, and a stretch of those gains oscillate. An amplifier whose supply is ramping, a regulator whose reference has not yet settled, a stage whose transistor has not reached its bias current — all of them are, briefly, the same circuit with less gain. The window in the figure is where the loop must end up; the region below it is territory the loop has to cross.

The same thing happens on the way out. Drive a conditionally stable loop hard enough that its output stage clips, and the effective gain of the forward path collapses for as long as the clipping lasts. The loop does not gracefully lose margin; it walks out of the bottom of its window and stays there until the overload clears. This is why conditionally stable designs are given clamps that limit the excursion rather than allowing the loop to find out for itself, and it is a design rule that reads as superstition until the gain axis is drawn.

What this does to the rest of the field

Two essays in this field now need a footnote, and it is the same footnote.

What is left at crossover measures a phase margin and treats it as the loop’s safety, obtaining it the way a bench does — cut the loop, drive one side, read what comes back to the other. Two measurements of one margin takes that margin and predicts an overshoot from it, then measures the overshoot independently and gets 34.9° against 34.9°. Both are correct, and both are correct about loops whose phase falls monotonically — which the three-pole loop they are drawn on does.

The general statement is weaker than either essay needs it to be, and it is this: a phase margin is a sufficient description of stability only when it is the only crossing there is. When it is not, the margin is still a true measurement of one frequency, and it has simply stopped being a summary of the loop.

The footnote reaches further than those two, because a great deal of this collection is written in terms of 1+T1+T and the arguments that use it inherit the assumption without stating it. How much of the amplifier gets through reports its sensitivity as monotone in the margin, and bisects a boundary at 50.0° below which the sensitivity changes sign — a statement that presupposes one crossing to be below. A source below a frequency explains a regulator’s impedance peak as 1+T1+T passing near zero once, and the node that is at ground for a while explains a summing junction’s three regions the same way. On a loop of the kind measured here every one of those curves would have three features rather than one, and none of the three would be reported by either margin.

None of that makes the four essays wrong. It makes the class of loop they are about narrower than the word “loop”, and the practical reading is a check rather than a caveat: before quoting a margin, count the crossings. It costs one scan of the phase, it is done on the same solve the margin came from, and it is the only thing that distinguishes a loop those essays describe from one they do not.

What was recorded and what reproduces

This essay closes a gap the rung below opened, and it does not close it with the number recorded there.

PHASE_PLAN.md recorded, at the end of the scale phase, that this loop was “stable only for gains between 1.835 × 10⁵ and 4.79 × 10⁷ — a 261:1 window”. The machinery was built and verified and the essay was carried forward; the number went into the plan file and into no assertion anywhere. It does not reproduce. With the construction as it now stands the window is 1.81 × 10⁶ to 3.36 × 10⁷, a factor of 18.6, and neither edge nor the ratio between them matches what was recorded.

There is no way to recover which parameters produced 261:1, because nothing gated it. That is the whole lesson and it is the site’s own habit stated backwards: a number that no assertion protects is a number that decays silently. Every figure above now carries its own, and the gate re-derives them at every position of both sliders.

The rule this loop stops being true under

Every figure on this site carries the frequency, amplitude or size at which its model stops applying. For this one the quantity is a gain, and there are two edges rather than one:

1.81 × 10⁶ and 3.36 × 10⁷. Below the first and above the second, this loop oscillates. Between them it settles. And the useful half of that sentence is the first half, because it is the one no margin reports and the one every instinct argues against.

What a margin does not say

A loop that is unstable above and below a window is the clearest case of a phase margin describing one crossover and no others. What is left at crossover is where the margin is defined and where the crossover is shown to move with both parameters. Two measurements of one margin is where the same quantity is read in the time domain, and the two agree only when there is one crossover to agree about. How much of the amplifier gets through is the sensitivity peak the margin does not carry either. The ideal amplifier, and where it stops being one is the finite product that makes all of it necessary, and Where the behaviour is written down is where a two-pole loop’s margin would have been enough.

Part 2 on loop gain

One argument about Loop gain, and one of 3 essays on it so far, each part numbered by how much of the idea it assumes. What sits either side of it:

What links here

Essays that reach for this one mid-argument — the half of a link its own author cannot write down, the 8 sharing most with it of 13.

The objects named here

The third axis, after the field and the idea: the things themselves, and every essay that touches each one.

Encirclement countLead compensationLoop gainNyquist criterionPhase marginStability