Yes, this in a portion of a homework assignment (hence the idealized and slightly asinine problem statement). Aside from solving the circuit (which I have done), I am supposed to simulate the following circuit using LTSpice. The problem is that idealized switch in the middle. I have tried using the voltage controlled switch built into LTSpice, but keep getting errors.

I am expecting a regulated voltage of (roughly) 50V.

enter image description here

I have tried simulated using a BJT with a square wave driving into the gate, but the result is highly dependent upon the voltage applied to the base. When I simulate with a 5V square wave, I get roughly 18V at the output, but when I simulate with a 50V square wave, I get an output around 42V.

enter image description here

I tried simulating using a FET (similar to above, just swap in the generic NFET model) as well, but out an output in the microvolt range, which clearly isn't correct. I also tried simulating using a voltage controlled switch, but I keep getting weird errors, I assume because the switch is only designed to be "thrown" once, not at a frequency of 200kHz. It keeps telling me that it can't find a model for my switch, even though the .op is clearly listed: enter image description here

If anybody know how to simulate a switch like these, my class mates and I would be very appreciative (especially since the professor simply said 'Ask Google' when I came to him after trying for several hours).


I just tried running the simulation again using an NFET. It regulates to roughly 19V, which makes me think this isn't work either, consider the diode drop between the 20V source and the output. I tried several different voltages to the gate, none of which made any difference in the simulation.

enter image description here

  • \$\begingroup\$ So, I Google 'spice ideal switch', and the second links is this: bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/UserGuide/… - also, you mention you 'keep getting errors' using a voltage controller switch. I'm not a spice expert but you might want to elaborate on that. \$\endgroup\$ – RJR Mar 19 '14 at 0:36
  • \$\begingroup\$ Thanks for the "lmgtfy" response, but the link you provided didn't address my issue. Yes, it mentions switches, but it doesn't address flipping a switch on/off at a certain frequency. \$\endgroup\$ – realityinabox Mar 19 '14 at 1:03
  • \$\begingroup\$ You have no base current limit in your BJT. A BJT isn't the best choice for 200kHz. A MOSFET should work fine, what was your gate drive voltage? You need to make sure you have enough voltage to fully enhance the channel. Your diode is a 1N4148 yet you may have lots of amps of output current, not sure what the model will do with that. Since this is a boost converter you should maybe start with 10% duty cycle instead of 50% to see what happens. \$\endgroup\$ – John D Mar 19 '14 at 1:22
  • \$\begingroup\$ @realityinabox, the switch is voltage controlled so I'd assume you just hook a square wave voltage source with the desired frequency up to nodes 3 and 4. Also, see here uta.edu/ee/hw/pspice/pspice10.htm ... \$\endgroup\$ – RJR Mar 19 '14 at 2:36

Try this instead

enter image description here

In the model you had the series resistance was too high, the off resistance too low, you also had series inductance and a series voltage.

An ideal switch has zero resistance when on and infinite resistance when off and no series inductance. LTspice wont let you have this but the model here is much closer.

When I run this simulation the output voltage settles around 52.7V

You also want to pick a different diode: I used a 1N4148 because you did but it wont handle the current.

| improve this answer | |
  • \$\begingroup\$ This definitely works as a boost circuit now, though it regulates at about 60V for me (using an 'ideal' diode rather than the 1N4148). I'm not sure why I am getting 10V difference from my expected value, but I'll roll with it for now. \$\endgroup\$ – realityinabox Mar 19 '14 at 22:46
  • \$\begingroup\$ The driving pulse is going from zero to 50V, yet the switch has vt=0 vh=-0.5; you should raise vt. Also, the 1N4148 is not quite the right choice, even if this is SPICE world and it can take 1kA without smoke effects. @realityinabox One reason is that you're not using negative feedback. Another is the choices for the elements (as mentioned above, for the diode). Use an ideal diode with .model d d ron=0.1 roff=10meg vfwd=0.45 vrev=100 epsilon=100m revepsilon=50m for a better and speedier choice. Then again, I am replying to a >2years old thread... \$\endgroup\$ – a concerned citizen Oct 9 '16 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.