I haven't used it myself, but you might try the sw (voltage-controlled switch) component, driven by a PWL or PULSE voltage source.I'd like to use LTspice to simulate how a mechanical switch produces a spike in voltage when it is opened while driving an inductive load.
Can it be done?
Excellent file Mike! Thanks for posting.
It is easy to make the switch state a function of time, a voltage, a current, etc......
My only issue with it is that it's a voltage controlled switch... is there no other kind of switch that could be timed during the simulation? But maybe that's not important since I can always configure a voltage source to drive it.
Would you please share with me your definition of easy? I'm a neophyte in most LTspice-related things... need to find an example of making a switch a function of time... or maybe I just need more experience with the spice-directive instruction.It is easy to make the switch state a function of time, a voltage, a current, etc...
Yeah... that's more or less what I meant on post #5 ... but you've given me even more information now, thanks.The sim I just posted makes the switch state a function of time because the controlling voltage is a function of time. By default, the switch is closed when the input voltage is >0V, and is off if the input control voltage is <=0V. If you prefer it to have a different Threshold voltage, you can set it in the .model SW statement. You can model a switch with hysteresis, too.
Hi cmartinez,I'd like to use LTspice to simulate how a mechanical switch produces a spike in voltage when it is opened while driving an inductive load.
Can it be done?
I'm afraid this thread is quite old, and I can't remember if I solved this problem or not. Besides I can't find an asc file in my small collection related to this subject.Hi cmartinez,
I'm trying to make the same thing with LTSpice, could you please tell me how you did it? Or even better, could you send me the .asc file? It would help me a lot!
.model switch SW(Ron=10m Roff=1G Vt=0.5)
PWL(0 0 1m 0 1.001m 1)
Yes, but it was by the TS.Be aware this is a resuscitated 3-year old thread.
Sadly he was last seen over 7 months ago
I don't think so. It was @Seamus_One who brought it back to life. @cmartinez was the TSOne curiosity
Yes, but it was by the TS.
Right.I don't think so. It was @Seamus_One who brought it back to life.
That's OK. It's happened to me on more than one occasion, and you're entitled to an occasional pass.Right.
I look at the wrong thread.![]()