Sub topic 6
Inverting Summing Amplifier
This chapter assumes you know KCL, Ohm's law, and the virtual short from the previous chapters. The summing amplifier is the inverting amplifier with more than one input resistor. You will derive its output equation, scale each input independently, check the result numerically, and learn where the equation stops being valid.
The circuit
Connect several sources, each through its own resistor, to the inverting input of an op amp. Put a feedback resistor Rf from the output back to that same node. Ground the non-inverting input.
The summing node is the junction of all the input resistors, Rf, and the inverting input pin.
Deriving the output equation
Two ideal op amp facts do all the work:
- The non-inverting input is at 0 V. With negative feedback, the virtual short holds the inverting input at the same voltage. The summing node is therefore a virtual ground at 0 V.
- No current flows into the op amp input pins.
Because the summing node is at 0 V, the current from source i is set only by its own resistor:
Ii = Vi / RiBecause the op amp draws no input current, the sum of these currents has nowhere to go except through Rf. KCL at the summing node says:
V1/R1 + V2/R2 + ... + Vn/Rn + (Vout - 0)/Rf = 0Solving for the output gives the summing amplifier equation:
Vout = -Rf * (V1/R1 + V2/R2 + ... + Vn/Rn)Each input is scaled by its own gain -Rf/Ri, and the results are added. The minus sign is the same inversion you saw in the single-input inverting amplifier.
Why the inputs do not interact
Every source sees a fixed resistance Ri to the virtual ground. A source cannot tell that other sources are connected, because the summing node does not move. This is why you can add, remove, or retune one input resistor without disturbing the others' gains. It is the main practical advantage of the inverting summer over a summing network built from plain resistors with no op amp.
Special cases
| Choice of resistors | Result |
|---|---|
| All Ri = Rf | Vout = -(V1 + V2 + ... + Vn), a plain inverted sum |
| All Ri = R, Rf arbitrary | Vout = -(Rf/R)(V1 + ... + Vn), a sum with common gain |
| All Ri = R, Rf = R/n | Vout = -(V1 + ... + Vn)/n, an inverted average of n inputs |
| Different Ri | Weighted sum, with weight Rf/Ri on input i |
Weighted sums
Setting each Ri independently sets each weight independently. With Rf = 20 kΩ, R1 = 10 kΩ, R2 = 20 kΩ, and R3 = 40 kΩ, the gains are:
- Input 1: -Rf/R1 = -2
- Input 2: -Rf/R2 = -1
- Input 3: -Rf/R3 = -0.5
Take V1 = 0.5 V, V2 = 1 V, and V3 = 2 V. Then:
Vout = -(2*0.5 + 1*1 + 0.5*2) = -(1 + 1 + 1) = -3 VResistors that differ by powers of two give weights that differ by powers of two. The next chapter uses that idea to build a digital-to-analog converter, so we do not develop it here.
Checking the result numerically
Before you build anything, check the algebra with a few lines of code. The function below evaluates the ideal equation. It also evaluates the difference amplifier formula from a later chapter, so you can reuse the file.
def summing_output(vs, rs, rf):
"""Ideal inverting summer: Vout = -Rf * sum(Vi / Ri)."""
return -rf * sum(v / r for v, r in zip(vs, rs))
def difference_output(v1, v2, r1, rf, r2, r3):
"""Four-resistor difference amp.
V1 drives the inverting input through r1, rf is the feedback resistor,
V2 drives the non-inverting input through r2, r3 goes from that input to ground.
"""
return v2 * (r3 / (r2 + r3)) * (1 + rf / r1) - v1 * (rf / r1)
print(summing_output([1.0, 2.0], [10e3, 10e3], 10e3)) # -3.0 (approximately, floating point)
print(difference_output(1.0, 3.0, 10e3, 20e3, 10e3, 20e3)) # about 4.0, which is (20k/10k) * (3 - 1)The first printed value reproduces the equal-resistor case with inputs of 1 V and 2 V. The output is -3 V.
A circuit simulator gives a second check. It also shows what a non-ideal op amp does to the answer. The SPICE netlist below models the op amp as a voltage-controlled voltage source with a gain of 100,000.
* Inverting summing amplifier, ideal op amp modeled as a high-gain VCVS
V1 in1 0 DC 1
V2 in2 0 DC 2
R1 in1 inv 10k
R2 in2 inv 10k
Rf inv out 10k
E1 out 0 0 inv 100k
.op
.endThe line E1 out 0 0 inv 100k sets V(out) = 100000 * (V(0) - V(inv)). That is the open-loop gain acting on the difference between the two input pins. The operating point should show V(out) close to -3 V.
You can predict the small error. Let A be the open-loop gain. Then V(inv) = -Vout/A, and KCL at the summing node gives:
Vout = -3 / (1 + 3/A)With A = 100,000 this is about -2.99991 V. The deviation is 0.003%, so the ideal model is accurate here. The factor in the denominator, 1 + (noise gain)/A, is the finite-gain error. The noise gain of the summer is 1 + Rf/(R1 || R2 || ...). In this circuit that is 1 + 10k/5k = 3. Adding more inputs raises the noise gain, so the error grows with the number of inputs.
Limits and common errors
The ideal equation holds only while the real circuit stays inside its operating limits. Check each item below.
- Output saturation. The output cannot exceed the op amp's output swing, which is typically a volt or two inside the supply rails. With ±12 V supplies, plan for roughly ±10 V. If the equation predicts -14 V, the real output clips near the negative limit and the equation no longer applies. Compute the worst case by summing the largest possible weighted inputs, not the typical ones.
- Sign. The output is inverted. If you need a positive sum, follow the summer with an inverting stage of gain -1, or use an inverting summer with inverted sources.
- Source resistance. The source's own output resistance adds in series with Ri. If a source has 1 kΩ output resistance and Ri is 10 kΩ, that input's gain is off by about 10%. Either drive the inputs from low-impedance sources, such as op amp outputs, or include the source resistance in Ri.
- Resistor tolerance. Each weight is a ratio of two resistors. With 1% parts, a weight can be off by about 2% in the worst case. Weights that must track each other, as in a DAC, need matched or thin-film networks.
- Input resistance is Ri, not infinite. Each source must supply current
Vi/Ri. A weak source can droop when loaded. The inverting summer is a current-summing circuit, so heavy loading is a design cost. - Input bias current. Real op amp inputs draw a small current. A resistor Rp from the non-inverting input to ground, equal to the parallel combination of all Ri and Rf, cancels most of the resulting offset. This matters most with bipolar-input op amps and large resistor values.
Working through a design
Suppose you need to mix three signals into one output with weights of 1, 2, and 0.5, and the signals never exceed ±1 V each. The worst-case output size is 1 + 2 + 0.5 = 3.5 V, which is well inside ±10 V.
- Choose Rf = 20 kΩ.
- Weight 1 gives R1 = 20 kΩ.
- Weight 2 gives R2 = 10 kΩ.
- Weight 0.5 gives R3 = 40 kΩ.
- Compute Rp = 20k || 10k || 40k || 20k = 1 / (1/20k + 1/10k + 1/40k + 1/20k) = 1 / (0.0000500 + 0.0001000 + 0.0000250 + 0.0000500) = about 4.44 kΩ.
Finally, check the output as a sanity test. With all inputs at +1 V, Vout = -(1 + 2 + 0.5) = -3.5 V.
Exercise
A summer has Rf = 47 kΩ, R1 = 47 kΩ, and R2 = 94 kΩ. V1 = 2 V and V2 = -3 V. What is Vout, and what is the input resistance seen by V2?
Show answer
The gains are -Rf/R1 = -1 and -Rf/R2 = -0.5. Vout = -(12) - (0.5(-3)) = -2 + 1.5 = -0.5 V. The input resistance seen by V2 is R2 = 94 kΩ, because the summing node is a virtual ground.
Exercise
You want an inverted average of four inputs using four equal input resistors of 20 kΩ. What value of Rf do you need, and what is Vout if the inputs are 1 V, 2 V, 3 V, and 4 V?
Show answer
The average needs a gain of -1/4 on each input, so Rf = R/4 = 5 kΩ. Vout = -(5k/20k)(1 + 2 + 3 + 4) = -0.25 * 10 = -2.5 V.
Exercise
A three-input summer has all resistors equal to 10 kΩ and an open-loop gain A = 50,000. Find the noise gain and the approximate finite-gain output for inputs summing to 3 V.
Show answer
The parallel combination of the three input resistors is 10k/3, so the noise gain is 1 + 10k/(10k/3) = 4. The output is -3 / (1 + 4/50000)... only if the ideal output is derived from the same KCL form, so use Vout = -Vsumideal / (1 + noise gain / A) with Vsumideal = 3 V. This gives Vout = -3 / (1 + 0.00008) = about -2.99976 V.