For everyone who's wondering how to turn this pulse switch into a PWM switch, you have to change the spice directive: .model sw sw(Vt=.5 Vh=-.4) Vt is the trip voltage, while Vh is the hysteresis voltage. Meaning, the switch turns on at (Vt - Vh) = 0.9V and turns off at (Vt + Vh) = 0.1V You can also change the on and off resistance by adding them to the spice directive with Ron and Roff respectively. On a side note, for me the sw component was no longer in the Misc subdirectory, but rather at the root. Also, if you have multiple switches the first sw in the directive is the name of your switch. So with a switch called foobar it'd be: .model foobar sw()
i have seen 12 videos that cover this but no one can tell me how to get the v-controllled switch to open & close repeatidly? i need it to pull in then open again. (?) can you do a video on that please?
I showed you how to use the Pulse voltage source to control the switch. Instead of a single pulse set up the pulse source for multiple pulses if you want the switch to operate every X seconds. Look at my LTSpice Beginner to Expert series to see more about how sources work. And look at my recent video on Behavioral Voltage sources for how to set up a more complicated control
With LTSpice V 17.1.15 the shown circuit will not work. Once the switch is activated it will not open again. You have to set the voltage pulse from -1V to +1V to make it work.
Thanks! Very useful! I'm new to electronics and LTSpice has been extremely useful for learning.
For everyone who's wondering how to turn this pulse switch into a PWM switch, you have to change the spice directive:
.model sw sw(Vt=.5 Vh=-.4)
Vt is the trip voltage, while Vh is the hysteresis voltage. Meaning, the switch turns on at (Vt - Vh) = 0.9V and turns off at (Vt + Vh) = 0.1V
You can also change the on and off resistance by adding them to the spice directive with Ron and Roff respectively.
On a side note, for me the sw component was no longer in the Misc subdirectory, but rather at the root.
Also, if you have multiple switches the first sw in the directive is the name of your switch. So with a switch called foobar it'd be:
.model foobar sw()
Your LTspice series is awesome 😎..it helped me a lot ...if possible please upload more
Thank you for this handy video.
Very well explained. Most useful for engineers. Great job!
Really BAD video that makes several mistakes. Do not believe one word of this video. It is wrong.
thanks for the model, great switch!
how do I tell the switch to use the defined model?
I just want a pushbutton switch spice model, and can't find one anywhere, but can't find anything about pushbutton models.
I don't need timed switch, I just need to turn on / off simple switch component. How is this done? There is no field "on/off" on the properties dialog
Jeez. Why are electronics simulation programs so clunky and counterintuitive?
i have seen 12 videos that cover this but no one can tell me how to get the v-controllled switch to open & close repeatidly? i need it to pull in then open again. (?) can you do a video on that please?
I showed you how to use the Pulse voltage source to control the switch. Instead of a single pulse set up the pulse source for multiple pulses if you want the switch to operate every X seconds. Look at my LTSpice Beginner to Expert series to see more about how sources work. And look at my recent video on Behavioral Voltage sources for how to set up a more complicated control
With LTSpice V 17.1.15 the shown circuit will not work. Once the switch is activated it will not open again. You have to set the voltage pulse from -1V to +1V to make it work.
This helped me a lot thanks !
what about more complex switches?
Why is the capacitor voltage negative iwhen the switch just turns on?
can you add a bilateral switch in ltspice? like cd4066b?
many thanks!
For the life of me, I don't get why the capacitors aren't initially uncharged, but there you are.
There is no "sw" component in the [misc] directory. I use the LT Spice Version 17.1.15
Found it. In the current version the "sw" is located in the top folder, not in MISC.
Didn't show the initial voltage needed to be minus.