Keyboard Shortcuts
Лайки
Пошук
Extended version of the LoopGain example
Frank Wiedmann
Hello,
Under http://groups.yahoo.com/group/LTspice/files/Examples/Educational/LoopG ain_Probe/, I have uploaded an extended version of the LoopGain example that comes with LTspice. The voltage and current sources for simulating the loop gain are conveniently placed inside a subcircuit, which plays the role of a "loop gain probe". These sources are controlled by a variable and are activated one at a time by a .step command, so that it is not necessary to duplicate the circuit. The step selection operator @ is used to compute the loop gain from the simulation results. In order to simulate the "normal" closed-loop gain of the circuit, both sources in the probe subcircuit can be turned off by setting the control variable to zero. The example also features a generalized version of Middlebrook's formula that was developed by Michael Tian and takes backward loop transmission into account. The result of this formula is independent of the direction in which the probe subcircuit is inserted. In a loop with no backward transmission, the result of Tian's formula is identical to that of Middlebrook's formula. Tian's formula is used by the stability analysis of the Spectre circuit simulator from Cadence Design Systems. By the way, has anyone found a way to calculate phase margin and gain margin in LTspice, so that one does not have to use the cursors each time to read the values? Best regards, Frank |
--- In LTspice@..., "Frank Wiedmann"
<frank.wiedmann@w...> wrote: Hello Frank, thanks for these circuit files. First I had problems to test your circuits until I realized that I have to switch on the storage of subcircuit currents and voltages. Control Panel->Save Defaults x Save Device Currents x Save Subcircuit Node Voltage x Save Subcircuit Device Current Please add a comemnt to your schematic about this. My understanding of this Middlebrook method is that it should be possible to calculate the open loop gain of an embedded amplifier. Now my results: I used your example but replaced the amps by LT1013. I also changed the load resistor to 100kOhm and the feedback resistor to 10kOhm. An additional capacitor of 1pF/100pF have been added at the -input to test whether this method is insensitive to that or not. I then added the "classical" open loop gain test circuit. When I now compare the result, the open loop gain of your configuration is 20dB off (it's exactly Rfeedback/Rsource) at low frequency. Why this? What have I understand wrong about Middlebrook's method? I also realized that the result differs at high frequency if I change the capacitors CTx at the -input to 100pF. Please help me to understand what's going wrong. I added my files to your folder. We can move my files later to another folder if you want that. Best Regards, Helmut http://groups.yahoo.com/group/LTspice/files/Examples/Educational/LoopG ain_Probe/, I have uploaded an extended version of the LoopGainfor simulating the loop gain are conveniently placed inside asubcircuit, which plays the role of a "loop gain probe". These sources areindependent of the direction in which the probe subcircuit is inserted. In aloop with no backward transmission, the result of Tian's formula isby the stability analysis of the Spectre circuit simulator fromCadence Design Systems.gain margin in LTspice, so that one does not have to use the cursorseach time to read the values? |
--- In LTspice@..., Frank Wiedmann wrote:
Hello, Underhttp://groups.yahoo.com/group/LTspice/files/Examples/Educational/LoopG ain_Probe/ I have uploaded an extended version of the LoopGain exampleVery impressive use of waveform math with hierarchical subcircuits. Did you learn about the @ operator from reading this Yahoo Group, from the recent changes to the help file, or from prior experience with another simulator? The example also features a generalized version of Middlebrook'sThanks for the very nice contribution to the LTspice community. I checked the technique with a three stage, equal element RC low pass network feeding back to a VCVS with gain set to 30 such that it just barely oscillates in a transient simulation. The probe may be inserted with either orientation at the VCVS or in the middle of the RC network without effecting the transient results. Yet it always yields the same, correct ac loop gain simulation results. As a matter of taste, I changed the polarity of the math expression to make the phase go to 0 rather than -180 at the point of oscillation. By the way, has anyone found a way to calculate phase margin andThe cursor method seems very easy and convenient. How and in what other format would you like LTspice to do this? Also, automated methods tend to have problems with conditionally stable systems, in which case a visual inspection would be required anyway. Regards -- analog(spiceman) |
--- In LTspice@..., "Helmut Sennewald"
<helmutsennewald@y...> wrote: --- In LTspice@..., "Frank Wiedmann"Done. to test whether this method is insensitive to that or not.change the capacitors CTx at the -input to 100pF.Opening the loop for simulating loop gain is generally not recommended because of the difficulties in getting the correct dc operating point and the correct impedances. However, in this particular example it works actually quite well. Of course, you have to go all the way around the loop in order to get the loop gain. So, if you measure the voltage at CT4/R13, you will get a result that is very close to that of the loop gain formulas. Best regards, Frank |
--- In LTspice@..., "analogspiceman"
<analogspiceman@y...> wrote: Very impressive use of waveform math with hierarchical subcircuits.From the changelog file, in fact, in connection with prior experience with other simulators. Well, I am a lazy person, so I would like to have a function thatBy the way, has anyone found a way to calculate phase margin andThe cursor method seems very easy and convenient. How and in what returns the numeric value without me having to move the cursors around. Of course, I would still look at the loop gain curve in order to see if anything strange happens. Best regards, Frank |
--- In LTspice@..., Frank Wiedmann wrote:
--- In LTspice@..., analogspiceman wrote:Next to your original files I have uploaded a zip file that--- In LTspice@..., Frank Wiedmann wrote: includes my test circuit with the three stage, equal element RC low pass network of which I wrote in my prior post. I also took the liberty of making a few "improvements" to your subcircuit to make it easier to use. Although LTspice's help file is very good, it does not cover allVery impressive use of waveform math with hierarchicalFrom the changelog file, in fact, in connection with prior of the useful features built in to LTspice. I've made a kind of LTspice help file crib sheet that fills in most of the blanks with regard to LTspice's math functions for B-sources and waveforms. It is here in the files section under "adventures with analog" as Waveform_Arithmetic_&_B-sources.pdf. You might give it a look see. Right now there is no tool to automatically present you withWell, I am a lazy person, so I would like to have a functionBy the way, has anyone found a way to calculate phase marginThe cursor method seems very easy and convenient. How and in numeric gain and phase margins. I suppose it could be added to the data in the output (log) file, or be made available in a message window similar to the average/RMS calculation, but it still would require exercising the mouse about as much as the cursor method. Now I am curious about what you had in mind. If you could relieve that curiosity by describing precisely how you imagined this feature might be implemented, I would be appreciative. -- analog(spiceman) |
--- In LTspice@..., "Frank Wiedmann"
<frank_wiedmann@y...> wrote: --- In LTspice@..., "Helmut Sennewald"Of course, you have to go all the way around the loop in order to getHello Frank and "analogspiceman", I think I have understood it now. The Middlebrook method calculates the "open" loop gain of the actual configuration. This is not necessarily the open loop gain of the opamp which is shown in the datasheet. The open loop gain from this method can be used to determine the stability of a circuit. It is stable, if the phase shift is less than 180degree at the gain point 0dB. I tested the circuit from "analogspiceman" too. It's very impressive that the probe can be moved around the circuit and we still get the same result for the open loop gain. Thanks to you both for presenting these methods with LTSPICE. I will now remove my files from this folder, because they add no value to the presentation. Best Regards, Helmut |
--- In LTspice@..., "analogspiceman"
<analogspiceman@y...> wrote: --- In LTspice@..., Frank Wiedmann wrote:Thank you for your effort. In order to avoid any possible confusion,--- In LTspice@..., analogspiceman wrote:Next to your original files I have uploaded a zip file that--- In LTspice@..., Frank Wiedmann wrote: you might want to add a short remark regarding the differences between our approaches: The function of the values 1 and -1 of the control variable has been exchanged and the loop gain according to your formula is the loop gain of my formula multiplied by -1 (meaning that the phases differ by 180 degrees). Both sign conventions for the loop gain are actually being used by different people. Yours is probably more logical from a mathematical point of view and it is in fact the one that Tian uses in his article. My definition is often used by circuit designers because Bode used this sign convention for his "return ratio" in his classic book "Network Analysis and Feedback Amplifier Design" (he did not use the term "loop gain"). With this sign convention, the phase of the loop gain is 0 degrees at low frequencies for most practical circuits, a fact that many designers find convenient. Well, to make this a more general feature, I could imagine a functionRight now there is no tool to automatically present you withWell, I am a lazy person, so I would like to have a functionBy the way, has anyone found a way to calculate phase marginThe cursor method seems very easy and convenient. How and in that returns the x-value of the zero crossing of a curve and a second function that returns the y-value of a curve for a given x-value. By inserting the first function into the second, one could form expressions for phase margin and gain margin. Another possible application of the first function would be finding the 3-dB frequency of a filter. Additional functions detecting e.g. the maximum or minimum of a curve might also be useful in this context. Best regards, Frank |
http://groups.yahoo.com/group/LTspice/files/Examples/Educational/LoopGThank you for this great subcircuit & example. I am trying to figure out how to arrive at the equation that is plotted in LTSpice from the equation in Tian's paper, "Striving for Small-Signal Stability". (Equation 30) I am still trying to understand this technique. Can someone show me the relationship between these two equations? LTSpice plot: 1/(1/(2*(I(V:lp:inj)@1*V(lp:probe)@2-V(lp:probe)@1*I(V:lp:inj)@2)+V(lp:probe)@1+I(V:lp:inj)@2)-1) Tian Equation (30) T= [2(AD-BC)-A+D] / [2(BC-AD)+A-D+1] |
--- In LTspice@..., "xrinlar" <xrinlar@y...> wrote:
http://groups.yahoo.com/group/LTspice/files/Examples/Educational/LoopG forain_Probe/, I have uploaded an extended version of the LoopGain subcircuit,simulating the loop gain are conveniently placed inside a figure out how to arrive at the equation that is plotted in LTSpice fromthe equation in Tian's paper, "Striving for Small-Signal Stability".(lp:probe)@1+I(V:lp:inj)@2)-1) It's actually pretty straightforward algebra. First of all, I divide numerator and denominator of the expression by its numerator and rearrange the terms of the new denominator: T = [2(AD-BC)-A+D] / [2(BC-AD)+A-D+1] T = 1 / {-1 + 1 / [2(AD-BC)-A+D]} T = 1 / {1 / [2(AD-BC)-A+D] - 1} Now, we have to obtain the values for A, B, C, and D from simulation. For the first step (@1) of the simulation, we have Vinj=1 and Iinj=0; for the second step (@2), we have Iinj=1 and Vinj=0. You should also notice that a positive current through Vinj is defined in the opposite direction of If in the article because in Spice, a current is defined as positive when it flows into the positive terminal of a component. So, we have If = -I(V:lp:inj) as the negative current through Vinj and Ve = V(lp:probe) as the voltage at the node named "probe". Now, it is easy to write down the expressions for the terms A, B, C, and D: A = -I(V:lp:inj)@2 B = -I(V:lp:inj)@1 C = V(lp:probe)@2 D = V(lp:probe)@1 In order to make the expression look a little more elegant, I finally introduce A' = -A and B' = -B and rearrange the terms a little bit: T = 1 / {1 / [2(B'C-DA')+D+A'] - 1} When you insert the expressions from above, you will get exactly the formula that I am using in my example. Best regards, Frank |
In order to make the expression look a little more elegant, I finally Great explanation, great circuit. Thank you. |
--- In LTspice@..., "brette_83" <benedikt.bretthauer@...> wrote:
I will use the notation from http://www.spectrum-soft.com/news/spring97/loopgain.shtm for my explanation. For my formula, I am using the fact that the amplitude of my voltage and current sources is 1 when they are active, so that Vf + Vi = 1 and If + Ii = 1. (The ground node is the negative terminal for Vi but the positive terminal for Vf, the drawing is not clear in this respect.) Using these two equations, we get Gv + 1 = Vf/Vi + 1 = (Vf + Vi)/Vi = 1/Vi and Gi + 1 = If/Ii + 1 = (If + Ii)/Ii = 1/Ii. With these results, we can easily calculate the loop gain: 1/(G + 1) = 1/(Gv + 1) + 1/(Gi + 1) = Vi + Ii G + 1 = 1/(Vi + Ii) G = 1/(Vi + Ii) - 1. Best regards, Frank |
Hi,
Thanks for the great explanations.
I have a question. In the file, on the left hand side, there are two circuits that use Middlebrook's approach. I've also tested the circuit with the classic method of injecting an AC source from ground, and breaking the loop with an L-C network. The results are exactly the same as the given examples.
However, when I use the Tian probe equation, the Bode plot looks completely different. Has anyone encountered the same issue? I believe I've followed all the instructions in the file, which are also contained within this thread.
I've uploaded the files in the following folder:
https://groups.io/g/LTspice/files/Temp/LoopGain_Probe_MC Thank you!
Marcos |
Replying to a 20-year-old topic that was last updated 15 years ago, Marcos (m.compadre.t) wrote:
I think you are referring to the schematic you just uploaded, LoopGain_Probe_MC.asc.
Your schematic is missing the symbol = .ASY file, and probably the SPICE model, for your "loop_probe" device. We can't try your simulation without those files. Please upload them. Uploaded schematics need to be complete including all symbols and models that did not come with LTspice. Your loop_probe did not come with LTspice, so you need to upload it with your schematic.
Andy
|
On Thu, Oct 31, 2024 at 12:50 AM, <m.compadre.t@...> wrote:
I suggest that you take a look at https://groups.io/g/LTspice/topic/50255277#msg108476 Best regards, Frank |
You might look into NISM. This is likely a much better and more accurate way to assess loop stability (via output impedance). Learn about NISM - Stability Testing/SimulationWhat is NISMBode Plots may not be enough to test your Power Supply StabilityLearn how the output impedance based ‘NISM’ (Non-Invasive Stability Measurement) test has become the Gold Standard for accurate power supply stability testing. Output impedance is the key. This method is superior in many ways to using Bode plots or the transient step load response. NISM (Non-Invasive Stability Measurement) is the software behind the stability measurement, converting output impedance directly to phase margin. And now it’s on Copper Mountain Technologies Compact VNAs.
Many regulators don’t provide access to the control loop. Newer regulators can have multiple loops. Usually, the manufacturer will not tell you this. What it means is that the Bode plot will not show the real stability. In addition, phase and gain margins do not reveal the worst stability points. The only accurate way to assess stability is via NISM and its output impedance-based assessment.
If you can measure output impedance, you can measure a power supply’s stability.
The NISM measurement was pioneered by Steve Sandler and Picotest. NISM is a mathematical conversion of output impedance to phase margin analogous to translating the transient step load Q into degrees, except it’s performed in the frequency domain. The conversion is embedded in many VNAs and soon, oscilloscopes with FRA features. For some VNAs it’s an add on software feature. NISM is also coming to PSpice and Keysight’s ADS so that regulators without control loop access or multiple internal loops can have their stabilities accessed in simulation (i.e., when Bode plots can’t be used or are inaccurate).
NISM Technical Information · Introduction to NISM / Main NISM Technical page · NISM Software
Videos Covering NISM · How to Design for Power Integrity: Power Supply NISM, 2023 · https://www.keysight.com/in/en/learn/course.how-to-design-for-power-integrity.html · Webinar: Non-invasive Stability Measurement of Power Supplies with Bode 100, Nov. 2015 · Introduction to NISM Measurement, Bode 100, June 2017 · Webinar: Stability Analysis of Power Supplies, March 2018 · Webinar: Output Impedance of Power Supplies, May 2020 · Robert Bolanos Video on How to measure a Power Supply's NISM and Output Impedance using the Bode 100, Oct. 2022 · Non-Invasive Phase Margin using the J2111A Current Injector, 2011
Papers and Some Background and Theory about why NISM works · NISM using the P2102A Probe and the Keysight E5061B, Picotest 4/29/2021 · Overview and Comparison of Power Converter Stability Metrics, DesignCon 2017 · Output Impedance for Stability Analysis, 2020 · Output impedance - an important design parameter for power supplies, Power Analysis and Design Symposium April 2018 · Paper: Fundamentals of Linear Stability - NASA Engineering 2014 · Video: Fundamentals of Linear Stability - NASA Engineering, NASA Nov. 2014 · Reconstructing a Loop Transfer Function from Output Impedance Zout, 2024
· ZOUT to NISM: Output Impedance to Non-Invasive Stability Measurement, 2024
· Output Impedance Zout, 2024
· A Bode Plot Without Access to the Control Loop, 2021 · Impedance measurements stabilize op-amp buffers, 2014 · Software Enables Accurate Stability Test, Improves Non-Invasive Phase Margin Measurement Accuracy, 2014 · Assessing Point-Of-Load Regulators Using Non-Invasive Techniques, 2012 · So how does this non‐invasive measurement relate to phase margin and gain margin? · Evaluate Feedback Stability When There’s No Test Point, 2012 · New Technique for Non-Invasive Testing of Regulator Stability, 2011 · A New Power Integrity Requirement to Supplement Target Impedance: Quantifying PDN Impedance Flatness from Sandler NISM – Designcon 2023, Link TBD, please inquire
Issues with Bode Plots · Non-Invasively Assess Your Multiple-Loop LDO’s Stability, 2014 · The 5-Minute Method for Stabilizing Any Control Loop, 2020 · Five Things Every Engineer Should Know About Bode Plots, 2014 · Killing the Bode Plot, 2016 · Bode Plots are Overrated, 2017 · When Bode Plots Fail Us, 2012 |
Повідомлення
Більше