Frequency, which is the same solve

The gain margin the straight lines get exactly wrong

A phase margin read off the straight lines is wrong by an amount that depends on where the loop crosses unity. A gain margin read off them is not: for an integrator and a pole pair the phase passes −180° at the pair's own frequency whatever the gain, and the lines are out there by exactly 20 log Q — 6.0206 dB for two real poles, 13.98 dB at a quality factor of five, at every integrator gain drawn. The stability condition for the loop turns out to be the same inequality: it is stable exactly when the gain margin the lines report exceeds that error.

Assumes: The straight lines, and where they are not the curve · What is left at crossover

A stability margin comes in two halves. The phase margin asks how much more lag a loop could take at the frequency where its gain is one. The gain margin asks how much more gain it could take at the frequency where its lag is half a turn. Both are read off the same pair of plots, and on paper both are usually read off the straight lines that stand in for those plots.

The margin the straight lines report measured the first half and found its error awkward to state. The sketch’s error in decibels moves the unity crossing, the moved crossing changes how much lag has accumulated, and the result is a number of degrees that depends on where the crossing falls relative to the corner: 6.83° short with the lines crossing at the corner, 0.38° short at a quarter of it, and for a peaking pair a reading of 71.57° on a loop with none.

The second half ought to be worse. It reads a gain at a frequency the phase chooses, and the phase sketch is itself an approximation with errors of up to 5.7° per pole. What the measurement finds instead is the cleanest statement the straight lines have yet produced. For the commonest loop there is, the gain margin they report is wrong by one number, that number is the sketch’s own error at the corner, and it does not move when the gain does.

Where the phase passes half a turn

The loop is the one the phase-margin measurement used, so that the two halves can be compared on identical circuits. An ideal integrator — a transconductance charging a capacitor, buffered — supplies −90° at every frequency and a gain falling at twenty decibels a decade. Behind it sits either a pair of buffered real poles or a single pole pair at a stated quality factor, with its corner at 1.00 kHz. The integrator’s gain is set so that the asymptotes cross unity at a stated fraction of the corner, which is how each figure names the loop.

The frequency at which a gain margin is read has a property that the phase margin’s frequency lacks. The integrator’s contribution to the phase is exactly −90° everywhere, and a second-order section contributes exactly −90° at its own natural frequency, whatever its damping. So the loop’s phase passes −180° at the pair’s frequency, 1.00 kHz, and nowhere else. The integrator’s gain does not appear in that statement, and neither does the quality factor.

That is the whole mechanism in advance. The reading is always taken at the corner, and the corner is the one frequency at which the straight lines, and where they are not the curve found the sketch’s error to be exact: 20log10Q20\log_{10}Q for a pair, positive when the pair peaks and negative when it does not.

The straight lines report 6.02 dB of gain margin, and the solved loop has 12.04 dBcomputed by solving, not by drawing. The gain and phase of a loop made of an integrator and two poles, the corner at 1.00 kHz, the integrator set so that the straight-line asymptotes cross unity at 500 Hz. The loop's phase passes −180° at 1.00 kHz. There the lines put the loop gain at −6.02 dB and the solve at −12.04 dB, so the gain margin they report is 6.02 dB against 12.04 dB. The difference is −6.0206 dB, which is 20 log Q exactly with Q = 0.5, at any integrator gain. Closed, the loop is stable: the largest real part among its poles is -2.17e-1 of the corner's angular frequency.-40-2002040loop gain (decibels), and its straight lines-270-180-90101001k10k100kfrequency (hertz)loop phase (degrees)−180° at 1.00 kHzthe loopan integrator and two polesphase passes −180° at1.00 kHzgain margin, the lines6.02 dBgain margin, the loop12.04 dBthe reading isshort by 6.02 dBclosed, the loop isstablesolved, then checked — a gain margin read off the straight linesout by 20 log Q = −6.02 dB
Fig. 1 An integrator and two real poles at 1.00 kHz, the straight lines crossing unity at 500 Hz. The phase passes −180° at 1.00 kHz. There the lines put the loop gain at −6.02 dB and the solve at −12.04 dB, so the lines report 6.02 dB of gain margin on a loop that has 12.04 dB. The slider moves the integrator’s gain; the difference stays at 6.0206 dB.

Two real poles sharing a corner are a pole pair at a quality factor of exactly one half, and the figure checks that they are. The sketch of such a pair is 20log1012=6.020620\log_{10}\tfrac12 = -6.0206 dB out at the corner, below the response rather than above it. With the lines crossing unity at half the corner, the lines say the loop gain at 1.00 kHz is −6.02 dB and the solve says −12.04 dB, so the reported gain margin is 6.02 dB and the loop’s is 12.04 dB. The reading is short by 6.0206 dB.

The slider is the integrator’s gain, and it is the part worth dragging. With the lines crossing at a tenth of the corner the reading is 20.00 dB against 26.02; at a fifth, 13.98 against 20.00; at the corner itself, 0.00 against 6.02, which is the loop the phase-margin measurement called marginal and found to have 21.39° of phase margin. The error is 6.0206 dB at every setting, to the ten decimal places the figure’s check demands.

The phase margin’s error on the same loops moved with the gain and was worst at the corner. The gain margin’s does not move at all, and the reason is not that the gain margin is a better-behaved quantity. It is that the frequency at which it is read has no gain in it.

The phase sketch cannot disturb that either, which is worth checking rather than assuming, because on paper the −180° frequency is found on the phase sketch and not on a solve. A pair’s straight-line phase is flat to a tenth of its corner, falls at ninety degrees a decade to ten times it, and is flat again: its value at the corner is exactly −90°, the midpoint of a straight line drawn symmetrically about the corner. With the integrator’s −90° added, the sketch passes −180° at the corner too. So the frequency named by the phase sketch and the frequency named by the solve are the same frequency, and a gain margin read entirely off paper — crossing from the phase lines, gain from the magnitude lines — is out by the same 20log10Q20\log_{10}Q and nothing more.

That is a coincidence of symmetry and not a property of sketches in general. The straight-line phase of a pair is wrong almost everywhere else — by up to 5.7° for each real pole near a tenth and ten times the corner, and by far more for a peaking pair, whose true phase swings through most of its half-turn inside a narrow band — but at the corner, where this reading is taken, the error is zero. The loop with a single pole behind its integrator has no gain margin to read at all: its phase approaches −180° and never reaches it, and the figure refuses to draw that loop rather than report an infinite margin as a number.

The damping that makes the reading exact

A pair’s corner error passes through zero at a quality factor of one, and so the gain margin read off its lines should be exactly right there.

The straight lines report 6.02 dB of gain margin, and the solved loop has 6.02 dB. computed by solving, not by drawing. The gain and phase of a loop made of an integrator and a pair at Q = 1, the corner at 1.00 kHz, the integrator set so that the straight-line asymptotes cross unity at 500 Hz. The loop's phase passes −180° at 1.00 kHz. There the lines put the loop gain at −6.02 dB and the solve at −6.02 dB, so the gain margin they report is 6.02 dB against 6.02 dB. The difference is 0.0000 dB, which is 20 log Q exactly with Q = 1, at any integrator gain. Closed, the loop is stable: the largest real part among its poles is -1.76e-1 of the corner's angular frequency.
Fig. 2 An integrator and a pair at a quality factor of one, the lines crossing unity at 500 Hz. The lines report 6.02 dB of gain margin and the loop has 6.02 dB: at Q = 1 the pair’s response at its own frequency is exactly on its flat asymptote, and the reading is right.

It is: 6.02 dB reported, 6.02 dB solved. At a quality factor of one the pair’s response at its own frequency is exactly on its flat asymptote, and the reading inherits that exactness. This is the same pair the margin the straight lines report used for its warning, because at half the corner that pair’s response has risen above its asymptote and the phase margin read off the lines was 6.02° too generous. The two halves of the same margin, read off the same lines of the same loop, are exact in one and over-report in the other.

A Butterworth pair lies below its lines at the corner, as two real poles do, and is short by less.

The straight lines report 13.98 dB of gain margin, and the solved loop has 16.99 dB. computed by solving, not by drawing. The gain and phase of a loop made of an integrator and a pair at Q = 0.7071, the corner at 1.00 kHz, the integrator set so that the straight-line asymptotes cross unity at 200 Hz. The loop's phase passes −180° at 1.00 kHz. There the lines put the loop gain at −13.98 dB and the solve at −16.99 dB, so the gain margin they report is 13.98 dB against 16.99 dB. The difference is −3.0104 dB, which is 20 log Q exactly with Q = 0.7071, at any integrator gain. Closed, the loop is stable: the largest real part among its poles is -3.01e-1 of the corner's angular frequency.
Fig. 3 An integrator and a Butterworth pair, Q = 0.7071, the lines crossing unity at 200 Hz. The lines report 13.98 dB of gain margin; the loop has 16.99 dB. The difference is 3.0103 dB, the Butterworth pair’s error at its own corner.

13.98 dB reported against 16.99 dB, short by 3.0103 dB — the Butterworth pair’s corner error, which is the same number a single real pole gives for a different reason. Every pair at or below a quality factor of one is short in the gain margin, which is the safe direction, and the amount is the sketch’s error at the corner and nothing else.

A pair that peaks, read in decibels

Above a quality factor of one the sign reverses and the size is unbounded, which the corner error already said. What the gain margin adds is how cleanly it lets that be read.

The straight lines report 6.02 dB of gain margin on a loop that is unstable, at −7.96 dB. computed by solving, not by drawing. The gain and phase of a loop made of an integrator and a pair at Q = 5, the corner at 1.00 kHz, the integrator set so that the straight-line asymptotes cross unity at 500 Hz. The loop's phase passes −180° at 1.00 kHz. There the lines put the loop gain at −6.02 dB and the solve at 7.96 dB, so the gain margin they report is 6.02 dB against −7.96 dB. The difference is 13.9794 dB, which is 20 log Q exactly with Q = 5, at any integrator gain. Closed, the loop is unstable: the largest real part among its poles is 1.25e-1 of the corner's angular frequency.
Fig. 4 An integrator and a pair at a quality factor of five, the lines crossing unity at 500 Hz. The lines report 6.02 dB of gain margin. At 1.00 kHz the solved loop gain is +7.96 dB, so its margin is −7.96 dB, and its closed-loop poles include one in the right half-plane: the loop is unstable.

With the lines crossing at half the corner and a pair at a quality factor of five, the lines report the same 6.02 dB they reported for two real poles, because the lines of a pair have no quality factor in them. The loop has −7.96 dB. At its own frequency the pair’s gain is five, the integrator’s there is one half, and 2.5 is 7.96 dB above unity. Closed, the loop has a pole with a real part of +0.125 of the corner’s angular frequency, which is the same unstable loop the phase-margin measurement found reported at 82.41°. The error is 13.9794 dB, which is 20log10520\log_{10}5.

The phase margin for that loop was wrong by 139.46°, and nothing about the 82.41° it reported suggested how the error was built. The gain margin is wrong by 13.98 dB, and the error can be written down before the loop is drawn: it is the pair’s peak, in decibels, and the lines were never going to contain it.

The same inequality, twice

Here is what makes the reading more than a curiosity. The loop is a cubic, and Routh’s condition for it — stated in the margin the straight lines report, checked there against the closed-loop poles and checked again in every figure here — is that the integrator’s unity frequency must be below the pair’s frequency divided by its quality factor:

ωu<ω0Q.\omega_u < \frac{\omega_0}{Q}.

Take the logarithm of both sides and multiply by twenty. On the left, 20log10(ω0/ωu)20\log_{10}(\omega_0/\omega_u) is precisely the gain margin the straight lines report, because the lines put the integrator’s gain at the corner at ωu/ω0\omega_u/\omega_0 and nothing else. On the right is 20log10Q20\log_{10}Q, the lines’ error at the corner. So the stability condition for this loop is, word for word:

the loop is stable exactly when the gain margin read off its straight lines exceeds the sketch’s own error at the corner.

Each figure checks that the three statements agree — the sign of the solved gain margin, the sign of the largest real part among the closed-loop poles, and which side of 20log10Q20\log_{10}Q the reported margin falls on. They are not three checks of one arithmetic. The first comes from a solve along the imaginary axis, the second from a factorised characteristic polynomial, the third from two numbers typed into the placement.

The straight lines report 6.02 dB of gain margin on a loop that has none. computed by solving, not by drawing. The gain and phase of a loop made of an integrator and a pair at Q = 2, the corner at 1.00 kHz, the integrator set so that the straight-line asymptotes cross unity at 500 Hz. The loop's phase passes −180° at 1.00 kHz. There the lines put the loop gain at −6.02 dB and the solve at 0.00 dB, so the gain margin they report is 6.02 dB against 0.00 dB. The difference is 6.0206 dB, which is 20 log Q exactly with Q = 2, at any integrator gain. Closed, the loop is on the edge: the largest real part among its poles is -5.87e-17 of the corner's angular frequency.
Fig. 5 An integrator and a pair at a quality factor of two, the lines crossing unity at 500 Hz. The lines report 6.02 dB of gain margin, which is exactly 20 log 2: the loop’s own margin is 0.00 dB and its closed-loop poles sit on the imaginary axis.

The edge case makes the identity visible. A pair at a quality factor of two, with the lines crossing at half the corner, has a reported gain margin of 6.0206 dB and a corner error of 6.0206 dB. The loop has 0.00 dB, its closed-loop poles have a largest real part of 5.87×1017-5.87\times10^{-17} of the corner’s angular frequency, and it is on the edge of oscillation. The same loop was reported at 71.57° of phase margin.

So the gain margin is the half of the sketch that can be corrected by hand. A designer who reads 6 dB off the lines and knows the pair’s quality factor has the loop’s true margin by subtraction: 6.02 − 6.02 = 0 at a quality factor of two, 6.02 − 13.98 = −7.96 at five. The phase margin admits no such subtraction, because its error is a composition of two nonlinear readings.

The straight lines report 20.00 dB of gain margin, and the solved loop has 6.02 dB. computed by solving, not by drawing. The gain and phase of a loop made of an integrator and a pair at Q = 5, the corner at 1.00 kHz, the integrator set so that the straight-line asymptotes cross unity at 100 Hz. The loop's phase passes −180° at 1.00 kHz. There the lines put the loop gain at −20.00 dB and the solve at −6.02 dB, so the gain margin they report is 20.00 dB against 6.02 dB. The difference is 13.9794 dB, which is 20 log Q exactly with Q = 5, at any integrator gain. Closed, the loop is stable: the largest real part among its poles is -4.95e-2 of the corner's angular frequency.
Fig. 6 The pair at a quality factor of five again, with the integrator’s gain cut until the lines cross unity at a tenth of the corner. The lines report 20.00 dB of gain margin; the loop has 6.02 dB. The rule predicts it — 20.00 exceeds 13.98 — and the closed loop is stable.

The subtraction also says how much gain has to be taken out to make the peaking loop safe. With the lines crossing at a tenth of the corner they report 20.00 dB, which exceeds 13.98 dB by 6.02, and the loop has 6.02 dB of true gain margin. The lines are not useless for a peaking pair; they are a reading that has to be debited by a known amount, and the amount is the quality factor.

How a designer actually meets the quality factor is less comfortable. The Q the amplifier decides found a filter section’s quality factor 1.97 per cent above the value its components give, which at a quality factor of five is 0.17 dB of gain margin that the subtraction would miss. The correction is exact; the number it is made with is not.

Three poles, and the frequency comes back

The exactness depends on one fact: that the phase crossing sits at the corner whatever the damping. Change the loop so that it does not, and the frequency conversion that made the phase margin awkward returns.

Three real poles at one corner, behind the same integrator, pass −180° where each pole supplies 30° of lag, which is at fctan30°=fc/3f_c\tan 30° = f_c/\sqrt3: 577 Hz. The figure checks that to nine places. At 577 Hz the lines still say the loop gain is the integrator’s alone, and the solve says it is lower by (1+13)3/2(1 + \tfrac13)^{3/2}, which is 3.748 dB. So a gain margin read off the magnitude lines, at the phase’s true crossing, is short by 3.748 dB, and it is short at every gain, for the same reason as before.

But that assumes the crossing was found on the true phase. If it is read off the phase sketch as well, the sketch puts each pole’s lag at 30° where 45(log10x+1)=3045(\log_{10}x + 1) = 30, which is at fc101/3f_c\cdot10^{-1/3}: 464 Hz, a tenth of a decade low.

The straight lines report 7.31 dB of gain margin, and the solved loop has 12.96 dB. computed by solving, not by drawing. The gain and phase of a loop made of an integrator and three poles, the corner at 1.00 kHz, the integrator set so that the straight-line asymptotes cross unity at 200 Hz. The loop's phase passes −180° at 577 Hz, and its straight-line phase sketch at 464 Hz. There the lines put the loop gain at −9.21 dB and the solve at −12.96 dB, so the gain margin they report is 9.21 dB, or 7.31 dB with the crossing read off the phase sketch too, against 12.96 dB. Closed, the loop is stable: the largest real part among its poles is -1.91e-1 of the corner's angular frequency.
Fig. 7 An integrator and three real poles at 1.00 kHz, the lines crossing unity at 200 Hz. The phase passes −180° at 577 Hz and its straight-line sketch at 464 Hz. Read at 577 Hz the lines report 9.21 dB of gain margin; read at 464 Hz, 7.31 dB. The loop has 12.96 dB, so the doubly sketched reading is short by 5.64 dB.

With the lines crossing unity at a fifth of the corner, the loop has 12.96 dB of gain margin. Read at the true −180° frequency the lines report 9.21 dB, short by 3.75. Read at the frequency the phase sketch names they report 7.31 dB, short by 5.64: the extra 1.90 dB is 20log10(577/464)20\log_{10}(577/464), the integrator’s slope applied to the tenth of a decade by which the phase sketch misplaced the crossing. Both readings are short and both errors are independent of the gain. With the lines at a tenth of the corner the numbers are 13.33 dB against 18.98, short by the same 5.64.

That independence survives because every term in the error is a ratio of frequencies that the gain does not move: where the phase crosses, where its sketch crosses, and what the poles do at the true crossing. What does not survive is the single closed form. With three poles the error is the sum of a magnitude error at one frequency and a slope applied to the gap between two others, and a designer would have to compute both.

Neither reading can over-report for real poles. The magnitude lines lie above a real pole’s response everywhere, so at any frequency they overstate the loop gain and understate the gain margin; and the phase sketch of a real pole below its corner has more lag than the pole does, so it names a crossing below the true one, where the integrator’s gain is higher still. Both errors point the same way, and the figure checks that the reading is never above the loop’s margin.

What the two halves of the sketch are good for

Set beside the phase margin, the gain margin read off the straight lines behaves in a way that is worth carrying as a rule.

For an integrator and one pair — the second-order core that most loop designs reduce to — the gain margin read off the lines is exact up to a known correction. Subtract 20log10Q20\log_{10}Q and the reading is the loop’s margin to every digit the arithmetic has. Short below a quality factor of one, exact at one, over above it. The loop is stable exactly when the reading exceeds the correction, which is Routh’s condition and nothing else.

The phase margin read off the same lines has no such correction. Its error is a function of the crossing’s position as well as of the damping, and for a peaking pair it has no bound: 71.57° reported on a loop with none, and no subtraction recovers the truth from the reading.

Where the phase does not cross at a corner, the frequency comes back into the gain margin too, and with it a second error that depends on how the crossing was found. For real poles both errors are on the safe side.

The practical consequence runs against habit. The margin most often quoted from a sketch is the phase margin, and it is the less trustworthy of the two; the gain margin, which is often left off, is the one a designer can repair with arithmetic. And the repair needs exactly the quantity the lines leave out — the pair’s quality factor — which is also the quantity where the behaviour is written down identifies as the pole’s angle rather than its distance.

None of this displaces the method that does not need a correction. What is left at crossover and two measurements of one margin read margins off the solved loop, where neither half has an error to state, and one solve read four ways keeps the straight lines for finding the shape.

Still open: the sections, the zeros, and a phase crossed more than once

A cascade whose sketch is right as a whole and wrong in every part. The correction here is the pair’s corner error, and a filter built from several pairs has one per section. An eighth-order Butterworth filter has sections at quality factors from 0.5098 to 2.5629, whose corner errors run from −5.85 to +8.17 dB and must add to the whole filter’s −3.0103 dB. The corner error a filter hides in its sections measures what that does to the section that most needs a tight tolerance.

Loops with zeros in them. Every loop here has only poles, which is why every error on the safe side stayed there. A lead section adds a zero whose response rises above its asymptotes and whose phase rises with frequency, and both of the steps that made the reading safe fail at once. The zero that lifts the lines measures which way the reading then errs and by how much.

A phase that passes −180° more than once. A conditionally stable loop crosses half a turn twice, and has two gain margins: one for more gain and one for less. Stable and unstable with less gain is about loops like that. Whether each crossing sits at a corner, and whether the lines are then exact up to a correction at each, is the next question about gain margins specifically, and it is unmeasured here.

Part 3 on asymptotic approximation

One argument about Asymptotic approximation, and one of 5 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.

Asymptotic approximationBode plotDamping ratioGain marginLoop gainModel rangePhase marginThe quality factor