Electronic – LTspice voltage source with varying Ton / Tperiod

buck-boostltspicepowerswitch-mode-power-supplyvoltage-source

I'm trying to simulate a buck-boost converter where Vin and Vout are constantly changing. As a result, the time it takes to charge/discharge the inductor varies as well, and a voltage source that controls the MOSFETs with a constant frequency won't cut it.

I've been simulating 1 or 2 cycles at a time by disconnecting the voltage source from the circuit after X seconds, but it's not efficient at all. Is there a way to vary the Ton of the voltage source with an equation? Or perhaps a way I can type a list of Ton values in a text box and have the voltage source pick one every cycle?

Thanks!

Best Answer

What you need is a variable duty cycle, which is part of the control loop. If you have that but don't know how to implement the PWM part, here's a start:

test

If you don't have the control loop, then you'll have to build one: voltage mode, current mode, karma mode, etc.

Related Topic