---
title: Switching power conversion
heading: Why linear regulators waste power, how an ideal switch processes power without loss, the duty cycle and the DC component of a switched waveform, and filtering the switching harmonics with an LC low-pass
eyebrow: S11 · Lesson 1 · Switching power conversion
xp: 50
---

::: hook
A phone charger the size of a matchbox converts 120 V AC to 5 V DC at 20 W and barely gets warm. A linear regulator doing the same job would have to burn off most of the power as heat. The difference is switching: a transistor that's either fully on (no voltage across it) or fully off (no current through it) dissipates almost nothing, and by switching it on and off fast and filtering the result, any average voltage can be produced. This course is about designing, modeling and controlling circuits built on that idea.
:::

::: play
- The voltage at the switch node of a buck converter: the input $V_g$ for a fraction D of each period and zero for the rest, at 100 kHz, with its spectrum.
- Its DC component is exactly $DV_g$. Everything else sits at the switching frequency and its harmonics.
- An LC low-pass filter with its corner well below the switching frequency passes the DC and strips the harmonics: that's the buck converter.
:::

```sim plot
view: spectrum
x: t = 0..0.00005 s
y: v = -2..14 V
slider: D = 0.05..0.95 = 0.275
slider: V = 5..24 = 12 V
plot: V*step(D - (t*100000 - floor(t*100000))) | label: switch node
samples: 1024
freq: f = 0..600k Hz
readout: DC component, V = D*V | digits: 3
readout: first harmonic amplitude, V = 2*V/pi*sin(pi*D) | digits: 3
```

::: predict
## A linear regulator drops 12 V to 3.3 V for a 2 A load. How efficient is it?

- [ ] About 95%
- [ ] About 70%
- [x] About 27%
- [ ] It depends on the load current

::: reveal
A linear regulator passes the full load current through a transistor with the difference in voltage across it, so its efficiency is at best $V_\text{out}/V_\text{in}$ = 3.3/12 = 27.5%, and it dissipates (12 − 3.3) × 2 = 17.4 W to deliver 6.6 W. A switching converter at 95% efficiency would lose 0.35 W.
:::
:::

::: nameit
## Why switch

A transistor dissipates $v \cdot i$. In a linear regulator both are large at once. As a switch, either v ≈ 0 (on) or i ≈ 0 (off), so an ideal switch processes power with no loss. Real switches lose a little in conduction and during the transitions (lesson 8); efficiencies of 90 to 99% are routine.

## The duty cycle

A switch that connects the input $V_g$ to a node for a fraction D of each period $T_s = 1/f_s$, and grounds it otherwise, produces a waveform whose average is

$$\langle v_s\rangle = DV_g$$

the **duty cycle** D controlling the output. The rest of the waveform is harmonics of $f_s$: its first harmonic has amplitude $\frac{2V_g}{\pi}\sin\pi D$.

## Filtering

An LC low-pass filter with corner $f_0 = 1/2\pi\sqrt{LC}$ passes the average and attenuates a harmonic at $f \gg f_0$ by about $(f_0/f)^2$. Ideal inductors and capacitors don't dissipate power, so the whole converter can in principle be lossless.

## The family

Rearranging the switch, inductor and capacitor gives converters that step voltage down (buck), up (boost), invert it (buck-boost) and more, with or without transformer isolation. Lessons 2 to 4 analyze them.
:::

::: example
## What duty cycle makes 3.3 V from 12 V, and how big is the switching ripple if the filter's corner is at 10 kHz and the converter switches at 200 kHz?

::: solution
1. **Duty cycle.**
   $$\begin{aligned} D &= \frac{3.3}{12} \\ &= 0.275 \end{aligned}$$
2. **First harmonic.** For a feel for the ripple, take D = 0.5. The first harmonic is then
   $$\begin{aligned} V_1 &= \frac{2 \times 12}{\pi} \\ &= 7.64\ \text{V} \end{aligned}$$
   at 200 kHz.
3. **Filter attenuation.** The LC filter attenuates it by
   $$\left(\frac{10\text{ kHz}}{200\text{ kHz}}\right)^2 = \frac{1}{400}$$
4. **Ripple left over.**
   $$\begin{aligned} \Delta v &\approx \frac{7.64\ \text{V}}{400} \\ &= 19\ \text{mV} \end{aligned}$$
   Higher harmonics are attenuated even more. Lesson 3 computes the ripple more precisely, from the inductor current's slopes.

**Answer:** D = 0.275, and the switching ripple is about 19 mV.
:::
:::

::: example
## A 6.6 W load is fed at 95% efficiency. How much power is lost, compared with the linear regulator?

::: solution
1. **Input power.**
   $$\begin{aligned} P_\text{in} &= \frac{6.6\ \text{W}}{0.95} \\ &= 6.95\ \text{W} \end{aligned}$$
2. **Power lost.**
   $$\begin{aligned} P_\text{loss} &= 6.95 - 6.6 \\ &= 0.35\ \text{W} \end{aligned}$$
3. **Compare with the linear regulator.** That's fifty times less than the linear regulator's 17.4 W: the difference between a small heat sink and none at all, or between a battery lasting an hour and three.

**Answer:** 0.35 W is lost, fifty times less than the linear regulator's 17.4 W.
:::
:::

::: example
## A server rack converts 48 V to 12 V at 96% efficiency, then 12 V to 1 V at 90%, delivering 100 W. How much power is lost, compared with a single 48 V to 1 V stage at 88%?

::: solution
1. **Two stages: efficiencies multiply.**
   $$\begin{aligned} \eta &= 0.96 \times 0.90 \\ &= 0.864 \end{aligned}$$
2. **Two-stage loss.**
   $$\begin{aligned} P_\text{in} &= \frac{100\ \text{W}}{0.864} \\ &= 115.7\ \text{W} \end{aligned}$$
   so 15.7 W is lost.
3. **Single-stage loss.** At 88%:
   $$\begin{aligned} P_\text{in} &= \frac{100\ \text{W}}{0.88} \\ &= 113.6\ \text{W} \end{aligned}$$
   so 13.6 W is lost.
4. **Compare.** Two good stages can lose more than one less efficient one, which is why direct 48 V-to-point-of-load converters became attractive in data centers.

**Answer:** the two-stage chain loses 15.7 W, more than the single 88% stage's 13.6 W.
:::
:::

::: check
given: a = 12 | 24 | 48; b = 1.8 | 3.3 | 5
answer: 100*b/a
unit: %
tolerance: 0.5%

## What's the best efficiency a linear regulator can have dropping {a} V to {b} V?

::: right
Right. $V_\text{out}/V_\text{in}$ = {answer}%.
:::

::: misses
- [100*(a - b)/a] That's the fraction it wastes.
- [any] Not yet. The full current flows at both voltages.
:::
:::

::: check
given: a = 12 | 24; b = 3.3 | 5; I = 0.5 | 2 | 5
answer: (a - b)*I
unit: W
tolerance: 0.5%

## A linear regulator drops {a} V to {b} V at {I} A. How much does it dissipate?

::: right
Right. $(V_\text{in} - V_\text{out})I$ = {answer} W.
:::

::: misses
- [a*I] That's the input power; subtract what the load takes.
- [any] Not yet. Voltage across the pass transistor times current.
:::
:::

::: check
given: D = 0.2 | 0.45 | 0.7; V = 5 | 12 | 48
answer: D*V
unit: V
tolerance: 0.5%

## A switch connects {V} V to a node for a fraction {D} of each period and grounds it the rest. What's the node's average voltage?

::: right
Right. $DV_g$ = {answer} V.
:::

::: misses
- [(1 - D)*V] The node is at $V_g$ for the fraction D.
- [any] Not yet. Average over one period.
:::
:::

::: check
given: P = 5 | 20 | 100; e = 0.85 | 0.92 | 0.97
answer: P*(1/e - 1)
unit: W
tolerance: 0.5%

## A converter delivers {P} W at {e} efficiency. How much does it lose?

::: right
Right. $P_\text{out}(1/\eta - 1)$ = {answer} W.
:::

::: misses
- [P*(1 - e)] Efficiency is output over input; the loss is input minus output.
- [any] Not yet. Input is $P_\text{out}/\eta$.
:::
:::

::: check
given: V = 5 | 12 | 48; D = 0.2 | 0.5 | 0.7
answer: 2*V/pi*sin(pi*D)
unit: V
tolerance: 0.5%

## A {V} V switch waveform has duty cycle {D}. What's the amplitude of its first harmonic?

::: right
Right. $\frac{2V_g}{\pi}\sin\pi D$ = {answer} V.
:::

::: misses
- [4*V/pi] That's a square wave swinging ±V; this one swings from 0 to V.
- [any] Not yet. Fourier-analyze a pulse train.
:::
:::

::: check
given: V = 12 | 48; f = 2 | 5 | 10; s = 100 | 250 | 500
answer: 2*V/pi*(f/s)^2*1000
unit: mV
tolerance: 0.5%

## A 50% duty {V} V switch waveform at {s} kHz drives an LC filter with its corner at {f} kHz. Estimate the fundamental ripple left at the output.

::: right
Right. $\frac{2V_g}{\pi}(f_0/f_s)^2$ = {answer} mV.
:::

::: misses
- [2*V/pi*(f/s)*1000] An LC filter falls at 40 dB per decade: square the frequency ratio.
- [any] Not yet. First harmonic times the filter's attenuation.
:::
:::

::: check
kind: parts
given: a = 0.94 | 0.97; b = 0.85 | 0.9 | 0.93; P = 50 | 200

## Two converters in cascade run at {a} and {b} efficiency, delivering {P} W.

::: part
answer: a*b*100
unit: %
tolerance: 0.5%

### What is the overall efficiency?

::: misses
- [(a + b)/2*100] Efficiencies multiply.
- [any] $\eta_1\eta_2$.
:::
:::

::: part
answer: P/(a*b) - P
unit: W
tolerance: 0.5%

### How much power is lost?

::: misses
- [any] Input minus output.
:::
:::
:::

::: check
kind: derivation
vars: V = 1..400, D = 0.05..0.95

## A switch node toggles between V and 0 with duty cycle D.

::: step
answer: D*V

### What is its average?
:::

::: step
answer: 2*V/pi*sin(pi*D)

### What is its fundamental's amplitude?
:::

::: step
answer: V*sqrt(D)

### What is its RMS value?
:::

::: right
Right. The filter keeps the average and has to remove the rest, most of it at the switching frequency.
:::
:::

::: explain
## Why can a switching converter in principle be 100% efficient when a linear regulator can't?

::: model
Power is dissipated in an element when it has voltage across it and current through it at the same time. A linear regulator controls its output by holding its pass transistor partway on, so the whole load current flows through it with the excess voltage across it, and that product is lost as heat. A switching converter only ever uses its transistor fully on, with almost no voltage, or fully off, with almost no current, so the product is near zero in both states. The energy is moved by inductors and capacitors, which store and release it without dissipating any, so an ideal switching converter loses nothing. Real ones lose a few percent in switch resistance, transitions and magnetic cores.
:::
:::

::: practice

::: check
given: a = 5 | 15 | 36; b = 1.2 | 2.5
answer: 100*b/a
unit: %
tolerance: 0.5%

## Linear regulator efficiency, {a} V to {b} V?

::: misses
- [any] $V_\text{out}/V_\text{in}$.
:::
:::

::: check
given: P = 2 | 60; e = 0.8 | 0.96
answer: P*(1/e - 1)
unit: W
tolerance: 0.5%

## Loss at {e} efficiency delivering {P} W?

::: misses
- [any] $P(1/\eta - 1)$.
:::
:::

::: check
given: V = 9 | 30; D = 0.3 | 0.6
answer: 2*V/pi*sin(pi*D)
unit: V
tolerance: 0.5%

## First harmonic of a {V} V, D = {D} pulse train?

::: misses
- [any] $\frac{2V}{\pi}\sin\pi D$.
:::
:::
:::
