Sub topic 2
Why negative feedback sets the gain
This chapter assumes you know Ohm's law, KCL and KVL, the voltage divider, and what gain means. It builds on the ideal op amp model from the previous chapter. You will see why wrapping an op amp with a resistor network turns a huge, unreliable gain into a small, predictable one. The next chapter turns this idea into the virtual short.
The problem with an op amp on its own
An op amp amplifies the difference between its two inputs:
Vout = A × (V+ − V−)
A is the open-loop gain. For a typical general-purpose op amp, A is about 100,000 at DC. It also varies a lot. It changes between parts from the same batch, with temperature, with supply voltage, and with output load. A datasheet might guarantee only a minimum of 50,000 and let the typical value reach 200,000 or more.
Used without feedback, the op amp is a poor amplifier for two reasons:
- A difference of 150 µV between the inputs would drive the output to 15 V. Any input larger than that sends the output to a supply rail.
- You cannot choose the gain. It is whatever the part happens to provide.
Without feedback, the op amp works as a comparator, which decides which input is higher. For amplification you need to tame the gain, and feedback does that.
What feedback means here
Feedback means sending a fraction of the output back to an input. The fraction is called β (beta), the feedback factor. It is set by a resistor network, so it is a ratio of resistors and does not drift like A does.
Feedback is negative when the returned signal reduces the difference at the input. In an op amp circuit, this means the feedback path goes to the inverting input (V−). Feedback is positive when it goes to the non-inverting input and pushes the difference larger.
The loop works like this:
- The input stage compares the input signal with the feedback signal. The difference is the error.
- The op amp multiplies the error by A to produce the output.
- The feedback network scales the output by β and subtracts it from the input.
Deriving the closed-loop gain
Write the loop as equations. The error is the input minus the fed-back signal:
e = Vin − β × Vout
The op amp output is A times the error:
Vout = A × e
Substitute the first equation into the second:
Vout = A × (Vin − β × Vout)
Vout × (1 + Aβ) = A × Vin
The closed-loop gain Acl is therefore:
Acl = Vout / Vin = A / (1 + Aβ)
The product Aβ is the loop gain. It measures how much the signal is multiplied as it travels once around the loop. When Aβ is much larger than 1, the 1 in the denominator is negligible:
Acl ≈ A / (Aβ) = 1 / β
The gain no longer depends on A. It depends only on β, which comes from resistor ratios.
For the non-inverting amplifier in this tutorial, the feedback network is a voltage divider from the output to the inverting input. With Rf from the output to the inverting input and Rg from the inverting input to ground:
β = Rg / (Rf + Rg)
so 1/β = 1 + Rf/Rg. That is the non-inverting gain formula you will derive formally in a later chapter. Here it comes out of the loop equation without any circuit analysis.
A worked example
Take Rf = 9 kΩ and Rg = 1 kΩ, and A = 100,000.
- β = 1 kΩ / (9 kΩ + 1 kΩ) = 0.1
- Loop gain Aβ = 100,000 × 0.1 = 10,000
- Acl = 100,000 / (1 + 10,000) = 9.9990
The ideal value is 1/β = 10. The real gain is low by about 0.01%.
The output for Vin = 1 V is 9.999 V. The error voltage is e = Vout / A = 9.999 / 100,000 ≈ 100 µV. The op amp needs only 100 µV of difference between its inputs to produce a 10 V swing, so the inputs are nearly equal. This near-equality is the virtual short, which the next chapter develops.
Why feedback desensitizes the gain
Suppose A falls from 100,000 to 50,000, a 50% drop, because of temperature or a poor part.
- A = 100,000: Acl = 100,000 / 10,001 = 9.9990
- A = 50,000: Acl = 50,000 / 5,001 = 9.9980
A 50% change in A changes the closed-loop gain by only 0.01%. In general, the fractional change in Acl is about the fractional change in A divided by (1 + Aβ). A large loop gain suppresses variations in A by that same factor.
The mechanism is that the loop corrects itself. If A drops, the output starts to fall. A lower output reduces the feedback signal β × Vout, so the error e grows. A larger error pushes the output back up. The output settles where the error is just big enough to support the required output.
The same mechanism reduces other imperfections in the amplifier, including distortion from the output stage and output-impedance effects. That is why almost every linear op amp circuit uses negative feedback.
Seeing it in a simulation
The following script models the op amp as an amplifier with a single time constant and clips its output at the supply rails. It runs the same loop with negative and positive feedback. It needs only the Python standard library.
def simulate(vin, beta, a=1e5, sign=-1, vsat=15.0,
tau=1.0, dt=2e-5, steps=500_000):
"""Settle the loop by stepping a first-order op amp model.
sign = -1 is negative feedback, sign = +1 is positive feedback.
"""
vout = 0.0
for _ in range(steps):
target = a * (vin + sign * beta * vout)
target = max(-vsat, min(vsat, target)) # supply clipping
vout += dt / tau * (target - vout)
return vout
beta = 0.1
print(round(simulate(1.0, beta, a=1e5), 3)) # 9.999
print(round(simulate(1.0, beta, a=5e4), 3)) # 9.998
print(round(simulate(0.001, beta, sign=+1), 2)) # 15.0
print(round(simulate(-0.001, beta, sign=+1), 2)) # -15.0The first two lines show desensitization. Halving A moves the result from 9.999 to 9.998. The last two lines show positive feedback. Once the output moves in one direction, the feedback pushes it farther the same way until it hits a rail. A 1 mV input of either sign is enough to decide which rail.
Negative versus positive feedback
| Property | Negative feedback | Positive feedback |
|---|---|---|
| Feedback connects to | Inverting input (V−) | Non-inverting input (V+) |
| Effect of an output change | Reduces the error | Increases the error |
| Behavior | Stable, output settles | Output runs to a rail |
| Closed-loop gain | A / (1 + Aβ) | A / (1 − Aβ), which diverges when Aβ ≥ 1 |
| Typical use | Linear amplifiers | Comparators with hysteresis, oscillators |
When the approximation fails
The result Acl ≈ 1/β needs Aβ to be much greater than 1. Two things can break this:
- High target gain. With β = 0.001 (a gain of 1000) and A = 100,000, the loop gain is only 100. The gain error is about 1%. You lose accuracy as the target gain approaches A.
- High frequency. A is not constant. It falls as frequency rises, so Aβ falls with it, and the gain error grows. This is the subject of the gain-bandwidth chapter.
Feedback also needs a stable loop. If extra delay in the loop turns the feedback positive at some frequency while Aβ is still above 1, the circuit oscillates. Standard op amps are compensated to be stable for resistive feedback networks, so you rarely see this unless you add large capacitive loads or long wiring at the inverting input.
Key points
- An op amp has a large and unpredictable open-loop gain A.
- Negative feedback returns a fraction β of the output to the inverting input.
- The closed-loop gain is A / (1 + Aβ), which approaches 1/β when the loop gain Aβ is large.
- The gain is then set by resistor ratios, and variations in A are suppressed by the factor (1 + Aβ).
- The error voltage between the inputs is tiny, which leads directly to the virtual short.
- Positive feedback drives the output to a rail.
Exercise
A non-inverting amplifier has Rf = 19 kΩ and Rg = 1 kΩ, and the op amp has A = 200,000. Find β, the loop gain, the closed-loop gain, and the error voltage between the inputs for Vin = 0.5 V.
Show answer
β = 1 kΩ / (19 kΩ + 1 kΩ) = 0.05. Loop gain Aβ = 200,000 × 0.05 = 10,000. Acl = 200,000 / (1 + 10,000) = 19.998, compared with the ideal 1/β = 20. Vout = 0.5 V × 19.998 = 9.999 V. The error voltage is Vout / A = 9.999 V / 200,000 ≈ 50 µV.
Exercise
A designer wants a gain of 1000 from an op amp whose open-loop gain may be as low as 50,000. What is the worst-case closed-loop gain, and what is the gain error compared with 1000?
Show answer
β = 1/1000 = 0.001, so Aβ = 50,000 × 0.001 = 50. Acl = 50,000 / (1 + 50) = 980.4. The error is about 2%, because the loop gain of 50 is too small for the 1/β approximation. A lower-gain stage or a higher-gain op amp is needed for better accuracy.