Sum/Difference Op-Amp circuit drawbacks that no one mentions? - Page 1
Forum section: electronics / beginners

author: LoveLaika
author_rank: Frequent Contributor
timestamp: July 07, 2021, 02:18:34 pm
content: I'm looking into building an op-amp circuit that consists of summation op-amps and difference op-amps to get the sum/difference of voltages to result in a specific 'equation' of sorts (essentially, just a linear equation of adding/subtracting voltages at the end of it all); I was thinking about these kind of circuits, and I was wondering, aside from the typical op-amp considerations (input bias current, input bias voltage, bandwidth, GBW, etc.), when building these types of circuits, what kind of considerations do you have to keep in mind?I've seen these circuits in books using the ideal op-amp model, but it doesn't really say much about the drawbacks of your choice of circuit. For instance, in the link below, one answer mentions how the non-inverting summing amp has issues that seem to make it impractical. Without knowing this, I'd probably run with it, so that's the stuff I'm trying to think about. Since my circuit can be boiled down to just inverting summation amps and difference amps, what are some things about them that should be taken into account in non-ideal scenarios (i.e., a limited number of inputs for performance, issues with floating nodes, etc.)?https://electronics.stackexchange.com/questions/268547/inverting-summing-amplifier-vs-non-inverting-summing-amplfier

author: TimFox
author_rank: Super Contributor
timestamp: July 07, 2021, 04:27:40 pm
content: Traditional analog computation used only inverting operational amplifiers. At DC, with high DC gain, the voltage at the summing point is the main source of error. Some of that is the static offset voltage (that can be trimmed) and very little of that (at DC) is the output voltage divided by the huge DC gain. At higher frequencies, the gain falls off and the error voltage increases. This is the basic analysis.

author: rstofer
author_rank: Super Contributor
timestamp: July 07, 2021, 05:24:44 pm
content: Input bias and offset are really important parameters and they get even more critical when the input resistor is 1Mohm. Then toss in a 1 ufd capacitor in place of the feedback resistor and you have the beginnings of an analog computer.The thing is, even a wee bit of input current times 1Mohm results in quite an error.http://www.analogmuseum.org/english/homebrew/vogel/Search for 'Vogel' on this page to get schematics and documentation - in German but easy to work throughhttp://www.analogmuseum.org/english/library.htmlThere are 3 summers and 2 integrators plus a multiplier and some other features.Use this page for the schematics. The summer detail may be helpful in that it includes the offset trim pot.http://www.analogmuseum.org/library/vogel_schaltplan.pdf

author: LoveLaika
author_rank: Frequent Contributor
timestamp: July 07, 2021, 05:46:54 pm
content: Thanks for the reply. With input offset voltage, that can be adjusted externally with a potentiometer [Link 1-Figure 5], or we could reduce the necessary input resistances to something smaller. In my equations, I'm ending up with no gain to the voltages, just adding them as is without gain, so as long as the resistors match, I can go with any value. Wouldn't that reduce the input offset voltage as well? In that sense, how can this be achieved when using a difference amplifier?On that note, link 2 shows a breakdown of determining appropriate values of a difference amplifier with multiple inputs. One commenter noted that with summing amps, adding more inputs degrades both noise and bandwidth performance. With that in mind, though it would use up a lot more op-amps, is it more precise to focus on one or two inputs per op-amp to easily trim each offset voltage rather than to just have one op-amp with many inputs?https://www.analog.com/media/en/training-seminars/tutorials/MT-037.pdfhttps://www.electronicdesign.com/resources/ideas-for-design/article/21799355/efficiently-design-an-opamp-summer-circuit

author: TimFox
author_rank: Super Contributor
timestamp: July 07, 2021, 06:27:28 pm
content: The input offset comes from two sources:(1)the input offset voltage (itself), defined as the small voltage you need to apply directly to the input to force the output to (or near) zero,and (2) the input bias currents, which produce another voltage contribution, calculated from the current and the total resistance seen by the input.(Offset current is the difference between the two bias currents; this is only relevant when you have matched the total resistance seen by each of the two inputs.)Reducing all the resistors will affect the current-induced contribution, but not the offset voltage itself. (Offset adjustment pins affect the offset voltage directly.)When you consider resistor thermal noise, higher resistance values contribute more noise voltage to the circuit, especially since the input resistors are in series with the input voltage. Also, the noise in the input bias currents (important for BJT input devices) produces a noise voltage that increases with higher resistance values.At higher impedance values, such as in electrometer small-current transresistance amplifiers, higher resistors contributeless current noiseto the the circuit.The gain of the total circuit from the total input offset to the output is called the "noise gain", an important parameter for error calculations and bandwidth.

author: rstofer
author_rank: Super Contributor
timestamp: July 07, 2021, 07:04:03 pm
content: What kind of accuracy do you need?Above I mentioned analog computing because it is clearly an example where adding, subtracting, multiplying and dividing are important. Integration is even more important. I'm not sure I would expect 1% accuracy.I also mentioned bias current. On the ComDyna GP6 computer, they use the LH0042CH op amp for the integrators because it has an input bias current of about 10 pA while for inverters they use a 741 op amp with about 80 nA of input bias current.https://www.scss.tcd.ie/SCSSTreasuresCatalog/hardware/temp-Comdyna-GP6-Analog-Computer/Comdyna-GP6-Analog-Computer.htmI'm guessing that you are planning to use +-15V supply do that your signal swing doesn't have to get too close to the rails. On the GP6, and the Vogel project, signal swings are between +-10V max and they both use +-15V supplies.

author: LoveLaika
author_rank: Frequent Contributor
timestamp: July 07, 2021, 07:14:12 pm
content: I think I'm beginning to see it. In a nutshell, you got the following:1. Input offset voltage (given by datasheet, can be reduced with offset pins, or with a pot at the inverting terminal if none are available)2. Input bias current (creates a voltage offset via Ohm's Law, reduced by reducing resistor values)Then you follow all this saying high resistor values increase the noise voltage, but contribute less current noise, so as R increases, you increase offset voltage caused by 1 source but reduce offset voltage by the other source. That's what I believe you are saying. So, please correct me if I'm totally misunderstanding.The basic summing amp always tied the non-inverting input to ground. While #1 can be reduced with a pot, couldn't you reduce #2 by placing a bias current compensation resistor in series with the non-inverting terminal? Doing all this would reduce the output error, but working all this seems to bring the equations that I posted in an earlier link to mind: selecting a feedback resistor in a difference amp with multiple inputs.This begs the question, how many op-amps are necessary? How do you reduce the number of op-amps down to a minimum value without sacrificing performance?

author: LoveLaika
author_rank: Frequent Contributor
timestamp: July 07, 2021, 07:18:56 pm
content: Quote from: rstofer on July 07, 2021, 07:04:03 pmThanks for replying. In terms of accuracy, I'm not sure yet. I'm just working out hypotheticals and trying to consider things that I'll need to take into consideration. At this point, I'm trying to see what voltages are available, so that limits my choice of op-amp. Right now, all I know is that my input signals go from 0 to -2 volts at a frequency of 100 MHz, lasting only for a few nanoseconds.

author: rstofer
author_rank: Super Contributor
timestamp: July 07, 2021, 07:47:37 pm
content: None of my replies have anything to do with such high speed operation.I got your voltage swing and speed confused with a filter design over in Projects.My bad...Gain Bandwidth Product is going to be your most important parameter.

author: TimFox
author_rank: Super Contributor
timestamp: July 07, 2021, 07:51:49 pm
content: So long as you tie the non-inverting input to ground, it is simple to null the bias current by feeding the inverting input through a very large resistor from a suitable pot (from one or both supplies, as required). For a sensitive ammeter (very high feedback resistor and no input resistor) back when JFET opamps were new, I installed a well-insulated mechanical relay with contacts to short the two inputs to zero the offset voltage with a pot connected to the offset adjust pins of the amplfier, then unshorted the inputs and adjusted the bias current with the other pot and large resistor.Noise: thermal (Johnson) noise can be considered as a voltage source (proportional to the square root ofR), or a current source (inversely proportional to the square root ofR), whichever is more convenient: it's the same noise, don't double-count it. The DC effects, of course, depend on the first power of the resistance.One op-amp suffices, so long as you don't mind the polarity inversion from input to output. The adjustment pots above do not increase the op-amp count.

author: TimFox
author_rank: Super Contributor
timestamp: July 07, 2021, 07:53:18 pm
content: I didn't see your frequency requirements. You may find that the errors are dominated by resistor shunt capacitance and uncontrolled stray capacitance to ground, even with a good high-speed op-amp.

author: LoveLaika
author_rank: Frequent Contributor
timestamp: July 07, 2021, 08:19:34 pm
content: Quote from: TimFox on July 07, 2021, 07:53:18 pmSorry about that. I was thinking of just op-amps in general and didn't mention it until now. That's just parasitic considerations, right? Not much can be done about that aside from picking the right components and ensuring that the layout is well done.

author: LoveLaika
author_rank: Frequent Contributor
timestamp: July 07, 2021, 08:25:53 pm
content: Sorry for not mentioning it sooner. I was thinking of op-amps in general, not taking into consideration the signal frequency.Thanks for your tip about GBW. I'll have to keep that in mind, but doing a quick search, there's not a lot of choices.

author: TimFox
author_rank: Super Contributor
timestamp: July 07, 2021, 10:01:33 pm
content: Capacitance is positive definite, but there are tricks to cancel it by driving a "neutralization" capacitor from an inverted signal.

author: LoveLaika
author_rank: Frequent Contributor
timestamp: July 07, 2021, 10:13:45 pm
content: Quote from: rstofer on July 07, 2021, 07:47:37 pmWhat concerns me is the short time the signal has reaching its max value. It only stays at -2 volts for only a few nanoseconds before going back to 0, so I would need a very fast amplifier to catch such a signal.

author: TimFox
author_rank: Super Contributor
timestamp: July 07, 2021, 10:16:38 pm
content: GBW is used to calculate the open-loop gain at the frequency of interest. The error referred to the op-amp input is the op-amp output divided by that gain (plus DC offset, of course).However, large-signal behavior at high frequencies may depend more on slew rate, since the amplifier's output has a limited dV/dt.

author: rstofer
author_rank: Super Contributor
timestamp: July 07, 2021, 11:20:22 pm
content: Quote from: LoveLaika on July 07, 2021, 10:13:45 pmIt's way out of my league but I think you're looking for a video amplifier.Here's a start with a 250 MHz op amp. My suspicion is that it isn't nearly fast enoughhttps://www.maximintegrated.com/en/products/analog/amplifiers/MAX4102.htmlYou need to work out dV/dt and find a suitable op amp before you get very far down the path. Perhaps you can find manufacturers with Parametric Search sites.If you happen on Analog Devices as a source, you can use LTspice to accurately model your systemhttps://www.analog.com/en/parametric-search/amplifiers/operational-amplifiers.html#

author: LoveLaika
author_rank: Frequent Contributor
timestamp: July 08, 2021, 03:59:15 pm
content: Thanks for your help and your suggestion. Unfortunately, the op-amp that you suggested can't be used due to my signal limits (ideal max output voltage is 8 volts), but your suggestion did give me an idea of how to proceed. Assuming the case of the maximum output voltage, I have to choose an op-amp that can satisfy such an output (thus, something higher than |5| volts), so that gave me a good place to start. Some of the op-amp models look promising when put into the simulation.

author: LoveLaika
author_rank: Frequent Contributor
timestamp: October 20, 2021, 07:37:04 pm
content: I apologize for the reply, but recently, I've been revisiting the concept again, and I wanted to ask for some input/feedback on the two differences. I've attached an example circuit to try and showcase the two different summing op-amps. In my design, I have a 50-ohm terminating resistor at each input, so rather than have the input be floating when inactive, there's a path to ground.So, the left one is the standard inverting summing op-amp. Pretty basic with a gain of -1. (In these examples, I just used 100-ohm resistors for illustration; it's not really indicative of actual values yet) Now, for the circuit on the right:All current going into VP goes out through R13. R10 and R9 contribute nothing. So, at that node, VP = (IN1 +IN2) / 3, assuming R6, R11, and R13 are all the same.For VN, it follows the basic formula: VOUT = (VN)*(1+{R8/R12}) where R8 is the feedback resistor.Combining the two, VOUT = (1+{R8/R12})*({IN1 +IN2} / 3), where the gain is controlled by R8, R12, and the combination of R6, R11, and R13.The notable issue faced on thequestion asked beforewas that the inputs could leave the non-inverting terminal floating. Plus, the possibility of crosstalk between the two inputs. However, is that not mitigated by the other added resistors? R10 and R9 allow for a short path to ground when there's no input signal. R13 gives a path for the signal to travel, which should prevent crosstalk from the signals. Plus, Node 4 can be any voltage, which would allow for offset voltage adjustment if necessary. While the standard non-inverting op-amp can't go below a gain of 1x, the addition of R13 in series with R6 and R11 could allow for lower values.Does all this seem correct? The question I have now regarding this layout is with other factors such as bandwidth and noise. As it is, does this configuration affect the bandwidth or increase the noise somehow? Also, while I illustrate with two inputs, how would things change if I try to scale it to 4 inputs?

author: rstofer
author_rank: Super Contributor
timestamp: October 20, 2021, 08:16:11 pm
content: Quote from: rstofer on July 07, 2021, 05:24:44 pmI built that Vogel analog computer and it works very well. Photo of front panel attached. I wanted the array of pin jacks to be 'perfect' so I built a CNC Mill to drill the holes. Talk about scope creep!I have since bought 2 Comdyna GP6 computers. They tend to use 741 op amps.https://www.scss.tcd.ie/SCSSTreasuresCatalog/hardware/temp-Comdyna-GP6-Analog-Computer/Comdyna-GP6-Analog-Computer.htmIn terms of analog computing, MATLAB Simulink has a lot of nice features. Need another integrator? No problem, just drag and drop one then wire it up.

author: rstofer
author_rank: Super Contributor
timestamp: October 20, 2021, 08:51:37 pm
content: Quote from: LoveLaika on October 20, 2021, 07:37:04 pmI'm not sure I understand the 50 Ohm resistors. I don't think they do much unless you are using them to terminate a signal.Were it me, I would jack up all of the other resistors by about x1000. How much current can the op amp output? Effectively, the output has to drive a 100 Ohm resistor to the current output voltage. If that is 10V, the current will be 0.1A. This is because the other end of the resistor is at virtual ground. 100k seems much more reasonable.

author: TimFox
author_rank: Super Contributor
timestamp: October 20, 2021, 09:46:05 pm
content: With the 100 ohm resistors to "virtual ground", the inputs will not present a 50 ohm termination to the sources, since the 100 ohm resistors are effectively in parallel with the 50 ohm resistors to "real ground".The question of the op amp output supplying current to the feedback resistors is very important, and at high frequencies any parallel capacitance (for compensation or frequency response control) must be included in that calculation.Regular op amps good for audio and DC were often specified to supply current into 2 k total load, with some good audio devices specified to drive 600 ohms.At RF, be very careful about how much voltage you intend to drive into a 50 or 100 ohm total load resistance.

author: LoveLaika
author_rank: Frequent Contributor
timestamp: October 20, 2021, 10:09:47 pm
content: Thanks for replying. Yeah, the 50-ohms are used to act as termination for the signals. Sorry, forgot to mention that. They're coming in from 50-ohm cables, so I had put them there for that reason.For sure, 100-ohms is not the value I would use. It's just that I didn't really bother changing the values. This was just for illustration. I would use different values, if I can decide on what values to use. I'm not so sure of that yet. The thing is, one part of the gain is determined by R8 and R12. For the inputs, assuming all resistors are equal at the non-inverting terminal, you can pretty much use any resistor value you want (just that it cuts the gain formed by R8 and R12 accordingly). I'm not driving high current loads, just trying to sum up small signal voltages.

author: LoveLaika
author_rank: Frequent Contributor
timestamp: October 20, 2021, 10:16:27 pm
content: Quote from: TimFox on October 20, 2021, 09:46:05 pmThanks for responding. For sure, I'm not going to use 100-ohms. It's just a placeholder value to illustrate what I'm trying to do. With the issue of the op-amp output supplying current, that's mitigated by larger resistor values? I previously used feedback resistors of 2k-ohms as well as for the op-amp inputs, so perhaps it might be worth it to do so here with this configuration. How does the addition of a feedback capacitor feed into my equations? If it's just in parallel with the feedback resistor, the capacitor acts as a short at high frequencies (forming a low pass filter), so it just sets the cutoff frequency. That's all it is, right?

author: rstofer
author_rank: Super Contributor
timestamp: October 20, 2021, 10:23:38 pm
content: A really good book on op amps: "Op Amps For Everyone" Chapter 4 is my favorite because it shows me how to scale and offset the input voltage. Like if I have a 12V SLA battery and I'm only interested in voltage between 10V and 15V and I want to offset the input to 0-5V (subtract off 10V) and rescale it to work with a 3.3V op amp or ADC. Very handy chapter...https://web.mit.edu/6.101/www/reference/op_amps_everyone.pdfFor your added inputs, you calculate each input resistor and the feedback resistor separately. There's no reason you can't use 10k input and 10k feedback to get 1 to 1 ratio and then add another input with 5k to get a 2 times input. Since the right hand end of the resistor is at virtual ground, the signals do not interact. Use any ratios you like. Breadboard the circuit and play with the input resistors.Remember, it's all down to Kirchhoff's Current Law at the (-) input pin and the pin is at 0V (virtual). So a bunch of currents come into the node and they all go out through the feedback resistor to get to the output pin.

author: Terry Bites
author_rank: Super Contributor
timestamp: October 21, 2021, 01:37:54 pm
content: They are aways a disappointment. If you dont need speed or high impedance inputs the INA105 ( INA133 INA157 etc) are more accurate than a hand rolled.the DC and AC errors for the inverting and non-inverting inputs are not the same- welcome to hell. There is always a trade off between DC accuracy and speed. Her's a good article on error analysis in diff amps:https://www.dataforth.com/catalog/pdf/an107.pdfYou generally can substitute instrumentation amps for diff amps. It will be more accrate from the outset and it can work out cheaper than the cost of a precision opamp and a few precison reistors. Less PCB room as well. The AD8421 and the LT1102 are fast. Check out the OPA396 and INA849 to get an idea of whats out there.

author: LoveLaika
author_rank: Frequent Contributor
timestamp: October 21, 2021, 09:09:23 pm
content: The more I work on this, the more I'm running into issues: loop gain, possible crosstalk, phase shift, bandwidth, etc. Running simple simulations is making me rethink this whole idea. I kind of need high speed, trying to achieve a bandwidth of 100 MHz.Well, I suppose that this is a 'difference' op-amp configuration, as in (0-{INPUTS}) if you look at it the right way. I've been testing with op-amps like the OPA818, but I never really thought about using other types of op-amps. How do instrumentation op-amps handle multiple inputs, as with my multiple inputs shown at the non-inverting terminal?

author: TimFox
author_rank: Super Contributor
timestamp: October 21, 2021, 09:27:39 pm
content: Do you need DC to 100 MHz?If only AC (RF), you could consider using broad-band transformers (such as the Mini-Circuits Labs units) and low-value resistors (say, 100 ohms) to do combinations of inputs, while respecting transmission line impedances.Anyway, if you use operational amplifiers up to 100 MHz signal frequencies, how will you verify the accuracy of the result, and to what tolerance?

author: LoveLaika
author_rank: Frequent Contributor
timestamp: October 22, 2021, 12:38:17 pm
content: The only way I'm verifying is using my signal generator to output a square wave and comparing the expected output on an oscilloscope. Caveat, my signal generator doesn't go up to 100 MHz, but it does go high enough where it is considered acceptable. And, yes, I'm looking at DC to 100 MHz or close to it.Would a current feedback op amp be good here? If the bandwidth isn't tied to the gain, I won't have to worry about how I need higher gain when there are more inputs.