PDA

View Full Version : Discussion Op-amp questions


soft2
Feb 10, 2009, 03:23 AM
I'm trying to calculate the gain for each of these circuits. I'm having some trouble so hoping someone can help me. The op-amps are rail-to-rail for both input and output. First time using eagle so feel free to offer tips on schematic drawing as well.

The first circuit I calculated a gain of 2.8 for V+ input above 0.18v. It appears to behave that way. So far so good.

The second circuit I calculated a gain of about 25 with input above 4.037v and about -23.9 when v+ drops below 4.037v. But it's not behaving that way. When V+ is 4.06 the amp just saturates at 5v. It's hard to measure the gain when input is below 4.037 because my probes cause a shift of several mv. Not sure why. And it's hard to change the output from the sensor. So I don't know for sure the negative gain.

If anyone can explain to me why the first circuit appears to work but not the second... Thanks for your help.

tune by tito
Feb 10, 2009, 04:03 AM
Go to http://www.national.com/analog

and you can simulate-emulate using their WEBENCH® Designer program
Best regards tito

jeffs555
Feb 10, 2009, 06:25 AM
I calculate the gain for the first circuit to be about 2.56 and for the second to be 125. I don't know how you are calculating gain and why you think the gain should change when the input is above or below a certain voltage. The gain for a non-inverting amplifier is equal to 1 + the feedback resistor divided by the resistance on the negative input. For the circuits you show, the negative input resistance is equal to the parallel combination of the resistor to ground and the resistor to 5v. In the first case that is 270k in parallel with 10k or about 9.6k and with the 15k feedback resistor gain is 1+1.56=2.56. For the second circuit the negative input resistance is 4.7k in parallel with 19.7k or about 3.8k and with 470k feedback gives a gain of 1+124. You show it wired as a non-inverting so the gain will always be positive.

soft2
Feb 10, 2009, 11:52 AM
jeffs thanks for this. First I gave the wrong value in circuit 1 for R4. I'm using 18K instead of 15K. D'oh. Sorry I'll try to fix that.

Now the formula for gain - why do you use the two resistors in parallel (on neg input) when one of them is going to +5v? I assumed that all the currrent would flow through the resistor tied to gnd and nothing through the other because it would always be at a higher voltage than Vout.

On circuit 2, for most of the range of the sensor on V+, the op-amp output will be lower than the V+ input. When it's lower, I guess I had the mistaken idea that the formula would be the same as for an inverting amp. Forgive me for being new to this, but I can't see why it's not.

tune_by_tito - thanks I haven't tried it yet but I will. I think Eagle has some kind of feature like this, doesn't it? Still getting used to eagle. not sure if I like it!

pmackenzie
Feb 10, 2009, 12:13 PM
The way the feedback works is to force the voltage at the inverting input to be the same as at the non-inverting one. So the voltage at the inverting input is Vi.

The currents at that point have to sum to zero.


(Vo-Vi)/R4 + (Vcc - Vi)/R2 + Vi/R3 = 0

solves to ( I hope :o )

Vo = -Vcc*R4/R2 + Vi ( 1 + R4/ (R2//R3))

For purposes of small signal gain both ground and the supply voltage are in effect at the same point. Takes a while to get your head around that.
The voltage divider just offsets the output to get it into the desired range for the input.

Pat MacKenzie

jeffs555
Feb 10, 2009, 02:37 PM
I think Pat covered the calculations very well. The equation he shows for Vo points out one of the things you need to watch for when using a resistive voltage divider like that to offset the voltage. Because the output offset is equal to -Vcc*R4/R2, any variation or noise on Vcc will be amplified and show up in the output multiplied by R4/R2.

Don't know if Eagle has any kind of analog simulation capability, but if you want an analog simulator that you can install and run on your PC for free you can go to www.linear.com/designtools/software/ and get LTSpice. The user interface for entering schematics doesn't seem very intuitive to me, but once you enter everything you can change values and see the results very quickly.

pmackenzie
Feb 10, 2009, 02:40 PM
FWIW, simulation software will not let you get to the heart of the matter, such as Jeff's point about the Vcc noise, or why the resistor to Vcc behaves the same as one to ground for determining gain.

Pat MacKenzie

soft2
Feb 10, 2009, 06:17 PM
The way the feedback works is to force the voltage at the inverting input to be the same as at the non-inverting one. So the voltage at the inverting input is Vi.

The currents at that point have to sum to zero.


(Vo-Vi)/R4 + (Vcc - Vi)/R2 + Vi/R3 = 0

solves to ( I hope :o )

Vo = -Vcc*R4/R2 + Vi ( 1 + R4/ (R2//R3))
Err... actually how can that first equation ever be right if Vo is greater than Vi? And it doesn't solve to the second. After looking at the circuit, I come up with 2 possible equations that might be right. At first I figured that the current thru R3 was negative compared to that of R4 and R2. That would make your equation:

(Vo-Vi)/R4 + (Vcc-Vi)/R2 - Vi/R3 = 0

which solves to your second equation. (I think :o )
But if we have to calculate the parallel resistance of R2 and R3 to use that as the input resistance, then doesn't it stand to reason that the equation should be:

(Vo-Vi)/R4 - (Vcc-Vi)/R2 - Vi/R3 = 0

I don't know which is right, if any.

For purposes of small signal gain both ground and the supply voltage are in effect at the same point. Takes a while to get your head around that.
The voltage divider just offsets the output to get it into the desired range for the input.

Pat MacKenzie
Takes a while to get your head around that? You got that right! I'm fairly smart but still don't understand where the current is flowing and why.

Thanks for your help.

pmackenzie
Feb 10, 2009, 06:55 PM
You're right, I messed up the sign of the third term when I posted, but not on the piece of paper where I worked it out on. :o

I also used a little short hand at the end that I assume you got, R2//R3 is R2*R3/(R2+R3).

"Where the current goes" is all shown in the equations of course. :)

If you are studying analog circuit theory you will soon find that for small signal purposes all voltage sources are in effect ground.

Pat MacKenzie

soft2
Feb 11, 2009, 12:39 AM
You're right, I messed up the sign of the third term when I posted, but not on the piece of paper where I worked it out on. :o

I also used a little short hand at the end that I assume you got, R2//R3 is R2*R3/(R2+R3).

"Where the current goes" is all shown in the equations of course. :)

If you are studying analog circuit theory you will soon find that for small signal purposes all voltage sources are in effect ground.

Pat MacKenzie
OK now that I know which formula is correct, which seems obvious now :D , it's more clear that R2//R3 are used because they replace input resistance in the standard formula as you wrote it for non-inverting gain. But other than the formula proving it to me, I still can't see why R2 should have anything to do with it.

When you refer to "small signal", what does that mean? The overall voltage or amplitude? Or other properties? When does it become a large signal? And why wouldn't the same formulas apply? OK I'm SURE you have time to take me thru engineering school here on RCG. ;)

jeffs thanks for the heads up on the noise. That is huge! Yes Vcc in my circuit will probably have some noise. I'm hoping the low frequency oscillations will cancel out with the output from the sensor because it is ratiometric. I am already taking a lot of steps to reduce supply noise.

Thanks for your help

pmackenzie
Feb 11, 2009, 06:55 AM
Small signal means that the circuit is operating in its linear range.
As soon as the op amp outputs get too close to the supply rails the gain essentially drops to zero.

An ideal op amp circuit is linear. What this means is that the gains are set only by the component values and not the input voltages.
You can get non linear circuits, but only by introducing a non linear element like a diode into the feedback loop.

So looking at your circuit Vcc only sets the operating point, not the gain. In effect you can set it to any voltage you want and the gain will be unchanged.
Set it to zero and it is quite clear that R2 and R3 are in parallel for the purposes of gain determination.

You could also look at Norton's theorem for an explanation:
http://en.wikipedia.org/wiki/Norton's_theorem

Pat MacKenzie