# 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](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/01-install/)). 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

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

![The File menu open at Open Example, DC-DC, Buck converter, marked 1 to 4](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/01-open-example.png)

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

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](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/02-schematic.png)

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](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/02-schematic-full.png)

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

## 3. Run the simulation

Click `[▶ Run]` in the toolbar, or press `F5`.

![The Run button in the toolbar, marked 1](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/03-run.png)

1. `[▶ Run]`.

## 4. Read the result

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](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/04-result.png)

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

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](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/05-dock.png)

1. `[Keep as reference]`.

## 6. Select the inductor

Click `L1` on the schematic.

![L1 selected on the schematic and its Inductance field in Properties, marked 1 to 2](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/06-select-inductor.png)

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

## 7. Double the inductance

Click the field, type `200u` and press `Enter`.

![The Inductance field set to 200u, marked 1](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/07-change-value.png)

1. The `Inductance` field, now `200u`.

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

## 8. Run again and compare

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](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/first-buck/08-compare.png)

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

```sh
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](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/02-closed-loop-buck/).
