---
title: Designing the voltage-mode controller
heading: Choosing the crossover frequency, type II and type III compensators built around an error amplifier, placing their zeros at the LC resonance and their poles near half the switching frequency, and a complete design for a voltage-mode buck
eyebrow: S11 · Lesson 18 · Designing the voltage-mode controller
xp: 50
---

::: hook
A voltage-mode buck with ceramic capacitors is a hard plant: a lightly damped LC resonance swings its phase from 0° to nearly −180°, and with no ESR zero nothing brings it back. Any crossover above the resonance meets almost −180° of plant phase, so the compensator must supply phase lead on top of the integrator's −90°. The standard answer is the type III compensator: an integrator, two zeros near the resonance to cancel it, and two poles at high frequency to roll off noise. This lesson designs one.
:::

::: play
- The loop gain of the 12 V to 3.3 V buck (L = 10 µH, C = 22 µF ceramic, a 1.65 Ω load, a 1 V PWM ramp and 0.8 V reference) with a type III compensator: integrator gain $\omega_I$, a double zero at $f_z$ and a double pole at $f_p$.
- The defaults cross over at 50 kHz, a tenth of the 500 kHz switching frequency, with 54° of phase margin.
- Move the zeros above the resonance and watch the phase margin collapse; lower $\omega_I$ and the crossover drops.
:::

```sim plot
view: bode
x: f = 100..1M Hz log
slider: w = 5000..300000 = 58300 log
slider: z = 2..40 = 8 kHz log
slider: p = 50..1000 = 250 kHz log
H: 2.909/(1 - (f/10730)^2 + j*f/(10730*2.447))*w/(j*2*pi*f)*(1 + j*f/(z*1000))^2/(1 + j*f/(p*1000))^2
marker: x = 10730 | label: LC resonance
marker: x = 50000 | label: target crossover
```

::: predict
## The buck's plant has −175° of phase at 50 kHz. A type III compensator with an integrator, two zeros at 8 kHz and two poles at 250 kHz adds how much phase there?

- [ ] −90°, just the integrator
- [ ] +90°
- [x] About +49°
- [ ] About +156°

::: reveal
−90° from the integrator, $+2\tan^{-1}(50/8)$ = +161.8° from the zeros and $-2\tan^{-1}(50/250)$ = −22.6° from the poles: +49.2° in all. The loop phase is −175° + 49° = −126°, a 54° phase margin.
:::
:::

::: nameit
## Choosing the crossover

The averaged model is only valid well below $f_s$, and the PWM adds delay, so crossover is usually placed at $f_s/10$ to $f_s/5$. A boost or buck-boost must also stay well below its RHP zero (a fifth of it or less).

## Compensator types (built around an op-amp error amplifier)

- **Type I:** an integrator, $\omega_I/s$. Enough only for very slow loops.
- **Type II:** integrator plus one zero and one pole, $\frac{\omega_I}{s}\frac{1 + s/\omega_z}{1 + s/\omega_p}$, giving up to nearly 90° of boost. Suits plants that look first-order near crossover: current-mode control (lesson 23) or capacitors with a low ESR zero.
- **Type III:** integrator plus two zeros and two poles, up to nearly 180° of boost. Needed for voltage-mode control with ceramic capacitors.

## Type III placement

1. Put the two zeros at or a little below the LC resonance $f_0$, to cancel its −180°.
2. Put the two poles near $f_s/2$ (or at the ESR zero), to attenuate switching noise.
3. Choose $\omega_I$ so $|T| = 1$ at the target crossover.
4. Check the phase margin (aim for 45 to 60°) and the gain margin, and simulate a load step.

The phase margin at crossover is $180° + \angle G_{vd}H/V_M + \angle G_c$.
:::

::: example
## Complete the type III design for the buck.

::: solution
1. **The plant.** $G_{vd}H/V_M$ has a DC gain of
   $$\begin{aligned} G_0 &= 12 \times 0.2424/1 \\ &= 2.91 \end{aligned}$$
   with its resonance at 10.73 kHz and Q = 2.45.
2. **Integrator gain.** With zeros at 8 kHz and poles at 250 kHz, making |T| = 1 at 50 kHz takes
   $$\omega_I = 58\,300\ \text{rad/s}$$
3. **Margins.** The loop crosses at exactly 50 kHz with a 54.5° phase margin, and its phase reaches −180° at 238 kHz, where the gain margin is 19.4 dB.
4. **Step response.** The closed-loop reference step overshoots 16% and settles within 2% in 85 µs.

**Answer:** $\omega_I$ = 58,300 rad/s gives a 50 kHz crossover with 54.5° of phase margin and 19.4 dB of gain margin; a reference step overshoots 16% and settles in 85 µs.
:::
:::

::: example
## Why not put the zeros exactly on the resonance?

::: solution
1. **What happens at the resonance.** The plant phase is changing fastest there, and its Q depends on the load, which varies.
2. **Placing the zeros a little below.** That keeps their phase boost fully developed by the crossover and tolerates resonance shifts, at the cost of a small gain bump.
3. **The numbers here.** With zeros at 10.7 kHz instead of 8 kHz, the phase margin falls to 48°.

**Answer:** zeros a little below the resonance keep their phase boost fully developed at crossover and tolerate a shifting resonance; zeros on the resonance would cut the margin here to 48°.
:::
:::

::: example
## A current-mode buck looks like a single pole near its 30 kHz target crossover. A type II compensator puts its zero at 6 kHz and its pole at 150 kHz. How much phase does it give back at crossover?

::: solution
1. **The integrator.** It costs 90°.
2. **The zero–pole pair.**
   $$\begin{aligned} \phi &= \tan^{-1}(30/6) \\ &\quad - \tan^{-1}(30/150) \\ &= 78.7° - 11.3° \\ &= 67.4° \end{aligned}$$
3. **Why that's the most it can give.** 30 kHz is the geometric mean of 6 and 150 kHz, so this is the pair's maximum:
   $$\sin^{-1}\frac{150 - 6}{150 + 6} = 67.4°$$
4. **The margin.** With the plant's own −90° from its pole, the loop keeps a margin near 67°, which is why current mode rarely needs type III.

**Answer:** the pair gives back 67.4°, leaving a phase margin near 67°.
:::
:::

::: check
given: z = 3 | 8 | 15; p = 150 | 300; c = 30 | 60
answer: -90 + 2*atan(c/z)*180/pi - 2*atan(c/p)*180/pi
unit: °
tolerance: 0.5%

## A type III compensator has an integrator, two zeros at {z} kHz and two poles at {p} kHz. What phase does it contribute at {c} kHz?

::: right
Right. $-90° + 2\tan^{-1}(f/f_z) - 2\tan^{-1}(f/f_p)$ = {answer}°.
:::

::: misses
- [2*atan(c/z)*180/pi - 2*atan(c/p)*180/pi] Include the integrator's −90°.
- [any] Not yet. Add each factor's phase.
:::
:::

::: check
given: r = 2 | 4 | 8; Q = 1 | 2.5 | 5
answer: -180 + atan((r/Q)/(r^2 - 1))*180/pi
unit: °
tolerance: 0.5%

## A second-order plant $1/(1 + s/Q\omega_0 + s^2/\omega_0^2)$ with Q = {Q}. What's its phase at {r} times $f_0$?

::: right
Right. $-180° + \tan^{-1}\frac{r/Q}{r^2 - 1}$ = {answer}°.
:::

::: misses
- [-atan((r/Q)/(r^2 - 1))*180/pi] Above resonance the denominator's real part is negative: the phase is near −180°.
- [any] Not yet. The angle of $1 - r^2 + jr/Q$.
:::
:::

::: check
given: g = 2 | 3 | 5; c = 20 | 50 | 100
answer: 2*pi*c*1000/g
unit: rad/s
tolerance: 0.5%

## A plant's magnitude is {g} (flat) near the crossover, and the compensator is a pure integrator $\omega_I/s$. What $\omega_I$ puts the crossover at {c} kHz?

::: right
Right. $|T| = g\omega_I/\omega_c = 1$, so $\omega_I = 2\pi f_c/g$ = {answer} rad/s.
:::

::: misses
- [c*1000/g] Use the angular frequency, $2\pi f_c$.
- [any] Not yet. Solve $g\omega_I/(2\pi f_c) = 1$.
:::
:::

::: check
given: P = -175 | -160 | -140; C = 20 | 45 | 70
answer: 180 + P + C
unit: °
tolerance: 0.5%

## At crossover the plant's phase is {P}° and the compensator adds {C}°. What's the phase margin?

::: right
Right. 180° + {P}° + {C}° = {answer}°.
:::

::: misses
- [any] Not yet. PM = 180° + total phase at crossover.
:::
:::

::: check
given: D = 0.4 | 0.6 | 0.75; L = 22 | 68; R = 10 | 40
answer: (1 - D)^2*R/(2*pi*L*1e-6)/5/1000
unit: kHz
tolerance: 0.5%

## A boost at D = {D} with L = {L} µH feeds {R} Ω. By the one-fifth rule, how high may its crossover be set?

::: right
Right. A fifth of the RHP zero $D'^2R/2\pi L$: {answer} kHz.
:::

::: misses
- [(1 - D)^2*R/(2*pi*L*1e-6)/1000] That's the zero itself; stay well below it.
- [any] Not yet. Find the RHP zero, then take a fifth.
:::
:::

::: check
given: z = 2 | 5; p = 50 | 200
answer: asin((p - z)/(p + z))*180/pi
unit: °
tolerance: 0.5%

## A type II compensator's zero is at {z} kHz and its pole at {p} kHz. What's the most phase boost its zero–pole pair gives?

::: right
Right. $\sin^{-1}\frac{f_p - f_z}{f_p + f_z}$ = {answer}°, at $\sqrt{f_zf_p}$.
:::

::: misses
- [any] Not yet. A lead with $\alpha = f_p/f_z$.
:::
:::

::: check
kind: parts
given: z = 2 | 5 | 10; p = 50 | 100 | 200; f = 10 | 20 | 40

## A type II compensator has its zero at {z} kHz and its pole at {p} kHz.

::: part
answer: (atan(f/z) - atan(f/p))*180/pi
unit: °
tolerance: 0.5%

### How much phase does the zero–pole pair add at {f} kHz?

::: misses
- [any] $\tan^{-1}(f/f_z) - \tan^{-1}(f/f_p)$.
:::
:::

::: part
answer: sqrt(z*p)
unit: kHz
tolerance: 0.5%

### At what frequency is that boost largest?

::: misses
- [any] The geometric mean.
:::
:::
:::

::: check
kind: derivation
vars: z = 100..100000, p = 1000..10000000

## A zero at z and a pole at p (p > z) in a compensator.

::: step
answer: sqrt(z*p)

### Where is their phase boost largest?
:::

::: step
answer: asin((p - z)/(p + z))*180/pi

### How large is it, in degrees?
:::

::: right
Right. The farther apart they are, the more phase, at the cost of more high-frequency gain.
:::
:::

::: explain
## Why does a voltage-mode buck with ceramic output capacitors need a type III compensator?

::: model
Above the output filter's resonance the buck's control-to-output phase approaches −180°, and with ceramic capacitors there's no ESR zero within reach to pull it back. The integrator that gives the loop its high low-frequency gain costs another −90°, so near a crossover set above the resonance the loop would sit at about −270° without help. A type II compensator's single zero recovers at most 90°, which isn't enough. A type III's pair of zeros, placed at the resonance, adds up to 180° and cancels the filter's phase drop, leaving the integrator's slope through crossover with healthy phase margin; its two high-frequency poles then roll the gain off again so switching noise isn't amplified.
:::
:::

::: practice

::: check
given: z = 4 | 12; p = 120 | 400; c = 25 | 80
answer: -90 + 2*atan(c/z)*180/pi - 2*atan(c/p)*180/pi
unit: °
tolerance: 0.5%

## Type III phase at {c} kHz: zeros {z} kHz, poles {p} kHz?

::: misses
- [any] $-90 + 2\tan^{-1}(f/f_z) - 2\tan^{-1}(f/f_p)$.
:::
:::

::: check
given: P = -170 | -150; C = 30 | 60
answer: 180 + P + C
unit: °
tolerance: 0.5%

## Phase margin: plant {P}°, compensator {C}°?

::: misses
- [any] 180 + plant + compensator.
:::
:::

::: check
given: D = 0.5 | 0.8; L = 10 | 47; R = 5 | 25
answer: (1 - D)^2*R/(2*pi*L*1e-6)/5/1000
unit: kHz
tolerance: 0.5%

## Boost crossover limit (one fifth of the RHP zero): D = {D}, L = {L} µH, R = {R} Ω?

::: misses
- [any] $D'^2R/(10\pi L)$.
:::
:::
:::
