Integrator not working

Thread Starter

paddynbob

Joined Oct 30, 2017
25
Hey! So I'm designing an integrator for a hypothetical PID controller for a project and its just not playing the game.

Attached are some screenshots of the circuit and the response with 0V input.

As you can see he's giving me a 1.25V output and I'm very cross with him.

The Cap is 500pF and the resistors are 12.26Mohm resistors (theres a max value it'll let me enter).

How can I make him not do this?

CheersScreen Shot 2017-11-20 at 12.03.14.pngScreen Shot 2017-11-20 at 12.02.55.png

Cheers friends
 

AlbertHall

Joined Jun 4, 2014
12,346
Real opamps have an input bias current. I don't know what the simulation does about this. You can cancel this out by including the same string of resistors in series with the non-inverting input. There is also an input offset current (the currents are not exactly the same for both inputs) and that will not be cancelled by the added resistance.

Next, your circuit assumes that both inputs and the output can work correctly at the negative supply voltage. This is not true of most opamps. Again I don't know what that simulator does about that. To get around that problem you could connect a negative supply to the opamp instead of connecting it to ground.

[EDIT] It looks like you do have a negative supply for the opamp.
 

Thread Starter

paddynbob

Joined Oct 30, 2017
25
Real opamps have an input bias current. I don't know what the simulation does about this. You can cancel this out by including the same string of resistors in series with the non-inverting input. There is also an input offset current (the currents are not exactly the same for both inputs) and that will not be cancelled by the added resistance.

Next, your circuit assumes that both inputs and the output can work correctly at the negative supply voltage. This is not true of most opamps. Again I don't know what that simulator does about that. To get around that problem you could connect a negative supply to the opamp instead of connecting it to ground.

[EDIT] It looks like you do have a negative supply for the opamp.
no luck adding the resistors to the other input! :(
 

AlbertHall

Joined Jun 4, 2014
12,346
http://www.electronicshub.org/operational-amplifier-as-integrator/
"At 0 Hz, the feedback capacitor behaves like an open-circuit, so there is no feedback from the output to the inverting input of the op-amp. Now the circuit behaves like an open-loop inverting amplifier with very high gain. This will result in the saturation of the output voltage. As the input frequency increases, the capacitor gets charged. At higher frequencies, the capacitor acts like a short circuit.

Op-amp Integrator with DC Gain Control
To avoid the saturation of the output voltage and to provide gain control, a resistor with high value of resistance can be added in parallel with the feedback capacitor Cf. The closed-loop gain of the integrator will be (R2/R1), just like a normal inverting amplifier."
 

Thread Starter

paddynbob

Joined Oct 30, 2017
25
http://www.electronicshub.org/operational-amplifier-as-integrator/
"At 0 Hz, the feedback capacitor behaves like an open-circuit, so there is no feedback from the output to the inverting input of the op-amp. Now the circuit behaves like an open-loop inverting amplifier with very high gain. This will result in the saturation of the output voltage. As the input frequency increases, the capacitor gets charged. At higher frequencies, the capacitor acts like a short circuit.

Op-amp Integrator with DC Gain Control
To avoid the saturation of the output voltage and to provide gain control, a resistor with high value of resistance can be added in parallel with the feedback capacitor Cf. The closed-loop gain of the integrator will be (R2/R1), just like a normal inverting amplifier."
Ok, so I've done this and its eliminated the offset liked an absolute machine, cheers man! What I'm having a little trouble with is deriving the gain in the form Ki*integral(Vin)dt for the purposes of my PI controller. Any ideas by any chance?
 

Thread Starter

paddynbob

Joined Oct 30, 2017
25
You will need someone who understands PID maths. I used to tune them by trial and error but that's all.
its more just deriving the transfer function of the integrator with the extra resistor in the feedback path? I'm just struggling a little with the differential term in there haha
 

crutschow

Joined Mar 14, 2008
34,450
When you close the PID feedback loop with the integrator you won't needed the resistor across the integrator capacitor because there is DC loop feedback (the P in PID) which will keep the integrator from saturating under normal operating conditions.

You only need the resistor when testing the integrator by itself.
 

Thread Starter

paddynbob

Joined Oct 30, 2017
25
When you close the PID feedback loop with the integrator you won't needed the resistor across the integrator capacitor because there is DC loop feedback (the P in PID) which will keep the integrator from saturating under normal operating conditions.

You only need the resistor when testing the integrator by itself.
only problem seems to be, when I take the resistor away the offset in the integrator output returns! But if I keep it in, it doesn't integrate properly
 

crutschow

Joined Mar 14, 2008
34,450
it doesn't integrate properly
What signal are you integrating?
12MΩ and 500pF gives an integrator time-constant rolloff of 6ms (26.5Hz), so the signal interval must be much shorter than that for it to act as an integrator.
So you need to increase the resistance and/or capacitance if the signal interval is approaching the integrator roll-off time-constant.
 
Top