Feedback, and the margin

Two wrong readings and one loop gain

A loop gain measured on a bench is measured at a wire, and a wire has an impedance on each side. Cut an amplifier's output with 100 Ω behind it and 160 nF ahead, inject a voltage in series, and the reading is the loop gain plus (1 + T)·Zs/Zl — 15.1° of margin where the loop has 8.9°, and a second unity crossing at 10.6 kHz that the loop does not have. Inject a current into the same wire and the error is (1 + T)·Zl/Zs: 19.8°, and 57 dB too much loop gain at low frequency. The two errors are reciprocal, so the readings combine exactly: 1/(1 + T) = 1/(1 + Tv) + 1/(1 + Ti) returns the loop gain at the controlled source's own input to a few parts in a billion, at every frequency and every load.

Assumes: What is left at crossover · The load that gets inside the loop

What is left at crossover measured its loop gain “the way it is obtained on a bench”: cut the loop, drive one side, read what comes back. It cut at the amplifier’s inverting input, where the amplifier is a voltage-controlled source that draws no current, and that choice made the measurement exact — the feedback network’s output was loaded by nothing before the cut and by nothing after it, so the ratio read there was the loop gain itself. It is also the one point on a real amplifier that a bench cannot reach. The controlled source is inside the package. What a bench can reach is a wire: the output pin, a trace, the top of a feedback resistor. And a wire has an impedance on each side of it.

So the bench method is not one method but two, according to what is injected. A voltage source in series with the wire leaves the current continuous and disturbs the voltage; a current injected into the wire leaves the voltage continuous and disturbs the current. Each reads a loop gain. Neither is the loop gain, unless the impedances either side of the cut are wildly unequal in the right direction, and on a capacitively loaded amplifier — the circuit whose stability somebody most often wants to measure — they are not.

What rescues the measurement is that the two errors are exact reciprocals of each other. Take both readings at the same cut and they determine the loop gain exactly, whatever the impedances are.

One loop, cut at its output wire with 160 nF on it: the voltage injection crosses unity twice, the current injection reads 57 dB too much at low frequency, and together they are the loop gaincomputed by solving, not by drawing. A three-pole amplifier closed for a gain of a hundred, with 100 Ω of output resistance and 160 nF of load. The loop gain read at the controlled source's own input, which draws no current (solid); read by a voltage injected in series with the output wire (dashed); and by a current injected into the same wire (dotted). The true loop crosses unity at 5.31 kHz with 8.9° of margin. The voltage reading first crosses at 5.04 kHz with 15.1°, and rises through it again at 10.6 kHz, because above 9.95 kHz the load is a lower impedance than the source. The current reading crosses at 5.82 kHz with 19.8°. Combined through 1/(1 + T) = 1/(1 + Tv) + 1/(1 + Ti) (dots), the two give the controlled source's reading to 3e-9 at every frequency.-50050100101001k10k100k1M10Mfrequency (hertz)loop gain read at the cut (decibels)at the controlled source8.9° at 5.31 kHzvoltage at the output wire15.1° at 5.04 kHzcurrent at the output wire19.8° at 5.82 kHzdots: the two combinedwithin 3e-9solved, then checked — one loop cut three waystwo wrong readings make one right one
Fig. 1 A three-pole amplifier closed for a gain of a hundred, with 100 Ω of output resistance and 160 nF of load: the loop gain read at the controlled source’s own input (solid), by a voltage injected in series with the output wire (dashed), and by a current injected into it (dotted). True: 8.9° of margin at 5.31 kHz. Voltage: 15.1° at 5.04 kHz, and back through unity at 10.6 kHz. Current: 19.8° at 5.82 kHz, and 57 dB too high at low frequency. The dots are the two injections combined, on the true curve to a few parts in a billion.

The loop and its cut

The amplifier is the one what is left at crossover built: a gain of 10510^5 with poles at 10 Hz, 4 kHz and 2 MHz, each a resistor and capacitor buffered from the next, closed by a 99 kΩ and 1 kΩ divider for a gain of a hundred. Two things are added. A 100 Ω resistor in series with the output, which every real output stage has in some form; and a capacitor from the output to ground after it, the load the load that gets inside the loop found putting a pole inside the loop. At 160 nF that pole is at 9.95 kHz, a little above the unloaded crossover, and it takes the margin from 34.7 degrees to 8.9.

Three netlists are solved at every frequency. In the first, the controlled source’s control input is driven from an independent source and the divider’s output is read — the exact cut, Bode’s return ratio for that source. In the second, the output wire between the 100 Ω resistor and the load is broken and a voltage source is placed across the break; the ratio of the voltage on the amplifier’s side to the voltage on the load’s side, with a sign, is the voltage reading. In the third, the wire is left whole and a current is injected into it; the current the load takes and the current the amplifier returns are separated through the 100 Ω resistor, and their ratio is the current reading. Nothing in any of the three writes a loop gain as a product of a forward gain and a feedback fraction.

Each reading is the loop gain plus an error

The hero figure shows what happens. The current reading is wrong by a huge factor at low frequency — 57 dB too much loop gain — and crosses unity near the right frequency with nearly twice the margin. The voltage reading follows the true loop closely at low frequency, crosses unity a little early with 15.1 degrees where the loop has 8.9, and then rises back through unity at 10.6 kHz. All three are solves of one circuit, so the differences are not noise.

They have a closed form. Write ZsZ_s for the impedance looking back from the cut towards the amplifier — here, the 100 Ω — and ZlZ_l for the impedance looking forward into the load: the capacitor in parallel with the divider. Then

Tv=T+(1+T)ZsZl,Ti=T+(1+T)ZlZs.T_v = T + (1 + T)\frac{Z_s}{Z_l}, \qquad T_i = T + (1 + T)\frac{Z_l}{Z_s}.

The error of each injection is (1 + T) times the impedance ratio at the cut — Zs/Zl for a voltage, Zl/Zs for a current — and the two ratios swap above 9.95 kHz. computed by solving, not by drawing. At the output wire of the same loop (100 Ω, 160 nF), the error of each reading against the controlled source's, divided by |1 + T| (lines), against the magnitude of the impedance ratio, solved separately for the two sides of the cut (dots). They are the same curves to 2e-10: Tv = T + (1 + T)·Zs/Zl and Ti = T + (1 + T)·Zl/Zs exactly. Zs is the output resistance; Zl is the load capacitor in parallel with the feedback divider, 100 kΩ at low frequency and falling as 1/f above its corner. Below 9.95 kHz the source is the smaller impedance and a voltage is the better thing to inject; above it the load is, and a current is. Where the two are comparable, near the loop's crossover, neither injection is good.
Fig. 2 At the output wire of the same loop, each reading’s error against the true loop gain, divided by |1 + T| (lines), against the magnitude of the impedance ratio at the cut, solved separately for each side (dots): Zs/Zl for the voltage reading and Zl/Zs for the current reading. The two coincide to a part in a billion. The ratios swap at 9.95 kHz, where the capacitor’s reactance equals the output resistance.

The figure measures both identities rather than assuming them. The impedances were solved separately — the load side driven alone by a current, the source side read off the netlist — and the error each reading makes, divided by ∣1+T∣|1 + T|, lies on the corresponding impedance ratio to a part in a billion at every frequency from 10 Hz to 10 MHz.

The reasoning behind them is short. A voltage injected in series with a wire that has zero impedance behind it sees all of its signal arrive at the load; with ZsZ_s behind it, part of what the loop returns is dropped across ZsZ_s by the current the load draws, and the reading counts that drop as loop gain. The size of the stray part is the divider Zs/ZlZ_s/Z_l, and it is multiplied by 1+T1 + T because the current the load draws is itself set by the closed loop. A current injected into a node divides between the two sides in inverse proportion to their impedances, and the same argument runs with the ratio upside down.

Where each one is right

A voltage injection is exact when Zs/ZlZ_s/Z_l is zero and a current injection when Zl/ZsZ_l/Z_s is. The output of an amplifier into a high-impedance feedback network is the textbook place for a voltage — the source is a few ohms, the load tens of kilohms — and it is why the voltage reading here is accurate at low frequency, where the load is 100 kΩ against 100 Ω. A capacitor at the output destroys that inequality exactly where it matters: the load’s impedance falls as 1/f, passes the source’s at 9.95 kHz, and near the 5.31 kHz crossover it is 188 Ω against 100, a ratio of 0.53.

The margin each method reads as the load grows: the true one falls from 34.7° to −3.5°, and the voltage reading is 15.4° out at 330 nF. computed by solving, not by drawing. The phase margin at the first frequency where each reading falls through unity, against the load capacitance, with 100 Ω of output resistance: read at the controlled source (solid), by a voltage at the output wire (dashed), by a current there (dotted), and by the two injections combined (dots). True: 34.7° at 1 nF, 33.9° at 4.7 nF, 30.4° at 22 nF, 21.8° at 68 nF, 8.9° at 160 nF, −3.5° at 330 nF. Voltage: 34.8, 34.3, 32.0, 26.3, 15.1, −18.9. Current: 90.1, 90.1, 90.0, 89.1, 19.8, −4.9. The combination equals the true margin at every load. A light load leaves the voltage reading right and the current reading meaningless. Near crossover-sized loads both are optimistic — at 160 nF 15.1° and 19.8° against 8.9° — and at 330 nF, where the loop is unstable, the voltage reading is pessimistic by 15.4°: the error has no fixed sign.
Fig. 3 The phase margin each method reports, at the first frequency where its reading falls through unity, against the load capacitance from 1 nF to 330 nF. True (solid): 34.7° falling to 8.9° at 160 nF and −3.5° at 330 nF. Voltage (dashed): right to a degree up to 22 nF, 15.1° at 160 nF, −18.9° at 330 nF. Current (dotted): about 90° wherever the load is light, 19.8° at 160 nF. The dots, the two combined, are the true margin at every load.

Swept over the load, the pattern is the one the identity predicts. With a light load the voltage reading is right to a fraction of a degree — 34.8 against 34.7 at 1 nF — and the current reading is meaningless, returning about 90 degrees at every load up to 68 nF, because there Zl/ZsZ_l/Z_s is a thousand and the reading is dominated by the error term, whose phase is the capacitor’s. As the load approaches the size that puts its pole near crossover, both readings go wrong together. At 160 nF the loop has 8.9 degrees; the voltage reading says 15.1 and the current reading 19.8 — both optimistic, a stability problem reported as a modest one.

And the error has no fixed sign. At 330 nF the loop is unstable, with −3.5 degrees, and the voltage reading reports −18.9: pessimistic by 15.4. A rule that says a single-injection reading always flatters, or always condemns, is not available. What is available is the identity, and the dots on the figure: at every load the margin read from the combination of both injections is the true margin to the precision of the bisection that located the crossover.

The crossing the loop does not have

The voltage reading’s second unity crossing deserves its own figure, because it is the error most likely to be believed.

Voltage injected at a capacitively loaded output reads a loop gain that rises back above unity at high frequency — a crossing the loop does not have. computed by solving, not by drawing. The voltage-injected reading at the output wire of the same loop, 100 Ω of output resistance, for four loads. Far above crossover the true loop gain is negligible and the reading becomes Zs/Zl, the output resistance over the load capacitor's reactance, which rises at 20 dB a decade. 1 nF: back through unity at 1.59 MHz; 10 nF: back through unity at 159 kHz; 47 nF: back through unity at 34.0 kHz; 160 nF: back through unity at 10.6 kHz. A reading taken at face value reports a second crossover there with whatever phase Zs/Zl has, near +90°, which is not a property of the loop at all.
Fig. 4 The voltage-injected reading at the output wire, 100 Ω of output resistance, for loads of 1, 10, 47 and 160 nF. Far above crossover the true loop gain has gone and the reading becomes Zs/Zl, which rises at 20 dB a decade: back through unity at 1.59 MHz, 159 kHz, 34.0 kHz and 10.6 kHz respectively.

Above crossover the true loop gain falls away, and the voltage reading falls with it — until the error term takes over. Far above crossover TT is negligible, 1+T1 + T is one, and the reading is simply Zs/ZlZ_s/Z_l: the output resistance over the capacitor’s reactance, rising at 20 dB a decade. It passes back through unity almost exactly where the capacitor’s reactance equals the output resistance: 1.59 MHz for a nanofarad, 159 kHz for ten, 34.0 kHz for 47 and 10.6 kHz for 160. Its phase there is near +90 degrees, so a reading taken at face value shows a second crossover with a phase that belongs to a capacitor rather than to a loop — and an instrument that reports the margin at the last crossing reports a loop whose stability is decided at a frequency where the loop has no gain at all.

A bench network analyser does not know which crossing is real. An engineer reading its plot sees a loop gain that dips below unity and comes back, which is the shape of the conditionally stable loop in stable, and unstable with less gain — a real phenomenon, with real consequences — and may go looking for a problem the amplifier does not have.

What the fifty-seven decibels are

The current reading’s low-frequency error is worth reading off the identity, because it shows why the error is not a small correction that grows near crossover but a term that can swamp the measurement anywhere. At 10 Hz the loop gain is a hundred — the amplifier’s 10510^5 divided by the closed-loop gain — and the impedance looking into the load is the full 100 kΩ divider, a thousand times the 100 Ω behind the cut. So Ti=T+(1+T)⋅1000T_i = T + (1 + T)\cdot 1000, which is 101×1000+100101 \times 1000 + 100, about 1.01×1051.01\times10^5: the loop gain read as a hundred thousand where it is a hundred, sixty decibels high less the few the capacitor already takes at 10 Hz. Nothing about the amplifier changed. The injected current simply has nowhere to go but back into the 100 Ω, and the reading counts the whole of it as signal that went round the loop.

The voltage reading at the same frequency is out by (1+T)⋅0.001(1 + T)\cdot 0.001, a tenth of a decibel on a loop gain of a hundred, which is why the textbook choice of injection point is the output wire. Both errors are the same expression with the ratio turned over; one ratio is a thousand and the other a thousandth, and which one a bench gets depends only on which source it happens to have.

How a bench takes both readings

A network analyser measures a ratio of two voltages, and both injections fit that. For the voltage reading a small resistor — ten or a hundred ohms — is placed in the wire, a transformer drives a signal across it, and the analyser’s two inputs read the voltages on either side of the resistor: that is the TvT_v of the netlist, with the resistor’s own value added to ZsZ_s and therefore part of the error. For the current reading the same signal is injected through a series capacitor or a large resistor into the node, and the two currents are read as voltages across two small sense resistors, one on each side. The two sweeps take minutes each. The combination is three lines of arithmetic on the exported data, and nothing about it needs the circuit’s impedances, its schematic or the manufacturer’s model of the amplifier.

The cost is that the second sweep must be taken with the circuit in the same state as the first. A loop whose crossover moves with temperature or with its operating point has to be measured twice under the same conditions, or the identity combines two different loops; and an amplifier whose output is driven past the current above which there is no impedance has no small-signal loop gain to combine.

Where on the loop to cut

The identity also says where a single injection can be trusted, which is the practical question when only one source is available.

Where on one loop to cut: the error of the reading at the true crossover, 5.31 kHz, for five injection points. computed by solving, not by drawing. The same loop (100 Ω, 160 nF), cut at three places and injected two ways, each reading's error against the controlled source's at the true crossover, on a logarithmic scale, with the margin each would report. voltage, ahead of the output resistance: 4.7e-16, 8.9°; voltage, after it: 8.3e-2, 15.1°; current, after it: 2.9e-1, 19.8°; voltage, in the divider: 1.5e+1; current, in the divider: 1.6e-3, 9.0°; true 8.9°. A voltage belongs where the impedance behind the cut is small against the one ahead of it, a current where it is large — and the output wire of a capacitively loaded amplifier is neither at its crossover.
Fig. 5 The same loop with 160 nF of load, cut at three places and injected two ways: each reading’s error against the true loop gain at the true crossover, 5.31 kHz, on a logarithmic scale, with the margin it would report. A voltage ahead of the output resistance is exact; after it, 8.3% out; a current there, 29%; in the feedback divider a current is 0.16% out and a voltage fifteen times.

Ahead of the output resistance, between the ideal output stage and the 100 Ω, the source impedance is zero and a voltage injection reads the loop gain to the last bit — 4.7×10−164.7\times10^{-16} at crossover, the same 8.9 degrees. A real amplifier has no such node available, but the same logic picks a real one: inside the feedback divider, between the 99 kΩ and the node the amplifier reads, the impedance looking back is the 99 kΩ plus the output network and the impedance looking forward is the 1 kΩ to ground. A current injected there divides almost entirely into the 1 kΩ, and it reads the loop gain to 0.16 per cent and the margin to a tenth of a degree. A voltage injected at the same point reads it fifteen times too large.

So the rule the textbooks state — inject a voltage where the source impedance is small against the load’s, a current where it is large — is exactly the identity’s two error terms, and its value depends on at crossover. The output wire satisfied the voltage rule by three orders of magnitude at low frequency and failed it by a factor of two where the margin is read. A cut chosen by looking at the schematic, as the probe is part of the circuit found of a measurement chosen the same way, is chosen at the wrong frequency.

Two wrong readings, one right one

The rescue follows from the two identities by elimination. Solve the first for Zs/ZlZ_s/Z_l and the second for Zl/ZsZ_l/Z_s, multiply them, and the product is one:

Tv−T1+T⋅Ti−T1+T=1.\frac{T_v - T}{1 + T}\cdot\frac{T_i - T}{1 + T} = 1.

Rearranged, that is a statement about the closed loop’s sensitivity function:

11+T=11+Tv+11+Ti,\frac{1}{1 + T} = \frac{1}{1 + T_v} + \frac{1}{1 + T_i},

or, solved for the loop gain, T=(TvTi−1)/(Tv+Ti+2)T = (T_vT_i - 1)/(T_v + T_i + 2). The impedances have gone. Two readings taken at the same cut, one with a voltage and one with a current, determine the loop gain at that cut without anybody knowing what impedance is on either side of it.

The hero figure’s dots are that combination at every frequency, and they lie on the controlled-source reading to a few parts in 10910^9 — the arithmetic of three separate complex solves. The margin figure’s dots are the margin read from the combination, and they equal the true margin at every load from 1 nF to 330 nF, including the unstable one. The single-injection readings were wrong by up to 15 degrees in either direction; the combination is not wrong at all.

The structure is a familiar one. Two measurements of one margin held a frequency-domain margin against a time-domain overshoot and learned from where they disagreed; what the load sees looking back read the same loaded amplifier from its output. Here the two measurements are of one quantity at one point, and they disagree in a way that is itself the measurement: the disagreement between TvT_v and TiT_i is the impedance ratio, and once it is known it can be removed.

What the true loop gain is the loop gain of

One qualification is needed, and it concerns what the exact answer is an answer to. Bode’s return ratio is defined with respect to a particular controlled source — here the amplifier’s gain block — and cutting at that source’s input gives it. The double-injection combination at a wire gives the loop gain at that wire, which for a loop with one path round it is the same number. A loop with two paths — a feedforward capacitor around a stage, or a second feedback network — has a different loop gain at different cuts, because some cuts break one path and not the other. The loop that never crosses found that the margins a loop reports depend on what is counted as the loop; the double injection does not remove that dependence, it only removes the error the injection itself makes.

And the combination assumes linearity. Two separate injections are combined as though the circuit had the same impedances during both, which holds for a small signal and fails if either injection drives a stage into slewing — the regime of the step too large to have an impedance, where no loop gain is defined at all.

The arithmetic

An amplifier with 100 Ω of output resistance driving 160 nF has 8.9° of margin at 5.31 kHz. Read by a voltage injected at its output wire it reports 15.1° at 5.04 kHz and a phantom crossing at 10.6 kHz; read by a current, 19.8° at 5.82 kHz and 57 dB of spurious low-frequency gain. Each reading is the loop gain plus (1 + T) times the impedance ratio at the cut — Zs/Zl for the voltage, Zl/Zs for the current — measured to a part in a billion. The two combine through 1/(1 + T) = 1/(1 + Tv) + 1/(1 + Ti) to the true loop gain at every frequency and the true margin at every load, while singly they are wrong by up to 15° in either direction. Inside the feedback divider a single current injection is right to 0.16 per cent.

Still open: a loop with two paths, the injection’s own size, and noise in the two readings

Two paths round the loop. With a feedforward capacitor across the top divider resistor the loop gain at the output wire and at the divider differ, and the double injection at each returns its own. Which of them predicts the closed loop’s ringing — and whether any single cut does — is the comparison that would say how a bench should measure a loop that is not a single ring.

How large an injection can be. The identity is linear. On an amplifier whose output stage slews at a few volts per microsecond, an injection large enough to read above the noise at 5 kHz may already be too large to be small; the largest injection at which the combined margin is still within a degree of the true one is a number with the slew rate in it.

Noise in two readings. Each reading has its own measurement noise, and the combination divides by Tv+Ti+2T_v + T_i + 2, which is small wherever both are near −1. Near crossover that denominator is not small, but whether the combination’s noise is larger or smaller than either reading’s there is a propagation-of-error calculation nobody has done here.

Part 4 on loop gain

One argument about Loop gain, and one of 4 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 objects named here

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

Crossover frequencyLoadingLoop gainMeasurement conditionOutput impedancePhase marginReturn ratioVerification