Free Trial
Free Trial
Power Electronics

Buck converter simulation step by step

Key Takeaways

  • Duty cycle sets the ideal output voltage, and the gap between the calculated value and the simulated one exposes switch and winding losses.
  • Inductor and capacitor values worked out before the build give you a ripple target to check the finished model against.
  • Solver time step and conduction mode decide how much the waveforms mean, so confirm both before trusting any efficiency or transient result.

Build a buck converter model in the right order and you’ll finish with a working step-down stage whose duty cycle, ripple and conduction behaviour you can defend.

A buck converter takes a higher DC input and produces a lower DC output by switching a transistor on and off quickly, then filtering with an inductor and a capacitor. Simulation suits it, because the interesting behaviour happens in microseconds at nodes awkward to probe safely. Data centres used 415 TWh of electricity in 2024, about 1.5% of global electricity consumption, and nearly all of it passes through step-down stages.

Discipline about setup separates a useful model from a pretty picture. Duty cycle, inductor value, switching frequency and solver settings all interact, and one wrong choice quietly alters what the other three appear to tell you. Build in a fixed order and verify one quantity per stage.

What a buck converter does and why duty cycle matters

A buck converter steps DC voltage down. Ideal output equals input voltage multiplied by duty cycle, so a 24 V input at 50% duty gives 12 V out. A switch, a freewheeling diode, an inductor and an output capacitor do the work, and duty cycle is your main control handle.

Picture a 12 V battery feeding a 5 V rail. Duty cycle lands near 0.42 in the ideal case and a little higher once the drop across the switch and the inductor’s winding resistance is counted. That small gap is the first genuinely useful thing a model gives you. It also shows what happens when the battery sags to 9 V and duty cycle climbs toward 0.58, where a controller near maximum duty loses regulation.

Sizing the inductor and capacitor before you build the model

Sizing the inductor and capacitor before you build the model

Pick the inductor from the ripple current you’re willing to accept, then the capacitor from the ripple voltage you can tolerate. A common starting point sets peak-to-peak inductor ripple at 30% of maximum output current. Both depend on switching frequency, so choose that first.

Take a 12 V to 5 V converter delivering 2 A at 200 kHz. A ripple target of 0.6 A puts the inductor near 24 µH, which rounds to a standard 22 µH part, and a 47 µF output capacitor holds ripple around 10 millivolts.

An inductor chosen too small pushes ripple high enough that the converter slips into discontinuous conduction at light load, and the simple duty cycle formula stops holding. Oversize it and the converter answers a load step sluggishly. Writing the target down first gives you something concrete to check against.

Building the buck power stage one component at a time

Assemble the circuit in the order power flows through it. Source, switch, freewheeling diode, inductor, output capacitor, load, and only then the measurements. That order keeps the schematic readable and makes a wiring mistake obvious the moment a waveform looks wrong. Work through this sequence.

  • Drop a DC voltage source and a controlled switch onto a blank model, set to 12 V.
  • Add the freewheeling diode from the return path to the switch node so inductor current always has a route.
  • Place the inductor between the switch node and the output node at your calculated 22 µH.
  • Connect the output capacitor and the load resistor in parallel across the output node.
  • Add current and voltage measurement blocks at the inductor and output, then wire both to a scope.

SPS supplies each of these as an editable library component, so the diode forward drop and the inductor series resistance stay visible as parameters you can open and read. When a student asks why the output settles at 4.87 V rather than 5 V, you point straight at the two numbers behind it.

“Writing the target down first gives you something concrete to check against.”

Setting up PWM gating and the solver for switching accuracy

Buck converter PWM comes from comparing a sawtooth carrier against a reference level. The carrier runs at your switching frequency and the comparator output opens and closes the switch. Set the carrier to 200 kHz, feed the comparator a constant 0.42 for open-loop testing, and you have a duty cycle you can adjust.

Solver settings matter as much as the gating does. A fixed-step solver at 1 µs cannot resolve a 5 µs switching period cleanly, so the applied duty cycle quantizes to the nearest step and the output lands somewhere you didn’t ask for. Allow at least 50 samples per switching period, which at 200 kHz means 100 ns or finer, and check that before doubting your component values.

Reading inductor current ripple against your design targets

Inductor current in a healthy buck converter is a triangle riding on a DC average. The average equals the load current and the peak-to-peak height is the ripple you sized the inductor for. Measuring both on the scope block confirms the power stage is wired and parameterized correctly.

Running the model at 2 A should show inductor current swinging between roughly 1.7 A and 2.3 A, centred on 2 A. A triangle centred elsewhere means the load resistor is wrong, and one much taller than 0.6 A means the inductance is too small.

The rising slope of that triangle equals inductor voltage during the on-time divided by inductance, so a slope that’s too steep points at a mismatch. Working backwards from waveform to component value is worth practising early, because harder converters ask the same of you.

Continuous versus discontinuous conduction in your simulation results

The main difference between continuous and discontinuous conduction is what happens at the bottom of the ripple triangle. Continuous conduction keeps inductor current above zero for the whole switching period. Discontinuous conduction lets current reach zero and rest there, and output voltage then depends on load current as well as duty cycle.

Reduce the load in the 2 A model to 200 mA and watch the triangle’s bottom flatten against zero. Output climbs above 5 V even though duty cycle hasn’t moved, which surprises most people the first time.

What you are checking Continuous conduction Discontinuous conduction
Inductor current waveform Current stays above zero all period. Current reaches zero and rests there.
Output voltage against duty cycle Output follows duty cycle times input. Output rises as load current falls.
Where you meet this mode Rated load with a properly sized inductor. Light load, standby, or an undersized inductor.
Switch node voltage appearance Two clean levels alternate every cycle. A third ringing level appears when current stops.
Response to a load step Recovery follows the filter response you predicted. Recovery shifts character as the mode flips.

Neither mode is a fault. Plenty of converters cross into discontinuous conduction at light load on purpose, since it cuts switching losses when there’s little current to deliver. Sweep load current down to a trickle and record where the handover sits, because a control loop tuned in one mode behaves differently in the other.

Testing efficiency and transient response on the finished model

Efficiency comes from dividing output power by input power once the model has settled. Transient response comes from stepping the load and watching how far output dips and how long recovery takes. Both tests reuse the model you already built.

Step the load from 2 A to 3 A at 5 ms and log the output. A dip of 150 millivolts recovering within 40 µs is a reasonable open-loop result for these filter values. Add conduction and switching losses to the switch and the diode, and efficiency falls from a theoretical 100% to the low nineties.

Step-down stages sit in front of an enormous amount of electrical work. Electric motor systems were responsible for 53% of global electricity consumption in 2023, and the drives running them carry buck stages for gate supplies and control rails. Efficiency figures are only as honest as the loss parameters you feed the model, so a forward voltage left at zero returns 99% every time.

Turning a working buck model into engineering understanding

A buck model earns its value through the questions it lets you answer afterwards. Raise the switching frequency and watch ripple and losses move in opposite directions. Halve the inductance and see the conduction mode flip at higher load. Each experiment takes a minute and teaches something a formula alone won’t.

Order matters more than the tool does. Students who calculate duty cycle, ripple and capacitor size before opening a model spot a wrong answer immediately, because they know what the waveform should look like. Those who build first and calculate afterwards believe whatever the scope shows.

SPS SOFTWARE suits that pattern, since every component model stays open and editable and the build runs inside MATLAB and Simulink alongside the scripts you’d use to sweep parameters. Start with the 12 V to 5 V converter described here, match the measured ripple to your hand calculation, then keep the file. The next converter you study begins from something you already trust.

“Those who build first and calculate afterwards believe whatever the scope shows.”

Cart Overview