This example shows how to model a switching power supply that converts a 30V DC supply into a regulated 15V DC supply. The model can be used to both size the inductance L and smoothing capacitor C, as well as to design the feedback controller. By selecting between continuous, discrete and fixed-point controllers, the impact of discretization and using limited numerical precision can be explored.
Modeling the switching devices as MOSFETs rather than ideal switches ensures that device on-resistances are correctly represented. The model also captures the switch-on/switch-off timing of the devices, this depending primarily on the gate capacitance values and the PWM driver output resistance.
If you have SimPowerSystems™, see example model power_switching_power_supply for an abstracted version of this model that uses ideal switching to give faster simulation times. The model here can be used to determine the on-resistance values required for the ideal switches, plus timing offsets if necessary. Using the ideal switching approach of SimPowerSystems™ can be used to simulate more complex power converters.
Workspace variables T_junction1 and T_junction2 are used to define the temperatures at which the two MOSFETs are simulated. Companion models elec_switching_power_supply_thermal and elec_switching_power_supply_thermal_only are used to determine these temperatures.