Integrator not working

Discussion in 'General Electronics Chat' started by paddynbob, Nov 20, 2017.

  1. paddynbob

    Thread Starter New Member

    Oct 30, 2017
    19
    0
    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?

    Cheers Screen Shot 2017-11-20 at 12.03.14.png Screen Shot 2017-11-20 at 12.02.55.png

    Cheers friends
     
  2. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,392
    1,485
    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.
     
  3. paddynbob

    Thread Starter New Member

    Oct 30, 2017
    19
    0
    no luck adding the resistors to the other input! :(
     
  4. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,392
    1,485
    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."
     
    xox, paddynbob and ebeowulf17 like this.
  5. paddynbob

    Thread Starter New Member

    Oct 30, 2017
    19
    0
    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?
     
  6. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,392
    1,485
    You will need someone who understands PID maths. I used to tune them by trial and error but that's all.
     
  7. paddynbob

    Thread Starter New Member

    Oct 30, 2017
    19
    0
    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
     
  8. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,392
    1,485
  9. crutschow

    Expert

    Mar 14, 2008
    19,805
    5,543
    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.
     
    paddynbob likes this.
  10. paddynbob

    Thread Starter New Member

    Oct 30, 2017
    19
    0
    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
     
  11. MrChips

    Moderator

    Oct 2, 2009
    16,887
    5,199
    What is the value of the resistor?
     
  12. paddynbob

    Thread Starter New Member

    Oct 30, 2017
    19
    0
    the largest value i can have is 12.26M, although I've tried smaller values.
     
  13. crutschow

    Expert

    Mar 14, 2008
    19,805
    5,543
    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.
     
    xox likes this.
Loading...