Voltecx is in beta. The macOS build comes first; Windows and Linux packages are still being tested.Beta. macOS comes first; Windows and Linux are still in testing. What's new

A PI controller is the first compensator most engineers reach for, and on a buck converter it works well or badly depending on what it is wrapped around. This article sizes the power stage of a 12 V to 3.3 V, 5 A buck, then designs its loop twice: once in voltage mode, where a PI runs into the LC double pole, and once in peak-current mode, where a PI is the right tool. Every number is worked out so you can check it.

The power stage

Specification: Vin=12V_{in} = 12 V, Vout=3.3V_{out} = 3.3 V, Iout=5I_{out} = 5 A, fsw=200f_{sw} = 200 kHz.

The duty cycle in continuous conduction is

D=VoutVin=3.312=0.275D = \frac{V_{out}}{V_{in}} = \frac{3.3}{12} = 0.275

Choose an inductor ripple of about 30 % of full load, ΔI≈1.5\Delta I \approx 1.5 A:

L=(Vin−Vout) Dfsw ΔI=8.7×0.275200 kHz×1.5 A=7.98 μHL = \frac{(V_{in} - V_{out})\,D}{f_{sw}\,\Delta I} = \frac{8.7 \times 0.275}{200\,\text{kHz} \times 1.5\,\text{A}} = 7.98\ \mu\text{H}

Take the standard value 8.2 µH. The ripple becomes ΔI=2.39/(200k×8.2 μ)=1.46\Delta I = 2.39 / (200\text{k} \times 8.2\,\mu) = 1.46 A.

With C=100C = 100 µF of ceramic capacitance and an ESR of 5 mΩ, the output ripple has two parts:

ΔVC=ΔI8fswC=1.468×200k×100 μ=9.1 mV,ΔVESR=ΔI⋅RESR=7.3 mV\Delta V_C = \frac{\Delta I}{8 f_{sw} C} = \frac{1.46}{8 \times 200\text{k} \times 100\,\mu} = 9.1\ \text{mV}, \qquad \Delta V_{ESR} = \Delta I \cdot R_{ESR} = 7.3\ \text{mV}

The two are not in phase, so the total is below their sum of 16.4 mV.

The buck power stage in Voltecx: Vin 12 V, switch S1 and diode D1, L1 8.2 µH, C1 100 µF with 5 mΩ ESR, and the 0.66 Ω load, driven open loop at D = 0.275 by a 200 kHz PWM.

Two switching periods in steady state, simulated in Voltecx: inductor current i(L1), output voltage v(out) and switch node v(sw).

The simulation of this circuit gives a peak-to-peak inductor ripple of 1.46 A and an output ripple of 10.9 mV, between the 9.1 mV capacitive part and the 16.4 mV sum.

The plant: the LC double pole

In voltage mode, the control-to-output transfer function of a buck is

Gvd(s)=VinVM⋅1+sRESRC1+sLR+s2LCG_{vd}(s) = \frac{V_{in}}{V_M} \cdot \frac{1 + s R_{ESR} C}{1 + s\frac{L}{R} + s^2 LC}

where VMV_M is the PWM ramp amplitude. With VM=1V_M = 1 V the DC gain is 12 (21.6 dB). The double pole sits at

f0=12πLC=12π8.2 μH×100 μF=5.56 kHzf_0 = \frac{1}{2\pi\sqrt{LC}} = \frac{1}{2\pi\sqrt{8.2\,\mu\text{H} \times 100\,\mu\text{F}}} = 5.56\ \text{kHz}

and its quality factor at full load (R=0.66 ΩR = 0.66\ \Omega) is

Q=RCL=0.66×3.49=2.3Q = R\sqrt{\frac{C}{L}} = 0.66 \times 3.49 = 2.3

The ESR zero is at 1/(2πRESRC)=3181/(2\pi R_{ESR} C) = 318 kHz, above the switching frequency, so it gives no help. Above f0f_0 the plant phase heads to −180°.

Two facts follow. First, the gain peaks by QQ at f0f_0, which is +7.2 dB at full load. Second, QQ grows as the load gets lighter: at 0.5 A, R=6.6 ΩR = 6.6\ \Omega and only the inductor's DCR and the capacitor's ESR damp the resonance. With 10 mΩ of DCR and 5 mΩ of ESR, the series-loss limit is Q≈L/C/(RDCR+RESR)=0.286/0.015≈19Q \approx \sqrt{L/C}/(R_{DCR}+R_{ESR}) = 0.286/0.015 \approx 19. Plan for a light-load QQ near 10.

Bode plot of the duty-to-output transfer function $G_{vd}$ from Voltecx's design.voltageLoop, at 5 A (R = 0.66 Ω) and at 0.5 A (R = 6.6 Ω, load damping only), with the double pole at 5.56 kHz marked.

In the plot, the load alone leaves Q=23Q = 23 at 0.5 A. The series losses (Q≈19Q \approx 19) damp it in parallel, 1/(1/23+1/19)≈101/(1/23 + 1/19) \approx 10, which is the value to plan for.

Attempt 1: a PI in voltage mode

The feedback divider sets VoutV_{out} from a 0.8 V reference, so H=0.8/3.3=0.242H = 0.8/3.3 = 0.242. A PI is

Gc(s)=Kp+Kis=Kp(1+ωzs),ωz=KiKpG_c(s) = K_p + \frac{K_i}{s} = K_p\left(1 + \frac{\omega_z}{s}\right), \quad \omega_z = \frac{K_i}{K_p}

Below f0f_0 the plant is flat, so the loop is dominated by the integral term:

T(f)≈VinVMHKi2πf=2.91 Ki2πfT(f) \approx \frac{V_{in}}{V_M} H \frac{K_i}{2\pi f} = \frac{2.91\,K_i}{2\pi f}

The PI adds nothing to cancel the −180° of the double pole. At f0f_0 the loop phase is −90° (integrator) plus −90° (plant), so f0f_0 is where the gain margin is read. To keep the resonant peak 10 dB below 0 dB at the light-load Q=10Q = 10:

2.91 Ki2π×5560×10≤0.316  ⇒  Ki≤380 s−1\frac{2.91\,K_i}{2\pi \times 5560} \times 10 \le 0.316 \;\Rightarrow\; K_i \le 380\ \text{s}^{-1}

The crossover is then fc=2.91×380/2π=176f_c = 2.91 \times 380 / 2\pi = 176 Hz. That is stable, with a phase margin near 90°, but it is about a hundred times slower than the switching frequency allows. A 1 A to 5 A load step would droop for milliseconds.

This is the textbook reason why voltage-mode bucks use a Type III compensator. Its two zeros, placed near f0f_0, cancel the double pole's phase, and two poles (one at the ESR zero or at fsw/2f_{sw}/2, one to roll off noise) keep the high-frequency gain down. The crossover can then sit near fsw/10=20f_{sw}/10 = 20 kHz.

Attempt 2: a PI in peak-current mode

With an inner peak-current loop, the inductor behaves like a current source. To a first approximation the control-to-output transfer function becomes first order:

Gvc(s)≈RRi⋅1+sRESRC1+sRCG_{vc}(s) \approx \frac{R}{R_i} \cdot \frac{1 + s R_{ESR} C}{1 + s R C}

where RiR_i is the current-sense gain in V/A. Take Ri=0.25R_i = 0.25 V/A. At full load the pole is at

fp=12πRC=12π×0.66×100 μ=2.41 kHzf_p = \frac{1}{2\pi R C} = \frac{1}{2\pi \times 0.66 \times 100\,\mu} = 2.41\ \text{kHz}

Above fpf_p, the plant magnitude is 1/(2πRiCf)1/(2\pi R_i C f), which does not depend on the load. That is the property that makes current mode easy to compensate.

Target fc=20f_c = 20 kHz. The plant there is

∣Gvc∣=12π×0.25×100 μ×20 k=0.318|G_{vc}| = \frac{1}{2\pi \times 0.25 \times 100\,\mu \times 20\,\text{k}} = 0.318

Place the PI zero at the full-load pole, fz=2.41f_z = 2.41 kHz. Above the zero the PI gain is about KpK_p, so the crossover condition is

Kp×0.318×0.242=1  ⇒  Kp=13.0K_p \times 0.318 \times 0.242 = 1 \;\Rightarrow\; K_p = 13.0
Ki=Kp⋅2πfz=13.0×15 140=1.97×105 s−1K_i = K_p \cdot 2\pi f_z = 13.0 \times 15\,140 = 1.97 \times 10^5\ \text{s}^{-1}

The plant contributes −83° at 20 kHz and the PI −7°, so the idealised margin is 90°. The real margin is lower, because a current-mode buck also has a sampling double pole at fsw/2f_{sw}/2 (Ridley's model). With slope compensation that gives that pole a Q of about 0.64, it costs roughly 18° at fsw/10f_{sw}/10, which leaves about 72°. At light load the pole moves down to 241 Hz, but the gain above it is unchanged, so the crossover stays at 20 kHz and the zero simply sits above the pole.

Checks before you build

  • Crossover limit. Keep fcf_c at or below fsw/10f_{sw}/10 to stay clear of the sampling effects and of the switching ripple in the feedback path.
  • Corners. Check the margin at minimum and maximum input and at light and full load. A voltage-mode plant changes gain with VinV_{in}; feed-forward of the ramp removes that.
  • Digital delay. A digital controller adds about 1.5 sampling periods of delay. At 20 kHz crossover and 200 kHz sampling, that is 360°×20/200×1.5=54°360° \times 20/200 \times 1.5 = 54° of phase lag. A digital design needs a lower crossover or a faster sampling rate.
  • Measure the loop gain. The models above are averaged approximations. Confirm the margin by injecting a small signal into the switching circuit, as described in loop gain and phase margin in simulation.

The formulas follow R. W. Erickson and D. Maksimović, Fundamentals of Power Electronics, 3rd ed. (converter transfer functions, controller design and current-programmed control), and R. B. Ridley's current-mode model.

Try it in Voltecx

  • Open the buckClosedLoop example (File > Open Example), which holds 12 V from 48 V with a PI.
  • design.voltageLoop designs a voltage-mode compensator: a PI, Type II or Type III. It writes kp and ki into the PI block, or a tf block for Type II or III.
  • analysis.loopGain with "method": "perturbation" measures the loop gain on the switching circuit, delays included.
  • design.robustLoop designs the loop over every corner of input, load, inductor, capacitor, ESR and modulator delay, and says why when no design passes every corner.

The design equations in Voltecx are textbook equations for an ideal converter in continuous conduction, and the report prints the formula it used. Check the result with a simulation at every corner before you trust it.