Integrator circuit LTSpice

Discussion in 'Programmer's Corner' started by andi1231, Feb 11, 2016.

  1. andi1231

    Thread Starter New Member

    Dec 13, 2015
    I would like to integrate a sinusoidal voltage with an amplitude of 630mV at 160Hz. After integrating I schould get a cosine curve. I simulated the integrator circuit in LtSpice. For the first 50ms everything looks good (see attachment) but for longer simulation times the output voltage of the integrator rises until it has swung into a mean value. The progression of the curve looks like an exponential function. I can't find anything about this phenomenon. Is there somebody, who can explain this? Or is it a problem of visualization of LTSpice? What values of the timeconstant τ1=R1*C1 and τ2=R2*C1 do I need.
    Thank you for your support attachment_2.PNG attachment_3.PNG attachment_4.PNG
  2. ScottWang


    Aug 23, 2012
    Please attach the *.asc file then our helper will be more easy to find out the problem.
  3. dannyf

    Well-Known Member

    Sep 13, 2015
    The DC portion is due to input bias current being integrated.
  4. andi1231

    Thread Starter New Member

    Dec 13, 2015
    Ok, thank you.
    in the attachment you can find my *.asc file. I thougt the resistor (R3=25 kOhm) should compensate the bias current and how can I understand the progression of the curve (exponential function)? I think the shape of the curve also changes by using different values of R1, C1 and R2. Is it right? Is there any other possibility of compensating the bias current?
    Thank you
  5. dannyf

    Well-Known Member

    Sep 13, 2015
    It normally should.

    Maybe this is particular to the model(s)? Maybe the simulation was trying to establish some equilibrium? The simulation looks to be right after that.
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    C1 is initially discharged. It therefore takes a while for the equilibrium position to be established. To reduce the time, reduce R2 to, say, 25k.
  7. crutschow


    Mar 14, 2008
    As noted by Alec, the exponential curve is the charge time for the capacitor to reach it's equilibrium value.
    That has a time-constant of R2C1.

    It has nothing to do with the input bias current.
    It's related to the phase of the input waveform when the integration is initially started.
    If you change the phase of the input sinewave to 90°, which is the output 0V point due to the integrator phase shift, and use the Skip initial operating point (UIC) option in the transient analysis, then you will not see this transient, as seen below.
    (I didn't have the OP-27 model so I had to change that, but it doesn't affect the simulation.)

    You can reduce the value of R2 to reduce the stabilization time if the input waveform starts at anything other than 90° , but that will change of phase-shift of your output.
    So it's a trade-off between time to stabilize and the phase-shift error you can tolerate.

    Last edited: Feb 12, 2016