Hi
I need to simulate a basic boost regulator like:
[Vin]-------[inductor]---|----------[diode]----|-------[output] | | | | [control]--[mosfet] [capacitor] | | | |----------------------|---------------------|So I was thinking of splitting into 2 sections: one for the on state and one for the off-state.
On State: [Vin]-------[inductor]-----|---------------------|------------| | | | | | / [capacitor] [Load] | / | | |------------------------|---------------------|------------|
Thanks to John Larkin here on sci.electronics.design I already have the code to do the on state:
FOR T = 0 TO 1 STEP DT IL = IL + (Vin-Vout) * DT / L IR = Vout / R IC = IL - IR Vout = Vout + IC * DT / C NEXT
So now I just need to do the off state.
Off state:
[Vin]-------[inductor]-----| | | | [inductor resistance] | | |------------------------|Scott