The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design >> Analog Design >> AC analysis
https://designers-guide.org/forum/YaBB.pl?num=1155668476

Message started by grosser on Aug 15th, 2006, 12:01pm

Title: AC analysis
Post by grosser on Aug 15th, 2006, 12:01pm

hello

Can you tell me how to perform AC analysis of that circuit?

It is a LDO with compensation. I want to know the real phase and gain in open loop.

If i use basic compensation circuit withouth the opamp on the left AC analysis gives sensible results (UGF=4e6 PM=70deg), the transient analysis is also ok.

When i add the opamp which is necessary the transient analysis is still ok, but AC gives strange results (UGF=3e7 PM=-11deg). I think AC analysis is setup badly, maybe due to two feedbacks.

How to setup AC analysis? Give me any hints please

regards

Title: Re: AC analysis
Post by loose-electron on Aug 15th, 2006, 12:14pm

It is gain/phase around the loop with the difference point at the amplifier in the center of the scehmatic.

So, you are looking at the gain with the input being an AC source in series with the Vref, and the additive phase gain at the other input of that op-amp.

Break the loop open at the negative input to the center op-amp. Get the AC response at that point.

hopefully that will get you started.

Jerry

Title: Re: AC analysis
Post by grosser on Aug 15th, 2006, 12:47pm

i do it in that way

C1 an L1 have huge values to not affect the response and to set proper operating point


i don't know why the transient response is very good although AC results are poor

Title: Re: AC analysis
Post by loose-electron on Aug 15th, 2006, 8:49pm

Hm,  just looking at things quickly -
- AC source should be in series with the Vref source, and
-  due to the phase inversion of the PMOS transistor, the negative feedback (at first glance) is at the positive input of the amplifier.

The gain/phase will change about 30 db with respect to operating point of the PMOS power transistor. At high power supply voltage, you get a lot more gain from the PMOS, because the device is in saturation. At low voltages, it is in triode and provides less loop gain.

Jerry


Title: Re: AC analysis
Post by Ken Kundert on Aug 16th, 2006, 12:09am

Using a large inductor and capacitor is a poor way to measure loop gain. It is difficult to do properly and can cause the simulator to misbehave. But even if these things do not go wrong, it gives inaccurate results because the filter disturbes the loading effects within the loop. You would be much better served using the stb analysis if you are using Spectre, or otherwise follow the advice in http://www.thekunderts.net/ken/docs/c%26d2001-01.pdf.

-Ken

Title: Re: AC analysis
Post by grosser on Aug 16th, 2006, 3:01am


loose-electron wrote on Aug 15th, 2006, 8:49pm:
Hm,  just looking at things quickly -
- AC source should be in series with the Vref source, and
-  due to the phase inversion of the PMOS transistor, the negative feedback (at first glance) is at the positive input of the amplifier.

The gain/phase will change about 30 db with respect to operating point of the PMOS power transistor. At high power supply voltage, you get a lot more gain from the PMOS, because the device is in saturation. At low voltages, it is in triode and provides less loop gain.

Jerry


why do you think AC source should be in series with Vref? it doesn't work

Title: Re: AC analysis
Post by loose-electron on Aug 16th, 2006, 3:05pm

Blacks Feedback Configuration -

Gain/Phase around the control system is taken from the positive input of the differencing circuit back to the negative input of the differencing circuit.

Take a careful look at your sign inversions in the system and determine what the positive and negative inputs are to your differencing circuit. Positive is the reference in this case, and the negative is the feedback (aka negative feedback control systems)

Ken - the large inductor/capacitor (or R and C) trick is a classic method to obtain a DC operating point. You grab your gain/phase response prior to going into the LC, and the only purpose of the LC is to find the DC op-point

Jerry

Title: Re: AC analysis
Post by Ken Kundert on Aug 16th, 2006, 11:23pm

I am well aware that using a very lowpass filter is a common trick for measuring loop gain. However, it is a poor approach that gives inaccurate results because it acts to break the loop at high frequencies and so affects the results by removing loading effects of the amplifier on the feedback network. That is why I warn people about whenever I see them use it.

-Ken

Title: Re: AC analysis
Post by svenn on Aug 17th, 2006, 8:12am


Ken Kundert wrote on Aug 16th, 2006, 11:23pm:
I am well aware that using a very lowpass filter is a common trick for measuring loop gain. However, it is a poor approach that gives inaccurate results because it acts to break the loop at high frequencies and so affects the results by removing loading effects of the amplifier on the feedback network. That is why I warn people about whenever I see them use it.

-Ken


Doesn't Spectre have loopgain simulation?

Title: Re: AC analysis
Post by Ken Kundert on Aug 17th, 2006, 8:36am

Yes, it is the stb analysis I mentioned earlier.

-Ken

Title: Re: AC analysis
Post by loose-electron on Aug 17th, 2006, 10:41am


Ken Kundert wrote on Aug 16th, 2006, 11:23pm:
I am well aware that using a very lowpass filter is a common trick for measuring loop gain. However, it is a poor approach that gives inaccurate results because it acts to break the loop at high frequencies and so affects the results by removing loading effects of the amplifier on the feedback network.


OK, agreed, but considering it is an LDO (sub MHz for the most part) and the load being broken off is the differential pair of the op-amp (small amount of C, not like the Cgs, Cgd of that big PMOS pass transistor. it should be close enough.

If you wanted to use this methodology, and include the amplifier input loading effects, you could use a second op-amp as a dummy load prior to the LPF. to include the loading effects. If really fussy, you can isolate the LPF out of the game with some VCVS behaviorals.

As with a lot of engineering, 5 ways will get it done,  :) and a million ways to mess it up.  :(

What would your approach be for opening the loop and maintaining the operating point? I looked at the paper that you mentioned, and it is comprehensive, but a bit of overkill for low frequency stuff in my opinion.

Also if the foundry models are off 30%, and you are trying to squeeze the the last 2% of accuracy out of the rest of the simulation?

tnx,
Jerry




Title: Re: AC analysis
Post by Ken Kundert on Aug 17th, 2006, 10:55pm

I recently did a hand calculation using a ua741 with 100k feedback resistors, and by ignoring the loading effect of the input capacitance, the phase margin would be off by over 20 degrees.

In my experience, if one is worried about phase margin, then the parasitcs are playing a significant role at the unity gain frequency and it dangerous to ignore them. And frankly, it takes no more effort to make the measurement properly than it does to make it improperly.

-Ken

Title: Re: AC analysis
Post by Frank Wiedmann on Aug 17th, 2006, 11:39pm


loose-electron wrote on Aug 17th, 2006, 10:41am:
What would your approach be for opening the loop and maintaining the operating point? I looked at the paper that you mentioned, and it is comprehensive, but a bit of overkill for low frequency stuff in my opinion.


Implementing the method used for stb analysis is not that difficult. I did it some time ago for LTspice (free, download from http://www.linear.com/designtools/softwareRegistration.jsp). You can find it either as the LoopGain2 example circuit in the installation or, in a slightly extended version, at http://groups.yahoo.com/group/LTspice/files/%20Examples/Educational/LoopGain_Probe/ (free registration required for access).

Once you have got the template, it is much easier to use this than to break the loop with a lowpass, and you don't have to worry if you are doing everything right (even the orientation of the probe does not matter).

Title: Re: AC analysis
Post by grosser on Aug 18th, 2006, 10:23am


Frank Wiedmann wrote on Aug 17th, 2006, 11:39pm:
Implementing the method used for stb analysis is not that difficult. I did it some time ago for LTspice (free, download from http://www.linear.com/designtools/softwareRegistration.jsp). You can find it either as the LoopGain2 example circuit in the installation or, in a slightly extended version, at http://groups.yahoo.com/group/LTspice/files/%20Examples/Educational/LoopGain_Probe/ (free registration required for access).

Once you have got the template, it is much easier to use this than to break the loop with a lowpass, and you don't have to worry if you are doing everything right (even the orientation of the probe does not matter).


thank You Frank for the link.

Is this method suitable only for opamp or feedback generally? I implemented it in my LDO according to the Middlebrook's method on the left in your ltspice template, but it doesn't work fine.


Title: Re: AC analysis
Post by Andrew Beckett on Aug 20th, 2006, 3:02pm

Whilst stb analysis is the right way to do things here (and it is very easy to use), if you do want to have the loop closed during dc, and open during ac, use spectre's switch component (which is in analogLib as spt*switch). This is an ideal switch which can be in different positions in different analyses.

This will suffer from loading inaccuracy effects, but at least you won't have the big inductors and capacitors messing things up...

If you have spectre, there is no good reason to use the "classic" method. I find that as soon as I've told people about stb analysis, they use it from then on. Even if your simulator doesn't support the method used in stb, using Middlebrook's method is a much better alternative than the "classic" method, and relatively easy to perform in practice.

Andrew.

Title: Re: AC analysis
Post by Frank Wiedmann on Aug 20th, 2006, 11:41pm


grosser wrote on Aug 18th, 2006, 10:23am:
Is this method suitable only for opamp or feedback generally? I implemented it in my LDO according to the Middlebrook's method on the left in your ltspice template, but it doesn't work fine.


It is suitable for feedback generally. It is essentially an improved version of Middlebrook's method. It uses exactly the same simulation setup as Middlebrook's method with just a different formula for calculating the loop gain. The result is independent of the orientation and the position of the probe in the loop (provided there is only one feedback loop in the circuit, see the article mentioned by Ken in reply #4 for details).

Title: Re: AC analysis
Post by loose-electron on Aug 21st, 2006, 1:48pm

All good commentary from everyone.

From Middlebrook's web site - here is a link to his writeup on GFT theory and how to test (simulate) for it:

http://ardem.com/downloads/GFTManual.pdf

Seems to be pretty comprehensive, and a useful read.

Jerry




Title: Re: AC analysis
Post by Frank Wiedmann on Aug 21st, 2006, 11:44pm

I would like to add two remarks here:

What is generally known as Middlebrook's method for measuring loop gain is not the method described in his GFT manual but the method presented in his much earlier article "Measurement of Loop Gain in Feedback Systems", Intl. J. of Electronics, 38, 485—512, Apr. 1975. This method neglects backward transmission.

The definition for loop gain given by Middlebrook in his GFT manual is slightly different from the definition given in the article mentioned by Ken (http://www.thekunderts.net/ken/docs/c%26d2001-01.pdf) which is used for Spectre's stb analysis. In terms of equation (20) of this article, the expression for Middlebrook's definition of loop gain would be T=k1/(k3+Ye+Yf). The advantage of Middlebrook's definition is that it is more closely related to the closed-loop gain of the circuit. Its disadvantage is that it is not symmetrical, the orientation of the probe does matter in his case. In most practical cases, the difference between both definitions will be negligible (if the probe is oriented correctly for Middlebrook's definition). Both definitions of loop gain will always tell you correctly if a circuit is stable or not, and there will generally be only very minor differences in calculated phase margin and gain margin.

Title: Re: AC analysis
Post by grosser on Aug 22nd, 2006, 12:58am

to Frank

can you tell me if i set this analysis properly? It doesn't work, so maybe i broke the loop in the wrong place?

regards

Title: Re: AC analysis
Post by Frank Wiedmann on Aug 22nd, 2006, 1:44am

To me, it looks like there are two feedback paths in your circuit: one via R1, where you put your probe, and another one via the opamp at the left of the schematic, which you are currently missing. You need to put the probe in a place where both loops are joined together. This would be either the + input of the opamp in the middle of the schematic, the output of this opamp (which is also the gate of the output PMOS), or the drain of the output PMOS. Ideally, you should get the same result in all three cases.

Title: Re: AC analysis
Post by grosser on Aug 22nd, 2006, 9:14am

the last thing i hope is phase.

How to plot phase in this method?

Title: Re: AC analysis
Post by grosser on Aug 22nd, 2006, 10:44am

I did a test to check what results Middlebrook's method gives compared to large LC method.

I don't know what results are reliable. If i put probe circuits in the places marked by red arrows the results are completely bad.
The simulation results(linked) come from attached test bench.

http://img211.imageshack.us/my.php?image=acopenip3.png

yellow curve is a Middlebrook's method result and the red is from LC method.

I don't understand why yellow gain increases in high frequencies and i wonder if i can rely on these results

regards

Title: Re: AC analysis
Post by Frank Wiedmann on Aug 22nd, 2006, 11:53pm

I am a bit surprised that you are getting a bad result when you put the probe at the output of the opamp. This point or the drain of the output PMOS are in my opinion the best places to put the probe. Did you check if the orientation of the probe is correct? It does matter when you are using Middlebrook's formula. If you use the formula from the article mentioned above that is being used by the stb analysis of Spectre, you should not have this problem because it is symmetrical.

Title: Re: AC analysis
Post by grosser on Aug 28th, 2006, 1:38am

Do you know how to plot the phase of this formula ((I(V3)/I(V4))*(-V(x)/V(y))-1)/((I(V3)/I(V4))+(-V(x)/V(y))+2) in Hspice?

Title: Re: AC analysis
Post by loose-electron on Aug 28th, 2006, 8:43am

Did Synopsys include a calculator type function (as Spectre-Cadence has) in the latest version of HSpice? It was not there 5 years back, and I have not been on HSPICE in a couple of years.

Title: Re: AC analysis
Post by Frank Wiedmann on Aug 28th, 2006, 12:59pm

Sorry, I'm not familiar with HSPICE either. However, I have added the formula for the symmetrical loop gain of Spectre's stb analysis for your configuration, where the circuit is duplicated, to my example at http://groups.yahoo.com/group/LTspice/files/%20Examples/Educational/LoopGain_Probe/. If you use this formula instead of Middlebrook's, you will not have to pay attention to the orientation of the probe.

Title: Re: AC analysis
Post by grosser on Aug 28th, 2006, 3:12pm


Frank Wiedmann wrote on Aug 28th, 2006, 12:59pm:
Sorry, I'm not familiar with HSPICE either. However, I have added the formula for the symmetrical loop gain of Spectre's stb analysis for your configuration, where the circuit is duplicated, to my example at http://groups.yahoo.com/group/LTspice/files/%20Examples/Educational/LoopGain_Probe/. If you use this formula instead of Middlebrook's, you will not have to pay attention to the orientation of the probe.



right, but i'm using the method on the left side of file LoopGain_Probe cause i don't know how to implement this on the right side one in HSPICE. There is not .step directive.

I am very grateful to you for your help.

Regards

Title: Re: AC analysis
Post by nobody on Sep 17th, 2006, 1:24am


grosser wrote on Aug 22nd, 2006, 10:44am:
I did a test to check what results Middlebrook's method gives compared to large LC method.

I don't know what results are reliable. If i put probe circuits in the places marked by red arrows the results are completely bad.
The simulation results(linked) come from attached test bench.

http://img211.imageshack.us/my.php?image=acopenip3.png

yellow curve is a Middlebrook's method result and the red is from LC method.

I don't understand why yellow gain increases in high frequencies and i wonder if i can rely on these results

regards


Hi, grosser

I was wondering how you do the simulation by applying Middlebrook's method.  Can you give me more information or details ? Thanks you in advance.

Actually, I applied a method like LC method. Two resistors are added like the way in LC
method. RR1 node1 node2 "value of DC resistance" "value of AC resistance".
            RR2 node3 node4 "value of DC resistance" "value of AC resistance
The value of DC resistacnce of RR1 is set to small and value of AC resistance of RR1 is set to very high. RR2 does the opposite of RR1.


Title: Re: AC analysis
Post by Ken Kundert on Nov 2nd, 2006, 7:55pm

The paper on calculating the loop gain without breaking the loop has moved. It can now be found at http://www.kenkundert.com/docs/cd2001-01.pdf.

-Ken

Title: Re: AC analysis
Post by alicia8283 on Jun 3rd, 2009, 7:37pm

Thanks for the information. I used stb analysis from spectre to run for the loopgain of my LDO. Attached is the block diagram of the circuit. I tried to break the loop at 3 locations, 1 is at the input of the 2nd stage op-amp, 2nd is at the input of the pass element (big PMOS), and 3rd point is at the input the of first stage op amp. I suppose wherever i break the loop as long as it is within the feedback loop, then i would get the same result. I get exactly the same loopgain and phase margin if i break at the 2nd and 3rd break point. But i would get different value of DC loop gain and phase margin if i break at the 1st point.  :o  :-/ Can anyone advise me why is the case?
Thanks in advance

Title: Re: AC analysis
Post by wave on Jun 5th, 2009, 11:29am


alicia8283 wrote on Jun 3rd, 2009, 7:37pm:
I suppose wherever i break the loop as long as it is within the feedback loop, then i would get the same result. I get exactly the same loopgain and phase margin if i break at the 2nd and 3rd break point. But i would get different value of DC loop gain and phase margin if i break at the 1st point.  :o  :-/ Can anyone advise me why is the case?
Thanks in advance


Yes, you should get the same results for the same loop --- assuming you use STB or such method that takes into account currents and reverse gains.

Your original detailed diagram has two loops (thru R1 and Vout).  An inner and outter loop.
You can chose to test both separately, which would change your DC gain.  
I would chose to test both loops simultaneously -- I would pick the gate of the PMOS pass gate to test, which also agrees with Frank.

Good luck,
Wave
::)

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.