# How to set the voltage controlled switch in Ltspice?

Discussion in 'Circuit Simulation & PCB Design' started by wenqinclch, Jul 24, 2017.

1. ### wenqinclchNew Member

Joined:
Jul 24, 2017
Messages:
3
Likes:
0
Hi guys,

I would like to make a simulation of a electric discharge programme with Ltspice. The circuit looks like below:

At the beginning, switch 1 will be closed and the switch 2 will be opened until the voltage of capacitance Ch Uch is higher than 15kV , then we close switch 2 and open switch 1. When Uch less then 12kV will switch 1 closed and swich 2 openesd again.

Anyone know how to connect these two switches into the circuit with the tunnels + and -, and how to write the SÖPICE directive for these two switches.

#### Attached Files:

• ###### circuit.png
File size:
20.1 KB
Views:
43
File size:
2.5 KB
Views:
22
Last edited: Jul 24, 2017

Joined:
Apr 12, 2012
Messages:
389
Likes:
34
3. ### alec_tWell-Known MemberMost Helpful Member

Joined:
Jul 10, 2011
Messages:
9,247
Likes:
1,218
Location:
Cardiff, Wales
Here's your asc file with the switch model statements.
Btw, where are you going to buy a 24.5G resistor, a 22.4femtofarad capacitor or a 6teraOhm resistor

File size:
2.9 KB
Views:
42

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### wenqinclchNew Member

Joined:
Jul 24, 2017
Messages:
3
Likes:
0

Thanks a lot!!That is really helpful.v
One more question. Because the switches also work when the voltage is -12kV or -15kV, so, can i add another value for Vt and Vh of two switches?
like: .model ms1 sw(Roff=1 Ron=1e12 Vt=13.5k Vh=1.5k Vt=-13.5k Vh=-1.5K)

6. ### alec_tWell-Known MemberMost Helpful Member

Joined:
Jul 10, 2011
Messages:
9,247
Likes:
1,218
Location:
Cardiff, Wales
That won't work (try it and see; that's the beauty of simulations ).
You could add two more switches: one in parallel with S1 and the other in parallel with S2. Then use model statements ms3, ms4 incorporating those negative values for vt (but +ve values for vh, otherwise the switch operates more like a potentiometer).

7. ### wenqinclchNew Member

Joined:
Jul 24, 2017
Messages:
3
Likes:
0
Done! Yes， i have tried and solved the problem already.
Thanks a lot