LTSpice 3 way switch help

Thread Starter

gbloomers

Joined Apr 1, 2019
11
Hi, really struggling to make a 3 way switch work in lt spice, any help much appreciated!

Have don't everything suggested that ive read in other forums but nothing has worked. Attached are images of what I have got and the switch file.

The idea being each variation of the 3 is run.
 

Attachments

Thread Starter

gbloomers

Joined Apr 1, 2019
11
Here is my file so far. This is to be part of a larger circuit. The idea is to be able to choose between having either 1, 2 or 3 of the JFET's engaged to get a different level of distortion from each one. Just need a switch to swap between the 3 outputs!

Thanks for any help
 

Attachments

Thread Starter

gbloomers

Joined Apr 1, 2019
11
Yes thats the same error that I get! Have tried a bunch of things and also edited one of the stock voltage controlled switches but with no luck. That would be amazing if you could look into it, thankyou!
 

Thread Starter

gbloomers

Joined Apr 1, 2019
11
hi,
There are a number of LTSpice users at AAC, one of them may already have a suitable 3 Pole switch,
I already have the regular 1 and 2 way switches, see if I can create a 3W model.
E

@Bordodynov
@Alec_t
Thanks for all the help. If you did also have 2 way switch the would be very helpful as I will also need one of those for something else!
 
Last edited by a moderator:

Alec_t

Joined Sep 17, 2013
15,112
Here are my switch files. They are voltage-controlled switches, with a control voltage in the 0V to 1V range. The ones with 'bm' in their name are break-before-make, whereas those with 'mb' in their name are make-before-break. For the 3-way switch, a control voltage between 0.34V and 0.65V selects the middle way.
Have fun.

Edit: Oops. forgot the SP3Tvc.sub file.
 

Attachments

Last edited:

Alec_t

Joined Sep 17, 2013
15,112
I think your 1P3T.sub file in post #4 needs modifying to work with the .asy file you posted.
The sub fle currently reads:

.subckt 1P3T 1 2 3 4
R12 1 2 { IF ( SET < 2, 1u, 1T) }
R13 1 3 { IF ( SET <= 2 & SET >= 2, 1u, 1T) } ****
R14 1 4 { IF ( SET > 2, 1u, 1T) }
.ends 1P3T

The line I've marked **** seems illogical, and the model does not have a node labelled 'out' as used in the .asy file..

Try this, which should work with SET=1,2 or 3:

.subckt 1P3T out 1 2 3
R12 out 1 { IF ( SET < 2, 1u, 1T) }
R13 out 2 { IF ( SET <3 & SET >= 2, 1u, 1T) }
R14 out 3 { IF ( SET >=3, 1u, 1T) }
.ends 1P3T
 
Last edited:

Thread Starter

gbloomers

Joined Apr 1, 2019
11
Thanks for all your replies. I had been working on a cruise ship and out at sea so could not download the files to try! But I have now...
unfortunately I have tried both of your switches with no luck. Also tried putting in the new .sub file recommendation from Alec. It always comes back with a missing nodes error. Is this potentially a formatting issue because I use a Mac?

I have also tried to edit the voltage controlled switch in the program already. This is after advice from this forum a long time ago here: It seems pretty good, but I get an error saying there is a pin count mismatch between the sub circuit spdt and the instance xspdtswitch.

My file is attached!
 

Attachments

ericgibbs

Joined Jan 29, 2010
21,423
hi gb,
Tried your asc file on two PC's one with LTS IV, I get 'Unkown schematic syntax' , on the other PC LTS XVII ' I get message 'missing potentiometer.sub.'

I am working on a 3 way version of a switch, finding difficult to control the selection, still trying.

E
 

ericgibbs

Joined Jan 29, 2010
21,423
hi,
I do have a copy of the pot files in the XVI version , downloaded your version into the XVII version.

I get the same message as you' Set: Missing Nodes' , I will try to debug it.
E
 

ericgibbs

Joined Jan 29, 2010
21,423
hi qb,
Reading what the result you aiming for ie: is producing a wav file for the 3 different gain stages, why not just 'hardwire' the asc file for each stage in turn and then run it for each connection.?

This will give you the 3 distortion levels as wav files.
E
 

eetech00

Joined Jun 8, 2013
4,705
Hi

Try this switch.

Unzip the .zip file so the .asy and .asc files are in your schematic folder.
Remove the other switch and params.

Add the switch and params and Connect it like shown below:

upload_2019-4-27_10-23-11.png

eT
 

Attachments

Thread Starter

gbloomers

Joined Apr 1, 2019
11
thanks for all the help everyone... I finally have working 2 and 3 way switches! Thanks eetech00 your switch worked a treat! Really appreciate everyone putting in the time to help a frustrated newbie out :)))
 
Top