Author Topic: Simple differential amplifier problem.  (Read 6145 times)

0 Members and 1 Guest are viewing this topic.

Offline steve30Topic starter

  • Frequent Contributor
  • **
  • Posts: 748
  • Country: england
    • Stephen Coates' Homepage
Simple differential amplifier problem.
« on: November 26, 2013, 04:33:03 am »
I was wondering if someone could assist me with this simple differential amplifier circuit. I've successfully used it with an LM324 op amp before, but sometimes I run into a problem where the output voltage isn't the difference between the two input voltages.

Like in todays case. See the attached image for the circuit diagram. The input voltages are both pretty much the same, so I would expect the output to be about 0V, but it isn't. If I add a 1k load to the output, it drops to 0.08V, which is closer, but not as close as I would like.

It seems to work better with smaller input voltages rather than these big ones.

I'd be grateful for any suggestions as to why this is happening.

steve30 :)
 

Offline steve30Topic starter

  • Frequent Contributor
  • **
  • Posts: 748
  • Country: england
    • Stephen Coates' Homepage
Re: Simple differential amplifier problem.
« Reply #1 on: November 26, 2013, 05:27:30 am »
They were all between 99.38k and 99.46k. So a difference of maybe 80R. I guess that could be a bit too much.
 

Offline rbola35618

  • Frequent Contributor
  • **
  • Posts: 305
  • Country: us
Re: Simple differential amplifier problem.
« Reply #2 on: November 26, 2013, 05:29:24 am »
You probably have issues with second order effects such as input
current offset and input voltage offset
 

Offline steve30Topic starter

  • Frequent Contributor
  • **
  • Posts: 748
  • Country: england
    • Stephen Coates' Homepage
Re: Simple differential amplifier problem.
« Reply #3 on: November 26, 2013, 07:15:03 am »
I just changed the resistors to 1M and it works better with these. There's now only up to about 14mV of error on the output.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2135
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Simple differential amplifier problem.
« Reply #4 on: November 26, 2013, 09:51:52 am »
The LM324 is not designed to go that close to the -ve rail (look at the schematic).

You need to rejig your diff. amp to an artificial ground, or put in a small negative rail (say -5v).

High-side current sense?
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Simple differential amplifier problem.
« Reply #5 on: November 26, 2013, 12:14:30 pm »
You should check out the datasheet, particularly about its voltage swing (to ground in this case).

The opamp is doing exactly what it is designed to do.

================================
https://dannyelectronics.wordpress.com/
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Simple differential amplifier problem.
« Reply #6 on: November 26, 2013, 12:24:00 pm »
Even with a "true" rail-to-rail op amp, you probably shouldn't be expecting accurate output all the way to 2mV. Add some gain.

Better, use a current sense amp. Even if that's not what you're doing here, it's a similar enough application.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline steve30Topic starter

  • Frequent Contributor
  • **
  • Posts: 748
  • Country: england
    • Stephen Coates' Homepage
Re: Simple differential amplifier problem.
« Reply #7 on: November 30, 2013, 11:05:19 pm »
The LM324 is not designed to go that close to the -ve rail (look at the schematic).

You need to rejig your diff. amp to an artificial ground, or put in a small negative rail (say -5v).

High-side current sense?

Are you sure? Looks like it should be fine to me. Anyway, I powered the op-amp from -5V instead of 0V, and I had the same problem.

Just seems peculiar how the circuit agrees that 2-2=0 and 10-10=(approx) 0, but manages to get 25-25 wrong.

I bought some current sense amplifier ICs, which do the job excellently, but it would still be cool to get the differential amp circuit working. I like being able to build things with parts which are more 'bog-standard'.
 

Offline tehmeme

  • Regular Contributor
  • *
  • Posts: 102
  • Country: gb
Re: Simple differential amplifier problem.
« Reply #8 on: November 30, 2013, 11:08:03 pm »
The LM324 is not designed to go that close to the -ve rail (look at the schematic).

You need to rejig your diff. amp to an artificial ground, or put in a small negative rail (say -5v).

High-side current sense?

Are you sure? Looks like it should be fine to me. Anyway, I powered the op-amp from -5V instead of 0V, and I had the same problem.

Just seems peculiar how the circuit agrees that 2-2=0 and 10-10=(approx) 0, but manages to get 25-25 wrong.

I bought some current sense amplifier ICs, which do the job excellently, but it would still be cool to get the differential amp circuit working. I like being able to build things with parts which are more 'bog-standard'.

just curious , which current sense IC did you use?
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12609
  • Country: us
Re: Simple differential amplifier problem.
« Reply #9 on: November 30, 2013, 11:29:23 pm »
Just seems peculiar how the circuit agrees that 2-2=0 and 10-10=(approx) 0, but manages to get 25-25 wrong.

Is this really peculiar?

If you have 2 V on the inputs, then you have a current through the resistors of 2/200 k = 0.01 mA.

If you have 25 V on the inputs, then you have a current 12x greater, 25/200 k = 0.125 mA.

By Ohm's law, the voltage drop across the resistors is proportional to the current, so any small imbalance in resistor values is going to show up as a voltage differential error at the op amp input terminals that is magnified in proportion to the input voltages.

You should expect the error to be worse with higher input voltages. It doesn't seem peculiar at all.

 

Offline steve30Topic starter

  • Frequent Contributor
  • **
  • Posts: 748
  • Country: england
    • Stephen Coates' Homepage
Re: Simple differential amplifier problem.
« Reply #10 on: November 30, 2013, 11:34:23 pm »
The LM324 is not designed to go that close to the -ve rail (look at the schematic).

You need to rejig your diff. amp to an artificial ground, or put in a small negative rail (say -5v).

High-side current sense?

Are you sure? Looks like it should be fine to me. Anyway, I powered the op-amp from -5V instead of 0V, and I had the same problem.

Just seems peculiar how the circuit agrees that 2-2=0 and 10-10=(approx) 0, but manages to get 25-25 wrong.

I bought some current sense amplifier ICs, which do the job excellently, but it would still be cool to get the differential amp circuit working. I like being able to build things with parts which are more 'bog-standard'.

just curious , which current sense IC did you use?

I used a MAX4172. Has a good specification and is nice and easy to get working. Only awkward thing is that its a SOIC8 package and I'm using breadboards, so I had to build an adapter.

IanB: Thanks, that makes a lot more sense now :).
 

Offline kg4arn

  • Supporter
  • ****
  • Posts: 271
  • Country: us
Re: Simple differential amplifier problem.
« Reply #11 on: December 01, 2013, 02:32:02 pm »
@steve30

What's happening in your original circuit is a limitation of the output stage of the 324 (and the LM358).

If the output is sinking current, it cannot approach the negative rail as closely (see the attached Figure from the data sheet).
You can see from the figure that 25V / 200K = 0.125 mA from the negative input to your diff amp needs to be absorbed by the output of the op amp, there is the 0.6V shelf in the curve.  I believe that is the 0.6V you observed.

This effect can be minimized or eliminated by biasing the output stage with a resistive load to the negative rail (usu about 4.7K).  I have seen this discussed in the LM358 data sheets but not the LM324 data sheets that I have read.  (I believe they share the same architecture).  For amplifying small signals this is not a problem and it lets the op amp use very little power.  For larger signal swings you will see what appears to be puzzling crossover distortion, if you do not have the output biased enough.

 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2135
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Simple differential amplifier problem.
« Reply #12 on: December 01, 2013, 04:00:36 pm »
The LM324 is not designed to go that close to the -ve rail (look at the schematic).

You need to rejig your diff. amp to an artificial ground, or put in a small negative rail (say -5v).

High-side current sense?

Are you sure? Looks like it should be fine to me. Anyway, I powered the op-amp from -5V instead of 0V, and I had the same problem.

Just seems peculiar how the circuit agrees that 2-2=0 and 10-10=(approx) 0, but manages to get 25-25 wrong.

I bought some current sense amplifier ICs, which do the job excellently, but it would still be cool to get the differential amp circuit working. I like being able to build things with parts which are more 'bog-standard'.

Yes. Look at the schematic of the LM324:

http://www.farnell.com/datasheets/1639829.pdf

It can't go to GND, only within Vbe of GND (see Q21 on the linked datasheet page 2).

As far as the why it doesn't track at nearer VCC, again the schematic might give some clues (although you could always read the datasheet).  If you add the Q6 Vce, Q2 Vbe and Q1 Vbe you'll get approx 1.5v.

https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf