Author Topic: differential amplifier with offset  (Read 9407 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
differential amplifier with offset
« on: October 09, 2015, 09:33:27 am »
if i take

https://en.wikipedia.org/wiki/Differential_amplifier#/media/File:Op-Amp_Differential_Amplifier.svg

And connect the RG to a voltage other than ground would this have the effect of adding that voltage offset to the output ?

Basically i want to measure the difference between two voltages but the difference could be negative or positive so i want to bias it to stay in the positive working range.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21686
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: differential amplifier with offset
« Reply #1 on: October 09, 2015, 09:40:19 am »
Yes.

By "ground", they really mean: "this is the voltage against which the output is measured".

Put another way, since the output isn't also specified as differential, we take the difference to ground by convention.

Of course, if you put any random voltage source in place of ground, its Thevenin equivalent resistance must be subtracted from Rg.  The circuit is "differential" only as long as the labeled reference nodes are true voltage sources.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: differential amplifier with offset
« Reply #2 on: October 09, 2015, 09:49:17 am »

Of course, if you put any random voltage source in place of ground, its Thevenin equivalent resistance must be subtracted from Rg.  The circuit is "differential" only as long as the labeled reference nodes are true voltage sources.

Tim

Hang on, you mean i need to alter Rg to effectively keep the same current in Rg as there would have been had I connected it to ground to keep the balance of the input resistors ?
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2085
Re: differential amplifier with offset
« Reply #3 on: October 09, 2015, 09:54:23 am »
Rg references both inputs and output to ground - if you change it, you change the reference for the whole circuit - I'm not sure that that is what you want.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: differential amplifier with offset
« Reply #4 on: October 09, 2015, 10:18:00 am »
Rg references both inputs and output to ground - if you change it, you change the reference for the whole circuit - I'm not sure that that is what you want.

Actually it is. I want to measure the difference between two voltages and add an offset so that my +/-0.25V range is shifted up to 0-0.5V range (uC's really hate negative voltages....)
 

Online mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: differential amplifier with offset
« Reply #5 on: October 09, 2015, 10:24:41 am »
Hang on, you mean i need to alter Rg to effectively keep the same current in Rg as there would have been had I connected it to ground to keep the balance of the input resistors ?

If the voltage source you are using to provide the offset has a non-negligible impedance (e.g. if you used a voltage divider) then yes.  If you add additional impedance to any part of the circuit you seriously degrade the performance of the amp e.g. common mode rejection.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: differential amplifier with offset
« Reply #6 on: October 09, 2015, 10:26:57 am »
Hang on, you mean i need to alter Rg to effectively keep the same current in Rg as there would have been had I connected it to ground to keep the balance of the input resistors ?

If the voltage source you are using to provide the offset has a non-negligible impedance (e.g. if you used a voltage divider) then yes.  If you add additional impedance to any part of the circuit you seriously degrade the performance of the amp e.g. common mode rejection.

I'd use a voltage reference of some sort or a resistor divider of significantly lower impedance.
 

Offline Performa01

  • Super Contributor
  • ***
  • Posts: 1643
  • Country: at
Re: differential amplifier with offset
« Reply #7 on: October 09, 2015, 10:59:54 am »
"significantly lower" isn't good enough.
If you alter any of the resistors by just 1%, CMRR will already be limited to 40dB maximum. And that in turn defeats the purpose of a differential amplifier...

This also means, you have to use resistors with better than 0.1% tolerance in the first place, so to get at least somewhere near 60dB of CMRR. 0.01% would be better of course - that's also why we usually don't build differential amps with discrete resistors but use appropriate ICs for this instead.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: differential amplifier with offset
« Reply #8 on: October 09, 2015, 11:33:33 am »
then i will just use a summing amplifier to add my required offset. the absolute value coming out is not a problem, but the relationship between the two inputs must remain constant.
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1282
  • Country: gb
    • bitdynamics
Re: differential amplifier with offset
« Reply #9 on: October 09, 2015, 12:03:19 pm »
I'm not sure you need a differential amplifier?

Just take each voltage,multiply it by the gain, then offset it back to the mid point of your ADC.  As you whole system has a common ground potential, you don't need to worry about CMRR and don't need an (expensive)instrumentation amplifer approach.  In fact, as oyu aren't going anywhere near the rails, and are worried about DC, then any jelly bean amp should do.



Also, knowing the application, you can get a higher resolution for the low voltage inputs by use reducing the ADC reference voltage!

With a 1V ref, you'd have a resolution of better than 1mV.

For all these things, get a copy of SPICE downloaded and try some circuits out!
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: differential amplifier with offset
« Reply #10 on: October 09, 2015, 12:26:16 pm »
Well as I'm only interested in the difference between the reference and a DUT and that it stay's constant-ish, I was thinking of taking that difference before feeding it into a uC, that way I immediately reduce the scale I'm trying to measure and get better ADC resolution as I can reduce the reference voltage as you say. As we know it's all relative. The initial offset between the test peice and the sample(s) can be up to +/-0.2375V so lets say a total range of 0.5V after adding 0.25V to it to make it all the right side of ground to include deviations on top that we are looking for so using the 1 or 1.1V reference that means i could still amplify it by 2x and get maximum resolution.

I suppose the other method is to oversample as we discussed, I'm torn both ways between all digital and doing analogue preprosessing (nothing like being given a blank sheet to get your teeth into and do some learning and testing  ;)) All I need to achieve is a slightly better (ok 1 order of magnitude  ;D) accuracy than in the application and I'm off the hook  :popcorn: of course bearing in mind that as I'm comparing 2 measurements I assume that inaccuracy due to the ADC doubles from 0.5LSB to 1LSB if I do all digital. but again just another factor of oversampling and that can be overcome.
« Last Edit: October 09, 2015, 12:37:20 pm by Simon »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: differential amplifier with offset
« Reply #11 on: October 09, 2015, 04:29:52 pm »
"significantly lower" isn't good enough.
If you alter any of the resistors by just 1%, CMRR will already be limited to 40dB maximum. And that in turn defeats the purpose of a differential amplifier...

This also means, you have to use resistors with better than 0.1% tolerance in the first place, so to get at least somewhere near 60dB of CMRR. 0.01% would be better of course - that's also why we usually don't build differential amps with discrete resistors but use appropriate ICs for this instead.

Then the voltage refrence (that can source and sink) is the best if I did that.
 

Offline Performa01

  • Super Contributor
  • ***
  • Posts: 1643
  • Country: at
Re: differential amplifier with offset
« Reply #12 on: October 09, 2015, 07:38:46 pm »
Then the voltage refrence (that can source and sink) is the best if I did that.

Yes, indeed. :)

Generally, it is a good idea to use a differential amplifier for small signal acquisition. Even when the signal is referenced to the same ground as the ADC, there will always be significant noise and offset errors as there is no such thing like an ideal ground. Not to mention mains hum, which is just about omnipresent. This is why common mode rejection is so important. Since you need 0.01% resistor tolerance in order to get anywhere near 80dB of CMRR, it is also a good idea to use an integrated differential amplifier with guaranteed CMRR specs, like the INA series from BB/TI.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: differential amplifier with offset
« Reply #13 on: October 09, 2015, 07:45:26 pm »
I'm not using a differential amplifier (in the form of an opamp) for noise imunity but to take the difference between a reference sensor and the sample under test. Because I'm more interested that both have a constant offset as they are presurized together I'm only actually interested in measuring the difference between the two not the absolute values.

The other method is oversampling the ADC so that I get a higher resolution anyway and don't need to "expand" the range with lots of analogue front end. Considering i will have 4 reference sensors (2 of each type) and three test samples (2 of 1 sort and 1 of another) that is a lot of analogue front end I'll end up with whereas with oversampling the ADC in a uC I just need to take 7 ADC readings and do the math. The signals will not change during measurement because I control the prssure so no hurry to take a measurement.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19521
  • Country: gb
  • 0999
Re: differential amplifier with offset
« Reply #14 on: October 09, 2015, 07:56:15 pm »
All is explained in the PDF linked below:
http://www.ti.com/lit/an/sloa097/sloa097.pdf
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11634
  • Country: my
  • reassessing directives...
Re: differential amplifier with offset
« Reply #15 on: October 10, 2015, 03:18:40 am »
you need to add Rref+Vref into the differential equation, (Rref is internal resistance of the Vref source, you can find the equation for the OP opamp setup somewhere in the net) and start from there... possibly Rg is a multiturn trimpot to balance the equation...
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: differential amplifier with offset
« Reply #16 on: October 10, 2015, 04:56:35 pm »
Well given the sheer amount of circuitry rewuired I think I'll just over sample my ADC in this case now that I know that the application is only working to a resolution of 10 bit I can over sample by a couple of bits and know that I'll be accurate enough.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: differential amplifier with offset
« Reply #17 on: October 10, 2015, 05:47:09 pm »
inamp, yo
http://www.analog.com/en/products/amplifiers/instrumentation-amplifiers.html

I'm not sure you need a differential amplifier?

Just take each voltage,multiply it by the gain, then offset it back to the mid point of your ADC.  As you whole system has a common ground potential, you don't need to worry about CMRR and don't need an (expensive)instrumentation amplifer approach.  In fact, as oyu aren't going anywhere near the rails, and are worried about DC, then any jelly bean amp should do.

That is a differential amplifier, with the differencing bit done in software. It suffers from the same problems.
No longer active here - try the IRC channel if you just can't be without me :)
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19521
  • Country: gb
  • 0999
Re: differential amplifier with offset
« Reply #18 on: October 10, 2015, 06:26:16 pm »
I agree, that's probably the best solution.

you need to add Rref+Vref into the differential equation, (Rref is internal resistance of the Vref source, you can find the equation for the OP opamp setup somewhere in the net) and start from there... possibly Rg is a multiturn trimpot to balance the equation...
I don't see any need for that. It's all simple arithmetic. Run through the formulas on the PDF. For educational purposes (he's decided to do something else) take Simon's figures.

VOUTfs = 0.5V
VOUTzs = 0V
VINfs = 0.25
VINzs = -0.25V
VREF = 5V Use the 5V regulated rail, which has a very low impedance.

m = (VOUTfs - VOUTzs)/(VINfs - VINzs) = (0.5 - 0)/(0.25 - -0.25) = 1
b = VOUTzs - m×VINzs = 0 - 1×-0.25 = 0.25

Both m & b are positive so see section 3.

R1 = 10k
R2 = (VREF×R1×m)/b = (5×10k×1)/0.25 = 200k

Rf = 10k
Rg = (R2×Rf)/(m×(R1+R2) - R2) = (200k×10k)/(1×(10k+200k)-200k) = 2000k/(210k-200k) = 200k

Personally, as this would be interfacing with an MCU, I'd  increase the output scale to 5V and add a potential divider to the 5V reference, as the input impedance can be higher whilst still using convenient resistor values.

Notice that R2 is now 820k, rather than the expected 1M because the output impedance of the potential divider is 180k: 820k + 180k = 1M
« Last Edit: October 10, 2015, 06:31:39 pm by Hero999 »
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11634
  • Country: my
  • reassessing directives...
Re: differential amplifier with offset
« Reply #19 on: October 11, 2015, 03:32:52 am »
For educational purposes (he's decided to do something else) take Simon's figures.
sorry maybe i missed the latest figure or decision in this thread... i only see a figure in the original post and then he talked about oversampling...anyway HMMV..
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf