Maker Pro
Maker Pro

Summing difference amp outputs

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
I am new to this, but have been doing a lot of reading to get up to speed,

The circuit I am designing has two primary inputs which go into negative input of difference op amps, with a set reference on the positive input, so the input can be inverted from a rising voltage to a falling voltage.
The outputs need to be summed and I was just going to simply put them through a passive averager setup, basically connecting each output to opposite ends of a 100K pot and using the wiper as the output of the averaged sum, this would also allow me to vary the mix between the two outputs to be 50:50, 90:10, 30:70, etc.
I thought this was a pretty elegant solution, then thought, as the difference amps have negative feedback, would the averaged voltage influence the feedback amount and hence alter the output?
Do I need to put the outputs through a buffer amp before summing/averaging or can it be done by using additional resistors on the output of each, say 500K - 1M?

Thanks in advance.

Edit: Just thought I better add, it is not an audio circuit, so a bit of "noise" is not an issue, the final voltage output goes to a pwm generator to drive a solenoid, the pwm unit is off the shelf type, controlled by a small pot, that is where I was going to connect in, I suspect internally it first goes through an amplifier as well before generating the square wave pulse, so I expect the op amp outputs to be adequate.
 
Last edited:

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
hi harpy
welcome to the forums :)

sorry cant help you on your specific prob not my field. just didnt want you to think you were being totally ignored
hopefully some one will come up with some suggestions :)

Dave
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
I would think that your idea would work. The feedback with an op-amp enables the output voltage to be set more or less independent of the load.

Why not post a sketch of what you have?
 

Laplace

Apr 4, 2010
1,252
Joined
Apr 4, 2010
Messages
1,252
I think I would connect the wiper on that 100K pot to another op amp in voltage follower mode to reduce the output impedance into the PWM generator, unless you're sure the PWM input has a very high input impedance.
 

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
Thanks for the replies,
all good, have also posted elswhere, getting used to being ignored,
Thanks for the consideration Davenn, have often done the same thing on other forums I am on.
duke37, sketch below, I just need to get my head around the resistance and voltage thing, i.e no load, voltage has no issue even on high resistance values, so what stops the entire circuit averaging out through the pot and the feedback?, my knowledge in this area is small and with the rate I have been trying to absorb it, quite confused at times.
Laplace, not sure what input impedance is on PWM, expect it is probably related type of circuit and is also high, the pot is quite small, but as noted below have considered putting in a summing amp on the output, to accomodate another potential input.
Will try to post diagram, may take a few goes, every site has different system.
Started with a simple idea, add voltages, after many long nights spent with google, got onto music mixers, then op amps.
It's a single supply circuit, the input range is 0 to 5V, output to PWM required +2.3V to +3.5V, (actual range is greater, but mechanical losses and restrictions bring actual operating range down), as said I need to change the input from rising to falling, so 0 to +5 becomes, around +3.5 to +2.3.
Had a few variations, using voltage followers summing into a difference amp, but then read there may be issues in summing on negative input of difference amp, so went to difference amp first, need to have a gain reduction of around 2:1, so have set adjustment from 1:1 to 4:1, the ref/diff voltage for each amp is from the same pot.
Diagram is on excel, please ignore the toggle buttons, I have put a few formulas in so I can simulate operation to determine resister values etc.
I have started to add a few other bits, and had put in idea of summing amp after as ???, particularly as I have also considered atleast one more input, there is a bit more to the whole circuit, but this is the core of it.
Sorry it's a bit scrappy as I was in the process of making some changes to the design.
Actually starting to enjoy this stuff, only problem is my ideas are way ahead of my current capabilities.
 

Attachments

  • Elec.Forum.jpg
    Elec.Forum.jpg
    133.3 KB · Views: 281
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Good diagram, well laid out and easy to read.

R2 and R4 are the feedback resistors across their respective amps so that the amp output impedance will be low and not affected by the other amp. The load on the amp, say 50K is quite high and will not affect the output voltage at either amp significantly. It looks good.

The amp configuration that you are using has a virtual earth at the - input. If you are to use more inputs, you could consider one of these to feed in several inputs to this point.
 

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
Good diagram, well laid out and easy to read.

R2 and R4 are the feedback resistors across their respective amps so that the amp output impedance will be low and not affected by the other amp. The load on the amp, say 50K is quite high and will not affect the output voltage at either amp significantly. It looks good.

The amp configuration that you are using has a virtual earth at the - input. If you are to use more inputs, you could consider one of these to feed in several inputs to this point.

Thanks for that,
A positive response, kind of gives you a warm and fuzzy feeling all over.

When you say virtual earth, as this is a single supply circuit, I assume you are reffering to the positive input and voltage divider(pot) giving an earth reference, this of course would be a floating position depending on where the reference is set.

Are you suggesting multiple inputs to the difference amps, not sure what you meant there?
Or are you suggesting that I could combine the two inputs into one amp?
I have kept them seperate as I have concerns about what is at the other end of the sensors, goes back to an master control unit, not sure what is in there, so better safe than sorry. In addition to that there are individual pots in the feedback of each amp to ciontrol the gain.
The third input I was looking at, works in oposition to the other two and would not need inverting, just summing into the output.
 
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Yes. you could connect both inputs to one op amp with a common offset, isn't it what audio mixers do, the problem would be of setting it up and you will do better to stick with what you have designed and understand.
 

Laplace

Apr 4, 2010
1,252
Joined
Apr 4, 2010
Messages
1,252
Not sure what the purpose of those 16 V zener diodes might be. With such high-value resistors, leakage current through the diode may have some affect on the signal level. If they are supposed to be overvoltage protection diodes, they should be placed on the other side of the 1 meg input resistors.
 

Laplace

Apr 4, 2010
1,252
Joined
Apr 4, 2010
Messages
1,252
On further consideration it seems as though you are describing a simple level shifter, input goes from 0 to 5 volts, output goes from 3.5 to 2.3 volts, and that there should be a simpler way to design a level shifter than what you have.

Refer to the attached diagram. The basic gain is given by dVo/dVi=(2.3-3.5)/(5-0)=-1.2/5. The gain of the op amp circuit 'A' is -Rf/Ri = -1.2/5, so choose Rf=12K, Ri=50K.

In circuit 'B' set the input to 0 and the output to 3.5, then use the Rf,Ri voltage divider to calculate the voltage at the '-' input terminal.

In circuit 'C' set the input to 5 and the output to 2.3, then use the Rf,Ri voltage divider to calculate the voltage at the '-' input terminal. It should be the same as in circuit 'B'.

In circuit 'D' set the '+' input virtual ground to a stable reference voltage equal to the value calculated in 'B' & 'C'. The op amp will work to keep the voltage at the '-' input equal to the virtual ground. That is your level shifter.
 

Attachments

  • Level-Shifter_6.png
    Level-Shifter_6.png
    21.5 KB · Views: 1,369

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
Not sure what the purpose of those 16 V zener diodes might be. With such high-value resistors, leakage current through the diode may have some affect on the signal level. If they are supposed to be overvoltage protection diodes, they should be placed on the other side of the 1 meg input resistors.

Yes, overvoltage protection, I have copied bits and pieces from similar circuit types that I have looked at, so layout does need a bit of fine tuning, thanks for the tip, will re arrange the circuit to suit.
 

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
On further consideration it seems as though you are describing a simple level shifter, input goes from 0 to 5 volts, output goes from 3.5 to 2.3 volts, and that there should be a simpler way to design a level shifter than what you have.

Refer to the attached diagram. The basic gain is given by dVo/dVi=(2.3-3.5)/(5-0)=-1.2/5. The gain of the op amp circuit 'A' is -Rf/Ri = -1.2/5, so choose Rf=12K, Ri=50K.

In circuit 'B' set the input to 0 and the output to 3.5, then use the Rf,Ri voltage divider to calculate the voltage at the '-' input terminal.

In circuit 'C' set the input to 5 and the output to 2.3, then use the Rf,Ri voltage divider to calculate the voltage at the '-' input terminal. It should be the same as in circuit 'B'.

In circuit 'D' set the '+' input virtual ground to a stable reference voltage equal to the value calculated in 'B' & 'C'. The op amp will work to keep the voltage at the '-' input equal to the virtual ground. That is your level shifter.

You may be right, I can't say right now, need to digest your info and do some research to determine if it does actually fit the desired outcome, not home currently on the road, so only limited internet and no printer scanner etc.
I do want to make the design as simple as possible, but as it is a prototype, I do need to build in a fair bit of adjustment capability, once an operational unit has been tuned in to the application, then further simplification will be possible.
When I get back, a week or so, will do some more research on your idea and give you a more detailed response, on whether I believe it fits the application or not, and why.
Thanks again, I really do appreciate the input,
 

foTONICS

Sep 30, 2011
332
Joined
Sep 30, 2011
Messages
332
use a buffer if want to protect your cct and not draw any current from the source.

and as far as summing goes, just stick each output into the input of this:

Op-Amp-Circuit-Summing-Amplifier.gif
 

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
On further consideration it seems as though you are describing a simple level shifter, input goes from 0 to 5 volts, output goes from 3.5 to 2.3 volts, and that there should be a simpler way to design a level shifter than what you have.

Refer to the attached diagram. The basic gain is given by dVo/dVi=(2.3-3.5)/(5-0)=-1.2/5. The gain of the op amp circuit 'A' is -Rf/Ri = -1.2/5, so choose Rf=12K, Ri=50K.

In circuit 'B' set the input to 0 and the output to 3.5, then use the Rf,Ri voltage divider to calculate the voltage at the '-' input terminal.

In circuit 'C' set the input to 5 and the output to 2.3, then use the Rf,Ri voltage divider to calculate the voltage at the '-' input terminal. It should be the same as in circuit 'B'.

In circuit 'D' set the '+' input virtual ground to a stable reference voltage equal to the value calculated in 'B' & 'C'. The op amp will work to keep the voltage at the '-' input equal to the virtual ground. That is your level shifter.

Been out of action for a few weeks with a few unwanted distractions, getting back into it now.
I reviewed your comments re the position of the Zenner diode at the input, I always struggle between providing enough information and writing a thesis. It is an automotive application and large portion of my layout is taken directly from a “Silicon Chip” publication, which details about a dozen different kits and all have the same input layout with a resister first, at 500K to 1M for sensor voltage inputs, followed by a capacitor and zenner, so I assume this is the appropriate layout for this type of application.
I have taken your equation (my original equations were obviously flawed) and reworked it as the output equation in my layout, you are correct in assuming I need a level shifter basically, but I also need a fair degree of adjustment until the final design has been proven in operation, both inputs may have the same adjustment or they may require different adjustments, can't say until I can do running trials.
 
Last edited:

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
use a buffer if want to protect your cct and not draw any current from the source.

and as far as summing goes, just stick each output into the input of this:

Op-Amp-Circuit-Summing-Amplifier.gif

The final summing has to maintain the same polarity, so I cannot use an inverting summing setup, unless I use a second amp as a buffer and invert it back again, which may well be the final outcome, but there are a number of other questions I need to resolve before I go further with the design.
 

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
The current design is posted below, sorry about the extended story, I have set the two inputs at the extremes of their gain, being unity down to 1/3 attenuation (a new word I just learned), but their operational area is expected to be around 2/3 attenuation, which is 50% on the VR1a & 2a.
The two inputs are identical layout, so using input 1 as the example, the voltage signal goes through VR1a to set the required gain/attenuation through the negative input of the op amp, the adjusted resistances are marked as Rin & Rf, the reference on the positive input, Vref, is set by VR1b, which is a dual gang pot with VR1a, this provides a voltage of +3V at unity gain and increases, as gain is adjusted, to +4V at the min of 1/3 attenuation. This setup ensures that no negative voltages can be created on the output as gain is adjusted and also maintains a constant output of 5V with an input of 1V irrespective of gain being adjusted. This is an operational adaptation that will make it easier to tune the unit on the run as 1V input is expected to be around the baseline of normal operation, so it will be easier as only upper range performance is altered by adjusting gain.
The outputs of op amp 1 & 2 go to either end of VR3 which is a balance control to allow one input to have a greater effect than the other, I expect normal operation to be within the 40-60% range (diagram is set on 100% input 1), but can’t really say till running trials have been done. From the wiper of VR3 this goes through to summing (with input 3 to be added later) on the positive input on op amp 2a, a reference voltage of about +1.5 is applied to the negative input through VR4, this is the final level adjustment, which will lift or drop the range as trials require.
I have included the power supply layout in this schematic, which is basically duplicated from the “Silicon Chip” publication I mentioned earlier, on the exit of the power supply I have put together a resister divider network, incorporating VR1b, VR2b, VR4 which will provide the reference voltages for the three op amps, there is an additional fixed resister in parallel to get the required 3 to 4V range and also VR5 to adjust 12 volts down to 4V for the divider.
This layout seems to do the trick, I have just used arbitrary resister and capacitor ranges at this stage, but before I go into fine tuning I have come across the “Knowledge Conundrum”, the more I learn, the more I realise that I don’t know, so there are some make or break questions I would like to ask:
1. Op amp selection, I just put in LM358’s because they were often used in the “Silicon Chip” kits, but have since discovered they have a serious limitation in that they lose linearity and drop off at 3V output, I was looking at using TLV2472’s as they have good linearity from 0V, but have a maximum rail voltage of 0 to +6V and this would require some layout changes, can anyone recommend an op amp with a higher rail voltage and good linearity from a minimum of 1V output, preferably 0V?
2. Op Amps can become unstable at gains less than unity and attenuation circuits need resister normalisation on the negative input or the use of a resistive divider if the positive input is being used, I have read this in a couple of places, one being this PDF from Texas Instruments: http://www.ti.com/lit/an/sloa058/sloa058.pdf (page 6, 2.2) Is this an issue with attenuation of down to 1/3?
3. From pdf above also on page 9, 2.3, “Noninverting summing circuits are possible, but not recommended. The source impedance becomes part of the gain calculation”. This relates to Op Amp2a, so do I need to take this into account and reconfigure the design, and seperate the summing and level shift stages in the final stage? the reason I set up for summing on positive input was I had read earlier not to sum on negative input on difference amp.
 

Attachments

  • 2 Input op amp circuit.jpg
    2 Input op amp circuit.jpg
    136.3 KB · Views: 306
Last edited:

Laplace

Apr 4, 2010
1,252
Joined
Apr 4, 2010
Messages
1,252
It is an automotive application and large portion of my layout is taken directly from a “Silicon Chip” publication, which details about a dozen different kits and all have the same input layout with a resister first, at 500K to 1M for sensor voltage inputs, followed by a capacitor and zenner, so I assume this is the appropriate layout for this type of application.
I would ask whether these 'kit' circuits have a substantial voltage difference between the virtual ground and physical ground like your circuit does. If there is normally no voltage drop across the Zener diode, then no problem. Otherwise there will be some leakage current which is multiplied by the 1M input resistance for an input error voltage. Will that be a problem? I don't know, but you can avoid the problem by where you place the Zener diode. Also, an automotive application will have temperature extremes. The error voltage could be greater at the temperature extremes.
 

Harpy

Nov 3, 2011
11
Joined
Nov 3, 2011
Messages
11
Laplace
The kits are predominantly single supply circuits, I think only one circuit has one op amp where a negative voltage is actually generated specifically for the negative rail, all others use the common earth. The power supplies range from 5V to 12V depending on the kit, so I assume all would have a similar voltage difference between the virtual ground and common earth. The unit will be mounted under dash so temp variations shouldn't be too bad, I will go and have a read up on the leakage current issues re zenner & resisters.
Also wanted to ask, re your previous post you said:
In circuit 'D' set the '+' input virtual ground to a stable reference voltage equal to the value calculated in 'B' & 'C'. The op amp will work to keep the voltage at the '-' input equal to the virtual ground. That is your level shifter.
Were you just refering to the op amp working around the half voltage between the rails, as this is a single supply circuit, or were you refering to an actual voltage from VG, i.e. 3V would actually be 3 + 12/2(VG) = 9V when referenced to actual earth?
I have assumed you meant 3V = 3V referenced to actual earth, the output equations look like they produce the right result under a variety of inputs following the op amp rule : it will generate an output voltage to make both inputs the same voltage.
 
Top