Q About Calculating Opamp Gain

Started by Paul Marossy, November 16, 2009, 01:09:49 PM

Previous topic - Next topic

Paul Marossy

Sorry, I know these are probably dumb questions and I should probably know all this stuff after all these years of building things, but I can't find anything on how you calculate opamp gain for these specific scenarios:

1. In a non-inverting input scheme where the gain is set by a variable resistor in the feedback loop with no resistor/capacitor to ground. I see this all the time on schematics, but I can't find anything that tells me how you figure that out. It's simple, you turn the gain control and it directly affects the gain. In the schematic I am looking at, I do not have an input resistor, either. How the heck do you calculate this?!

2. What happens to the calculation needed above, for example, when you have a 1M Vref resistor connected to the non-inverting input and a 16K Vref resistor connected to the wiper of the gain control? I can't find anything that covers this, either.

I know it would be helpful if I could share the schematic, but I can't because of a non-disclosure agreement. If someone could just give an idea of what to do in terms of calculations, I could get an idea of the amount of gain happening in each stage.

CynicalMan

Quote from: Paul Marossy on November 16, 2009, 01:09:49 PM
Sorry, I know these are probably dumb questions and I should probably know all this stuff after all these years of building things, but I can't find anything on how you calculate opamp gain for these specific scenarios:

1. In a non-inverting input scheme where the gain is set by a variable resistor in the feedback loop with no resistor/capacitor to ground. I see this all the time on schematics, but I can't find anything that tells me how you figure that out. It's simple, you turn the gain control and it directly affects the gain. In the schematic I am looking at, I do not have an input resistor, either. How the heck do you calculate this?!

2. What happens to the calculation needed above, for example, when you have a 1M Vref resistor connected to the non-inverting input and a 16K Vref resistor connected to the wiper of the gain control? I can't find anything that covers this, either.

I know it would be helpful if I could share the schematic, but I can't because of a non-disclosure agreement. If someone could just give an idea of what to do in terms of calculations, I could get an idea of the amount of gain happening in each stage.

1. My understanding is that in the first situation, the gain would always be 1, unless there is a path from the opamp's - pin to ground or Vref. Since that is not happening, either there is something being missed because we can't see the schematic or I have no clue what I am talking about. In a non-inverting amplifier setup, there doesn't need to be an input resistor.

2. The 1Meg resistor is probably just to bias the input at 4.5V. The 16k resistor is more interesting. In that setup the gain pot should affect gain but I don't know how.

I suggest you try putting these circuits into LTSpice or another spice program and test them out.

R.G.

Quote from: Paul Marossy on November 16, 2009, 01:09:49 PM
1. In a non-inverting input scheme where the gain is set by a variable resistor in the feedback loop with no resistor/capacitor to ground. I see this all the time on schematics, but I can't find anything that tells me how you figure that out. It's simple, you turn the gain control and it directly affects the gain. In the schematic I am looking at, I do not have an input resistor, either. How the heck do you calculate this?!
If you really mean a circuit with the input to the (+) input and the (-) input connected to the output by a variable resistor, and  no other connections to the (-) input, the gain will always be one, no matter what the value of the resistor is, as long as the resistor is between zero ohms and less than one tenth of the input impedance of the (-) input. For JFET and MOSFET opamps, that could be many megohms. For a bipolar like the NE5532, that may be as little as 10K before the input impedance starts messing with you. For most opamps, zero to well over half a meg is a good estimate for "it's always unity".
Quote
2. What happens to the calculation needed above, for example, when you have a 1M Vref resistor connected to the non-inverting input and a 16K Vref resistor connected to the wiper of the gain control? I can't find anything that covers this, either.
I'm not really clear on what you mean here. In the above example, I understood that the variable resistor was connected as a two terminal variable resistor. I *think* you mean it's now a three terminal setup with a 16K to vref. But it's not clear how that matches with example in 1. I'd have to see the schematic, or at least a fragment.

The bottom line in this is that the forward gain is that the feedback network from output to (-) attenuates the output signal which the (-) input sees compared to the actual output. The action of the opamp is to force the voltage on the (-) input to follow the voltage on the (+) input; it can only do this when the feedback network attenuates the output voltage by making the output voltage 1/attenuation times bigger so the voltage which appears on the (-) input matches the (+) input. Notice that this is true for the case when the output is shorted to the (-) input or connected to the (-) input by a resistor. It's only when you have an attenuation network that the gain goes above unity.

So whatever network appears between the output and (-) input attenuates the output. However complicated that network is, when you simplify it down, it gives you the gain.
Quote
I know it would be helpful if I could share the schematic, but I can't because of a non-disclosure agreement. If someone could just give an idea of what to do in terms of calculations, I could get an idea of the amount of gain happening in each stage.
Perhaps you could post a fragment, stripped of all details except the gain setting resistors.

Or dump it into a simulator, as suggested.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

waltk

There's a TI publication titled "Single-Supply Op-Amp Circuit Collection" here: http://courses.cit.cornell.edu/bionb440/datasheets/SingleSupply.pdf.  It explains different opamp configurations in detail.  May not cover your exact question - but it might prod your memory...

Paul Marossy

OK, I have to give you a piece of the schematic. This is part of a six layered PCB I was paid to reverse engineer and breadboard for testing & tweaking.

No input resistor, 500K variable resistor between output and non-inverting input. The gain definitely increases when you turn the knob.  :icon_wink: I see this arrangement on a lot of schematics, but I can't find anything that describes this and how to calculate it. Everything I have found involves resistors to ground or a ratio between the input resistor and the feedback resistor value. Do I assume that the gain is variable between 47 and 547 on this schematic? This is what I don't understand.  :icon_confused:

Also, there is a 16K resistor connected to the wiper of the pot. I am pretty sure that Vref is not connected to the other end of the pot from looking at the layers of the PCB. It works fine like this on the breadboard. Another thing I don't understand is how you can have a cap in series with the Vref resistor, it seems like it wouldn't work because it would block DC, right? But it appears that is what is happening on the circuitboard. I at first thought that the caps might be to ground, but I can not find where they connect to ground - there just isn't a connection to ground on those caps.

There is a lot more weird (and trick) stuff going on with the rest of the circuit, but I can't divulge any more info.  :icon_frown:


R.G.

Quote from: Paul Marossy on November 16, 2009, 06:44:42 PM
OK, I have to give you a piece of the schematic. This is part of a six layered PCB I was paid to reverse engineer and breadboard for testing & tweaking.


No input resistor, 500K variable resistor between output and non-inverting input. The gain definitely increases when you turn the knob.  :icon_wink: I see this arrangement on a lot of schematics, but I can't find anything that describes this and how to calculate it. Everything I have found involves resistors to ground or a ratio between the input resistor and the feedback resistor value. Do I assume that the gain is variable between 47 and 547 on this schematic? This is what I don't understand.
It's back at that "attenuation of feedback path" I mentioned. This feedback path does indeed attenuate.

QuoteAlso, there is a 16K resistor connected to the wiper of the pot. I am pretty sure that Vref is not connected to the other end of the pot from looking at the layers of the PCB. It works fine like this on the breadboard. Another thing I don't understand is how you can have a cap in series with the Vref resistor, it seems like it wouldn't work because it would block DC, right?
Signal isn't DC - it's AC. And a Vref, properly made, looks like a short to ground in AC signal terms.

Quote
There is a lot more weird (and trick) stuff
Or confused stuff.  :icon_biggrin:

R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

zyxwyvu

Quote from: Paul Marossy on November 16, 2009, 06:44:42 PM
No input resistor, 500K variable resistor between output and non-inverting input. The gain definitely increases when you turn the knob.  :icon_wink: I see this arrangement on a lot of schematics, but I can't find anything that describes this and how to calculate it. Everything I have found involves resistors to ground or a ratio between the input resistor and the feedback resistor value. Do I assume that the gain is variable between 47 and 547 on this schematic? This is what I don't understand.  :icon_confused:

The pot isn't so much a gain control as a tone control. The key is the 500pF capacitor. If it were not there, the pot would have (almost) no effect. The higher the resistance of the pot setting, the more the mids are attenuated. Here's a picture from a simulation that shows this (frequency response for 0%, 10%, 50% and 100% pot settings, higher % = higher resistance):



As you can see in the picture, the gain ranges from ~3 for a narrow peak at 200Hz on the maximum resistance setting, up to 4 for most frequencies at the minimum resistance setting. In order to calculate this, you would need to do some complex (as in real/imaginary) algebra with the impedances and Kirchoff's laws on the feedback loop.

Paul Marossy

#7
Quote from: zyxwyvu on November 16, 2009, 10:31:58 PM
The pot isn't so much a gain control as a tone control. The key is the 500pF capacitor. If it were not there, the pot would have (almost) no effect. The higher the resistance of the pot setting, the more the mids are attenuated.

OK, I can buy that. But I did also look at all the waveforms for each stage with a scope, and there is definitely some clipping going on in this first stage, but it does in fact not affect the gain a huge amount when you adjust the gain control. So I guess you can have clipping happening without necessarily having a lot of gain? That's a new concept for me. I guess that would be good if you don't want hard opamp clipping to be happening...