Purposes for adding capacitor in the feedback loop of opamps:
Real op-amps are not ideal. An op-amp already contains internal poles and phase shift. External components (wiring capacitance, probe capacitance, transistor gates, ADC inputs, photodiodes, etc.) add even more phase shift. Too much phase shift in the feedback loop can turn negative feedback into positive feedback at high frequency → oscillation. The capacitor helps by reducing the amplifier gain at high frequencies before the phase shift becomes dangerous.
The resistor and capacitor form a frequency-dependent feedback network. At low frequencies: capacitor is effectively open gain is set by the resistor ratio normally. At high frequencies: capacitor impedance decreases, feedback becomes stronger, closed-loop gain drops
Wide bandwidth means more noise.By limiting bandwidth, the capacitor reduces: RF pickup, broadband noise, switching spikes, EMI susceptibility
This is extremely common in: oscilloscope probes, photodiode amplifiers, high impedance sensors, differential probes, transimpedance amplifiers, etc. Input capacitance introduces another pole that can destabilize the circuit. The feedback capacitor creates a compensating zero/pole pair.
There is no universal value. The value depends on:
Adding Cf creates a low-pass filter in the feedback path.The cutoff frequency is approximately:
fc = 1 / (2π * Rf * Cf)
So:
This is more subtle and very important in fast/high-impedance circuits. Suppose the inverting node has capacitance:
This capacitance together with Rin creates a pole:
fp = 1 / (2π * Rin * Cin )
This pole can destroy phase margin. A feedback capacitor introduces a zero that compensates it. A common approximation is:
Cf ≈ Cin * (Rin / Rf)
This is widely used as a starting point.
For photodiodes and probes, the feedback capacitor is often mandatory. Without it: huge peaking, oscillation, ringing, etc. The optimal value depends on:
A common approximation:
Cf ≈ SQRT( Cin / ( 2π * Rf * GBW ) )
where: GBW = op-amp gain-bandwidth product Cin = total input capacitance
But in practice this is usually refined using: