Author Topic: What's wrong with my differential amplifier circuit? (Lab PSU design)  (Read 2942 times)

0 Members and 1 Guest are viewing this topic.

Offline tbjTopic starter

  • Contributor
  • Posts: 25
Hi all.

I'm trying to use a differential amplifier for high side current sensing in my bench supply, loosely based on Dave's series of bench power supply videos.

Here's my simulated circuit. Works more or less as expected.



In my real circuit...

Op amp is a KIA358P (LM358 clone) which in the datasheet says the output should be able to swing to ground.

One side of sense resistor is at ~16.7 above ground
The other side is at ~16.3 above ground

Resistors are 10k (actually 9.73k, matched to within .01k)

I expect to see ~.4 volts at the op-amp output; I actually see ~.7.

What's going on here then?

Any help appreciated :)
 

Offline void_error

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: ro
  • I can transistor...
That's easy, you're trying to operate your opamp outside its common-mode input voltage range.
The 358 has a PNP input stage so it can't take an input voltage as high as its supply rail, TI datasheet says 1.5V below V+ maximum.
Either increase the supply voltage at least 2-3V above the input voltage or use a rail-to-rail input opamp.
Also take the input offset voltage into account.
« Last Edit: May 18, 2015, 08:56:07 pm by void_error »
Trust me, I'm NOT an engineer.
 

Offline DanielS

  • Frequent Contributor
  • **
  • Posts: 798
That's easy, you're trying to operate your opamp outside its common-mode input voltage range.
The op-amp's Vin+ is at Vsupply/2 due to the 10k-10k voltage divider. That puts the op-amp pretty much exactly in the middle of its common-mode range.

I have not checked the specs but since it is a no-frills bipolar op-amp, I'm guessing 0.7V is about as low as the output can go without negative supply.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
That's easy, you're trying to operate your opamp outside its common-mode input voltage range.
The op-amp's Vin+ is at Vsupply/2 due to the 10k-10k voltage divider. That puts the op-amp pretty much exactly in the middle of its common-mode range.

Yes, VICM is not being exceeded here. You're just expecting the output to go lower than it can while also sinking current.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline akis

  • Frequent Contributor
  • **
  • Posts: 981
  • Country: gb
You may be able to insert a biased diode 1n4148 at the foot of R6 therefore raising 0V to 0.65V or thereabouts. You could bias the diode through a 2-3K resistor. That way your "0V" expected output is now shifted to 0.7 V, it is not terribly accurate as the diode's drop will fluctuate somewhat, but if you bias it strongly it will not be affected by R3 and R6.
 

Offline AxleD

  • Regular Contributor
  • *
  • Posts: 52
  • Country: za
I encountered the same issue trying to use the LM358/LM258 as a high side differential amplifier. After pulling my hair out for a day or two I eventually found the answer in the datasheet. Despite what they say, the LM358 can only swing to ground if it sinking a tiny current or sourcing current. If it sinks more than a few microamps the transistor will saturate at 0.7v instead of the 0v you expected (as c4757p already highlighted).

See the attached which was taken from the TI datasheet.

To get the opamp to swing below 0.7v you can use higher feedback resistors (say 200k) or load the output. Unfortunately you will run into the same problem when the voltage drop across the resistor gets very small and you need the opamp to swing virtually to ground (a few mv).

The only viable solutions i found was to get a good rail to rail op amp or use a negative supply.
 

Offline tbjTopic starter

  • Contributor
  • Posts: 25
I'm beginning to believe that there's no such thing as a true rail-to-rail op-amp  :D

Using a charge pump to create a virtual negative rail seems like it could be an option. Seems hacky, though. Is this a common way to handle this?

The supply to the op-amp doesn't have to be symmetrical, does it? I could just have 5 volts or so on the negative rail just so I can swing the output entirely to ground, correct?

One thing I don't get is why this problem was never mentioned in Dave's lab supply videos (and, in fact, doesn't manifest itself in the usupply, which uses the 358 in this configuration in the current limit circuit).
 

Offline DanielS

  • Frequent Contributor
  • **
  • Posts: 798
The supply to the op-amp doesn't have to be symmetrical, does it?
Most op-amps do not have a ground reference pin so they have absolutely no clue where their + and - supplies are relative to ground. You can split the supply voltage whichever way you want within the device's operating range depending on what input and output dynamic range you need.

Since all you want here is to have true zero within the output range, even -2V negative supply would be enough.

One inexpensive way of generating a low-power negative rail is simply to capacitively couple the supply transformer into a second rectifier bridge. You can limit the negative supply with either a couple of shunt diodes, a zener, a 431, a 7905 or anything convenient.
 

Offline akis

  • Frequent Contributor
  • **
  • Posts: 981
  • Country: gb
Did you check my diode suggestion. You only need 2 additional components, a diode and a resistor. Because the op-amp cannot really sink down to 0V, very few op-amps can, you do not ask it to. You tell it "your 0V from now on will be 700mV". So all you have to do then is subtract 700mV from whatever the output is, it is almost perfectly linear.

Edit: correcting early morning brain farts

 

Online mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
I'm beginning to believe that there's no such thing as a true rail-to-rail op-amp  :D

If there is, the ancient and very cheap LM358 certainly isn't it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf