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
Documentation

Getting started: your first buck converter in 10 minutes

You open a 48 V to 12 V buck converter, simulate it, read the output on the scope, change the inductor and compare the two runs. You need Voltecx installed (manual, chapter 1). Nothing else.

How to read the pictures: a red box with a number marks what you click, in that order. A grey chip such as ▶ Run is a button, File › Open Example is a menu path, and F5 is a key.

1. Open the buck example

Step 1 of 8 · about 1 min

Choose File › Open Example › DC-DC › Buck converter, textbook.

The File menu open at Open Example, DC-DC, Buck converter, marked 1 to 4

  1. File.
  2. Open Example.
  3. DC-DC.
  4. Buck converter, textbook: the buck with an ideal switch and diode, whose numbers match the hand formulas (the Buck converter example carries the losses of real parts).

Result: a new tab named buckIdeal opens with the circuit.

2. Read the circuit

Step 2 of 8 · about 1 min

The power stage is drawn at the bottom and the control at the top.

The buck schematic with its six main parts, marked 1 to 6

  1. Vin: the 48 V input.
  2. S1: the switch.
  3. L1: the 100 µH inductor.
  4. C1: the 100 µF output capacitor.
  5. R1: the 2.4 Ω load, which draws 5 A at 12 V.
  6. PWM: turns the switch on and off at 100 kHz. Its duty (D = 0.25) comes from the Duty block.

This is the whole window. The library is on the left, the schematic in the middle, Properties on the right and the scope at the bottom. The switch at the top of the library shows Symbols, the generic parts this lesson uses, or Parts, the real parts with their data-sheet ratings in tables.

The whole Voltecx window with the buck example open, marked 1 to 6

  1. Vin.
  2. S1.
  3. L1.
  4. C1.
  5. R1.
  6. PWM.

3. Run the simulation

Step 3 of 8 · about 1 min

Click ▶ Run in the toolbar, or press F5.

The Run button in the toolbar, marked 1

  1. ▶ Run.

4. Read the result

Step 4 of 8 · about 1 min

The scope opens in the panel under the schematic when the run ends.

The scope in the panel with v(VOUT) and i(L1) after the first run, marked 1 to 2

  1. v(VOUT) is ticked in the signal list. The output starts at 12 V, because the example pre-charges C1 to 12 V, dips to about 8.6 V while the inductor current builds up, rings and settles at 12 V.
  2. Keep as reference keeps this run on the plot for the next step.

Result: the Measurements table shows v(VOUT) near 12 V and the inductor current i(L1) near 5 A. After the start-up (from 3 ms on), the output averages 12.0 V and the inductor current swings about 0.9 A peak to peak.

5. Keep this run

Step 5 of 8 · about 1 min

Click Keep as reference. The run stays on the plot as Ref 1 while you change the circuit and run it again.

Keep as reference in the scope's toolbar, marked 1

  1. Keep as reference.

6. Select the inductor

Step 6 of 8 · about 1 min

Click L1 on the schematic.

L1 selected on the schematic and its Inductance field in Properties, marked 1 to 2

  1. L1 is selected.
  2. Properties shows its Inductance: 100u (100 µH).

7. Double the inductance

Step 7 of 8 · about 1 min

Click the field, type 200u and press Enter.

The Inductance field set to 200u, marked 1

  1. The Inductance field, now 200u.

Result: L1 now shows 200 µH. Every edit is one undo step (⌘Z).

8. Run again and compare

Step 8 of 8 · about 1 min

Press F5. The scope shows both runs.

The second run over the reference: the inductor current ripple is half as large, marked 1 to 2

  1. i(L1) · Ref 1: the first run, kept as reference Ref 1 and drawn dashed in a colour of its own.
  2. i(L1): the new run. Its band is about half as wide: the ripple fell from 0.9 A to about 0.45 A.

Result: twice the inductance gives half the ripple, as ΔI = (Vin − Vout)·D / (L·fsw) says. The output still averages 12 V, but it rings more slowly at start-up. Runs shows one card per run, titled with what changed (L1 100 µH → 200 µH).

The same steps from a script

powercraft-cli run \
    --cmd file.openExample --params '{"name":"buckIdeal"}' \
    --cmd simulation.run   --params '{}' \
    --cmd circuit.setParam --params '{"component":"L1","key":"l","value":"200u"}' \
    --cmd simulation.run   --params '{}' \
    --cmd scope.measure    --params '{"signals":["v(out)","i(L1)"],"t0":"3m"}'

Next: close the loop with a compensator.