Electronic – Differential amplifier offset problem

operational-amplifier

I have breadboarded a simple differential amplifier:

schematic
http://www.ti.com/lit/ds/symlink/lm158-n.pdf

what I expect is that OUT=B-A but that only works when the voltage of
B is larger than A+0.6, i:e there seems to be an offset of about 0.6V on the output.
Since the output LM358 is supposed to be able to go to ground I can't figure out
where this offset is comming from. Any ideas?

Edit: VDD is 16V in my tests and if I tie A to ground, then OUT=B without the offset.

Best Answer

Here are some: -

Scenario 1 - A is at 3 V and B is at 0 V - the output will be trying to make -3V but limits at 0V.

Scenario 2 - A is at 3 V and B is at 3 V - +Vin will be 1.5 volts and the output will be trying to make -1.5 volt + 1.5 volt = 0V = GND.

Scenario 3 - B is at 6 volt, A is at 3 V - +Vin will be 3V and the output won't be trying to force anything into the feedback loop so the output will be +3 volts.

EDIT

Following a look at the circuit diagram of the LM358 it is apparent that it will have problems in the circuit getting down to 0V: -

enter image description here

Without the 50uA current sink the output would only get down to about 0.6V. The current sink trys to pull it the rest of the way but, with R2 and R3 pulling the output up to some value (maybe half rail at 8V) then there will be a problem that can only be overcome with a slight negative rail or a good load on the output to ground.

8V across 2x 18k is a current of 222uA so it might help if the 18k resistors were made 180k.