Capacitor in a non-inverting OpAmp circuit - Page 1
Forum section: electronics / beginners

author: Midphase
author_rank: Regular Contributor
timestamp: February 07, 2025, 03:04:23 am
content: I'm curious about exactly the purpose of the C9 capacitor in this non-inverting opamp circuit?I assume it's performing some sort of filtering to minimize noise in the amp?If so, what would be the best way to calculate the ideal size of the capacitor?On a related note, what are the purposes of C7 and C8? Are they also performing a filtering (high pass?).Sorry for the noob question, I'm trying to wrap my head around all of this. Many thanks!

author: ledtester
author_rank: Super Contributor
timestamp: February 07, 2025, 03:39:24 am
content: For the cap in the feedback path:https://electronics.stackexchange.com/questions/196322/understanding-op-amp-circuits-with-extra-capacitors-in-the-feedback-path

author: Coordonnée_chromatique
author_rank: Frequent Contributor
timestamp: February 07, 2025, 07:51:57 am
content: "this capacitor adds an extra pole in the amplifier's frequency response, which can increase the phase margin and make the circuit more stable. This is a bit more complex and depends on the properties of the op-amp, so I won't go into detail."Be carefull if you want to remove it, the circuit can go ot of phase margin and therfore oscillate, giving a +-VCC at the output and a lot of magic smoke (+fire) can occur.

author: Zero999
author_rank: Super Contributor
timestamp: February 07, 2025, 11:39:16 am
content: Quote from: Coordonnée_chromatique on February 07, 2025, 07:51:57 amDon't worry. It won't emit magic smoke without the capacitor. The TL071's output is protected against over-current. The circuit will also be stable and not oscillate without the capacitor.All the capacitor does is reduce the high frequency response, which is desirable in some applications.However, in this case, I doubt the capacitor does much. The cut-off frequency with 47pF and 10k is 340kHz and the gain of this circuit is 22, but the open loop gain of the TL071 is only 10 at 340kHz.I'll post a simulation and bode plot later.

author: David Hess
author_rank: Super Contributor
timestamp: February 07, 2025, 12:01:58 pm
content: Quote from: Zero999 on February 07, 2025, 11:39:16 amIn that case, the capacitor is there to cancel the effect of stray capacitance at the inverting input which would otherwise lower the phase margin. Maybe the original layout was marginal in this respect, making the feedback capacitor necessary for stability.

author: ledtester
author_rank: Super Contributor
timestamp: February 07, 2025, 02:07:20 pm
content: Quote from: Midphase on February 07, 2025, 03:04:23 amC7 looks like it is an AC coupling cap and with R6 is used to remove the DC bias from the input signal.C8 is probably some attempt to filter out high frequencies, but it's very, very small.C10 AC grounds the feedback resistor R9 so the DC component of the op-amp's output doesn't see it and therefore is not amplified.More explanation here:https://electronics.stackexchange.com/questions/437278/single-supply-non-inverting-amplifier-using-op-amp

author: PGPG
author_rank: Frequent Contributor
timestamp: February 07, 2025, 03:23:02 pm
content: Quote from: Midphase on February 07, 2025, 03:04:23 amIf this is acoustic range amplifier this capacitor can be there to reduce TIM distortions.I have never been working seriously with acoustic amplifiers so I'm not sure.When people moved from tube to transistor amplifiers they could improve the linearity of the amplifier and lower the distortion by making the amplifier itself high gain and putting a strong feedback loop around it. All the parameters measured with sine waves were better, but everyone had heard that tube sounded nicer. That's when TIM distortion was discovered.

author: Midphase
author_rank: Regular Contributor
timestamp: February 07, 2025, 05:24:46 pm
content: Interesting,Well, I already made a couple of small changes to the circuit (I'm attaching the full schematic which is for a circuit designed to bring a guitar level input up to line level, as well as the reverse of that) designed to interface synthesizer outputs with guitar pedals and back.For one, I don't have a TL071, but I have plenty of TL072's so that's what I'm using.The other tweak I've done so far is to change the value of R9 to 330Ω to increase the gain of the opamp a bit (or alternatively was thinking of replacing R8 with a 12KΩ resistor...but not both as it's introducing clipping in the signal).Beyond that, I'm hoping to make any additional changes that could improve the circuit, and I would love to be able to fine tune the capacitors C8 and C9 values to offer a slightly more "musical" effect.Lastly, I assume that R5 is there to establish the input impedance for the guitar? 1MΩ seems to be the suggested value for that.stomp-adapter.pdf(44.7 kB - downloaded 60 times.)

author: Zero999
author_rank: Super Contributor
timestamp: February 07, 2025, 07:11:31 pm
content: Quote from: David Hess on February 07, 2025, 12:01:58 pmThat doesn't make sense because they've added 10pF between the non-inverting input and 0V.Anyway, I've simulated with and without the 47pF capacitor. The difference between attenuation is <3dB above 340kHz.Note, I've removed the other components for the simulation, as I just wanted to show the effect of the feedback capacitor.

author: Midphase
author_rank: Regular Contributor
timestamp: February 07, 2025, 09:03:28 pm
content: Thank you.I just removed the capacitor from the circuit and I can not tell any difference in sound by ear.Would a different size capacitor affect a lower frequency? Like for instance rolling off, say 8Khz-10Khz and above would probably not have any negative effect on the guitar input sonic characteristics.

author: David Hess
author_rank: Super Contributor
timestamp: February 07, 2025, 10:48:01 pm
content: Quote from: PGPG on February 07, 2025, 03:23:02 pmI made that mistake in my first audio power amplifier designs. Constraining the bandwidth by adding a big feedback capacitor leads to more TIM because the amplifier takes longer to recover from overload. The solution is to limit bandwidth by filtering before and after the amplifier, like with a current feedback operational amplifier were feedback capacitance is verboten unless you know the magic circuit configuration.If C9 was added to cancel the effect of stray capacitance at the inverting input, then it would be scaled by the ratio of the feedback divider. So 47pf/10k = ?pF/470, and it cancels 2.2 picofarads across R9, which is really 2.2 picofarads of parasitic capacitance from the inverting input to ground. That is about right so that is what C9 is doing.I never had that sort of problem with the TL071 series of JFET input operational amplifiers which would require C9, but maybe they had an especially poor layout.

author: jwet
author_rank: Frequent Contributor
timestamp: February 07, 2025, 10:57:40 pm
content: Plot phase on the same graph with and without and with that 10p on the plus input (bad idea). Extend the frequency and vertical range so you can see the 0 dB crossover and true phase margin. Another test might be to feed it square waves and look at dynamics, over shoot, etc. You might also try to load the amp with a small cap load- maybe 100 pf. Audio circuits often have to drive unterminated lines that are capacitive. It may not be audible or obvious, but its important.

author: floobydust
author_rank: Super Contributor
timestamp: February 07, 2025, 11:16:44 pm
content: Properly done, these audio gain stages have an input filter for out-of-band incoming signals, such as AM radio, WiFi, BT, LED lighting etc.OP did not say where the input "BFFX" goes to, but for example a guitar jack has lot's of RF and ESD as well and you would never run that naked into an op-amp.So the 10pF cap C8 is a fail without some accompanying series resistance. I would use 100 ohms and C8 220-470pF C0G, and a ferrite bead as well.The next generation TL07xHhave "integrated EMI and RF filters" but I have not experimented with them.TL071 datasheetFor cap C9 it's another HF roll-off, I use this for limiting bandwidth, as there's no real need for the circuit to amplify over 100kHz.

author: MrAl
author_rank: Super Contributor
timestamp: February 08, 2025, 11:49:21 am
content: Quote from: Midphase on February 07, 2025, 03:04:23 amHi,To figure this out, you can short out C7 and that means all those components at the input are eliminated if we think of the output impedance of the input source to be zero. That leaves only the components in the negative feedback circuit which includes C9 and C10 and associated two resistors.Next, it helps if you are already familiar with low pass and high pass circuits.First, think of that GND at the input of C10 as being an input voltage also. We can then think of C9 and R8 as providing a low pass filter function, and C10 and R9 as providing a high pass function. Because we have both a high pass and low pass, it is very likely this constitutes an elementary type of bandpass filter. In fact, that's what this circuit does, although the bandwidth is very wide.It help if you recognize the low pass and high pass topology because then you can immediately see that you have both, and provided the high pass function works at a lower frequency than the low pass function, you can assume it's a bandpass of a sort.Bandpass filters can be sharp or very wideband. This one happens to be very wideband. You can get the approximate cutoff frequencies from multiplying the resistor value times the capacitor value, then multiplying by 2 and by pi, then taking the reciprocal:f=1/(2*pi*R*C)You can do this with the 10uf and 470 Ohm to get the high pass frequency, and with the 47pf and 10k to get the low pass frequency. Since the low pass frequency comes out so much higher than the upper limit of human hearing, we might wonder why they went so high up with this frequency. 100kHz would have been plenty.In case you want to look at this in more detail, you can do a full circuit analysis. It gets a little complicated but if you short out C7 and assume the input source has zero output impedance, the transfer function is not too complicated:Vout/Vin=(s^2*C10*C9*R8*R9+s*C10*R9+s*C9*R8+s*C10*R8+1)/((s*C9*R8+1)*(s*C10*R9+1))and the amplitude of that is:magnitude=sqrt((1-w^2*C10*C9*R8*R9)^2+(w*C10*R9+w*C9*R8+w*C10*R8)^2)/(sqrt(w^2*C9^2*R8^2+1)*sqrt(w^2*C10^2*R9^2+1))and this gives you a chance to plot the approximate curve with frequency after plugging in the values for the components, and you can switch components to see how different values affect the response.For example, if you raise R9 that raises the impedance of the C10 and R9 series part, and that means we get less of a high pass function, meaning it almost all high pass. If we decrease R9, we increase the influence of the high pass section so we get more of the high pass function.The way many people like to do this is to use Bode analysis. That allows you to combine straight line segments (in many cases) to get the approximate frequency response. For example, the C10 and R9 combination would be a straight line up at an angle starting from the origin, while the C9 and R8 combo would be a straight line down at an angle starting at the upper cutoff frequency.This idea has been around for decades and if you are interested in learning about it you should look it up on the web. It does get a little trickier with systems that have a true second order response.Computers changed this a lot because you can just plot the transfer function, and it takes less than a second.

author: Coordonnée_chromatique
author_rank: Frequent Contributor
timestamp: February 08, 2025, 12:34:35 pm
content: Quote from: David Hess on February 07, 2025, 12:01:58 pmI've wrote that because i've replaced a TL071 with a NE5532 in a output buffer and burned my finger on the surface of the chipThe capacitor solved the phase reversal problem.

author: floobydust
author_rank: Super Contributor
timestamp: February 08, 2025, 06:51:37 pm
content: Uh the 5532 is a dual, the 071 is a single... swapping those two will make smoke... I could see 5534/TL071 or 5532/TL072 swaps, if that is what you meant.The phase-reversal problem with TL071 is due to the input voltage going below the VCMspec, no capacitor anywhere is going to prevent that. It causes a frequency doubling effect, to sound fairly crazy in audio effects when overloaded.I've had op-amp IC's run hot if they are oscillating at say 10MHz but don't hear that in an audio circuit of course.

author: Zero999
author_rank: Super Contributor
timestamp: February 08, 2025, 07:32:56 pm
content: Quote from: floobydust on February 08, 2025, 06:51:37 pmI would have assumed he had change the layout on account of the different pin-out, not just blindly swapped the ICs.

author: floobydust
author_rank: Super Contributor
timestamp: February 08, 2025, 09:10:32 pm
content: After my Great Breadboard Meltdown 1979, I'm a bit more careful about changing IC's. I have pics lol. I think it might have been an LM386 oscillating to meltdown though.OP's circuit seems to be a guitar effects stomp pedal but we don't really know.Op-amp oscillating, phase-inverting, picking up RF etc... that's afeaturefor the fuzz and many people won't realize otherwise.

author: Midphase
author_rank: Regular Contributor
timestamp: February 09, 2025, 06:07:21 pm
content: Quote from: Zero999 on February 08, 2025, 07:32:56 pmYeah, I rewired the pins to the new opamp since they have a different configuration.The circuit is for a guitar preamp, to bring the level up to line level so that one can plug a guitar into a synthesizer/line level device for further processing.So far it seems to work as advertised, although I am not sure if the amplification is high enough. I'm tempted to utilize the second opamp in the TL072 to further boost the signal, although I wonder if in that case I should be using the inverting input of the first opamp, and then invert it again with the second opamp?I'm a bit unclear on the advantages/disadvantages of using the inverting input vs. the non-inverting input.

author: TimFox
author_rank: Super Contributor
timestamp: February 09, 2025, 06:54:29 pm
content: Advantage of non-inverting: high input impedance.Advantage of inverting: no common-mode problems.

author: jwet
author_rank: Frequent Contributor
timestamp: February 10, 2025, 05:24:54 pm
content: Words of wise man a long time ago- "always invert unless you can't"Don't forget also that the gain of a non inverting stage is 1+Zf/Zin. The gain doesn't go to zero like an inverting stage when the feedback ratio goes to zero- its just goes to unity.