The problem
An electric two-wheeler or three-wheeler needs several low-voltage rails for lights, horn, controller logic, displays and USB chargers, usually derived from the traction battery by DC–DC converters. Sizing the inductor and capacitor and closing the voltage loop are basic skills for any EV power-electronics engineer, and simulation shows how each choice affects ripple and stability.
Objectives
- Size the inductor, capacitor and switching frequency of a buck and a boost converter.
- Build switching models in Simscape Electrical.
- Verify steady-state ripple against design equations.
- Design voltage-mode control and test load and line steps.
- Estimate losses and efficiency.
What you need
Tools and toolboxes
- Simulink — PWM generation, controllers, scripted sweeps and logging.
- Simscape Electrical — MOSFET, diode, inductor, capacitor, sources and loads.
- Control System Toolbox — Optional: bode and margin on the averaged converter model for loop design.
Software
- MATLAB R2023b or later
- Simulink
- Simscape Electrical
Extra parts and data
None beyond the software above.
Key concepts
- Buck converter ratio
- In continuous conduction Vo = D·Vin, so a 48 V to 12 V buck runs near D = 0.25 before losses.
- Boost converter ratio
- In continuous conduction Vo = Vin/(1 − D), so 12 V to 24 V needs D = 0.5.
- Inductor ripple
- For a buck, ΔIL = (Vin − Vo)·D/(L·fs); the inductor is usually sized so ripple is 20 to 40 per cent of rated current.
- Right-half-plane zero
- A boost converter's control-to-output response has a right-half-plane zero that limits the achievable voltage loop bandwidth.
Step-by-step guide
- 1
Write the specifications
Set labelled example specs. Buck: 48 V input (range 40–54 V across the battery's state of charge), 12 V output, 10 A, 100 kHz, output ripple below 1 per cent. Boost: 12 V input, 24 V output, 2 A, 100 kHz. Note also the load-step requirement, for example 2 to 10 A, with output deviation under 5 per cent and recovery within 1 ms.
Checkpoint: A spec table covering input range, output, current, frequency, ripple and transient limits.
- 2
Size the components
In a MATLAB script, compute duty cycle, inductance for 30 per cent ripple at the worst-case input, and output capacitance from ΔVo = ΔIL/(8·fs·C) for the buck. For the boost compute L from ΔIL = Vin·D/(L·fs) and C from ΔVo = Io·D/(fs·C). Choose standard values and include the capacitor ESR ripple contribution. Check also that the inductor will not saturate at peak current, using the rated saturation current of a candidate part.
Checkpoint: Script prints chosen L and C and predicted ripple values meeting the spec.
- 3
Build the buck switching model
In Simulink, build the buck with Simscape Electrical MOSFET, Diode, Inductor (with series resistance), Capacitor (with ESR) and a resistive load, fed by a DC Voltage Source. Generate PWM from a comparator against a sawtooth or with a PWM Generator block and convert to a physical gate signal. Use a local solver with a fixed step of 50 ns, or ode23t with a small maximum step.
Checkpoint: Open-loop at the computed duty, output settles near 12 V and inductor current ripple matches the design within 10 per cent.
- 4
Build the boost switching model
Build the boost the same way and run it open loop at D = 0.5 with the rated load. Check inductor current ripple and output voltage ripple against the calculations. Reduce the load until the inductor current touches zero to find the boundary of discontinuous conduction and compare with the theoretical boundary. Note the difference between ideal and measured output voltage, which comes from losses in the switch, diode and inductor resistance.
Checkpoint: Output near 24 V at rated load and a measured DCM boundary close to the calculated one.
- 5
Build averaged models
Build state-space averaged models of both converters, either from equations in Simulink or linearised in MATLAB with tf, to use for control design. Compare the averaged and switching responses to a duty step. The averaged model should track the mean of the switching waveform. The averaged model runs hundreds of times faster, so it is the right tool for control design and parameter sweeps, while the switching model remains the reference for ripple and stresses.
Checkpoint: Averaged and switching responses overlap in Simulation Data Inspector apart from ripple.
- 6
Design voltage-mode control
Design a PI or Type II compensator for the buck to give a crossover around one tenth of the switching frequency and at least 45 degrees of phase margin. For the boost, keep crossover well below the right-half-plane zero frequency, which depends on load and duty. Implement the compensator in Simulink with a duty limit and anti-windup. Check the margins at light and full load, because the plant changes with load.
Checkpoint: Loop margins from bode or hand calculation meet the targets for both converters.
- 7
Test load and line steps
Apply load steps (2 to 10 A for the buck, 0.5 to 2 A for the boost) and input steps (40 to 54 V for the buck) and log output voltage, inductor current and duty. Measure undershoot, overshoot and recovery time. Script all tests with sim() so they can be rerun after any change. Overlay each response on the averaged-model prediction to show how well it predicts the switching behaviour.
Checkpoint: All steps meet the deviation and recovery limits in the spec, or the shortfall is explained.
- 8
Estimate losses and report
Estimate MOSFET conduction loss from Rds(on), switching loss from rise and fall times or switching energy, diode loss from forward voltage and inductor copper loss from its resistance, using example datasheet values. Compute efficiency at several loads. Write up specs, sizing, verification, control design, test results and efficiency, with limits such as ideal gate drive and no layout parasitics. Include the component sizing script as an appendix.
Checkpoint: An efficiency-versus-load plot and a complete report reproducible from scripts.
Testing & validation
- Ripple matches design equations within 10 per cent.
- DCM boundary of the boost matches theory.
- Averaged models match switching models on mean values.
- Loop margins meet targets.
- Load- and line-step responses meet the spec.
Expected results
Two sized and verified DC–DC converters for EV auxiliary rails with closed-loop control, measured transient response and an efficiency estimate, all traceable to the design equations.
Take it further
- Replace the diode with a synchronous MOSFET and compare efficiency.
- Add peak current-mode control and compare transient response.
- Design an input filter and check it does not destabilise the converter.
- Use battery voltage from a scooter drive-cycle simulation as the input.
Viva and review questions
Why size the buck inductor at maximum input voltage?
Ripple ΔIL = (Vin − Vo)·D/(L·fs) is largest at the highest input voltage, so sizing there guarantees the ripple limit across the range.
Why is boost control bandwidth limited?
The boost has a right-half-plane zero in its control-to-output response, which adds phase lag and limits stable crossover to well below that zero frequency.
What happens in discontinuous conduction?
Inductor current falls to zero each cycle, so the voltage ratio depends on load as well as duty, and the converter dynamics change.
Learn it at DIYguru
These DIYguru courses and programmes teach what this project needs.
