Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SPDT in LTspice questions

Status
Not open for further replies.

Hawaslsh

Full Member level 3
Joined
Mar 13, 2015
Messages
164
Helped
5
Reputation
10
Reaction score
7
Trophy points
1,298
Location
Washington DC, USA
Activity points
3,422
Hello all,
1604786064516.png

I am trying to create a SPDT switch in LT-spice. Naturally I went to google and found a decent solution, link here. I don't fully understand the how the spice directive defines the switch. Above is the recreation from the tutorial from the link which works as expected. The first line ".subckt..." defines the port names for the SPDT symbol. What/how do the next two lines "S1..." and "S2..." define the two switch states? in the third and fourth line; what is Vh and Vt?
Also, I tried expanding the above example for my purposes and ran into some unexpected results. Instead of two DC supplies feeding the SPDT, I have two filtered, and inverted PWM signals, see schematic below. When I run a transient analysis to see how driving those large capacitors will look, I get a very unexpected spike shortly into the simulation.
1604809228767.png
1604809595589.png

I delayed the switching for a ~1 sec (below) and plotted the inputs to the SPDT switch. With no switching the inputs to the SPDT looks as they should. The output of the SPDT lies on top of V2 and wasn't plotted to avoid confusion.
1604810342019.png

When the switching starts it seems the switch is causing serious resonance and yields in an error. The Bottom left shows the the full time and voltage scale before reaching the error. The plot on the bottom right is focused in on when the switching starts. Any idea why I am seeing these results?
1604811104749.png
1604811008765.png

Thanks in advance
Sami
 

Many questions in one post.

You have a lot going on in your project. It's best to start out making simple circuits, to study how each component behaves. Charging capacitors, generating PWM, activating a SPDT, op amp behavior. Etc.
 

You find information about SPICE switch model and meaning of parameters in the LTspice help under LTspice/Circuit Elements/S. Voltage Controlled Switch.

Driving a large capacitance by an OP buffer is a basically a bad idea because it brings up stability problems, switching the load on and off is even worse. The simulator problems can be probably overcome by tuning SPICE parameters in the control panel, but it's an advanced topic, not suggested for SPICE tentative steps.

I don't see what you want to achieve with this circuit.If it serves a useful purpose, we should be able to find a better implementation.
--- Updated ---

The most comprehensive support for LTspice can be obtained here https://groups.io/g/LTspice
 

If it serves a useful purpose, we should be able to find a better implementation.

I simply want to drive or modulate (between -1.5 and -0.7V) the gate bias to some pHMETS at 100 Hz, see below.
1604844173222.png

I choose to do it this way for a few reasons:
1) filtered PWMs are usually a good way to produce DC outputs from a micro? But in this case I need a negative voltage.
2) The pwm frequency is ~450 HZ, in turn the inverting filter's time constant is pretty long. So i used a switch and 2 separate PWM lines to create a modulated signal with sharper edges rather than replying on 1 signal and changing the PWM % to create the modulation.
3) The caps exist as a load because the datasheet for the pHEMT suggests them. For this purpose I believe I can remove them, at least the 4.7uF, because my modulation is pretty slow.

If there is a better way to do this, I am open to change.
Thanks,
Sami
 

Place series resistors 50 to 100 ohms between OP outputs and switch, the load capacitor can be selected according to the intended edge rise time.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top