Monday, December 16, 2013

Ideal switch

It is winter again and I am buried in snow in Toronto. I am not much into winter activities and this means only coding can stop me for going crazy. So I am back again to this project. After weeks of dithering, pretending to review code and thinking of future strategies, I finally gotten around to taking this project further.

Like I said before, the diode model is not complete because the diode doesn't know when and where to freewheel. To highlight this, I made the ideal switch model and tried to simulate a buck converter. Here's the code for the ideal switch (click on view raw below the code box to see the code in another window):



This is the circuit for the buck converter.



And this is the control code - actually just an open loop with a constant 50% duty ratio  (click on view raw below the code box to see the code in another window):



And on execution, the current (measured by Ammeter_La) through the inductor La is:

And as can be seen, the diode does not free wheel at all. The current rises when the switch turns on and drops to zero when it is turned off.

The strategy to overcome this will be my next blog entry as it is a fairly detailed algorithm.

No comments:

Post a Comment