# Worked example: a 12 V to 24 V boost converter

The `boost` example steps 12 V up to 24 V at a duty cycle of 0.5 and 50 kHz, into a 24 Ω load (1 A). By hand, the inductor carries 2 A with a 0.60 A ripple and the output ripple is 45.5 mV. A 60 ms run gives 23.99 V, 2.00 A, 0.60 A and 45 mV. The default 10 ms run ends at 23.89 V because the boost's LC resonance is lightly damped and still ringing.

## Open it

In the app: **File › Open Example › DC-DC › Boost converter**, then press **F5**. From the command line, with the longer run:

```sh
powercraft-cli run --cmd file.openExample --params '{"name": "boost"}' \
  --cmd simulation.settings --params '{"tEnd": 0.06}' \
  --cmd simulation.run \
  --cmd scope.measure --params '{"signals": ["v(out)", "i(L1)"], "t0": 0.0599, "t1": 0.06}'
```

![The boost example: a 12 V source, L1 = 200 µH, switch S1 to ground, diode D1, C1 = 220 µF and a 24 Ω load, with a constant duty of 0.5 driving a 50 kHz PWM.](https://voltecx-web.nguyenvanqui291.workers.dev/media/worked-examples/boost-converter-12v-to-24v/schematic.svg)

| Part | Value |
| --- | --- |
| Input $V_{in}$ | 12 V |
| Duty cycle $D$ | 0.5 (open loop) |
| Switching frequency $f_{sw}$ | 50 kHz |
| Inductor $L_1$ | 200 µH, starts at 2 A |
| Output capacitor $C_1$ | 220 µF, starts at 24 V |
| Load $R_1$ | 24 Ω |

## The hand calculation

In continuous conduction the inductor's volt-seconds balance over a period, which gives

$$V_{out} = \frac{V_{in}}{1 - D} = \frac{12}{0.5} = 24\ \text{V}, \qquad I_L = \frac{I_{out}}{1 - D} = \frac{1\ \text{A}}{0.5} = 2\ \text{A}$$

While the switch is on, the full input is across the inductor:

$$\Delta I = \frac{V_{in}\,D}{f_{sw}\,L} = \frac{12 \times 0.5}{50\ \text{kHz} \times 200\ \mu\text{H}} = 0.60\ \text{A}$$

While the switch is on the diode is off, and the capacitor alone feeds the load:

$$\Delta V = \frac{I_{out}\,D}{f_{sw}\,C} = \frac{1 \times 0.5}{50\ \text{kHz} \times 220\ \mu\text{F}} = 45.5\ \text{mV}$$

## Why the default run has not settled

To the duty cycle, a boost looks like an LC filter whose inductance is $L/(1-D)^2 = 800$ µH. With 220 µF and 24 Ω:

$$f_0 = \frac{1}{2\pi\sqrt{800\ \mu\text{H} \times 220\ \mu\text{F}}} = 379\ \text{Hz}, \qquad Q = R\sqrt{\frac{C}{L/(1-D)^2}} = 12.6$$

A resonance with Q = 12.6 decays with a time constant of $2Q/(2\pi f_0) \approx 10.6$ ms. The capacitor and the inductor start at their average values, but the first switching period still disturbs them, and the ring that follows lasts tens of milliseconds. After the default 10 ms the output still reads 23.89 V; after 60 ms it has settled.

![The output over a 60 ms run: the ring at 379 Hz dies out over tens of milliseconds and v(out) settles at 24 V.](https://voltecx-web.nguyenvanqui291.workers.dev/media/worked-examples/boost-converter-12v-to-24v/settling.svg)

## The run

| Quantity | Hand | Run |
| --- | --- | --- |
| Output after the default 10 ms | — | 23.89 V |
| Output after 60 ms (last five periods) | 24 V | 23.99 V |
| Mean inductor current | 2 A | 2.00 A |
| Inductor ripple (peak to peak) | 0.60 A | 0.60 A |
| Output ripple | 45.5 mV | 45 mV |

![Three periods at the end of the 60 ms run: the switch node v(sw) toggling between 0 V and 24 V, the inductor current i(L1) as a 0.60 A triangle around 2 A, and v(out) with its 45 mV ripple.](https://voltecx-web.nguyenvanqui291.workers.dev/media/worked-examples/boost-converter-12v-to-24v/steady-state.svg)

## Try next

- Close the loop with the `boostClosedLoop` example. A boost's loop is limited by its right-half-plane zero; [the boost design article](https://voltecx-web.nguyenvanqui291.workers.dev/blog/boost-converter-design-rhp-zero) explains why.
- Raise D to 0.6: $V_{out}$ = 30 V, $I_L$ = 2.5 A, and the resonance moves to $f_0 \propto (1 - D)$.
- Compare with the [buck worked example](https://voltecx-web.nguyenvanqui291.workers.dev/worked-examples/buck-converter-48v-to-12v), which settles in a few milliseconds because its Q is 1.

Every number on this page comes from a run that a test repeats (`auto::tests_worked_examples`), so the page changes when the simulator does.
