# Vary the integration factor of a opamp integrator

I am working on a analog PID circuit and I need to make a opamp integrator circuit where I can change the integration factor. Now why do I've to make this circuit (I saw the circuit for example here): simulate this circuit – Schematic created using CircuitLab

But a 'normal' opamp integrator is a circuit without the variable resistor. Why can I not just vary $\text{R}_1$?

• R1 defines the input impedance of your integrator circuit. If this input impedance changes it could change how whatever is feeding the signal to the circuit operates. You could put a voltage follower in line first, then adjust R1 and (over some set range) it would probably be OK. You would just have to make sure it always looked like a large impedance compared to the output of your voltage follower amp. For example, if it puts out up to 25 mA at 5 V, then you'd always want well over 200 Ohms of R1. – MikeP Feb 1 '18 at 16:33
• It’s a first order lag, not an integrator. – Chu Feb 1 '18 at 16:35
• @MikeP Ahh so: I've to build an integrator this way because of the input impedance of the opamp? – klopr Feb 1 '18 at 16:35
• @Chu Huh, it is an integrator according to many resources. – klopr Feb 1 '18 at 16:36
• @klopr No, it certainly isn't a functional integrator - it may look like it integrates at high frequencies but it won't integrate at low frequencies with R2 present. – Andy aka Feb 1 '18 at 16:54

R1 and C, without R2, make an op-amp integrator. Adjust either value, of course R1 is easier to adjust than the C, to adjust the gain.

R2 does something else, it forms a time constant with C, turning it into a low pass filter, with low frequency gain R2/R1, and corner frequency controlled by the R2.C product.

Alternatively, you could regard it as an integrator that works for AC, and R2 limits the DC gain to a reasonable and controllable value, rather than infinity (theoretical) or the open loop gain of the op-amp (practical)

• First of all thanks. So for my PID controller I need to change $\text{R}_1$ and remove $\text{R}_2$?! – klopr Feb 1 '18 at 16:38
• THere is no D and so just "PI", so choose how you independently control Ki , Kp and Kd. – Tony Stewart Sunnyskyguy EE75 Feb 1 '18 at 16:45

Compensation gains are affected by PID in summing junctions so the variables must be independent.

Phase and frequency compensation may also need to include phase lead compensators with addition R in series with the integrator caps so improve stability at the closed loop unit gain margin or phase margin. These are not necessarily the best k factors for Kp,Ki,Kd. One can plot / simulate a sig. gen. response of the PID filter. [I did this]

For an intuitive time domain response consider this.

If you inject a slow triangle wave to all 3 Op Amps for gains $k_p, k_i, k_d$;
- the P amp just outputs a triangle
- the Derivative or D amp produces a square wave with Vpp/R=Ic=CdV/dt
- the Integral or I amp output almost a Sine wave but for DC is a steady ramp.

For a frequency response of a PID control consider this;

• The I response is an integrator with a -6dB/octave LPF slope like a Bass boost amp but integrates DC
• the D response has + 6dB/octave HPF slope like a treble boost amplifier
• the midband of the I and D filter results in a notch that shifts according to the I and D gains until you add the Proportional gain amp.
• the P Amp brings up the notch level of the midband and with sufficient gain flattens the midband entirely
• however in a closed loop system the PID is supposed to reduce the long term dc drift with the integrator, reduce HF noise with the gain of the D amplifier and reduce the midband error with high proportional gain.
• ultimately it depends on the inertia of the system, noise reduction, stability , step overshoot and slew rate desired for the plant or servo response desired and the power of the actuators, choice of feedback sensors and use of PID an other types of feedback that makes it possible to be stable.