Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LTspice: Voltage-Controlled Switch In AC Analysis

Status
Not open for further replies.

smithmat

New Member
My goal is to use LTspice to conduct an AC analysis of a circuit by varying the frequency of a square wave supplied to the gate of a FET. As I haven't found a way to sweep a square wave, I have instead used a sinusoidal supply to regulate a voltage-controlled switch (see attached).

This method works properly in transient analysis but fails in AC; it appears that the switch no longer turns on. What am I doing wrong? Is there an easier way to do this?

Thank you
 
AC analysis only works for sinewave signals.
 
In this case I'm using a sine wave and just reshaping it into a square wave. It surprises me that this doesn't work.
 
In this case I'm using a sine wave and just reshaping it into a square wave. It surprises me that this doesn't work.

It will only do a swept AC analysis with an AC voltage amplitude entered in the Small Analysis box, spanning the frequency range entered into the Sim commands boxes.


Which parameters are you wanting to check for in your circuit.?
 
I'm building a class E amplifier as shown in the attached schematic. I'd like to view the frequency response for given configurations to try to maximize power efficiency.

When configuring the source for ac analysis I set the small ac amplitude to 10V as shown in your first figure. The ac sweep is configured as shown in your second figure with the exception of the sweep type being 'decade'.
 
hi,
One method I have used for square wave inputs is a sine source into a ultra high speed comparator.

The overall AC analysis will include the comparator operation, but if fast enough you should be able to use a test point at its output and the MOSFET filter as another.

I will try the method later on your asc file

EDIT:
A rough and ready example.

Tried a LT1227 100MHz OPA [dual supply] TP1 is 'almost' flat
 
Last edited:
I've been working with that component as well trying to do the same operation, but I had trouble with loading. Before moving into AC analysis I wanted to ensure that the transient behavior was consistent and I found that connecting the output of the comparator to the gate caused significant distortion to the square wave signal. What would you recommend?
 
hi,
.................
The overall AC analysis will include the comparator operation, but if fast enough you should be able to use a test point at its output and the MOSFET filter as another.

Eric, one question:

How could an ac analysis, which is a LINEAR small-signal analysis, "include the comparator operation" ?
Isn't the comparator a non-linear element?
In ac analysis ALL non-linear parts resp. transfer characteristics are linearized around the bias point before the analysis starts.

W.
 
I've been working with that component as well trying to do the same operation, but I had trouble with loading. Before moving into AC analysis I wanted to ensure that the transient behavior was consistent and I found that connecting the output of the comparator to the gate caused significant distortion to the square wave signal. What would you recommend?

Hi,
Try a variation of this method, uses a 140MHz OPA.

The circuit is very basic as drawn, it will require more refinement, but its a close approximation.

E.
 
Last edited:
Hi Eric,

with reference to my former question (post 8) may I ask:
What is the purpose of an ac analysis for a circuit with an opamp without feedback ?
Did you check the operating point of the opamp ?
Idealized model without offset voltage?

W.
 
Hi Eric,

with reference to my former question (post 8) may I ask:
What is the purpose of an ac analysis for a circuit with an opamp without feedback ?
Did you check the operating point of the opamp ?
Idealized model without offset voltage?

W.

hi W,
I would suggest you concentrate on replying to the OP's problem, rather than my posts, I am sure he/we will find it far more helpful.

Read the OP's post #5 for what he is trying to measure.

Eric
 
hi W,
I would suggest you concentrate on replying to the OP's problem, rather than my posts, I am sure he/we will find it far more helpful.
Read the OP's post #5 for what he is trying to measure.
Eric

Sorry, I apologize for asking a question to a post and a circuit you have submitted.
I was of the opinion that your post was partly an answer to the OP's problem.
More than that, I couldn't read the asc file in post 5.

W.

PS: In case you don't like or allow any comments or questions which are not DIRECTLY related to the original question, I ask myself if I should leave the this forum.
What has happened? I have detected something that I consider as not correct - and I have asked a corresponding question. That`s all.
Bye bye.
 
PS: In case you don't like or allow any comments or questions which are not DIRECTLY related to the original question, I ask myself if I should leave the this forum.
What has happened? I have detected something that I consider as not correct - and I have asked a corresponding question. That`s all.
Bye bye.

Its not a case of comments not being allowed, its just that the OP's topic is often derailed by discussions about some aspect of another members post/s, which does not help the OP to solve his problem.

If you feel strongly enough about the accuracy of information with any post, I would suggest you create a new thread, so that we can all discuss it without disrupting the OP's thread.

In many cases what an OP is trying to achieve is not explained to us and we have to start from somewhere in the hope we can suggest a solution or an alternative method.

As you can see from the attached image [post#5] the OP wanted to know why his circuit for AC analysis did not work, the reason why was posted to him.

I suggested a method I had used, either a fast comp or a fast OPA to square up the AC analysis sine wave, this method has limitations

I would now expect the OP to consider variations on this method and its drawbacks and get back to us with his comments.
 
Last edited:
Eric, my reply is in blue.

Its not a case of comments not being allowed, its just that the OP's topic is often derailed by discussions about some aspect of another members post/s, which does not help the OP to solve his problem.


The OP was asking for an ac analysis of a non-linear and time-dependent circuit.
In my post#8 I have pointed to the fact that an ac analysis requires a linearized system. That was my answer to the OP's question.

If you feel strongly enough about the accuracy of information with any post, I would suggest you create a new thread, so that we can all discuss it without disrupting the OP's thread.

So you recommend a new thread just for answering questions which may arise in another thread?

In many cases what an OP is trying to achieve is not explained to us and we have to start from somewhere in the hope we can suggest a solution or an alternative method.
As you can see from the attached image [post#5] the OP wanted to know why his circuit for AC analysis did not work, the reason why was posted to him.

Yes, and I gave an answer in post#8.

I suggested a method I had used, either a fast comp or a fast OPA to square up the AC analysis sine wave, this method has limitations
I would now expect the OP to consider variations on this method and its drawbacks and get back to us with his comments.

Yes, and I had a question to the method suggested by you. Why didn't you answer? It was a pure technical question - perhaps interesting for the OP and other readers of this thread.
 
Last edited:
Eric,

Your design looks like it will work great. I was able to recreate it and find the same results. However I'm trying to generate a transient analysis to verify that it operates as expected and it appears that the square wave is being heavily distorted by loading, causing issues with the FET. I have little experience in design and don't know how best to resolve this. Any suggestions?

Thanks for your help.
 
Eric,

Your design looks like it will work great. I was able to recreate it and find the same results. However I'm trying to generate a transient analysis to verify that it operates as expected and it appears that the square wave is being heavily distorted by loading, causing issues with the FET. I have little experience in design and don't know how best to resolve this. Any suggestions?

Thanks for your help.

hi,
I was thinking of using the output of the fast OPA to drive your 'switch' as shown in your first diagram.

That is just insert the switch part of your circuit between the OPA out and the MOS gate.

E.

EDIT:
Thats not working as I would expect.! will keep trying.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top