Sub topic 10
Gain error from finite open-loop gain
The earlier chapters used the virtual short, which assumes the op amp's open-loop gain A is infinite. A real op amp has a large but finite A, so the inverting and non-inverting amplifiers come out slightly below their ideal gains. This chapter derives that error and shows how to estimate it. It also shows how to choose an op amp with enough open-loop gain.
This chapter assumes you can do these things:
- Write node equations for the summing node.
- Work with voltage dividers.
- Convert between gain ratios and decibels. For example, 100 dB is a factor of 100,000.
It treats A as a constant, which is accurate at DC and low frequencies. The next chapter covers how A falls with frequency.
Where the virtual short comes from
An op amp output obeys Vout = A (v+ - v-). If Vout is a few volts and A is 100,000, the difference between the inputs is only tens of microvolts. The virtual short says that difference is zero. With finite A it is actually:
v+ - v- = Vout / AFor Vout = 10 V and A = 100,000, the inputs differ by 100 µV. That small leftover voltage is the cause of the gain error. The ideal equations ignore it, and the exact equations below keep it.
Deriving the exact closed-loop gain
Both amplifiers can be written with one quantity, the feedback factor β. This is the fraction of the output voltage that returns to the inverting input through the resistor network when the source is set to zero.
Inverting amplifier
The inverting input sits on a divider between Vin (through Rin) and Vout (through Rf). With the non-inverting input grounded:
v- = Vin · Rf/(Rin+Rf) + Vout · Rin/(Rin+Rf)
Vout = -A · v-Substitute and solve for Vout/Vin. Define β = Rin/(Rin+Rf), the weight on Vout:
Vout/Vin = -(Rf/Rin) · Aβ / (1 + Aβ)Non-inverting amplifier
Here Vin drives v+ directly, and Rf and Rg form a divider from Vout to v-, so β = Rg/(Rf+Rg). Then:
Vout = A (Vin - β Vout)
Vout/Vin = A / (1 + Aβ) = (1/β) · Aβ / (1 + Aβ)The common form
For both circuits:
actual gain = ideal gain × Aβ / (1 + Aβ)The factor Aβ is the loop gain. It is the gain a signal sees going once around the feedback loop. The factor Aβ/(1+Aβ) is always slightly below 1, so the actual gain is always slightly smaller in magnitude than the ideal gain. As A grows toward infinity the factor approaches 1, and the ideal equations return.
The fractional error is exactly:
error = actual/ideal - 1 = -1 / (1 + Aβ)When Aβ is large, this is approximately -1/(Aβ).
Noise gain: the useful shortcut
The reciprocal 1/β is called the noise gain. It is also the gain the non-inverting configuration gives the signal.
| Configuration | Ideal gain | β | Noise gain 1/β |
|---|---|---|---|
| Non-inverting | 1 + Rf/Rg | Rg/(Rf+Rg) | 1 + Rf/Rg |
| Inverting | -Rf/Rin | Rin/(Rin+Rf) | 1 + Rf/Rin |
The two configurations differ in one detail. A non-inverting amplifier with gain 10 and an inverting amplifier with gain -10 do not have the same noise gain. The non-inverting one has noise gain 10, and the inverting one has noise gain 11, because the source resistor Rin is part of the feedback divider. The inverting amplifier therefore has slightly more error at the same gain magnitude.
The error then becomes easy to estimate:
error ≈ -(noise gain) / AFor a non-inverting gain of 10 with A = 100,000, the error is about 10/100,000 = 0.01%. For the inverting amplifier at gain -10, it is 11/100,000 = 0.011%.
Worked numbers
The table below uses a non-inverting amplifier with gain 10 (β = 0.1) and shows the exact error for several values of A.
| Open-loop gain A | In dB | Loop gain Aβ | Actual gain | Error |
|---|---|---|---|---|
| 1,000 | 60 dB | 100 | 9.901 | -0.99% |
| 10,000 | 80 dB | 1,000 | 9.990 | -0.10% |
| 100,000 | 100 dB | 10,000 | 9.9990 | -0.010% |
| 1,000,000 | 120 dB | 100,000 | 9.99990 | -0.0010% |
Each tenfold increase in A gives a tenfold reduction in error. This only works while the loop gain stays large. Raising the closed-loop gain lowers β, so the same op amp has more error at higher gain. If you set the closed-loop gain to 1,000 with A = 100,000, the loop gain drops to 100 and the error rises to about 1%.
Computing it in Python
This script implements the exact formulas. It also solves for the open-loop gain needed to meet an error target.
def inverting_gain(rf, rin, open_loop_gain=float('inf')):
ideal = -rf / rin
if open_loop_gain == float('inf'):
return ideal
return ideal / (1 + (1 + rf / rin) / open_loop_gain)
def noninverting_gain(rf, rg, open_loop_gain=float('inf')):
ideal = 1 + rf / rg
if open_loop_gain == float('inf'):
return ideal
beta = rg / (rf + rg)
return open_loop_gain / (1 + open_loop_gain * beta)
def required_open_loop_gain(noise_gain, max_error):
"""Smallest A so that |error| = 1/(1 + A*beta) is at most max_error."""
return (1 / max_error - 1) * noise_gain
print(inverting_gain(10e3, 1e3)) # -10.0
print(noninverting_gain(9e3, 1e3)) # 10.0
print(inverting_gain(10e3, 1e3, 1e5)) # about -9.9989
print(noninverting_gain(9e3, 1e3, 1e5)) # about 9.9990
for a in (1e3, 1e4, 1e5, 1e6):
actual = noninverting_gain(9e3, 1e3, a)
print(f"A={a:>9.0f} gain={actual:.5f} error={(actual / 10 - 1) * 100:.4f}%")
# Gain of 100 (noise gain 100), error no worse than 0.01%
print(required_open_loop_gain(100, 1e-4)) # about 1e6 (120 dB)Checking with SPICE
A voltage-controlled voltage source E1 models the op amp with a gain of 1e5. This makes the finite-gain error visible in an operating-point run.
* Inverting amplifier, ideal gain -10
Vin in 0 DC 1
Rin in inv 1k
Rf inv out 10k
E1 out 0 0 inv 1e5
.op
.endThe operating point should report v(out) of about -9.9989 V, not exactly -10 V. The non-inverting version follows.
* Non-inverting amplifier, ideal gain 10
Vin in 0 DC 1
Rf out inv 9k
Rg inv 0 1k
E1 out 0 in inv 1e5
.op
.endIt should report about +9.9990 V. If you change 1e5 to 1e3, the outputs should move to about -9.89 V and +9.90 V. The inverting value follows from the 11/1,000 = 1.1% error.
How much open-loop gain do you need?
Work backward from the accuracy you need.
- Find the noise gain 1/β of your circuit.
- Decide the maximum gain error ε, as a fraction.
- Require
A ≥ (1/ε - 1) × noise gain, which is about noise gain / ε.
For a gain of 10 with a 0.1% budget, you need A of about 10,000 (80 dB). For a gain of 100 with a 0.01% budget, you need about 1,000,000 (120 dB). Precision op amps often offer 120 dB or more. General-purpose parts typically offer 90 to 110 dB.
In many designs this error is not the dominant one. Resistor tolerance is often larger. A 1% resistor pair gives about 2% gain error, which swamps a 0.01% finite-gain error. Finite-gain error matters when you use 0.01% resistors, when you run at high closed-loop gain, or when the amplifier sits inside a precision measurement chain. Because the finite-gain error is predictable, it can also be calibrated out in software or compensated by adjusting a resistor.
Gotchas
- Datasheet A is a typical or minimum figure. It is measured at DC with a given supply, load and output swing. It varies with temperature and with output level. Use the minimum value for worst-case error, not the typical one.
- A is not constant with frequency. The DC formula above does not apply at higher frequencies. A falls roughly as GBW/f above a low corner frequency, and it also picks up a phase lag. Plugging |A(f)| into
Aβ/(1+Aβ)gives the wrong answer because it ignores the phase. For example, with GBW = 1 MHz and a gain of 10, A has magnitude about 100 at 10 kHz. The true gain error at that frequency is about 0.5%, not the roughly 9% that a DC formula would suggest. - Heavy loads reduce A. An output current-limited stage has a lower gain when it drives a low-resistance load. Check the datasheet's open-loop gain against load resistance.
- The error is a gain error, not an offset. It scales with the signal, so it cannot be fixed with an offset trim. It is also not the same thing as the input offset voltage, which is covered in a later chapter.
- Do not compare gains of different configurations naively. A gain of 10 and a gain of -10 differ in noise gain (10 versus 11) and so in error.
The feedback loop as a block diagram
The diagram shows why the error is 1/(1 + Aβ). The amplifier multiplies the difference between the source and the fed-back signal. The feedback network returns a fraction β of the output.
The error voltage Vin - β·Vout that the amplifier needs equals Vout/A. Because A is large, this voltage is small, which is the virtual short. It is never exactly zero, though, so the output never quite reaches the ideal value.
Exercise
A non-inverting amplifier uses Rf = 99 kΩ and Rg = 1 kΩ. The op amp's minimum open-loop gain is 200,000. Find the actual closed-loop gain and the percentage error.
Show answer
The ideal gain is 1 + 99k/1k = 100, so β = 1k/(99k + 1k) = 0.01. The loop gain is Aβ = 200,000 × 0.01 = 2,000. The actual gain is 100 × 2,000/2,001 = 99.950, an error of -1/2,001, or about -0.05%.
Exercise
An inverting amplifier has Rf = Rin = 10 kΩ, so its ideal gain is -1. The op amp has A = 100,000. What is the actual gain, and what minimum A keeps the error below 0.01%?
Show answer
The noise gain is 1 + Rf/Rin = 2, so β = 0.5 and Aβ = 50,000. The actual gain is -1 × 50,000/50,001 = -0.99998, an error of about -0.002%. For a 0.01% limit, A ≥ (1/0.0001 - 1) × 2 = 19,998, so about 20,000 (86 dB) is enough.
Exercise
Why does the same op amp produce more gain error when you raise the closed-loop gain from 10 to 100?
Show answer
Raising the closed-loop gain lowers β, and therefore lowers the loop gain Aβ. The error is about 1/(Aβ), which equals the noise gain divided by A. A tenfold increase in noise gain gives about a tenfold increase in error.