Sub topic 6
Inverting summing amplifier
This chapter assumes you know Ohm's law, KCL, the ideal op amp model, and the virtual short at the inverting input. Here you will extend the inverting amplifier to several inputs and derive its output equation.
From one input to many
The inverting amplifier has one input resistor R1 and one feedback resistor Rf. Its gain is -Rf/R1. If you add more input resistors that all connect to the same inverting node, you get a summing amplifier.
The inverting input is a virtual ground. Under negative feedback the op amp holds it at the same voltage as the grounded non-inverting input, which is 0 V. Every input resistor therefore sees 0 V at its far end, so each input current depends only on its own source and resistor.
Deriving the output equation
Write KCL at the inverting node. The ideal op amp draws no input current, so all current from the sources must flow through Rf.
- The current from source k is Ik = Vk / Rk, because the node sits at 0 V.
- The sum of the input currents flows into Rf: I = V1/R1 + V2/R2 + ... + Vn/Rn.
- The voltage across Rf is I × Rf. The left end of Rf is at 0 V, so Vout = -I × Rf.
The result is:
Vout = -Rf × (V1/R1 + V2/R2 + ... + Vn/Rn)
Each input is amplified by its own gain, -Rf/Rk. The inputs do not interact, because the virtual ground isolates them from each other. This is superposition at work, and a later chapter treats it in detail.
If all input resistors equal Rf, the output is simply -(V1 + V2 + ...). If the input resistors differ, the circuit is a weighted sum. A smaller Rk gives that input a larger weight.
Worked example
Take V1 = 1 V, V2 = 2 V, and R1 = R2 = Rf = 10 kΩ. The formula gives Vout = -10k × (1/10k + 2/10k) = -3 V.
The SPICE netlist below models the op amp as a voltage-controlled voltage source (VCVS) with a gain of 100,000. Run the operating point analysis and check V(out).
* 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
.endV(out) comes out close to -3 V, but not exactly. The model's gain is finite, so the inverting node sits a few tens of microvolts away from 0 V.
The Python functions below evaluate the same formula. They also check a difference amplifier, which a later chapter derives.
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)Common errors
- Forgetting the minus sign. The output is the negative of the weighted sum.
- Dividing by the wrong resistor. Each voltage divides by its own Rk, and Rf only multiplies the total.
- Connecting a source to the non-inverting input and expecting it to be summed. That input is grounded in this circuit.
- Ignoring the output limit. If the weighted sum is larger than the supply allows, the output saturates and the formula no longer holds.
Exercises
Exercise
An inverting summer has Rf = 20 kΩ, R1 = 10 kΩ with V1 = 0.5 V, and R2 = 5 kΩ with V2 = -0.2 V. What is Vout?
Show answer
Vout = -20k × (0.5/10k + (-0.2)/5k) = -20k × (50 µA - 40 µA) = -20k × 10 µA = -0.2 V.
Exercise
Why can you ignore the other sources when you compute the current from one input resistor?
Show answer
The inverting node is a virtual ground at 0 V, so each resistor has 0 V at one end. Its current depends only on its own source voltage and resistance, so the inputs do not affect each other.