# OpAmp puzzle

#### GrahamRounce

Joined May 6, 2009
19
Hi all. Not for the first time, I've hit a road block with an opamp circuit. Any help would be very appreciated.
In the picture, the first two circuits are non-inverters from different Texas articles. They are similar, but as you can see, R1 goes to different places! Does it matter? I'd have thought so. It makes it difficult if manufacturers can't get their demo circuits right!
My immediate problem is with the third circuit, my own. It's supposed to have a gain of one (via the two 1M resistors, and the ability to shift the signal downwards via VR. Pictures of the signals in and out are shown. In practice, VR does shift the signal level, but the gain is about 5! Why, I don't know.
Thank-you very much,
Graham

#### crutschow

Joined Mar 14, 2008
34,047
but the gain is about 5! Why
Are you sure the two resistors are 1 megohm, and the pot is 10k ohm?

#### Ian0

Joined Aug 7, 2020
9,503
Your second circuit won't work because there is no DC path to ground on the non-inverting input.
It does matter where R1 connects - it connects to the reference. The reference is usually ground especially if you have split (positive and negative) supplies.
The output voltage (measured between the output terminal and the reference), will be the input voltage (measured between the input terminal and the reference) multiplied by the gain.
On your third circuit, it is a non-inverting circuit, so the gain is 1+(R1/R2) which is equal to 2 (ignoring the resistance of the pot).

#### Papabravo

Joined Feb 24, 2006
21,003
The manufacturer got both demo circuits right. The two circuits are fundamentally different. Why would you have ANY expectation that they would be the same?

In the first case the resistor network is connected to GROUND. In this circuit the output will go to whatever voltage it needs to, such that the inverting input (-) will be equal to Vin.

The second circuit has the input AC coupled to the non-inverting input, while the inverting input is fixed at a voltage determined by Vdd/2 or one-half the supply voltage and Vout. This is a common thing to do in single supply circuits. Just because the expressions for the gains are the same does not imply that the circuits are identical.

The first circuit works down to DC, but the 2nd circuit does not.

#### Papabravo

Joined Feb 24, 2006
21,003
Here is a simulation of the first circuit

You can clearly see the average gain of 1.5 and not that the gain applies to both the AC component and the DC component.

#### Papabravo

Joined Feb 24, 2006
21,003
Here is the simulation of the 2nd circuit

You can clearly see that C1 has removed the 1.25 Volt offset on the input signal and cenetered the AC component of the input at +3 volts which is VDD/2

Is it now clear that these are two different circuits and they both have the same AC gain at low frequencies.

#### Ian0

Joined Aug 7, 2020
9,503
The first circuit works down to DC, but the 2nd circuit does not.
Hypothetically it does, because in the absence of a resistance to ground, the cutoff frequency is zero.

#### GrahamRounce

Joined May 6, 2009
19
Thank-you all, esp PapaB.
I now see that ignoring the "1+" in the gain became a bad habit and gave a way wrong answer at low gain.
I'm glad to have my belief in TI restored.
I think my circuit (the 3rd one) should work if I AC couple the input, though I still don't see why the gain is 5 and not 2. Perhaps it will all come out in the wash. I'll let you know!

#### Ian0

Joined Aug 7, 2020
9,503
I think my circuit (the 3rd one) should work if I AC couple the input,
Be careful where you return the DC bias resistor to.

#### GrahamRounce

Joined May 6, 2009
19
Yes, thanks. That's what the pot's supposed to be for. After coming through the coupling capacitor, the signal will be -50mV to +50mV. Eventually I want a decent-sized dc output that reflects the amplitude of the sine wave, so to lift the wave by 50mV the pot should be set to Vdd/2 - 50mV ?

Should I have mentioned that the frequency is about 500kHz? That's not causing a problem in the preceding voltage follower stage.

[Like with recursion in maths, I find the operation of op-amps very hard to get my head round.
Eg "the output will go to whatever voltage it needs to, such that the inverting input (-) will be equal to Vin". Why? How does it know : ) ?
Also, in an inverting circuit, as all the configuration is on the "-" input, why does the "+" input also get amplified?
I just try to remember these things, and not ask too many questions, but it's hard work without an intuitive understanding. Which is why I fall back on examples with simple diagrams and rules I can work from, but that can lead to trouble, as we see.
(I only use single supply devices, for psu convenience, but unfort they're even less intuitive!) ]

Thanks again,

#### Ian0

Joined Aug 7, 2020
9,503
Eg "the output will go to whatever voltage it needs to, such that the inverting input (-) will be equal to Vin". Why? How does it know : ) ?
Also, in an inverting circuit, as all the configuration is on the "-" input, why does the "+" input also get amplified?
Feedback! That’s how it knows!
if the non-inverting input is higher than the inverting input, it makes the output voltage higher. If the inverting input is higher than the non-inverting input, it makes the output lower. Thus it reaches the situation where the two inputs are the same level provided that you have the feedback connected correctly.
Knowing that the inputs are at the same level, and that only a negligible current flows into the inputs, means that you can calculate what the voltage on the output terminal must be to achieve that, and from that you get the gain equations.

Bear in mind that the op-amp is a dc device. You must establish DC conditions on both inputs, so you need a DC PATH TO GROUND (or some other dc level) on the non-inverting input, a fact that @Papabravo appears to have overlooked in his otherwise excellent advice to you.

#### Papabravo

Joined Feb 24, 2006
21,003
It is a consequence of high open loop gain and negative feedback.

#### Bordodynov

Joined May 20, 2015
3,167
Here is the simulation of the 2nd circuit

View attachment 304197

You can clearly see that C1 has removed the 1.25 Volt offset on the input signal and cenetered the AC component of the input at +3 volts which is VDD/2

Is it now clear that these are two different circuits and they both have the same AC gain at low frequencies.
Papabravo,
You have made an incorrect circuit. You do not have an external circuit that gives a constant bias to the input of the operational amplifier. You need to add an external resistive divider to that input. In the spice model there are two very large identical resistors (20000000000000 Ohm). They are to simulate leakage across the input of the operational amplifier. In reality, the leakage to power and ground is different!

Last edited:

#### crutschow

Joined Mar 14, 2008
34,047
"the output will go to whatever voltage it needs to, such that the inverting input (-) will be equal to Vin". Why? How does it know : ) ?
Also, in an inverting circuit, as all the configuration is on the "-" input, why does the "+" input also get amplified?
Okay, take a deep breath.
It's really rather straight-forward if you understand the basics of an op amp.

One important thing to understand is that an op amp has a differential input, which means it only amplifies the voltage difference between the two inputs.
It basically ignores the common-mode (same voltage) applied to both inputs (within limits as stated in its data sheet).

Thus if the plus input has a more positive voltage than the minus input the output will go positive (amplified by the large open-loop gain), and vice-versa for opposite polarity inputs.

So if you add a path from the output to the negative input (negative feedback), then the output will always go in the direction as to reduce the difference between the two input voltages to near zero, due to the high voltage gain of the op amp (typically 100k or more).
For example, for a 10V output the typical input difference voltage would only be 10V/100k = 100µV (ignoring any real-world small input offset).
That's why it is often stated that the difference (for most practical purposes) is zero.

If the plus input is connected to signal ground, then the negative input will also go to near ground (sometimes called a virtual ground point) due to the feedback, since that's the only stable state where the input voltage difference is near zero.

So that's how it "knows".

If you understand the above, then you should be able to understand how most op amp circuits work.

Last edited:

#### Papabravo

Joined Feb 24, 2006
21,003
Papabravo,
You have made an incorrect circuit. You do not have an external circuit that gives a constant bias to the input of the operational amplifier. You need to add an external resistive divider to that input. In the spice model there are two very large identical resistors (20000000000000 Ohm). They are to simulate leakage across the input of the operational amplifier. In reality, the leakage to power and ground is different!
It may be that the circuit is impractical. I was only trying to replicate the circuit shown in Figure 3. of the TS's original post.