Square waves turn into triangles through integration, triangles back into squares through differentiation, and PID controllers lean on both. This page derives the formulas, picks component values and explains why a real integrator always needs a bleed resistor.
The integrator replaces the feedback resistor with a capacitor C: the input feeds R into the virtual ground node and C spans the inverting input to the output. The virtual open holds the charging current at Ui over R, so the output ramps at one over RC times the integral of the input. With R at 10k and C at 0.1µF the time constant is 1ms and a 1V square step ramps the output 0.1V per ms, turning the square wave into a triangle. Symbols per GB/T 4728.
The differentiator swaps R and C: the capacitor sits in series with the input and R does the feedback, so the output follows minus RC times the rate of change. A triangle becomes a square. But differentiation amplifies high frequencies by nature: a glitch on the input becomes a large spike and noise multiplies, with oscillation lurking. Practical differentiators add a small series resistor Rs of about 1k to the capacitor, clamping the high-frequency gain to Rf over Rs.
A pure integrator has a fatal flaw: offset current slowly charges C and the output drifts to a rail. Real integrators parallel C with a large bleed resistor Rp of about 1M, pinning the DC gain to Rp over R at the cost of pure integration at low frequency. Traps: polyester capacitors leak and drift, so use film types; a leaky reset switch leaves staircases; a DC offset on the input drives the integrator straight to the rail. Reset by shorting C at power-up before operation.
| Item | Recommended | Note |
|---|---|---|
| Integrator R | 10k to 100k | sets slope with C |
| Integrator C | 10nF to 1µF film | low leakage, low drift |
| Bleed Rp across C | 1M | stops drift to rail |
| Rs in series with C | 1k | clamps HF gain |
| Time constant RC | about period/10 | too large dulls response |
| Power-up action | reset first | short C before running |
Integrators and differentiators fit waveform shaping, ramp drives, PID controllers and V/I conversion. Always use film capacitors, always fit the bleed resistor, always limit the differentiator at high frequency, and check output drift on a scope, better than one percent of range per minute.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Analogue computation circuits per GB/T 4728; safety IEC 60204-1. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.