Feedback, and the margin

The band a sampled loop repays in

Close the three-pole amplifier's loop through a sampler and hold at 100 kHz and Bode's sensitivity integral still balances — but only over the band below 50 kHz, because that is all the band a sampled loop has. The whole debt, 6.60 kHz·Np, is repaid there; the continuous loop had repaid 88.6% of its own by the same frequency and spends decades above on the rest. Below a tenth of the sample rate the sampled loop is the continuous loop with half a sample of delay, 24.7° of margin against 24.6°. And the finite band turns the equality into a floor: hold the sensitivity 20 dB down over a third of the band and no loop can peak below 10 dB. This loop's floor is low and its margin sets its peak; the sample rate at which the peak is 3 dB above the continuous loop's is 18 times the crossover.

Assumes: How much of the amplifier gets through · What is left at crossover · Two measurements of one margin

The area that feedback only moves found that a feedback amplifier’s desensitisation — the factor by which a change in the device is kept out of the answer — is exactly repaid: the logarithm of the device sensitivity, integrated over linear frequency, has as much area above zero as below, and the margin decides only the shape of the repayment — a spike just past crossover or a hump spread over a decade. In its running integral the last tenth of the debt was repaid ten times above the crossover and the last hundredth seventy times above it. The repayment always had somewhere further up to go.

A loop closed through a sampler does not. Its loop gain is defined only up to half the sample rate — above that the frequencies are aliases of ones below — and its sensitivity integral is taken over that band and nowhere else. That was the second of the area essay’s open questions: the debt then has nowhere far away to go, and the peak should be harder to flatten. The phase a delay never stops adding put a delay in the same loop and found the integral unmoved and the peak climbing; a sampler with a hold is, at low frequencies, exactly such a delay. This essay measures how far the analogy goes and where the finite band makes the difference.

The same loop, held between samples

A sampled loop measures the error once a sample, holds the correction constant until the next, and so sees the continuous amplifier through a zero-order hold. Its discrete loop gain is the hold equivalent of the continuous one, and for a loop made of three real poles that equivalent is exact by partial fractions. With L(s)=K∏ωi/(s+ωi)L(s) = K\prod\omega_i/(s+\omega_i) and cic_i the residues of L(s)/sL(s)/s,

Ld(z)=K+∑ici z−1z−e−ωiTs,L_d(z) = K + \sum_i c_i\,\frac{z - 1}{z - e^{-\omega_i T_s}},

which is strictly proper, because the residues sum to minus K. A strictly proper discrete loop that is stable when cut has its own sensitivity integral: ∫0fs/2ln⁡∣Sd∣ df=0\int_0^{f_s/2}\ln|S_d|\,df = 0. The continuous theorem needed the loop to fall two poles’ worth at infinity; the discrete one needs only that the loop gain take at least a sample to respond, which a hold guarantees.

Sampled at 100 kHz, the loop repays its whole debt below 50.0 kHz: 6.60 kHz·Np each side, with a peak of 8.72 dB — the continuous loop had repaid 89% by thencomputed by solving, not by drawing, from the loop's exact zero-order-hold equivalent. The three-pole amplifier of the area essay (second pole 4 kHz), closed through a sampler and hold at 100 kHz. The device sensitivity, in decibels, against linear frequency from zero to half the sample rate, where the discrete response ends. Margin 24.7° at a crossover of 5.71 kHz, against 34.9° for the continuous loop; peak +8.72 dB at 6.45 kHz. The area below zero is 6.598 kHz·Np and the area above, all of it inside the band, 6.598; net 1.84 × 10⁻² Hz·Np. The continuous loop, by 50.0 kHz, had repaid 88.6% of its own.-40-30-20-1001001020304050frequency (kilohertz), up to half the 100 kHz sample rate20 log |1/(1 + T)| (decibels)below 6.60, above 6.60 kHz·Npsolved, then checked — the Nyquist bandnet 1.84 × 10⁻² Hz·Np
Fig. 1 The sampled loop’s sensitivity in decibels against linear frequency from zero to half the 100 kHz sample rate, where the discrete response ends. The two areas are equal, 6.60 kHz·Np each side, and all of the repayment lies inside the band. The slider is the sample rate.

At 100 kHz the sampled loop crosses over at 5.71 kHz with 24.7° of margin, against 34.9° continuous, and its sensitivity peaks at +8.72 dB at 6.45 kHz, against 5.70. The area below zero is 6.598 kHz·Np and the area above, every hertz-neper of it below 50 kHz, is 6.598. The continuous loop, by 50 kHz, had repaid 88.6 per cent of its own debt.

The slider shows the band tightening. At 500 kHz the sampled loop’s areas are 6.72 kHz·Np, almost the continuous loop’s 6.74, and its peak is 6.23 dB; at 200 kHz, 6.67 and 7.09 dB; at 50 kHz, 6.47 and 13.08 dB, with the whole repayment squeezed below 25 kHz — a fraction over four times the crossover — where the continuous loop had repaid only 77 per cent.

Why the equivalent is exact, and what it does not see

The partial-fraction form is not an approximation of the sampled loop; it is the sampled loop. Each of the amplifier’s three poles is a first-order system, and between two samples its input is held constant, so its state moves from one sample to the next by exactly e−ωiTse^{-\omega_i T_s} of its distance to the held input’s final value. Summing the three responses with the residues as weights gives the loop’s value at the next sample instant with nothing left out. The same construction is what a digital controller’s designer does by hand when converting a plant to the discrete domain, and it is why the discrete integral can be checked to the last hertz-neper rather than estimated.

What it does not see is what happens between samples. The discrete sensitivity is the sensitivity at the sample instants: the loop corrects only what it measures, and it measures only once a sample. A disturbance at a frequency near half the sample rate can leave the amplifier’s output rippling between samples while the sampled error looks quiet, and the sensitivity drawn here says nothing about that ripple. For an amplifier whose output is itself sampled by the next stage, at the same instants, that is no loss; for one whose output is used continuously, the intersample behaviour is a second question with its own answer.

Half a sample of delay, and where the analogy ends

The hold is the first thing to account for, and it has a well-known estimate: a value held for a sample period is, on average, half a sample old, so the hold should act like a delay of Ts/2T_s/2.

A 5 µs delay in the loop: the peak rises to 8.76 dB and the sensitivity above crossover becomes a comb, and the two areas are still equal — 6.95 kHz·Np each side. computed by solving, not by drawing, from the loop's closed form, held against the netlist's cut loop to a part in a billion. The three-pole amplifier of the area essay (second pole 4 kHz) with a pure delay of 5 µs in its loop. Its margin falls from 34.9° to 24.6° at an unchanged crossover of 5.73 kHz, and the peak of |1/(1 + T)| rises from +5.70 to +8.76 dB. Above crossover the delay keeps turning the loop's phase, so the sensitivity rises and falls about zero with a period of 200 kHz. The area below zero is 6.945 kHz·Np, the area above 6.945, net 4.83 × 10⁻⁵ Hz·Np — integrated to 50 MHz on a grid that takes sixty steps a tooth.
Fig. 2 From the delay essay: the continuous loop with 5 µs of delay, half a sample at 100 kHz. Its margin is 24.6°, its peak 8.76 dB, and above crossover its sensitivity is a comb that runs on without end.

The delay essay’s loop with 5 µs in it has 24.6° of margin and an 8.76 dB peak — within 0.13° and 0.04 dB of the sampled loop at 100 kHz. Drawn together, the two are the same curve until near the end of the band.

Sampled at 100 kHz the loop is, below a tenth of that, the continuous loop with 5.0 µs of delay: 24.7° of margin against 24.6°. computed by solving, not by drawing. The device sensitivity of the loop sampled at 100 kHz with a zero-order hold, beside the continuous loop with no delay and with a delay of half a sample, 5.0 µs, from 100 Hz to half the sample rate. Below a tenth of the sample rate the sampled and delayed curves agree to 0.10 dB, and the sampled loop's margin, 24.69°, is the delayed loop's 24.56° to within the hold's departure from a pure delay; the continuous loop's is 34.9°. Near half the sample rate they part: the delayed loop's sensitivity goes on into its comb, and the sampled loop's response folds back and ends.
Fig. 3 The sampled loop’s sensitivity beside the continuous loop with no delay and with half a sample of delay, from 100 Hz to half the sample rate. Below a tenth of the sample rate the sampled and delayed curves agree to a tenth of a decibel; near the end of the band they part.

Below a tenth of the sample rate the sampled and delayed loops agree to 0.10 dB, and their margins, 24.69° and 24.56°, differ by the hold’s departure from a pure delay — a hold has a sin⁡(x)/x\sin(x)/x magnitude as well as its linear phase, and at the crossover that magnitude is 0.995. Near half the sample rate they part. The delayed loop’s sensitivity goes on into its comb, with teeth at every multiple of 200 kHz, and repays part of its debt there. The sampled loop’s response folds back at 50 kHz and ends, so whatever the comb would have repaid above 50 kHz has to be repaid below it instead.

That is the whole of the difference in one sentence, and it is why the half-sample estimate is a good estimate of the sampled loop’s margin and a poor one of its repayment. The margin is decided at the crossover, where a hold and a delay are indistinguishable; the repayment is decided by the whole band, and the hold has less band.

Nowhere far away to go

The sampled loops reach zero exactly at half their sample rates; the continuous loop is still 23% in debt at 25 kHz and 1.9% at 250 kHz. computed by solving, not by drawing. The running integral of ln|1/(1 + T)|, divided by the area below zero, for the loop sampled at 50.0 kHz, 100 kHz, 500 kHz and for the continuous loop. Each sampled curve ends at half its sample rate, exactly at zero; the continuous one is still 23.2% short at 25 kHz, 11.4% at 50 kHz and 1.94% at 250 kHz, and repays the rest over decades above. A sampled loop has no decades above.
Fig. 4 The running integral of the sensitivity’s logarithm, over the area below zero, for the loop sampled at 50, 100 and 500 kHz and for the continuous loop. Each sampled curve reaches zero exactly at half its sample rate; the continuous one is still repaying decades above.

The running integrals make the confinement visible. Each sampled curve falls to −1 where its sensitivity first reaches one and climbs back to exactly zero at half its sample rate — the last hertz of its band. The continuous loop is still 23.2 per cent short at 25 kHz, 11.4 per cent at 50 kHz and 1.94 per cent at 250 kHz, and it repays the remainder over the decades above, where a sampled loop has nothing.

The consequence is in the shape of the sampled loops’ curves near the end of their bands. They do not merely stop at the continuous loop’s level; they rise faster than it beforehand, because the part of the debt the continuous loop would have repaid between 50 kHz and infinity has been moved below 50 kHz. At 50 kHz sample rate, where the band ends at 25 kHz, nearly a quarter of the debt has been moved, and the peak has risen to 13.08 dB to carry it.

Seen this way, the sample rate is not only a limit on how fast the loop can respond. It is a limit on where the loop may put the cost of the responding it does, and the two are separate. A faster sampler gives the loop more band below its Nyquist frequency in which to spread the repayment thinly, and that is worth something even to a loop whose crossover is far below the sample rate already — which is what the 500 kHz curve’s slight difference from the continuous one, two decades above its crossover, is showing.

A finite band is a floor under the peak

The continuous integral is an equality and it bounds nothing: the repayment can always be spread thinner over a wider band, so a loop can in principle have any peak above zero decibels it likes, at the cost of repaying over decades. A finite band removes that freedom, and the integral becomes a lower bound.

Suppose the sensitivity stays below a depth ε over the band from zero to f1f_1. The area below zero is then at least f1ln⁡(1/ε)f_1\ln(1/\varepsilon), and it must be repaid in the remaining fs/2−f1f_s/2 - f_1 of band, so somewhere there the sensitivity reaches at least

∥S∥∞≥(1ε)f1/(fs/2−f1).\|S\|_\infty \ge \left(\frac{1}{\varepsilon}\right)^{f_1/(f_s/2 - f_1)}.

In decibels that is the depth times x/(1−x)x/(1-x), with x the fraction of the Nyquist band desensitised — a statement about every sampled loop, whatever its poles.

Hold the sensitivity 20 dB down over a third of the Nyquist band and no sampled loop can peak below 10 dB; over a tenth, 2.22 dB — and every loop here sits far above its floor. computed by solving, not by drawing. The sampled integral as a design limit: if |1/(1 + T)| stays below a depth over a fraction x of the band from zero to half the sample rate, the remaining fraction must carry as much area above zero, so the peak is at least the depth in decibels times x/(1 − x), for any loop. Curves for depths of 10, 20, 40 dB. Dots: the three-pole loop sampled at 30.0 kHz, 50.0 kHz, 100 kHz, 200 kHz, 500 kHz, each at the edge of its own −20 dB band — 30.0 kHz: x = 0.063, peak 26.22 dB against a floor of 1.35; 50.0 kHz: x = 0.038, peak 13.08 dB against a floor of 0.79; 100 kHz: x = 0.019, peak 8.72 dB against a floor of 0.39; 200 kHz: x = 0.010, peak 7.09 dB against a floor of 0.19; 500 kHz: x = 0.004, peak 6.23 dB against a floor of 0.08. This loop's desensitisation is deep but narrow, so its floor is low and its peak is set by its margin; a loop asked to desensitise a large share of its band meets the floor first.
Fig. 5 The least possible peak of a sampled loop’s sensitivity, against the share of the Nyquist band held below a depth of 10, 20 or 40 dB. The dots are the three-pole loop at five sample rates, each read at the edge of its own −20 dB band: all sit far above the −20 dB floor.

The curves are steep. Hold the sensitivity 20 dB down over a tenth of the band and the peak is at least 2.22 dB; over a third, at least 10 dB; over half, at least 20. At 40 dB of desensitisation those floors double. A design specification that asks a sampled loop for deep desensitisation over much of its band is asking for a large peak, and the integral says so before any design is attempted.

The three-pole loop sits far above these floors, which says something about it rather than about the bound. Its −20 dB band ends a little below a kilohertz whatever the sample rate, so at 100 kHz it desensitises only 1.9 per cent of its band and its floor is 0.39 dB, against an actual peak of 8.72. Its peak is set by its margin, which the hold’s half-sample delay eats; the integral’s floor is not the binding constraint. A loop whose desensitisation reached a large share of its band — a high-gain digital controller run close to its own sample rate — would meet the floor first, and no amount of margin would get it below.

Reading the floor as a specification

The floor is most useful turned round, as a test of a specification before any loop is designed. Take a sampler at 100 kHz, so a band of 50 kHz, and a requirement that disturbances be rejected by 40 dB. Rejection to 5 kHz is a tenth of the band and costs a peak of at least 4.4 dB somewhere above it; rejection to 10 kHz is a fifth and costs at least 10 dB; rejection to 25 kHz, half the band, costs at least 40 dB — a disturbance at the peak’s frequency amplified a hundredfold. No compensation, no ordering of poles and zeros, no amount of cleverness in the controller moves those numbers, because they follow from the band alone.

The same requirement on a continuous loop has no floor, and that is precisely the comfort the continuous analysis offered and a sampled implementation withdraws. A specification written for a continuous loop and then implemented digitally can be one the integral forbids, and the place it shows up is a resonance just below half the sample rate, where the debt has been driven because it had nowhere else to go.

There is a useful corollary for choosing a sample rate. If the specification fixes a rejection depth up to a fixed frequency and a tolerable peak, the floor fixes the smallest band that can carry the repayment, and so the smallest sample rate. With 40 dB to 10 kHz and a peak of at most 6 dB, x/(1 − x) must be at most 0.15, so x is at most 0.13 and the band must be at least 77 kHz — a sample rate of 154 kHz before any margin has been considered.

The sample rate a margin needs

The practical question is the reverse: for a loop with a given margin, how fast must the sampler be before sampling costs little?

A sampled loop's peak rises 3 dB above the continuous loop's when the sample rate falls to 24, 18, 10 times its crossover, at 25°, 35°, 65° of margin. computed by solving, not by drawing. The sensitivity peak of the loop sampled with a hold, against the sample rate, for three second-pole settings: 2.00 kHz, 25.2° and a crossover of 4.25 kHz; 4.00 kHz, 34.9° and a crossover of 5.73 kHz; 20.0 kHz, 65.3° and a crossover of 9.10 kHz. Each tends to its continuous loop's peak as the sample rate rises and climbs as it falls, until the loop is unstable. The peak is three decibels above the continuous one at 103 kHz (24.3 times the crossover), 101 kHz (17.6 times the crossover), 86.9 kHz (9.5 times the crossover). A loop with less margin needs a faster sampler for the same penalty, because half a sample of delay is a larger share of what margin it has.
Fig. 6 The sampled loop’s sensitivity peak against the sample rate for three second-pole settings, giving 25.2°, 34.9° and 65.3° of margin. Each tends to its continuous loop’s peak as the sample rate rises; the dots mark where the peak is three decibels above it.

Each curve tends to its continuous loop’s peak as the sample rate rises and climbs as it falls, until the loop is unstable. Take three decibels above the continuous peak as the point where sampling has started to cost something a designer would notice. The 34.9° loop reaches it at 101 kHz, 17.6 times its crossover; the 25.2° loop at 103 kHz, 24.3 times its crossover; the 65.3° loop at 86.9 kHz, 9.5 times its crossover.

At the low end the curves end where the loops become unstable, and the half-sample estimate predicts where. A hold costs 180 fc/fs180\,f_c/f_s degrees at the crossover, so a loop with margin φ loses all of it at a sample rate of about 180 fc/φ180\,f_c/\varphi: 29.6 kHz for the 34.9° loop, whose sampled version at 30 kHz has 3.3° left. The three loops’ critical rates are close to one another because the loop with the least margin also has the lowest crossover, and the two effects nearly cancel in that ratio.

The ordering is the half-sample delay at work. A loop with little margin has little phase to spare, so the hold’s 180 fc/fs180\,f_c/f_s degrees is a larger share of what it has; it needs a faster sampler, in proportion to its crossover, for the same penalty. The common rule that a sampled loop’s sample rate should be ten to twenty times its crossover is, by these numbers, right for loops with comfortable margin and short for loops without it.

Where this sits beside the hold’s phase

Half a clock against a pole measured the phase a sampled loop loses to its hold and found it to be half a sample of delay, in the same terms used above. That essay’s currency was phase at one frequency; this essay’s is area over the band. The two agree where they overlap — the margin a sampled loop has is the delayed loop’s margin to a seventh of a degree — and differ where they do not: the phase account says nothing about where the debt is repaid, and the area account says nothing about stability that the margin does not.

Taken together they give a sampled loop’s designer two separate numbers to check. The margin, from the half-sample estimate, decides whether the peak is acceptable; the floor, from the share of the band desensitised, decides whether any loop could do better. When the first is the binding one, the loop needs more margin or a faster sampler; when the second is, it needs a less ambitious specification, because nothing inside the band can help.

What it leaves out

A computation delay on top of the hold. A digital controller usually applies its correction one computation after the sample, which adds a further delay to the hold’s half sample. The discrete integral still holds, and the margin falls by the extra delay’s phase; the floor is unchanged, because it depends only on the band.

Anti-alias and reconstruction filters. A real sampled loop has filters before the sampler and after the hold, each adding phase near the crossover. A reconstruction that is more than a hold — four rectangles and no filter built output pulses from up to four convolved clock rectangles — adds half a sample of delay for each rectangle, so the smoother the output, the more of the margin it spends. They make the loop’s continuous part longer and its margin smaller, and the integral is unchanged so long as the sampled loop stays stable.

And an open loop with nothing unstable in it. A loop that controls an unstable plant owes more than zero: its integral is the sum of the logarithms of the unstable discrete poles, times the band, and a finite band then makes the floor much higher. None of the amplifiers here is unstable when cut.

Still open: the floor for a continuous loop with a bandwidth limit, the computation delay, and two loops in cascade

A continuous loop that must be small above a frequency. The sampled floor came from confining the repayment to a band. A continuous loop whose gain must be below some level above a stated frequency — which a real amplifier’s finite bandwidth enforces — confines it too, less sharply, and the same argument should give a floor on its peak that depends on how small the loop gain must be and how far above crossover the limit starts.

Where the computation delay belongs. A controller that computes in less than a sample could apply its correction early, or wait and apply it on the next sample edge to keep the timing regular. The first has less delay, the second less jitter; whether the margin the first saves is worth the timing noise it adds is a trade a sampled loop’s designer meets every time.

Two sampled loops in cascade. An inner current loop and an outer voltage loop sampled at the same rate share the band, and the outer loop sees the inner one’s sensitivity peak as part of its plant. Whether the outer loop’s floor is set by its own desensitisation or inherits the inner one’s is a question the discrete integral could answer for each loop separately and the cascade has not yet been asked.

Part 5 on desensitivity

One argument about Desensitivity, 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.

DesensitivityDesign tradeoffIntegrationLoop gainPhase marginSample rateSampled dataZero-order hold