Analog voltage subtraction

Interested in Robotics? Here's the place to be.
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Analog voltage subtraction

Post by hlreed »

I have two voltages, A and B.
I would like to produce voltage C where
C = A - B. Voltage is i*r.
Given resisters of value r, how do you make a pure
C = A - B voltage? I have not done analog in a long time and I think my first presumption might have been wrong. Any ideas here?
Harold L. Reed
Microbes got brains
greg123
Posts: 361
Joined: Sat Sep 07, 2002 1:01 am
Location: St. John's NFLD Canada
Contact:

Re: Analog voltage subtraction

Post by greg123 »

You can make a subtraction circuit with a reistor network and an op amp.<p>I'll have to find the specs<p>greg
Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

Re: Analog voltage subtraction

Post by Will »

Harold,
It is relatively easy to do - The way I know to do it from memory requires two op amps, one to invert one of the voltages and the other to sum the two voltages. All of the resistor values change according to the relative ranges/spans of the two voltages from which you wish to produce the difference. the range of the desired output and the supply voltages with which you intend to work - with particular reference as to whether or not you are using bipolar or single ended supply and signal ranges. I cannot make drawings on this medium but if you send me details of the voltages as above then I will send you a circuit diagram done in MS Word. my E mail address is [email protected] or you can phone me at 281 578 1898 which is essentially just around the corner from you.
BB
Ron H
Posts: 360
Joined: Tue Dec 18, 2001 1:01 am
Location: Boise, ID
Contact:

Re: Analog voltage subtraction

Post by Ron H »

hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: Analog voltage subtraction

Post by hlreed »

Thnaks everbody, but I need a resister only solution to this. I know about difference amps and they take 4 resisters and an op amp.
A pot is a voltage divider which takes the ratio between two voltages with two variable resisters.
Let A and B be two voltages. Let R be the value of all the resisters. Use two R's, connected with A and B on the ends. The voltage at the center (C)is:
A - B = C ;where all voltages are i*R
The current between A and B is (A - B)/2*R<p>This was my starting assumption. Is this correct?
Harold L. Reed
Microbes got brains
Ron H
Posts: 360
Joined: Tue Dec 18, 2001 1:01 am
Location: Boise, ID
Contact:

Re: Analog voltage subtraction

Post by Ron H »

You can't subtract DC voltages with a passive circuit. If you connect V1 to one end of R1, and V2 to one end of R2, and connect the other ends of R1 and R2 together, the voltage at the junction will be, by superposition,<p>Vjct=(V1*R2+V2*R1)/(R1+R2)<p>You can see that if you make R1=R2,<p>Vjct=(V1+V2)/2<p>You can only add DC voltages without using active circuitry.<p>Ron
Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

Re: Analog voltage subtraction

Post by Will »

Harold,
Put what RonH says another way - If you hsve 2 resistors R1 and R2 in series and you nominate the voltage at the junction as C -Then, the current in the curcuit = (A - B)/(R1 + R2) so that the voltage C is R1*(A - B)/(R1 + R2) + B.
When R1 = R2 then C = R*(A - B)/2R + B (Not ((A - B)/2)*R . . as you say)
= (A - B)/2 + B = A/2 - B/2 + 2*B/2
= A/2 + B/2 = (A + B)/2
BB
Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

Re: Analog voltage subtraction

Post by Will »

Harold,
A second thought - If you really want to know the difference between two voltages then just connect them in series in opposition i.e. either +ve to +ve or -ve to -ve then the overall voltage is C = A - B. If you apply it to a resistor to ground then you can read C or, if you want to measure the current then I = (A - B)/R
BB
Ron H
Posts: 360
Joined: Tue Dec 18, 2001 1:01 am
Location: Boise, ID
Contact:

Re: Analog voltage subtraction

Post by Ron H »

<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by Will:
Harold,
A second thought - If you really want to know the difference between two voltages then just connect them in series in opposition i.e. either +ve to +ve or -ve to -ve then the overall voltage is C = A - B. If you apply it to a resistor to ground then you can read C or, if you want to measure the current then I = (A - B)/R
<hr></blockquote><p>Will, that works fine if the two voltages don't have a common node (like GND). If they do, which is usually the case, then it can't be done.<p>Ron
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: Analog voltage subtraction

Post by hlreed »

Will and Ron, you both have it right.
If you put two voltages on the ends of one resister it calculates the difference, but you can't read it. You need 3 resisters. Two convert voltage to current. The other is connected to the node and the other end is to ground. This converts from current to voltage.
You can add or subtract this way. To subtract you should have + and - voltages to read correctly.
Thanks for shaking up my old brain.
Harold L. Reed
Microbes got brains
Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

Re: Analog voltage subtraction

Post by Will »

Ron,
You are right of course - If the two voltage sources had a common ground then they are already, irreversibly, half way connected in parallel. I was only treating the subject as theoretical - In practice, with or without common ground connections, one would have to consider the source impedance of both sources, which would probably render the method impractical as a measurement tool. Much easier to get one or two op amps. Perhaps just as interesting a question might be - Is it possible to measure voltage differences with only one op amp - given that we would only be using the +ve connection as a reference and doing the computing at the -ve connection ?
BB
Ron H
Posts: 360
Joined: Tue Dec 18, 2001 1:01 am
Location: Boise, ID
Contact:

Re: Analog voltage subtraction

Post by Ron H »

<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by Will:
Ron,
You are right of course - If the two voltage sources had a common ground then they are already, irreversibly, half way connected in parallel. I was only treating the subject as theoretical - In practice, with or without common ground connections, one would have to consider the source impedance of both sources, which would probably render the method impractical as a measurement tool. Much easier to get one or two op amps. Perhaps just as interesting a question might be - Is it possible to measure voltage differences with only one op amp - given that we would only be using the +ve connection as a reference and doing the computing at the -ve connection ?
<hr></blockquote><p>What do you mean by +ve and -ve? Are you referring to the input pins?<p>Ron
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: Analog voltage subtraction

Post by hlreed »

You might like to know that if you use 3 resisters, all connected with V1 and V2 and ground on the ends. Measure at the common connection, call that C, then you get:
C = (V1 + V2)/3<p>I suspect, but have not done it yet, that two resisters, done the same way, measured at the middle connection would produce C = (V1 + V2)/2
(This is a pot set in the middle.) A pot is the source for V1 and V2.<p>A single resister with V1 and V2 on the ends produces i*r = V1 - V2 but you cannot measure it.
(The IR drop across the resister is V1 - V2.)<p>To produce a difference with an op amp, connect it for the usual negative feedback with 3 resisters. Add another resister from + input to ground. Make all the resisters the same value.
Then output (Out = In+ - In-). This works.<p>Subtraction requires negation. Is there a passive way to do X = -X ?
Harold L. Reed
Microbes got brains
Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

Re: Analog voltage subtraction

Post by Will »

This is fun ! - It's waking my old brain up too !
Ron - I mean the =ve and -ve signal input connections to the op amp.
Harold - You are right - twice - firstly if you connect two equal resistors between V1 and V2 and consider the junction of the two as C = Vo then Iin = (V1 - V2)/2.R and Vo = V2 + Iin.R = V2 + [(v1 - V2)/2.R}]*R = V2 + (V1 -V2)/2 = V2/2 + V1/2 - V2/2 = V2/2 + V1/2 = (V1 + V2)/2 which is exactly as I said in my July 21 except then we were talking about A nd B in stead of V1 and V2.
The op amps - You are right again except that I had some little difficulty with your description. If however I read it to be (All resistors equal value) V1 connected to signal
-ve via R and V2 connected to signal +ve via another R then, if I add an R (Feedback resistor)between signal -ve and output Vo and another R between +ve input and ground then the output is (V2 - V1)/2 - Good stuff !
BB
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: Analog voltage subtraction

Post by hlreed »

Will, this is fun for me too.
The op amp with 4 resisters, In-, in+, feedback, and R4. Connect In- to pin 2, feedback to pin 2 and pin 6. Connect In+ to pin 3, R4 to pin 3 and ground. Send V2 to In-. Send V1 to In+. Read output at pin 6. [Output = V1 - V2] exactly if
In- = In+ = feedback = R4.
No divide by 2 here. I used this in a Nanoliter Chloride titrator I build. (Big production. About .1 units a year.)
Burr-Brown makes an IC that does this, using 40k resisters on the chip. Costs more than a PIC 12C508A though.Output = V1 - V2
Harold L. Reed
Microbes got brains
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests