Why is this simple circuit unstable? - Page 1
Forum section: electronics / beginners

author: ssashton
author_rank: Frequent Contributor
timestamp: July 15, 2022, 06:35:58 pm
content: SOLVED! I was very stupid.Hi everyone!I built this circuit and I'm testing the input and output of U9 by feeding an input from my audio interface and recording it back.It is unstable as shown, but if I remove R52 and R45 from the feedback network it becomes stable (and has unity gain). I tried connecting R52/R45 to GND (rather than bias) via a 1uf capacitor, but it made no difference.I'm struggling to understand why it would be stable with unity-gain by not with even a small amount of gain?I did originally have some 3n3 caps on the input and output for HF filtering but removed them in case they were the problem, but seems not.Bias is provided by 1/2 of U6. I'm not currently testing the 2/2 of U6 but those parts are there and connected. I mention in case that is the cause of instability.Power is provided by a LM317 with 15V in 12V out with 10uF electrolytics. Local decoupling on each op-amp is 100nF 0603 right next to each IC. I have reduced output to 10V in case not enough drop, but no change.Thanks!

author: StillTrying
author_rank: Super Contributor
timestamp: July 15, 2022, 07:47:55 pm
content: I don't know, I'd probably try 1uF to 10uF Bias to GND.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 15, 2022, 10:36:54 pm
content: You could start by drawing opamps as opamps instead of squares.Without that I (and a lot of other people) have a lot less interest in figuring out what the schematic does.That "bias" thing does look suspicious though. A decoupling capacitor may help, or add an opamp as a buffer so it has a low impedance.

author: tggzzz
author_rank: Super Contributor
timestamp: July 15, 2022, 11:00:41 pm
content: I second the point about drawing the schematic using the common patterns. If you do that, not only does it make other people more likely to help you, but also it helps you understand what you are doing.Apart from that,...Unstable in what way?Construction technique? If solder less breadboards, expect to spend more time debugging the breadboard than debugging your circuit.Have you done a spice simulation? Transient and frequency domain?Decoupling capacitors? Minimised inductance in PSU wires?

author: ssashton
author_rank: Frequent Contributor
timestamp: July 16, 2022, 12:12:44 am
content: Okay hopefully this will be easier for you to read:FWIW I'm not the one drawing op-amps that way, it's just the built-in footprint for the part.By unstable I mean there is lots of distortion and noise on the output.This is a 1KHz sine.This is when it's stable:I did a bit more testing and found further details. For simplicity I'll talk only about U2.1 in the new schematic drawing.Only removing R52 in the feedback leg makes it unity-gain and seems almost, but not fully stable.In addition, removing C44 and C45 makes it fully stable.What I find strange is that I can add back C45 on the output, provided I lower the output buffer R55 from 470R to 100R.I don't understand why a lower buffer resistor value would help stability, but in nay case I think this is just patching a deeper problem. Even with 100R on the output it is still unstable when I ask for a little gain.The layout is on a 4 layer PCB it's not on a breadboard although I now wish I had done so!

author: tggzzz
author_rank: Super Contributor
timestamp: July 16, 2022, 08:42:01 am
content: That certainly is easier top comprehend.Unfortunately the diagram on that server is almost illegible; see below.It is good practice to upload images to this site, since that means the image won't disappear when a random company's business plan changes to require "moneytisation of assets"; PhotoBucket is one example. Use the button below and select "end-of-post expandable thumbnail". For schematics, use gif or png format.Apart from that.Show or describe experimental setup with a photo; details matter.Distinguish between stability and distortion.What does the time domain signal look like?What's the amplitude?Does the distortion vary with amplitude?What is thetypeof the electrolytics?

author: ssashton
author_rank: Frequent Contributor
timestamp: July 16, 2022, 09:25:18 am
content: I was rather expecting someone would just say "duh, of course that doesn't work because..." after looking at the schematic.I take it nobody thinks there is anything particularly wrong with my schematic, then?Attached is the PCB layout. 15V comes in on the right hand IDC, goes to C48, then to the GND and power plane for the LM317. LM317 outputs 12V (currently set at 10V) on traces to the local bypass caps for each op-amp. The larger power plane is used for bias which comes from U6.Signal is input on the left hand connector going to C31, C36, C41, C46. Goes to U8, U9. Then out via C34, C37, C40, C43 and to the right hand IDC.How can I test the time domain response?I have an audio interface which is good for getting low noise low distortion measurements. I also have a cheap Pico-scope that has higher bandwidth but IIR only 8bit.I was thinking I might try an LM7805 as a bias source. Then maybe also try an inverting configuration on a bread board, see if it behaves much different.P.S. You can click on the images I posted above to go to the server and expand the view.

author: RoGeorge
author_rank: Super Contributor
timestamp: July 16, 2022, 10:07:51 am
content: - Youmusthave local bypass capacitors near the opamps power pins, I don't see any in the schematic. They help in many ways, including stability.- Look for any unwanted ground loops in the PCB and/or in the signal cables (incorrect shielding can create ground loops), also power supply should never be connected near the signal input, but near the output(I see your PCB, but didn't check it for any of the above, also I don't know the opamp, the advice is generic "should do" against self oscillating).

author: ssashton
author_rank: Frequent Contributor
timestamp: July 16, 2022, 10:19:02 am
content: Quote from: tggzzz on July 16, 2022, 08:42:01 amWoooaa!This is embarrassing, but I've got to admit to it after asking you all for help.I had the output of my test rig set at +12dBu (3V rms) when I thought it was at +3dBu (1V rms). So yeah, when it has gain it runs in to the rails. Less gain, and less input level no problem.I reduced the input signal to the test PCB and now all is wellI do find it very interesting still, that under non-ideal conditions it seemed to be more stable with 100R output buffer than 470R. Why would this be, isn't more buffer better?

author: tggzzz
author_rank: Super Contributor
timestamp: July 16, 2022, 11:39:32 am
content: Quote from: ssashton on July 16, 2022, 09:25:18 amCan't be arsed to figure out what is/isn't available on a random server, nor to enable JavaScript for a random server on the offchance it might help.Simpler + fewer dependencies is better.QuoteThat depends on what equipment you have.If "audio interface" means "computer audio card", then that will capture sequential samples which are, by definition, time domain. Use audio editor to examine .wav file etc. Scope will do. If you only have a spectrum analyser, then do an inverse FFT.Quote

author: jasonRF
author_rank: Regular Contributor
timestamp: July 16, 2022, 05:22:45 pm
content: Quote from: ssashton on July 16, 2022, 12:12:44 amI know your problem is solved, but for future reference, distortion and noise do not necessarily mean the circuit is unstable. You haven’t presented any measurements that lead me to believe this was a stability problem at all. If it were unstable your Picoscope would most likely be capable of measuring it. My 2204a (the cheapest model currently in production) has a measured bandwidth if about 25 MHz, and I have easily seen unstable circuits oscillate at 20+ MHz, as well as instabilities excited by square-wave inputs (‘fuzz’ after rising or falling edges). If you learn how to use the Picoscope properly it can be a powerful tool, even if it is a cheap model!Jason