C6 · Lesson 25 · Integrators and differentiators
Calculus with a capacitor and an op amp
Swap the feedback resistor of an inverting amplifier for a capacitor, and the op amp integrates its input: the input current flows into the capacitor, so the output records the running total. Swap the input resistor for a capacitor instead, and it differentiates. Before digital computers, rooms of these circuits solved the differential equations of flight and ballistics. Today integrators shape waveforms, set filter characteristics and turn currents into voltages in every measurement chip.
Play
- An inverting integrator: a square wave in, through R, into the capacitor's virtual ground. The large resistor across C keeps the output from drifting. (The scope shows the circuit a second after it was switched on, once its start-up offset has died away.)
- What shape is the output? How steep are its slopes?
- Halve R, or halve C. What happens to the slopes?
Predict
An integrator with R = 10 kΩ and C = 100 nF has a steady +1 V input. How fast does its output change?
−1 V/ms. The input drives mA into the virtual ground, and that current charges the capacitor, so the output falls at V/ms. Left alone it would ramp until it hit a supply rail, which is why practical integrators have a resistor across the capacitor or get reset.
Name it
Integrator and differentiator
Integrator. Input resistor R, feedback capacitor C. The input current flows into C (rule 1), and the capacitor's voltage is the output's, negated (rule 2):
In the frequency domain, : gain , falling 20 dB per decade, with +90° of phase (an inversion and a 90° lag).
Why it drifts. At DC the capacitor is open, so the op amp has no feedback, and any tiny input offset is integrated without limit. A large resistor across C (here 1 MΩ) gives DC feedback, turning the circuit into a low-pass with a corner at that behaves as an integrator well above it.
Differentiator. Input capacitor C, feedback resistor R:
Its gain grows with frequency without limit, so it amplifies noise and tends to oscillate. Practical differentiators add a small resistor in series with C to cap the gain at high frequencies.
Uses. Integrators: triangle-wave and ramp generators, the integrating ADCs in multimeters, PID controllers (D3), and charge amplifiers. Differentiators: edge detectors, rate sensors.
Worked example
An integrator has R = 100 kΩ and C = 10 nF, and its output saturates at −12 V. A steady 1 V is applied. What happens?
Show the solution
- Ramp rate.
- Time to saturate. At that rate it reaches −12 V after 12 ms.
- Afterward. It stays at −12 V until the input changes sign.
Answer the output ramps down at 1 V/ms, saturates at −12 V after 12 ms and stays there until the input changes sign.
Worked example
The same integrator gets a ±1 V square wave at 500 Hz. What comes out, and what leak resistor across C keeps it from drifting while affecting 500 Hz little?
Show the solution
- Output. Each 1 ms half cycle ramps by 1 V, so the output is a 1 V peak-to-peak triangle.
- Leak resistor. A 10 MΩ leak puts the integrating corner at far below 500 Hz.
Answer a 1 V peak-to-peak triangle comes out, and a 10 MΩ leak resistor keeps it from drifting.
Worked example
A differentiator has C = 10 nF and = 10 kΩ. A 100 Ω resistor is added in series with C. What's its gain at 1 kHz, at 10 kHz, and far above?
Show the solution
- Corner of the series pair.
- Below the corner. It still differentiates, and the gain is :
- Far above. The capacitor is a short, and the gain levels off at
- Why the resistor is there. The bare differentiator's gain would keep rising with frequency, amplifying noise and, combined with the op amp's own pole, ringing or oscillating. The series resistor caps it.
Answer the gain is 0.628 at 1 kHz, 6.28 at 10 kHz, and levels off at 100 far above.
Check
An integrator with R = 22 kΩ and C = 47 nF has a steady 1 V input. How fast does its output change?
Write units the way you normally would: 1.5 V/ms, 1500 mV/ms and 0.0015 kV/ms are the same answer.
Check
What's the gain of an integrator (R = 10 kΩ, C = 10 nF) at 1000 Hz?
Check
A ±1 V square wave at 100 Hz drives an integrator (R = 22 kΩ, C = 220 nF). What's the peak-to-peak swing of the triangle that comes out?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
A differentiator has R = 10 kΩ and C = 10 nF. Its input rises at 10 V/ms. What's its output?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
An integrator has = 1 MΩ across its 10 nF capacitor to stop drift. Below what frequency does it stop acting like an integrator?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
Check
A differentiator has C = 10 nF and = 10 kΩ, with 220 Ω in series with C.
(a)
What's its gain at 1 kHz, well below the series corner?
(b)
Where does its gain level off at high frequency?
Check
An integrator has input resistor R and capacitor C, with a leak resistor L across C, and a steady input V.
Step 1
How fast does its output ramp at first?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
Where does the leak make it settle?
Step 3
Below what frequency does it stop integrating?
Explain why
Why does an ideal op-amp integrator drift, and how does a resistor across the capacitor stop it?
At DC a capacitor carries no current, so with only a capacitor in the feedback path there's no DC feedback at all. Any small constant input, such as the op amp's own offset voltage or bias current, drives a constant current into the capacitor, and the output ramps steadily until it hits a supply rail. A large resistor across the capacitor gives DC feedback, limiting the DC gain to , so small offsets only produce a small, steady output. Above the corner frequency set by that resistor and the capacitor, the capacitor dominates and the circuit still integrates.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.