LTspice .model help

The following is a Q and A and Q I posted on a Yahoo group. I didn't get the info I needed to procede. Please read the exchange and see if you could help with my lack of info. .............................................................................................. Q. I have noted the switch (SW) that comes with Ltspice has ½ ohm of resistance between contacts. I would like to modify it to be an ideal switch. When I do a control/right click, the sw has no value or spiceline attributes. zero ohms, zero capacitance, etc. may not compute, so I could set them very low. I have the printed users manual in front of me and still can't figure it out.

Please describe how to display and change the qualities of the SW or any other device. Step by step advice would best help me. Thanks, Mike .................................................................................................. A. The switch (SW) requires a .model line. In this line you can set the Ron and Roff values (and other parameters).. This is an example taken from the help file: .model MySwitch SW(Ron=.1 Roff=1Meg Vt=0 Vh=-.5 Lser=10n Vser=.6)

The following are the default values of the parameters

Voltage Controlled Switch Model Parameters

name parameter units default

--------------------------------------------- Vt threshold voltage Volts 0. Vh hysteresis voltage Volts 0. Ron on resistance Ohms 1. Roff off resistance Ohms 1/gmin Lser series inductance Henry 0. Vser series voltage Volts 0. ilimit current limit Amps infin.

To get an almost ideal switch put Ron=1u and Roff=1000G ............................................................................................ Q. I am sorry, but I don't know where to put this info. I've tried opening the component atribute editor, changing the prefix to X and adding the info to the spiceline, among other things without success. Where do I install a .model? And then how do I pull it up to make a schematic?

Thanks again, Mike

Reply to
amdx
Loading thread data ...

..............................................................................................

..................................................................................................

............................................................................................

If you place a switch on a new schematic then it will be given the name S1 and a value of SW.

If you right click on the value then you can change it to something like IAMASTUIPIDCUNT.

Then you can place a spice directive statement like

.model IAMASTUIPIDCUNT SW(Ron=1m Roff=1E6 Vt=1V)

on your schematic using the place a spice directive thing at the right of the toolshed.

DNA

Reply to
Genome

See Vswitch.asc example file that came with switchercadIII. One possible path is.... C:\\Program Files\\LTC\\SwCADIII\\examples\\Educational D from BC

Reply to
D from BC

..............................................................................................

..................................................................................................

............................................................................................

Thanks for your help, of course I didn't want to type it in every time I use it, but if it's that simple great! I'll probably use the name MySwitch, I like that better. Mike

Reply to
amdx

Thanks D, I'll look at that.

Reply to
amdx

Well, it might be easier than that..... but then I'd have to try and work it out..... or you could have a fiddle yourself.

You can edit the standard files in......

C:\\Program Files\\LTC\\SwCADIII\\lib\\cmp

Which are really text files and have lots of .model statements in them. And you can add more .model statements to them.

So, if you make your own text file in that directory and call it standard.sw and then put a load of .model myswitcha/b/s sw(my idea of a switch) stuff in it then LTspice might pick that lot up as a standard file it will include for you and allow you to pick one from your list.

It might just work... but I'm not going to try it because there might be a bit more work involved and I'm a lazy bum.

If it does work like that you may buy yourself fourteen free beers and smile a lot.

DNA

Reply to
Genome

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.