Inverting op amps, phase shifts, and instabilities, oh my! - Page 1
Forum section: electronics / beginners

author: Fulcrum
author_rank: Regular Contributor
timestamp: June 07, 2016, 09:41:43 pm
content: Hello everyone. I am attempting to make sense of when exactly an inverting op amp becomes instable, and how to measure this point in a simulation software.As such, I have recreated a typical circuit in TINA-TI:Running an AC transfer simulation creates the following bode plot:I have of course attempted to read everything I can find on op amps, but mostly everything I can find on the phase difference is in regards to non-inverting op-amps. I suppose I only have a few questions:1) Is the phase difference really measured between the input of Rin (R8 in this schematic) and the output?2) At what phase difference does the op amp become unstable? (assuming gain is above 1 at this point)In the documentation I can find, the phase difference is said to begin at -180 degrees, before dropping to -270 degrees, and later crossing -360 degrees where oscillation occurs. However, the simulation shows it begins at 180 degrees. I assume this is because it is inverting. Would that mean that it will become unstable at 0 degrees phase difference? Just trying to clear up a lot of confusion I have about this.

author: rfeecs
author_rank: Frequent Contributor
timestamp: June 07, 2016, 10:19:40 pm
content: Here is a reference:http://www.ti.com/lit/an/sloa020a/sloa020a.pdfYou need to look at the loop gain. Break the connection between R8 and the inverting input. Put your input signal at the inverting input. Take the output at the connection of R8 and R7. Refer to figure 5 in the reference. You also ground the other end of R8.

author: Fulcrum
author_rank: Regular Contributor
timestamp: June 07, 2016, 10:39:51 pm
content: Quote from: rfeecs on June 07, 2016, 10:19:40 pmI see. However, the results I get are nonsense. I assume it's because the non-matched inputs create a small difference which gets amplified to the maximum or minimum output value of the opamp. I would have to set the bias voltages very accurate, yes?

author: rfeecs
author_rank: Frequent Contributor
timestamp: June 07, 2016, 11:03:01 pm
content: I see what you mean.Here is a step by step video using LTSPICE:http://www.linear.com/solutions/4449Here they connected the AC source between the two points to insert the signal while maintaining the DC loop feedback.

author: Fulcrum
author_rank: Regular Contributor
timestamp: June 07, 2016, 11:13:52 pm
content: Quote from: rfeecs on June 07, 2016, 11:03:01 pmWell, managed to find the operating point so that the results makes a bit more sense. I see that A*beta crosses 0dB gain long before the phase difference crosses 0 degrees... Meaning it's stable. Or, at least it should be. Ugh, this doesn't get me anywhere. My real life circuit is still oscillating wildly at 436MHzI have two inverting op-amps connected in series by a small ac-coupling. Isolated they work a charm, but when connected (ac-coupled or dc-coupled) the output of the second oscillator oscillates. Maybe I should make a separate thread about this.

author: rfeecs
author_rank: Frequent Contributor
timestamp: June 07, 2016, 11:33:07 pm
content: It sounds like there is some feedback from the second stage back to the first stage, either through the power supply connection or some kind of ground loop.Make sure you have good bypass caps on the supply pins close to the chips and with a short path to ground. Hopefully you have a solid ground plane, not a protoboard. The ground plane between the two stages should be a continuous connection, not connected by long wires. You could also add small resistors or ferrite beads on the power supply connections on the supply side of the capacitors for more isolation.If your circuit is like your schematic, your input impedance looks fairly low. You might try measuring one stage loaded with a 36 ohm resistor on the output to see if that affects the stability.

author: Fulcrum
author_rank: Regular Contributor
timestamp: June 08, 2016, 12:14:29 am
content: Quote from: rfeecs on June 07, 2016, 11:33:07 pmHey, thanks for showing interest. None of the electrical engineers at my university seems to have any idea about what to do, so I'm left on my own with no formal electronics education. Literally weeks of struggling with this now. Here you have the entire circuit as it is on the board now (bypass caps not shown):The zeners on the last stage keeps the output voltage above 0V to protect some sensitive electronics that comes later.Removing the AC-coupling 22pF cap between the two opamps makes them both stable. Keeping the cap and disabling the first opamp makes the output of the last one stable. Otherwise, the output of the last opamp will oscillate at 436MHz with a Vpp of about 200mV and a DC-value of perhaps 1V. I don't remember exactly, can get you some oscilloscope pics and fourier transforms tomorrow. This oscillation can be measured throughout the signal line, even on the junction between the last 60pF cap and 47 Rin resistor.Replacing the cap with a 0-ohm resistor does not help.Actually, I first encountered the problem when I realized I had set the gain of the first opamp waaay too high (using a 6,8k Rf instead of the correct value of 1,2k... Doh!), leading me to believe the first stage was the problem. However, it's completely stable on its own even with the correct 1,2kOhm Rf. Could it be radiative feedback? The two opamps are very close together, although the input of the first and output of the second are furthest apart (13mm).Regarding bypass caps, they are mounted less than 1mm from the power pins and are two 0603smd packages, one 10nF and one 100nF, the lowest value closest to the pins. Everything is smd, actually. Naturally I have a solid groundplane, except below the opamps themselves to minimize stray capacitance. I have followed every high speed analog design guides I could find. I am also attaching the TINA-TI file if you wish to have a look.

author: rfeecs
author_rank: Frequent Contributor
timestamp: June 08, 2016, 01:05:24 am
content: I might be concerned about the zener diodes. Have you tried removing the zeners as a test to see if it still oscillates?

author: Fulcrum
author_rank: Regular Contributor
timestamp: June 08, 2016, 10:55:27 am
content: Quote from: rfeecs on June 08, 2016, 01:05:24 amI thought of it, but I'd rather not, as I do not have any spares. If it comes to it, I will have to do it. But I don't see why they would make a problem. They have very low capacitance, and the simulations did not show any problems from adding them.

author: Kalvin
author_rank: Super Contributor
timestamp: June 08, 2016, 12:53:40 pm
content: You can increase the stability of an inverting op amp by adding a capacitor across the feedback resistor R2.

author: rstofer
author_rank: Super Contributor
timestamp: June 08, 2016, 01:32:55 pm
content: I'm quite suspicious of the zeners in the feedback path. What is the DC gain of the op amp if neither diode conducts? What happens to the DC gain when one of the diodes starts to conduct and the loop gain suddenly changes?Analog electronics isn't really my thing but there must be some operating condition under which the diodes aren't conducting and there is no feedback followed shortly thereafter by a sudden change in loop gain.LTspice is a nice tool, no doubt, but the simulation is not the circuit. It is simply a mathematical illusion...

author: StillTrying
author_rank: Super Contributor
timestamp: June 08, 2016, 03:13:55 pm
content: I get the OPA847 as a high speed multiplexer, and the lmh6703 as a 1.2Ghz current feedback amp - which won't like all that junk in place of Rf.

author: Fulcrum
author_rank: Regular Contributor
timestamp: June 08, 2016, 11:08:33 pm
content: Quote from: Kalvin on June 08, 2016, 12:53:40 pmI am aware of this, however this will also lower the gain at higher frequencies.Quote from: rstofer on June 08, 2016, 01:32:55 pmI'm afraid I cannot answer your questions.Quote from: StillTrying on June 08, 2016, 03:13:55 pmOpa847 is a 3.8GHz opamp from TI. What do you mean with junk in place of Rf? The zeners? They do not seem to be a problem, the circuit behaves as expected apart from the oscillations when connected to the opa847Anyways guys, I figured out why it was oscillating. Seems that there was feedback coupling through the power supply. I put inductors in the paths of the power for the OPA847, and the oscillation stopped.