This article shows a MATLAB simulation of a DC-DC converter that turns a -12V DC input into a +48V DC output. The video below shows the simulation running, and the model file is available for download further down the page.
Simulation parameters
The simulation uses these settings:
- PWM frequency: 32 kHz
- Duty ratio: 80%
- Input voltage: -12V DC
- Output voltage: +48V DC
Why a negative-to-positive converter is needed
Some systems only have a negative supply rail, or a supply that is negative with respect to the circuit ground. If part of your hardware needs a positive rail at a higher level, you need a converter that flips the polarity and raises the magnitude at the same time. If you are unsure what a negative voltage means, remember that it is simply a potential below the reference point you chose as ground.
How the conversion works
A standard boost converter keeps the polarity of its input. Feed it -12V and the output would stay negative. To get a positive output from a negative input, the circuit needs an inverting arrangement, such as the inverting buck-boost topology. This type of converter uses the same basic parts as a boost converter:
- a switch (a MOSFET or IGBT) driven by a PWM signal
- an inductor that stores energy while the switch is on
- a diode that lets that energy flow to the output when the switch turns off
- an output capacitor that smooths the voltage across the load
The parts are connected so the output polarity is opposite to the input. With a negative input, that gives a positive output.
Switch on and switch off
When the switch is on, current rises in the inductor and energy builds up in its magnetic field. The diode is reverse biased, so the output capacitor alone supplies the load.
When the switch turns off, the inductor current keeps flowing. It now passes through the diode into the capacitor and load, which delivers the stored energy at the opposite polarity.
Checking the numbers
For an ideal inverting buck-boost converter in continuous conduction, the output magnitude follows this relation:
Vout = Vin × D / (1 − D)
With Vin = 12V and D = 0.8, the gain is 0.8 / 0.2 = 4, so the ideal output is 48V. That matches the settings of this simulation. Real hardware will give a somewhat lower output because of switch, diode and inductor losses.
This also explains why the duty ratio matters so much. At 80% the converter steps up strongly, and small changes in D move the output a lot. That is one reason closed loop control is usually added in practice.
Setting up the model in MATLAB Simulink
The downloadable file contains the working model. If you want to build or modify your own version, the general steps are:
- Place a DC voltage source set to -12V (or a 12V source connected with reversed polarity).
- Add a switch (MOSFET or IGBT), a diode, an inductor and an output capacitor, wired as an inverting buck-boost stage.
- Connect a resistive load across the output capacitor.
- Drive the switch with a pulse generator. At 32 kHz the period is 1/32000 s, about 31.25 µs, and an 80% duty ratio means the switch is on for about 25 µs of each cycle.
- Add voltage and current scopes on the input, inductor and output.
- Run the simulation and wait for the output to settle before reading the result.
Choosing component values
Pick the inductor so the current ripple stays at an acceptable level at 32 kHz. Pick the output capacitor so the voltage ripple stays small for your load current. A higher switching frequency lets you use smaller parts, but switching losses increase. Treat the values in the model file as a starting point and adjust them to your own requirements.
What to look for in the results
- Output polarity: the output should settle positive, near +48V in the ideal case.
- Inductor current: it should rise and fall each cycle without dropping to zero if you want continuous conduction.
- Voltage ripple: a small ripple on the output indicates a suitable capacitor value.
- Start-up behavior: check for overshoot while the output voltage builds up.
Related simulations
If you want to go further, these other projects cover related ideas. For regulating the output automatically, see our boost converter with closed loop control simulation. For a smaller step-up example with an intelligent controller, there is a 12V to 24V boost converter simulation that uses fuzzy logic. Another approach to high gain from a -12V source is covered in the KY converter in MATLAB article. If you would like to move from simulation to a microcontroller, take a look at a boost converter using Arduino in Proteus.
Practical notes before building hardware
- Choose a switch, diode and capacitor rated well above 48V, since voltage spikes occur during switching.
- Make sure the inductor can handle the peak current without saturating.
- Keep the switching loop short and the layout tight to limit noise.
- Be careful with grounding, because the input is negative relative to the output reference.
FAQ
Can a normal boost converter turn a negative voltage into a positive one?
No. A standard boost converter keeps the input polarity. To change polarity you need an inverting topology such as the inverting buck-boost converter.
Why does 80% duty at -12V give 48V?
In the ideal inverting buck-boost relation, the gain is D / (1 − D). At D = 0.8 this equals 4, and 4 × 12V gives 48V. Losses in real components will lower the result slightly.
Can I change the switching frequency?
Yes. The simulation uses 32 kHz, but you can change it. Remember to re-check the inductor and capacitor values, since ripple and losses both depend on frequency.
Do I need closed loop control?
Open loop is fine for a simulation demo. For real hardware, a feedback loop keeps the output at 48V when the input or load changes.