Sub topic 14
Making the integrator practical: drift and a feedback resistor
This chapter assumes you know the ideal inverting integrator, Vout = -(1/RC) ∫Vin dt, and the virtual ground at the inverting input. It also assumes you know that a capacitor acts as an open circuit at DC.
Why the ideal integrator drifts
A real op amp has a small input offset voltage, Vos, typically 1 to 5 mV. It also has input bias current. With the input grounded, the virtual ground sits at Vos instead of 0 V, so the resistor R carries a current of about Vos/R. The capacitor has no DC path to discharge through, so it integrates that current forever:
dVout/dt ≈ Vos / (RC)
With R = 10 kΩ, C = 100 nF and Vos = 2 mV, the output ramps at 2 V/s. A ±12 V output stage saturates in about 6 seconds, even with no input signal. Bias current flowing into the capacitor adds a similar ramp. Once the output saturates, the virtual short no longer holds and the circuit stops integrating.
Adding a feedback resistor
The fix is a resistor Rf in parallel with C. It gives the capacitor a DC discharge path and limits the DC gain. The feedback impedance becomes Rf in parallel with 1/(sC), so:
Vout/Vin = -(Rf/R) / (1 + jωRfC)
This is a low-pass filter with these properties:
- DC gain: -Rf/R, which is finite.
- Corner frequency: f_c = 1/(2π Rf C).
- Above f_c: the gain falls at -20 dB/decade, approaching the ideal -1/(jωRC). The phase relative to the inverting gain approaches -90°.
- Offset at the output: Vos(1 + Rf/R) instead of a ramp.
Choosing Rf
Pick the DC gain you can tolerate, then check the corner frequency against your signal.
- Choose R and C for the integration rate, here R = 10 kΩ and C = 100 nF.
- Limit the DC gain to 10, so Rf = 10 × R = 100 kΩ.
- Compute f_c = 1/(2π · 100 kΩ · 100 nF) ≈ 15.9 Hz.
- Check the lowest signal frequency. It should be above about 160 Hz.
- Check the offset. With Vos = 2 mV, the output sits near 2 mV × 11 = 22 mV, which is far from saturation.
The trade-off is direct. A larger Rf gives a lower corner and a better integrator, but a larger DC offset. A smaller Rf gives a stable output, but integration only works at higher frequencies.
Checking the response numerically
This script compares the practical circuit with the ideal one at several frequencies.
import cmath
import math
R = 10e3
C = 100e-9
Rf = 100e3
for f in [1, 15.9, 159, 1590]:
w = 2 * math.pi * f
practical = -(Rf / R) / (1 + 1j * w * Rf * C)
ideal = -1 / (1j * w * R * C)
# Phase of the practical response relative to the inverting gain
rel_phase = math.degrees(cmath.phase(practical / -1))
print(f"{f:7.1f} Hz practical={abs(practical):7.3f} "
f"ideal={abs(ideal):7.3f} phase={rel_phase:6.1f} deg")| Frequency | Practical gain | Ideal gain | Phase relative to inverting |
|---|---|---|---|
| 1 Hz | about 10 | about 159 | about -3.6° |
| 15.9 Hz | about 7.07 | about 10 | -45° |
| 159 Hz | about 1.00 | about 1.00 | about -84° |
| 1590 Hz | about 0.10 | about 0.10 | about -89° |
Well below fc the practical gain flattens at 10, while the ideal gain keeps climbing. Above about 10 × fc the two agree.
Common errors
- Choosing Rf too small. The corner moves up into the signal band, and the circuit stops integrating your signal.
- Ignoring the DC offset. The output sits at Vos(1 + Rf/R), not at 0 V.
- Expecting a perfect ramp at very low frequency. The ramp rolls off and settles at the -Rf/R level.
Exercise
An inverting integrator uses R = 20 kΩ and C = 47 nF, and you want a DC gain of no more than 20. Choose Rf, find the corner frequency, and give the lowest signal frequency at which the circuit integrates well, using the 10 × f_c rule.
Show answer
Rf = 20 × 20 kΩ = 400 kΩ. f_c = 1/(2π · 400 kΩ · 47 nF) = 1/(0.1181) ≈ 8.5 Hz. The circuit integrates well above about 85 Hz.