The gain margin the straight lines get exactly wrong
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: for a pair, positive when the pair peaks and negative when it does not.
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 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 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.
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.
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.
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 .
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:
Take the logarithm of both sides and multiply by twenty. On the left, is precisely the gain margin the straight lines report, because the lines put the integrator’s gain at the corner at and nothing else. On the right is , 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 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 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 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 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 : 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 , 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 , which is at : 464 Hz, a tenth of a decade low.
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 , 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 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
- The loop that never crosses gain margin, loop gain, model range, phase margin
- The resistor that buys the margin back loop gain, model range, phase margin
- Where the trouble is at the input loop gain, model range, phase margin
- How much of the amplifier gets through loop gain, phase margin
- The best damping is not the one to build damping ratio, model range
- The boundary that improves when the part gets worse loop gain, model range