Run this example
The browser version is coming soon. Until then, open this example in the desktop app. Download Voltecx
The buckIdeal example (the textbook buck: an ideal switch and diode) steps 48 V down to 12 V at a fixed duty cycle of 0.25 and 100 kHz, into a 2.4 Ω load (5 A). By hand, the output is 12 V, the inductor ripple 0.90 A and the output ripple 11.25 mV. The run gives 11.99 V, 0.90 A and 11.2 mV.
Open it
In the app: File › Open Example › DC-DC › Buck converter, textbook, then press F5. From the command line:
powercraft-cli run --cmd file.openExample --params '{"name": "buckIdeal"}' \
--cmd simulation.run \
--cmd scope.measure --params '{"signals": ["v(out)", "i(L1)"], "t0": 0.0039, "t1": 0.004}'
| Part | Value |
|---|---|
| Input | 48 V |
| Duty cycle | 0.25 (open loop) |
| Switching frequency | 100 kHz |
| Inductor | 100 µH |
| Output capacitor | 100 µF, starts at 12 V |
| Load | 2.4 Ω |
The hand calculation
In continuous conduction the switch node is for a fraction of each period and 0 V for the rest, and the inductor passes its average:
While the switch is on, across the inductor ramps its current up by
The capacitor takes the triangular part of that current. The charge in one half of the triangle gives the output ripple:
The run
The example runs for 4 ms. The capacitor starts at 12 V, so the start-up is short. Measure the last ten periods (3.9 to 4.0 ms):
| Quantity | Hand | Run |
|---|---|---|
| Mean output voltage | 12 V | 11.99 V |
| Mean inductor current | 5 A | 5.00 A |
| Inductor ripple (peak to peak) | 0.90 A | 0.90 A |
| Output ripple (last two periods) | 11.25 mV | 11.2 mV |
The output sits 6 mV under 12 V: the switch and the diode each have 1 mΩ of on-resistance, and the formula has none. Over ten periods the output ripple reads about 0.4 mV more than over two, because the slow tail of the LC start-up is still in the window.
Try next
- Change
Din the circuit variables to 0.5 and check V. - Halve L1 to 50 µH: the inductor ripple doubles to 1.8 A and the output ripple to about 22 mV.
- Raise R1 until the current triangle touches zero. Past that point the buck runs in discontinuous conduction and no longer holds.
- Close the loop: the closed-loop buck holds 12 V with a PI controller.
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.