Set 23 — SMPS Design and Closed-Loop Control
Sets 18 to 22 designed power stages and assumed a controller that produces the right duty ratio at every input voltage and load. That assumption hides most of the engineering. A buck's duty ratio must move from 0.40 to 0.667 across its input range, a flyback's from 0.20 to 0.44 — and it must do so fast enough to hold the output during a load step, without oscillating.
Closing that loop means knowing what the power stage does to a small change in duty ratio, and the answer is different for every topology: a resonant double pole in a buck, a right-half-plane zero in a boost or flyback, a fourth-order pair in a Ćuk. This set builds the model, designs the compensator against it, and then confronts the two things that make a real supply harder than the model — the load step and the isolation barrier.
The buck's control-to-output transfer function has a DC gain, a resonant double pole and an ESR zero:
\[ f_{LC} = \frac{1}{2\pi\sqrt{LC}}, \qquad f_{ESR} = \frac{1}{2\pi\,\text{ESR}\cdot C}, \qquad Q = R\sqrt{\frac{C}{L}}, \qquad G_{dc} = V_{in} \]Crossover is chosen well below the switching frequency:
\[ f_c \approx \frac{f_s}{10}, \qquad \left|G_{vd}\right|_{f_c} \approx V_{in}\left(\frac{f_{LC}}{f_c}\right)^2 \]Phase margin is assembled term by term:
\[ \text{PM} = 180^\circ+\angle G_{plant}+\angle G_{comp}, \qquad \text{target } 45\text{–}60^\circ \]Current-mode control replaces the double pole with a single pole:
\[ f_p = \frac{1}{2\pi RC}, \qquad \text{but needs } S_e \ge \frac{S_f-S_n}{2} \text{ for } D > 0.5 \]The load-step undershoot has two independent limits:
\[ \Delta V_{ESR} = \Delta I\cdot\text{ESR}, \qquad \Delta V_{loop} = \frac{\Delta I}{2\pi f_cC}, \qquad \Delta V_{slew} = \frac{L\Delta I^2}{2CV_L} \]An optocoupler brings a 4:1 gain tolerance and a pole:
\[ \text{CTR} = 50\text{–}200\% \Rightarrow 12\ \text{dB of uncertainty}, \qquad f_{opto} = \frac{1}{2\pi R_{pu}C_{eq}} \]
A buck converter runs from 24 V to 12 V at 5 A, with \(L = 20\ \mu\text{H}\), \(C = 100\ \mu\text{F}\) of 20 mΩ ESR, at \(f_s = 200\) kHz. Find the DC gain, the resonant frequency and its \(Q\), the ESR zero, and the gain and phase at a 20 kHz crossover.
The DC gain is the sensitivity of output to duty ratio:
Note it depends on the input voltage, not the output. A buck running from 30 V has 2 dB more loop gain than one running from 24, so the loop must be stable across the whole input range — the compensator is designed once and must hold everywhere.
The resonance, from the output filter:
A \(Q\) of 5.4 gives a 14 dB peak and a phase that swings through 180° within a decade. And unlike the Ćuk resonance of Set 21, this one is damped by the load — at light load \(R\) rises and \(Q\) rises with it, so the worst case is no load.
The ESR zero, which the capacitor introduces for free:
Above this frequency the capacitor's impedance is dominated by its resistance, so the output stops rolling off. A left-half-plane zero, which adds phase — genuinely helpful, and one of the few places where a parasitic works in the designer's favour.
Evaluate at the intended crossover. Well above resonance the double pole falls at 40 dB per decade:
So the plant is already close to unity gain at 20 kHz. The compensator needs to add only 2.4 dB there — almost nothing. The gain is not the problem.
The phase is the problem:
Fifteen degrees short of an inversion. Close the loop with a plain integrator — which contributes another \(-90^\circ\) — and the total is \(-256^\circ\): comfortably unstable. The compensator must supply phase, not gain.
Which compensator, and why:
| Type | Max phase boost | Suits |
|---|---|---|
| Type I (integrator) | 0° | first-order plants only |
| Type II (1 zero, 2 poles) | < 90° | current-mode, flyback |
| Type III (2 zeros, 3 poles) | < 180° | voltage-mode buck — this case |
A double pole needs roughly 90° of boost to recover a usable margin, and only Type III can deliver it. That is the whole reason voltage-mode buck converters use the more complicated network.
Design a Type III compensator for the converter of Problem 1 with a 20 kHz crossover. Place the two zeros at 3.5 kHz, one pole at the ESR zero and one at \(f_s/2\), and verify the resulting phase margin.
The placement strategy. Each element is put where it does a specific job:
| Element | Frequency | Purpose |
|---|---|---|
| Integrator (pole at 0) | — | zero steady-state error |
| Two zeros | 3.5 kHz | cancel the double pole, boost phase |
| Pole | 79.6 kHz | cancel the ESR zero |
| Pole | 100 kHz | attenuate switching ripple |
The two zeros are placed at the resonance so that their phase lead is already fully developed by the time the loop reaches 20 kHz. Placing them at the crossover instead would give only half the boost, since a zero contributes 45° at its own frequency.
Phase contributed by the two zeros at 20 kHz:
Nearly the full 180° available, because 20 kHz is almost six times the zero frequency. This is why the zeros go below the crossover, not at it.
Phase lost to the two high-frequency poles:
Modest, because both poles sit well above the crossover. Note that the pole at 79.6 kHz gives back exactly the 14.1° the plant's ESR zero contributed — they cancel, which is the intent.
Total compensator phase:
A net phase lead of nearly 45°, despite containing an integrator. That is what Type III buys, and it is the reason two zeros are needed rather than one.
The phase margin:
Right in the target band. Below 45° the transient response rings; above 60° it is over-damped and slow. Fifty-nine degrees gives roughly a 5% overshoot to a step — the standard compromise.
Set the gain. The compensator must supply \(+2.4\) dB at 20 kHz to bring the loop to unity there:
Which sets the resistor ratio in the network; everything else was set by the pole and zero placement. The gain is genuinely the last step, as Problem 1 anticipated.
Check the corners. A compensator designed at one operating point must survive the others:
| Condition | Effect | Consequence |
|---|---|---|
| \(V_{in} = 30\) V | DC gain +2 dB | \(f_c\) rises to ~22 kHz, PM falls slightly |
| No load | \(Q\) rises | sharper peak — but far below \(f_c\) |
| Capacitor ages | ESR rises, \(C\) falls | \(f_{ESR}\) and \(f_{LC}\) both move up |
| Ceramic output cap | ESR zero disappears | lose 14° — PM falls to 45° |
The last row is a real trap. Substituting a low-ESR ceramic for an electrolytic removes the helpful zero, and a loop designed to rely on it loses phase margin. The same substitution that damaged the Ćuk in Set 21 damages the compensation here — for the same reason, that the parasitic was doing useful work.
The same converter is compensated with peak current-mode control. Find the new plant pole, state what compensator is now sufficient, and determine the slope compensation required at \(D = 0.7\) (an input of 17.1 V).
What current mode does. An inner loop terminates the switch on-time when the inductor current reaches a commanded peak. The inductor stops behaving like an inductor and starts behaving like a current source:
The inductor's pole is absorbed into the inner loop, so the outer voltage loop sees only the output capacitor working against the load.
The new plant:
A single pole at 663 Hz plus the same ESR zero at 79.6 kHz. At 20 kHz the phase is roughly \(-90^\circ+14^\circ = -76^\circ\), against \(-166^\circ\) in voltage mode — ninety degrees better, for free.
Which changes the compensator required:
| Voltage mode | Current mode | |
|---|---|---|
| Plant order | 2nd | 1st |
| Phase at \(f_c\) | \(-166^\circ\) | \(-76^\circ\) |
| Compensator | Type III | Type II |
| Components | 3 R, 3 C | 2 R, 2 C |
| Input feedforward | none | inherent |
| Current limiting | separate circuit | inherent, cycle by cycle |
Three genuine advantages beyond the simpler compensator. Input feedforward is inherent because a higher input makes the current ramp faster, terminating the pulse sooner without the outer loop doing anything — so line rejection is excellent. And the peak current is bounded by construction, which is the same argument the hysteresis controller of Set 17 made.
But there is a catch. Above 50% duty ratio, a perturbation in the inductor current grows rather than decaying from cycle to cycle:
The result is subharmonic oscillation — alternate wide and narrow pulses at \(f_s/2\). It is not a small-signal instability that the compensator can fix; it lives in the inner loop and must be cured there.
Compute the slopes at \(D = 0.7\), which needs an input of \(12/0.7 = 17.1\) V:
The slope compensation required:
An artificial ramp of at least this slope is subtracted from the current command each cycle. A common choice is \(S_e = 0.5S_f = 300\) kA/s, which gives margin at all duty ratios; setting \(S_e = S_f\) gives deadbeat response, where any perturbation is removed in a single cycle.
What slope compensation costs:
A large compensating ramp swamps the sensed current signal, so the inner loop stops being a current loop and the advantages fade — the pole reappears, line feedforward weakens, and current limiting becomes duty-dependent. The design target is the minimum ramp that guarantees stability at the maximum duty ratio, and no more.
The converter of Problem 1, compensated to a 20 kHz crossover, sees a load step from 1 A to 5 A. Predict the output undershoot by both the loop-limited and slew-limited routes, identify which governs, and state how to improve it.
Three things happen in sequence when the load steps up:
| Phase | Timescale | Mechanism |
|---|---|---|
| 1. ESR step | instantaneous | extra current through the capacitor's resistance |
| 2. Capacitive droop | until the loop responds | capacitor alone supplies the extra current |
| 3. Recovery | loop bandwidth | inductor current rises to the new load |
The instantaneous ESR step:
Unavoidable and instant — no loop can respond to it, because it is a resistive drop, not a charge deficit. The only remedy is a lower-ESR capacitor.
The loop-limited droop. The capacitor supplies the extra current for roughly one loop time constant:
Now the independent check. Even with an infinitely fast loop, the inductor current cannot rise instantly:
The charge deficit while the inductor catches up. This is a hard floor set by the power stage — no controller can beat it.
Which one governs?
The loop is the limitation, not the power stage — so increasing the bandwidth will genuinely help, down to the 133 mV floor. Had the slew figure been the larger, more bandwidth would have achieved nothing and the answer would have been a smaller inductor or a bigger capacitor.
Test the remedies:
| Change | Loop droop | ESR step | Total |
|---|---|---|---|
| Baseline (20 kHz, 100 µF) | 318 mV | 80 mV | 398 mV |
| \(f_c\) to 40 kHz | 159 mV | 80 mV | 239 mV |
| \(C\) to 200 µF | 159 mV | 80 mV | 239 mV |
| ESR to 5 mΩ | 318 mV | 20 mV | 338 mV |
| Both \(f_c\) and \(C\) doubled | 80 mV | 80 mV | 160 mV |
Bandwidth and capacitance are interchangeable in the droop term — doubling either halves it. Bandwidth is usually cheaper, but it is limited to about \(f_s/10\), so beyond 20 kHz here the switching frequency would have to rise too.
The step down is worse. Removing load leaves the inductor delivering current with nowhere to put it:
Here the two slopes happen to be equal, because \(V_{in} = 2V_o\). At high input the rise is fast and the fall slow, so the overshoot on a load release exceeds the undershoot on a load application — and at low input the reverse. The worst-case transient is at the input extreme, not the nominal.
The flyback of Set 22 needs its output regulated, but the controller sits on the primary side of an isolation barrier. Analyse the standard TL431-plus-optocoupler solution: the gain uncertainty from a CTR of 50 to 200%, the pole it introduces with a 1 kΩ pull-up, and the bandwidth that results.
The problem. The output must be sensed on the secondary, where it is, and the duty ratio must be set on the primary, where the switch is — and the two are separated by a barrier that must withstand several kilovolts:
The standard answer places a TL431 shunt reference on the secondary, which does the error amplification and compensation, and drives an optocoupler LED whose transistor pulls on the primary controller's feedback pin.
The first difficulty is gain tolerance. An optocoupler's current transfer ratio — output current per input current — is specified over an enormous range:
Twelve decibels is a factor of four in crossover frequency. And it is worse than a tolerance: CTR falls with age and temperature, so a supply that is fast when new becomes slow after a few thousand hours — a well-known failure mode in which the transient response degrades without anything appearing to break.
How the design must accommodate it. The loop must be stable at maximum CTR and adequate at minimum:
| Condition | Loop gain | Consequence |
|---|---|---|
| CTR 200% (new, cold) | +6 dB | highest \(f_c\) — check phase margin here |
| CTR 100% (nominal) | 0 dB | design point |
| CTR 50% (aged, hot) | −6 dB | lowest \(f_c\) — check transient here |
So the design point is squeezed from both ends: stability is checked at one extreme and performance at the other, and the nominal design has to leave margin for both. In practice this costs about half the bandwidth that would otherwise be achievable.
The second difficulty is the optocoupler's own pole. The output transistor's collector capacitance works against the pull-up resistor:
Which caps the loop at a few kilohertz — roughly a sixth of the 20 kHz the non-isolated buck of Problem 2 achieved. Combined with the 12 dB of tolerance, an isolated supply is typically five to ten times slower than an equivalent non-isolated one.
What can be done about the pole:
Reducing the pull-up to 200 Ω moves the pole to 53 kHz but needs five times the LED current and gives a fifth of the gain, which the TL431 must then make up. A worthwhile trade in a fast supply and unnecessary in a slow one.
The alternatives:
| Method | Bandwidth | Accuracy | Cost |
|---|---|---|---|
| TL431 + optocoupler | ~3 kHz | excellent | lowest |
| Fast optocoupler, low \(R_{pu}\) | ~15 kHz | excellent | higher LED current |
| Primary-side regulation | slow | poor — ±5% | no opto at all |
| Auxiliary winding sense | moderate | ±3% | one winding |
| Digital isolator | very high | excellent | highest |
| Isolated amplifier | high | excellent | high |
Primary-side regulation, in which the controller infers the output from the flyback voltage on an auxiliary winding, eliminates the optocoupler entirely — and gives up tight regulation in return. It dominates the low-cost charger market for exactly that reason: a phone charger does not need ±1%.
A 65 W USB-PD adapter runs from 90 to 264 V AC and delivers 20 V at 3.25 A, with a target efficiency of 92% at full load and under 75 mW at no load. Build the loss budget, identify the largest terms, and explain how the no-load target is met.
The total loss allowance:
Five and a half watts to distribute across every component. That is the entire design constraint, and every choice in the adapter is a claim on part of it.
Allocate it, worst case at 90 V AC:
| Term | Budget | Share | Set by |
|---|---|---|---|
| Switching + snubber | 1.20 W | 21% | Set 22, Problem 6 |
| Transformer copper + core | 1.10 W | 19% | Set 24 |
| Input bridge rectifier | 1.00 W | 18% | two diodes at ~0.9 V |
| Primary switch conduction | 0.90 W | 16% | Set 2 loss model |
| Secondary rectifier (synchronous) | 0.80 W | 14% | Set 18, Problem 3 |
| Output cap ESR + controller | 0.65 W | 12% | — |
| Total | 5.65 W | 100% | \(\eta = 92\%\) |
No single term dominates, which is the signature of a well-balanced design — and also of a design that is hard to improve, since halving any one term buys under 2% of the total. The adapter that reaches 94% does so by improving four things at once.
The input bridge is worth a second look. At low line the input current is high and the power factor is poor:
A capacitor-input rectifier at 65 W is just below the 75 W threshold where Set 10 concluded that PFC becomes mandatory — which is exactly why 65 W is such a common adapter rating. A watt of bridge loss is the price of not fitting the boost stage of Set 19.
Now the no-load requirement, which is a different problem entirely:
At no load the conduction terms vanish but the fixed ones do not:
All three are proportional to switching frequency — the same observation as Set 2, Problem 4. Running at 65 kHz with no load would burn well over a watt in switching alone, fifteen times the budget.
The answer is to switch less often. Burst mode delivers a short train of pulses and then sleeps:
| No-load technique | Saves |
|---|---|
| Burst / skip mode | switching, gate and snubber loss — the bulk of it |
| Reduced \(V_{gs}\) at light load | gate charge loss |
| High-value feedback divider | bleeder current on the output |
| Controller sleep between bursts | quiescent current |
| X-capacitor discharge on unplug only | a few tens of milliwatts |
The last row is one many designers miss. Safety standards require the X capacitor to discharge within a second of unplugging, and a permanent bleeder resistor doing that job burns 30 mW continuously — 40% of the entire no-load budget. Active discharge circuits that detect the unplug event exist purely to reclaim it.
The two operating points are almost different products:
| Full load | No load | |
|---|---|---|
| Dominant loss | conduction and switching | fixed and quiescent |
| Frequency | 65 kHz | ~1 kHz effective |
| Control mode | continuous PWM | burst |
| Loop bandwidth | ~3 kHz (Problem 5) | irrelevant |
| Optimise by | better components | switching less |
A modern controller detects the load and reconfigures itself between them. The transition must be smooth in both directions, and handling it badly produces audible noise as the burst frequency passes through the acoustic range — the characteristic whine of a cheap adapter with nothing plugged in.
Key Formulas
| Quantity | Relation | Notes |
|---|---|---|
| Buck DC gain | \(G_{dc} = V_{in}\) | Rises with input — check both ends |
| Resonance | \(f_{LC} = \dfrac{1}{2\pi\sqrt{LC}}\) | — |
| Its \(Q\) | \(Q = R\sqrt{C/L}\) | Worst at no load |
| ESR zero | \(f_{ESR} = \dfrac{1}{2\pi\,\text{ESR}\cdot C}\) | Helpful — adds phase |
| Gain at crossover | \(V_{in}\left(f_{LC}/f_c\right)^2\) | Above resonance |
| Plant phase | \(-180^\circ+\tan^{-1}(f_c/f_{ESR})\) | — |
| Zero phase boost | \(\tan^{-1}(f_c/f_z)\) each | Place well below \(f_c\) |
| Phase margin | \(180^\circ+\angle G_{plant}+\angle G_{comp}\) | Target 45–60° |
| Current-mode pole | \(f_p = \dfrac{1}{2\pi RC}\) | First order |
| On / off slopes | \(S_n = \dfrac{V_{in}-V_o}{L},\ S_f = \dfrac{V_o}{L}\) | — |
| Slope compensation | \(S_e \ge \dfrac{S_f-S_n}{2}\) | Needed for \(D > 0.5\) |
| ESR step | \(\Delta I\cdot\text{ESR}\) | Instantaneous |
| Loop droop | \(\dfrac{\Delta I}{2\pi f_cC}\) | Improved by \(f_c\) or \(C\) |
| Slew floor | \(\dfrac{L\Delta I^2}{2CV_L}\) | Cannot be beaten by control |
| Opto tolerance | CTR 50–200% = 12 dB | Design at both extremes |
| Opto pole | \(f_{opto} = \dfrac{1}{2\pi R_{pu}C_{eq}}\) | Caps \(f_c\) at \(f_{opto}/3\) |
| No-load loss | \(\propto f_s\) | Fixed by burst mode |
Common Mistakes
Thinking the double pole is a gain problem. At crossover the plant was at \(-2.4\) dB and \(-166^\circ\) — the phase is what needs fixing — Problem 1.
Checking stability at one input voltage. The DC gain is \(V_{in}\), so the loop gain changes across the range — Problem 1.
Placing the compensator zeros at the crossover. A zero gives only 45° at its own frequency; placing them at 3.5 kHz for a 20 kHz crossover gave 160° — Problem 2.
Substituting a ceramic output capacitor after compensating. Losing the ESR zero costs 14° of phase margin — Problem 2.
Using current-mode control above \(D = 0.5\) without slope compensation. Subharmonic oscillation follows — Problem 3.
Adding excessive slope compensation. Too much ramp turns the loop back into voltage mode and loses the benefits — Problem 3.
Predicting transient droop from the loop alone. Both the loop and the slew limit must be computed; the larger governs — Problem 4.
Forgetting the instantaneous ESR step. Eighty millivolts appeared before the loop could react — Problem 4.
Ignoring optocoupler CTR tolerance. A 4:1 range is 12 dB, and it drifts with age — Problem 5.
Optimising an adapter only at full load. No-load loss is dominated by frequency-proportional terms that better components do not touch — Problem 6.
Six problems and the controller is no longer an assumption. The buck's double pole turned out to cost phase rather than gain, which is why voltage-mode designs need a Type III network; current mode removed ninety degrees of lag and asked for a slope-compensation ramp in return; the load step had two independent limits of which only one responded to bandwidth; and the isolation barrier cost a factor of six in speed before any design decision was made.
One component has now appeared in every set of Part 3 without ever being designed. The buck's inductor, the boost's PFC choke, the Ćuk's coupled pair, the flyback's gapped transformer, the forward's reset winding — each was specified by an inductance and a current and then set aside. Turning those numbers into a core, a gap, a turns count and a wire gauge is the last piece, and it is where the losses that Set 23 budgeted at 19% of the total actually come from.
Next: Set 24 — Magnetics for Switching Converters, where a 100 µH inductor is designed from core selection to Litz stranding, core loss is computed from the Steinmetz relation and found to be a fortieth of the copper loss, proximity effect is shown to triple the AC resistance until the windings are interleaved, and the frequency-versus-size trade is worked out properly.