PWMSim

Control

PI buck — 5 V regulation

A 12 V to 5 V buck with a sampled PI voltage controller.

Open and simulate
Press Run: the example simulates in your browser. Open and simulate takes it to the full app, where you can change it.

Try this

Change the voltage reference from 5 V to 4 V and compare regulation. Then press Run again.