Mini Project: A 24 V to 12 V Buck Converter from Specification to Bench Test
A robot arm's controller cabinet has a industrial bus and needs a , rail for a camera and a fan tray. The bus is nominally but, by the cabinet's specification, may sit anywhere from to . In this project you take the converter the DC-DC lessons have been building from a written specification to a design you could lay out and test: component choice, losses and temperatures, the control loop, a SPICE check at the worst corner, a bench test plan, and a short design report. Each step reuses a lesson; the links say which.
Safety: this is a low-voltage project, but bench testing is limited to and below with the supply's current limit set. The corner of the specification is checked by calculation and simulation only. The test plan lists the hazards (hot parts, stored energy, inductive kick, output overvoltage).
The specification
| Item | Requirement |
|---|---|
| input | to DC, nominal ; bench tests at and only |
| output | (static, over line, load and temperature), to |
| ripple | at most ( peak-to-peak, bandwidth) |
| load step | to at : deviation at most () |
| efficiency | at least at , |
| thermal | ambient up to ; junctions at most (derating rule), inductor at most |
| protection | current limit with hiccup or foldback; soft start about ; survives a hot plug at |
| switching | , non-synchronous (Schottky), voltage-mode controller with a ramp and a reference |
Step 1: power stage and components
The buck relations and the component currents are in The Buck Converter; the worst-case table, the catalogue choice and the load-step sizing of the output capacitor are in Component Selection. The result, re-used here:
| Part | Choice | Why |
|---|---|---|
| inductor | shielded, , (for a rise), DCR | ripple ratio at most at ; above the current limit |
| output capacitor | , X7R, about at bias | load step, not ripple, sets it |
| input capacitors | , X7R next to the switch, plus , electrolytic | rms at ; the electrolytic's ESR damps the hot-plug ring (Protection and Reliability) |
| MOSFET | , at , , package | plus ringing stays under of (Power MOSFETs, Gate Drivers) |
| diode | Schottky, , , | average current up to at (Power Diodes) |
The output divider sets the voltage: with and , (use , ). With resistors and a reference, the static error budget is about , inside the requirement.
Step 2: losses and temperatures
The loss model of Loss Budgets at the three input voltages, with the junction-to-ambient resistances you would estimate from the layout (Thermal Design): for the MOSFET on a copper area, for the diode, and for the inductor's copper loss (its datasheet's rise at , that is ).
import numpy as np
# Losses of the chosen design (parts from Component Selection, model from Loss Budgets), 2 A out
Vout, Iout, fsw, L = 12.0, 2.0, 200e3, 56e-6
Rds, tsw, Coss, Qg, Vg = 0.015 * 1.5, 20e-9, 300e-12, 15e-9, 5.0 # 60 V MOSFET, hot RDS(on)
Vf, dcr, Pcore, Iq, esr_in, esr_out = 0.45, 0.038, 0.05, 2e-3, 0.005, 0.005
def losses(Vin):
D = Vout / Vin
dI = Vout * (1 - D) / (L * fsw)
k = 1 + (dI / Iout)**2 / 12
return {"MOSFET": D * Iout**2 * k * Rds + 0.5 * Vin * Iout * tsw * fsw
+ 0.5 * Coss * Vin**2 * fsw + Qg * Vg * fsw,
"diode": Vf * (1 - D) * Iout,
"inductor": Iout**2 * k * dcr + Pcore,
"capacitors": Iout**2 * D * (1 - D) * esr_in + dI**2 / 12 * esr_out,
"controller": Vin * Iq}
# thermal: junction-to-ambient on the board (assumed from layout and datasheets), 50 C ambient
Rth = {"MOSFET": 40.0, "diode": 45.0, "inductor": 90.0}
Ta, Tmax = 50.0, 110.0
print(" Vin MOSFET diode inductor total eff Tj MOSFET Tj diode T inductor")
for Vin in (18.0, 24.0, 30.0):
p = losses(Vin)
tot = sum(p.values())
T = {k: Ta + p[k] * Rth[k] for k in Rth}
print(f"{Vin:4.0f} {p['MOSFET']*1e3:5.0f} {p['diode']*1e3:5.0f} {p['inductor']*1e3:5.0f} "
f"{tot*1e3:5.0f} {100*24/(24+tot):5.2f} % {T['MOSFET']:6.1f} {T['diode']:6.1f} {T['inductor']:6.1f}")
worst = max(Ta + losses(v)["diode"] * Rth["diode"] for v in (18.0, 24.0, 30.0))
print(f"hottest junction {worst:.1f} C against a {Tmax:.0f} C derating limit: margin {Tmax - worst:.1f} K") Vin MOSFET diode inductor total eff Tj MOSFET Tj diode T inductor
18 157 300 202 700 97.17 % 56.3 63.5 68.2
24 174 450 203 880 96.46 % 56.9 70.2 68.3
30 198 540 203 1007 95.97 % 57.9 74.3 68.3
hottest junction 74.3 C against a 110 C derating limit: margin 35.7 K
The efficiency requirement is met at () and even at . The diode is the hottest part and the largest loss at high input, where it conducts of the time; at it still has of margin. A synchronous MOSFET would buy about points of efficiency, at the cost of a second gate drive and dead-time management.
Step 3: the control loop
The plant is the buck's control-to-output transfer function (Averaged Models): a double pole at , lightly damped, with the ceramic capacitors' ESR zero above , so the phase drops towards just where the loop must cross over. A Type III compensator (Voltage-Mode Control) supplies the missing phase: an integrator, two zeros near (here at and ) and two poles at . Its gain is set for a crossover of , a tenth of the switching frequency, at . Because the modulator's gain is , the crossover moves with the input; the code checks all three input voltages, the load-step response and the component values.
import numpy as np
from scipy import signal
# Voltage-mode loop of the buck: plant, Type III compensator, margins and a 1 A load step
L, RL, C, Rc, R, fsw, Vramp = 56e-6, 0.038, 29.7e-6, 0.005, 6.0, 200e3, 1.0
f0 = 1 / (2 * np.pi * np.sqrt(L * C))
P = np.polymul
def plant(Vin):
# vo/d = (Vin/Vramp) * Zp / (Zp + RL + sL), Zp = R (1 + s C Rc) / (1 + s C (R + Rc))
num = (Vin / Vramp) * R * np.array([C * Rc, 1.0])
den = np.polyadd(P([L, RL], [C * (R + Rc), 1.0]), R * np.array([C * Rc, 1.0]))
return num, den
fz1, fz2, fp1, fp2, fc = 0.5 * f0, f0, fsw / 2, fsw / 2, 20e3
w = lambda f: 2 * np.pi * f
cnum = P([1 / w(fz1), 1], [1 / w(fz2), 1])
cden = P([1, 0], P([1 / w(fp1), 1], [1 / w(fp2), 1]))
n24, d24 = plant(24.0)
_, h = signal.freqs(P(n24, cnum), P(d24, cden), worN=[w(fc)])
wi = 1 / abs(h[0]) # integrator gain for |T(fc)| = 1 at 24 V
print(f"f0 = {f0/1e3:.2f} kHz; zeros {fz1/1e3:.2f} and {fz2/1e3:.2f} kHz, poles {fp1/1e3:.0f} kHz (x2), "
f"wi = {wi:.0f} rad/s")
f = np.logspace(2, 6, 4001)
for Vin in (18.0, 24.0, 30.0):
n, d = plant(Vin)
_, T = signal.freqs(wi * P(n, cnum), P(d, cden), worN=w(f))
mag, ph = np.abs(T), np.unwrap(np.angle(T))
k = np.argmax(mag < 1) # first crossing of 0 dB
j = np.argmax(ph < -np.pi) # first crossing of -180 degrees
print(f"Vin = {Vin:4.1f} V: fc = {f[k]/1e3:5.1f} kHz, PM = {180 + np.degrees(ph[k]):4.1f} deg, "
f"GM = {-20*np.log10(mag[j]):4.1f} dB at {f[j]/1e3:5.1f} kHz")
# closed-loop output impedance Zo/(1 + T) and a 1 A load step at 24 V; s is scaled by
# wn = 2 pi 10 kHz (s = wn x) so the polynomial coefficients stay well conditioned
wn = w(10e3)
sc = lambda p: np.array(p) * wn ** np.arange(len(p) - 1, -1, -1.0)
n, d = plant(24.0)
Tn, Td = sc(wi * P(n, cnum)), sc(P(d, cden))
zl, zc = [L, RL], [C * Rc, 1.0] # Zo = (RL + sL) || Zc || R, Zc = (1 + s C Rc)/(s C)
zn = sc(R * P(zl, zc))
zd = sc(np.polyadd(np.polyadd(R * P(zl, [C, 0.0]), R * np.array(zc)), P(zl, zc)))
num_cl, den_cl = P(zn, Td), P(zd, np.polyadd(Td, Tn))
x = np.linspace(0, 300e-6 * wn, 3001) # 300 us in scaled time
_, v = signal.step((num_cl, den_cl), T=x)
k = v.argmax()
print(f"1 A load step at 24 V: dip {1e3*v[k]:.0f} mV after {x[k]/wn*1e6:.1f} us, "
f"within {abs(1e3*v[-1]):.1f} mV of the final value after 300 us")
print(f"estimate dI/(2 pi fc C) = {1e3/(2*np.pi*fc*C):.0f} mV; specification 360 mV")
# Type III network around the error amplifier, R1 = 10 kohm from the output to the inverting input:
# wi = 1/(R1 (C1 + C2)), fz1 = 1/(2 pi R2 C1), fp2 = 1/(2 pi R2 C1 C2/(C1 + C2)),
# fz2 = 1/(2 pi (R1 + R3) C3), fp1 = 1/(2 pi R3 C3)
R1 = 10e3
Csum = 1 / (wi * R1)
C2 = Csum * fz1 / fp2 # from fp2/fz1 = (C1 + C2)/C2
C1 = Csum - C2
R2 = 1 / (w(fz1) * C1)
R3 = R1 / (fp1 / fz2 - 1) # from fp1/fz2 = (R1 + R3)/R3
C3 = 1 / (w(fp1) * R3)
print(f"R1 = 10.0 kohm, R2 = {R2/1e3:.2f} kohm, R3 = {R3:.0f} ohm, "
f"C1 = {C1*1e9:.1f} nF, C2 = {C2*1e12:.0f} pF, C3 = {C3*1e9:.2f} nF")f0 = 3.90 kHz; zeros 1.95 and 3.90 kHz, poles 100 kHz (x2), wi = 2563 rad/s
Vin = 18.0 V: fc = 15.8 kHz, PM = 55.9 deg, GM = 23.6 dB at 105.4 kHz
Vin = 24.0 V: fc = 20.0 kHz, PM = 54.8 deg, GM = 21.1 dB at 105.4 kHz
Vin = 30.0 V: fc = 24.2 kHz, PM = 52.8 deg, GM = 19.1 dB at 105.4 kHz
1 A load step at 24 V: dip 227 mV after 12.2 us, within 5.9 mV of the final value after 300 us
estimate dI/(2 pi fc C) = 268 mV; specification 360 mV
R1 = 10.0 kohm, R2 = 2.13 kohm, R3 = 406 ohm, C1 = 38.3 nF, C2 = 761 pF, C3 = 3.92 nF
The phase margin stays between and and the gain margin at least over the input range. The step dips by , inside the requirement and a little better than the estimate of Component Selection. Round the network to E-series values (, , , , ) and rerun the cell with them before ordering parts. Two cautions: below about at the converter enters DCM (Discontinuous Conduction Mode), where the double pole disappears and the loop gain falls, so measure the light-load response too; and the ceramics' capacitance falls further when hot, which lowers and the phase margin.
Step 4: SPICE at the worst corner
The ripple and the peak current are largest at the highest input. Bench tests stop at , so the corner is checked in ngspice: the deck of the buck lesson with this project's parts, a fixed on-time of (a little above to cover the drops) and a load.
cat > buck30.cir <<'EOF'
* Mini project buck at the worst-case input, 30 V -> 12 V, 2 A, 200 kHz (open loop, fixed on-time)
* switch 22.5 mohm (hot), Schottky, L 56u (DCR 38 mohm), Cout 29.7u effective (ESR 5 mohm)
.model SW1 SW(Ron=0.0225 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 30
VG g 0 PULSE(0 5 0 10n 10n 2.06u 5u)
S1 vin sw g 0 SW1
D1 0 sw DSCH
L1 sw a 56u
RL1 a out 38m
C1 out c 29.7u
RESR c 0 5m
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
meas tran ilmax max i(L1) from=4.9m to=5m
meas tran vswmin min v(sw) from=4.9m to=5m
.endc
.end
EOF
ngspice -b buck30.cir 2>&1 | grep -E '^(vout|vpp|ilpp|ilmax|vswmin) +='vout = 1.207624e+01 from= 4.900000e-03 to= 5.000000e-03
vpp = 1.404514e-02 from= 4.900000e-03 to= 5.000000e-03
ilpp = 6.582595e-01 from= 4.900000e-03 to= 5.000000e-03
ilmax = 2.341910e+00 at= 4.997075e-03
vswmin = -4.516627e-01 at= 4.997076e-03
SPICE gives of ripple (hand calculation: capacitive plus a small ESR part), an inductor ripple of (hand: ), a peak of , well under the saturation current and the limit, and a switch node that swings below ground while the diode conducts. The lab shows the ideal version at the same corner: , a peak of , of ripple and . Raise to (): the lab reports DCM and, at this fixed duty cycle, , which the loop must correct.
Step 5: the bench test plan
Build the converter on a two-layer board with a solid ground plane, the input capacitors, the MOSFET and the diode in the tightest possible loop (Snubbers, dv/dt, di/dt and Layout), or use a buck evaluation board with similar parts. Equipment: a bench supply to with current limit, an electronic load (or , and power resistors), two -digit DMMs with Kelvin leads at the board terminals, a scope with a limit and a current probe.
| Test | Conditions | Expected (with uncertainty) |
|---|---|---|
| start-up and soft start | , limit , load | monotonic rise in about (, the soft-start capacitor's tolerance); no overshoot above |
| output voltage | and ; , , | ; line and load changes within |
| efficiency | ; to , after warm-up | about at to , points from the meters; the model's curve within about point |
| output ripple | , , probe tip and barrel on | to at ; spikes at the edges are measurement artefacts if they shrink with a shorter ground |
| inductor ripple | current probe on | nominal at , to with the inductance tolerance |
| load step | at | dip to , recovery within about ; ringing means low phase margin |
| loop gain (optional) | injection resistor to at the top of , network analyser | near at and at ; phase margin to |
| temperatures | , , , thermocouple or IR camera | diode about above ambient, MOSFET and inductor under ; add (the step from a to a ambient) before comparing with the limits |
| current limit and short | short through a MOSFET switch, pulses | peak near (), hiccup or frequency foldback, no damage |
| hot plug | applied through of cable with a mechanical switch | input peak under with the electrolytic fitted (the Protection lesson's deck, with of ceramics and , gives ; rerun it with this board's and and the electrolytic's datasheet ESR) |
Hazards and safe setup. Supply at most , current limit set before connecting. Load resistors and the diode get hot: mount resistors on a heatsink and keep fingers off the board while it runs. Never disconnect the feedback divider or its probe while running: the output would rise towards the input. A short-circuit test only through a rated MOSFET switch, never with a wire or tweezers. Discharge the electrolytic after power-off. The corner stays in simulation.
Your write-up
A two- to four-page report:
- Specification and the assumptions you added (ambient, derating rules, test limits).
- Design: topology and frequency choice, the component table with the worst case each part was checked at, and the feedback divider.
- Losses and thermal: the loss table at three input voltages, the thermal resistances used and where they came from, the temperature margins.
- Control: plant, compensator poles and zeros, the network values (E-series), the margins over the input range, the predicted load-step response; what changes in DCM.
- Simulation: the SPICE results at next to the hand calculations.
- Measurements: every test of the plan with the expected value, the measured value, its uncertainty, and pass or fail.
- Discrepancies and their likely causes (capacitance at bias and temperature, inductance tolerance, probe technique).
- Safety and limits: what was not tested on the bench and why.
Extensions
- Synchronous rectification. Replace the diode by a MOSFET in the first cell (see the synchronous version in Loss Budgets) and recompute efficiency and temperatures; add dead time and the body-diode loss.
- Current-mode control. Redesign the loop with peak current-mode control (Peak Current-Mode Control and Digital Control): a Type II compensator suffices, and the input voltage no longer moves the crossover.
- Input filter and EMI. Add a filter at the input and check that its output impedance stays below the converter's input impedance near the filter's resonance.
Test yourself
Why is the 30 V corner of this project checked in ngspice rather than on the bench?
- ngspice is more accurate than a scope
- the course limits bench work to 24 V and below, and the worst-case ripple and peak current occur at the highest input
- 30 V is outside the MOSFET's rating
- the controller does not work at 30 V
In a voltage-mode buck with a fixed ramp, raising the input voltage from 18 V to 30 V…
- leaves the loop unchanged
- raises the modulator gain , so the crossover frequency rises (16 to 24 kHz here)
- lowers the crossover frequency
- moves the LC double pole
Which part limits this design thermally?
- the MOSFET
- the Schottky diode, especially at high input where it conducts 60 % of the time
- the output capacitors
- the controller
What does a Type III compensator provide that a Type II does not, for this ceramic-capacitor buck?
- an integrator
- a second zero, giving enough phase boost near the lightly damped LC double pole when there is no useful ESR zero
- a lower switching frequency
- current limiting