The Buck Converter: Volt-Second and Charge Balance
A industrial bus has to feed a , load: a fan tray, a radio, a camera. The Analog Electronics course showed the buck converter's three formulas; this lesson derives them from the two balance laws of the switching cell, adds the currents every component must carry (average, peak and rms), includes the capacitor's ESR, and checks the design with a switched ngspice model that has real losses. The same method, applied to other arrangements of the same parts, gives every converter in the next lessons.
Circuit and the two intervals
Assume continuous conduction (CCM): the inductor current never reaches zero, so in each period exactly one of and conducts. During ( on) the inductor sees ; during ( on, its drop neglected) it sees . Small-ripple approximation: is nearly constant over a period.
Theory: the balance laws applied
Volt-second balance on :
Charge balance on : the average capacitor current is zero, so the average inductor current equals the load current, . The inductor current rises linearly by
(peak-to-peak), the same from both intervals, as balance demands. The ripple is largest at for a fixed , and grows as the input rises at a fixed output (since grows): size the inductor at the maximum input voltage.
Output ripple. The capacitor takes the inductor's AC part, a triangle of height . The charge in one positive half-triangle is , so with an ideal capacitor
The two parts are out of phase (the ESR part follows the current, the capacitive part its integral), so the total peak-to-peak lies between the larger one and their sum. With ceramic capacitors the first dominates; with electrolytics the ESR term usually does.
Component currents (CCM, small ripple; with ripple ratio ):
| Component | Average | rms |
|---|---|---|
| Inductor | ||
| Switch | ||
| Diode | ||
| Input capacitor | 0 | (ripple neglected) |
| Output capacitor | 0 |
The input capacitor's rms current, largest at where it is , is the most often forgotten rating in a buck; it heats the capacitor through its ESR (Component Selection).
Worked example: 24 V to 12 V at 2 A
Given: , , , , , with .
Find: , , the peak inductor current, the output ripple parts, and the switch and input-capacitor rms currents.
Solve:
Check: the ripple ratio is , inside the usual 0.2 to 0.4 range. The inductor needs a saturation current above (with margin for start-up and overload, say ), and the input capacitor an rms rating of at least . The total output ripple is somewhere between and ; the code computes it.
import numpy as np
Vin, Vout, Iout, fsw, L, C, esr = 24.0, 12.0, 2.0, 200e3, 47e-6, 47e-6, 0.010
D, Ts = Vout / Vin, 1 / fsw
dI = (Vin - Vout) * D / (L * fsw)
r = dI / Iout
print(f"D = {D:.3f}, dIL = {dI:.4f} A (r = {r:.3f}), peak {Iout + dI/2:.4f} A")
# sample one period of the inductor current and derive every component current from it
N = 20000
t = np.arange(N) * Ts / N
on = t < D * Ts
iL = np.where(on, Iout - dI/2 + dI * t / (D * Ts), Iout + dI/2 - dI * (t - D*Ts) / ((1 - D) * Ts))
iQ = np.where(on, iL, 0.0)
iD = np.where(on, 0.0, iL)
iCin = iQ - iQ.mean() # the input source supplies the average
iC = iL - Iout
rms = lambda x: float(np.sqrt(np.mean(x**2)))
for name, x, formula in [("inductor", iL, Iout*np.sqrt(1 + r*r/12)),
("switch", iQ, Iout*np.sqrt(D*(1 + r*r/12))),
("diode", iD, Iout*np.sqrt((1-D)*(1 + r*r/12))),
("input cap", iCin, Iout*np.sqrt(D*(1-D))),
("output cap", iC, dI/np.sqrt(12))]:
print(f"{name:10s}: avg {round(float(x.mean()), 6) + 0.0:6.3f} A, rms {rms(x):6.4f} A (formula {formula:6.4f} A)")
# output voltage ripple: capacitor charge plus ESR drop
vC = np.cumsum(iC) * (Ts / N) / C
v = (vC - vC.mean()) + esr * iC
print(f"ripple: capacitor only {np.ptp(vC)*1e3:.3f} mV, ESR only {np.ptp(esr*iC)*1e3:.3f} mV, "
f"total {np.ptp(v)*1e3:.3f} mV")D = 0.500, dIL = 0.6383 A (r = 0.319), peak 2.3191 A
inductor : avg 2.000 A, rms 2.0085 A (formula 2.0085 A)
switch : avg 1.000 A, rms 1.4202 A (formula 1.4202 A)
diode : avg 1.000 A, rms 1.4202 A (formula 1.4202 A)
input cap : avg 0.000 A, rms 1.0084 A (formula 1.0000 A)
output cap: avg 0.000 A, rms 0.1843 A (formula 0.1843 A)
ripple: capacitor only 8.488 mV, ESR only 6.383 mV, total 9.689 mV
The input-capacitor rms is with the ripple included ( without). The two ripple parts combine to , well below their sum.
Interactive: the lab with the same numbers
The lab is lossless and has no ESR, so its ripple is the capacitive part only. It reads , , a peak of , and . Raise to (a load): the converter enters discontinuous mode and the output rises to at the same duty cycle (Discontinuous Conduction Mode).
Cross-check in ngspice, with losses
The deck uses an ideal voltage-controlled switch with on-resistance, a Schottky diode model, of inductor resistance and the ESR. The drops need a slightly longer on-time: of (). It runs (1000 cycles) so the start-up ringing of the output filter has died out, and measures over the last .
cat > buck.cir <<'EOF'
* Buck 24 V -> 12 V, 2 A, 200 kHz: switch 50 mohm, Schottky, L 47u (30 mohm), C 47u (ESR 10 mohm)
.model SW1 SW(Ron=0.05 Roff=1meg Vt=2.5 Vh=0)
.model DSCH D(Is=5u N=1.1 Rs=0.03 Cjo=200p BV=60 IBV=10u)
VIN vin 0 24
VG g 0 PULSE(0 5 0 10n 10n 2.56u 5u)
S1 vin sw g 0 SW1
D1 0 sw DSCH
L1 sw a 47u
RL1 a out 30m
C1 out c 47u
RESR c 0 10m
RLOAD out 0 6
.control
tran 10n 5m 0 10n
meas tran vout avg v(out) from=4.9m to=5m
meas tran vpp pp v(out) from=4.9m to=5m
meas tran ilpp pp i(L1) from=4.9m to=5m
let pin = -v(vin)*i(VIN)
meas tran pinavg avg pin from=4.9m to=5m
let eff = 100*vout*vout/6/pinavg
print eff
.endc
.end
EOF
ngspice -b buck.cir 2>&1 | grep -E '^(vout|vpp|ilpp|pinavg|eff) +='vout = 1.201829e+01 from= 4.900000e-03 to= 5.000000e-03
vpp = 9.807601e-03 from= 4.900000e-03 to= 5.000000e-03
ilpp = 6.465605e-01 from= 4.900000e-03 to= 5.000000e-03
pinavg = 2.471272e+01 from= 4.900000e-03 to= 5.000000e-03
eff = 9.741225e+01
SPICE gives , an inductor ripple of (slightly above because is larger), an output ripple of (the Python estimate was ) and an efficiency of . That is optimistic: the model switch changes state in with no capacitance, so there is no switching loss (Hard-Switching Waveforms and Switching Losses). Most of the lost here ( in, out) is the diode's forward drop during the off-time.
Guided lab: a 24 V to 12 V buck on the bench
Hand calculation. For a buck evaluation board (or the mini project build) with your , and : , , , and the input-capacitor rms current at full load.
Simulation. Put your values into the lab and into the ngspice deck; adjust the pulse width until the deck gives your output voltage.
What you would measure. Supply from a bench supply set to with a limit (the input current at out is about ), load with a , resistor on a heatsink or an electronic load set to . Expect within of (set by the feedback resistors), an inductor ripple of to peak-to-peak with a current probe (inductance tolerance is typically ), and to of output ripple with the probe tip-and-barrel at the output capacitor and the scope's 20 MHz limit on. The switch-node waveform swings from about to with ringing on the edges.
Hazards and safe setup. maximum, current limit set before connecting. The load resistor dissipates and burns skin; the inductor, diode and switch get hot. Never disconnect the load from a running board under a scope probe in a way that lets a feedback wire come loose: an open feedback divider drives the output to the input voltage. Keep the probe ground short; a long ground lead on the switch node also couples noise into other channels.
Pitfalls
- Sizing the inductor at nominal input. Ripple is largest at the highest input; size and its saturation current there.
- Ignoring the input capacitor. It carries up to rms and sets the input ripple; a long input wire without it rings.
- Using the ideal-capacitor ripple formula for an electrolytic. Its ESR ripple can be ten times the capacitive part.
- Forgetting DCM. At light load the inductor current reaches zero and no longer holds; the control loop hides this until it matters.
Practice
- Repeat the worked example for (same , , ): , and .
- Choose for at .
- A buck with uses an electrolytic with and at . Which ripple term dominates?
Answer
- , , .
- (choose ).
- , : the ESR term, almost twenty times larger.
Test yourself
Volt-second balance on the buck inductor gives…
For a fixed output voltage, the buck's inductor ripple is largest at…
- the minimum input voltage
- the maximum input voltage
- the maximum load
- the minimum load
The average inductor current of a buck in steady state equals…
- the input current
- the load current
- half the load current
- the peak switch current
At and , the input capacitor's rms current (ripple neglected) is about…
- 0 A
- 1 A
- 2 A
- 4 A