SPICE is a useful tool to help check for potential circuit stability problems. Here is one simple way to do it:
Figure 1 shows a non-inverting amplifier using the OPA211 with a couple of minor variations that are common in many applications. R3-C1 is an input filter. R4 is an output resistor to protect against abuse when connected to the outside world. CL models a five-foot cable.
Checking the response to a small-signal step function or square wave is the quickest and easiest way to look for possible stability problems. Figure 2 shows the simulation circuit. Notice that the input terminal is connected to ground and the input test signal is connected directly to the non-inverting input. The input filter would slow the input edge of a step function. If you want to know how a bell rings, hit it with a hammer, not a rubber mallet.
The response is probed at the output of the op amp, not just the Vout node of the circuit. R4 and CL filter the output response so that Vout will not show the true overshoot of the op amp. To check stability, we want to know what the op amp is doing.
Notice that the amplitude of the applied step is 1mV (creating a 4mV step at the output). We want the small-signal step response. A large input step that induces slewing will have less overshoot and will not clearly reveal potential instability.
The simulation shows approximately 27% overshoot at the op amp’s output, too much to be comfortable that this circuit will be stable under all conditions. Assuming a second-order stability system, this would indicate a phase margin of approximately 38°. Also, notice that the frequency response shows considerable amplitude peaking, another sign of potential instability. The peaking occurs at 14MHz, the inverse of the period of the ringing in the time domain. A commonly accepted guideline for reasonable stability is a phase margin of 45° (or greater) which translates to 20% (or less) overshoot.
There are fancier analyses that can be done with SPICE—Bode analysis by breaking the loop, finding phase and gain margins. But for most relatively simple circuits (feedback loop involving one op amp) this approach is a very good indicator of possible problems. Of course, any SPICE simulation relies on the accuracy of the op amp’s macro model. Our best SPICE models are excellent but not perfect. Furthermore, circuit variation, non-ideal components, circuit board layout parasitics, poor supply bypassing—all can affect the circuit. That’s why you build it, test it, compare with simulation and optimize. SPICE is a useful tool, valuable but not sufficient.
How would you improve the stability of this circuit? Comments welcome below below…
Thanks for reading,
Simulations are performed with the free version of TINA-TI.
Index to all The Signal blogs.
There is a really great app note on how to fake out Pspice to accurately give you Open Loop Gain, Beta, Noise Gain (1/Beta), and Loop Gain (AvB) -- "PSPICE Performs Op Amp Open Loop Stability Analysis (HA5112)" Harris AN9536.1. This makes stability analysis easier and you can get the location of the poles and zeros, which helps with compensation. I can't find it on the web but let me know and I can email it to you.
I would argue that this is not a true test of circuit stability because the + op amp input will never see an ideal step. The RC input filter has a time constant of 20 ns. In fact, the only time op amps ever see a ideal step inputs are in SPICE simulations.
For anyone interested, I've found the Harris application note here:
Thanks Simon. I've emailed out quite a few so there seems to be some interest. This raises a great point...old databooks and app notes are still golden. The newest generation of students grew up without these books, and I think it has an effect. Remember flipping through a databook to learn what else a manufacturer had to offer? Or looking at the many pages of example circuits? The web is wonderful for fast access to datasheets (remember faxback services :) ), but it can also obscure information if you don't know what to ask for.
I have downloaded both referenced app notes and bot come as as (secured) pdf files which will not let me print or save them.
My suggestion for improving the stability and for the same frequency bandwidth of this circuit is shunting the R2 resistor with 27pF capacitor and don't use the input R3, C1 filter.
Clyde...I put the files in my profile. I'm assuming you can access them...never done that before.
I just accessed the files Time Sobering placed in his profile, I had no problems at all downloading them. The Harris Ap Note looks quite good. Thanks Tim!
If I see that right, all this measures the input to output transfer. I do not see the inner loop, more like a black box.
The feedback loop is closed by the divider R1/R2. When SPICE is doing an AC analysis, it applies short circuits to inductors and open circuit to capacitors. So inserting a very large inductor in between the OpAmp resistive divider and R2 would still result in a good operating point (the ESR of the inductor should be a few Ohms). Now I have a node - Inductor/R2 - which I can connect an AC source to with a very large capacitor value. This source would be blanked out at operating point calculation due to the capacitor.
Now you can set the AC value of that source to '1' - a theoretical calculation will take place, which does not know saturation. With '1' at the AC source, the Opamp output node is the inner feedback loop. (Vtest=0!)
This is how I would do such a simulation to have an information about stability - So far I did that with OpAmp/MOSFET current sources. My experience is that many sources looked critical but stable, but in reality they were not stable... I had to apply a compensation and with much margin in the loop the simulation did a good job.
What you think aboit that?
Hello, I see your concern with the RC filter on the input and agree that if you drive the input signal through the RC filter before it reached the non-inverting input then you would not effectively test the stability of the circuit because the RC filter will dampen the step input. However, if you place the step input directly on the non-inverting input as shown in the second schematic in the blog then the input will see the actual step input and the overshoot of the output will provide a very accurate representation of the circuit phase-margin once you correlate the overshoot to phase-margin using the final image in the blog. This is very effective in SPICE if you're interested in quickly determining if your circuit may have stability issues. In the real world on the bench there will be some non-idealities due to the non-zero ramp time of your function generator (and perhaps even a bit of overshoot out of the function generator) but this test will still provide the easiest method to test the stability of your OPA design.
@ Clyde: try http://www.pdfunlock.com/
The Harris app note is freely available on the Intersil website at www.intersil.com/.../an9536.pdf.
Agreed Collin. I simply use a very large cap (Pspice doesn't care) in series with the inverting input and and a 100k feedback (think differentiator) and hit it with an AC. I can then see the dominant pole with any kind peaking.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.