Electronic – Op-amp integrator response to square wave

integratoroperational-amplifier

schematic

simulate this circuit – Schematic created using CircuitLab

I would like to study the frequency responce of this op-amp integrator to a square wave. By setting a frequency of 10KHz and the pp-amplitude of the in-voltage to 340mV I obtain a triangle output wave with a pp-amplitude of 244mV. Now, according to my prevision I should have an output of 161mV, in fact Vout=(-1/R1 C1)*integral(vin dt)=-(Vin/(2 f R1 C1)) that is the integrator formula for a square wave. I have already checked this value by expanding in fourier series the square wave and by trasforming each harmonic through the transfer function. The op-amp is TL081. Even if it is not shown in the circuit scheme, the op-amp is powered through +15 and -15 DC sources.

Can someone help me out?
[EDIT: corrected the extra factor 2 as signalled by Olin Lathrop]

Screenshot of the oscilloscope:

enter image description here

Best Answer

I'm not entirely sure how to answer the why question, but simulation reproduces the same result; first the big picture:

enter image description here

But if you zoom in there are tiny little overshoot peaks in there...

enter image description here

which are actually pretty close to those measured. TL081 model is from TI, which is actually a very basic one... yet it predicted the overshoot pretty well.

Alas while I'm not completely sure what actually causes them, thanks to discussion below with the OP, all fingers point to the slew rate of the TL081. If I lower the slopes of the square wave by 3 orders of magnitude (from 1ns to 1us), then the output spikes go away (in simulation), but I also get some DC bias on the output (once it stabilizes):

enter image description here

Yeah, the datasheet slew rate for TL081 is 13 V/us. So in 1ns (first simulation) it would only be able to swing its output by 13mV, not enough to react to 25x greater input swing. Basically the output gets briefly pulled (up or down) by the input via the feedback resistor before the opamp can react to correct that. Actually it almost works like a voltage doubler during those spikes. Another way to check this is to measure the time span of the spikes. In [the first] simulation those spikes last 240ns (=4.15MHz), which is comparable to the 3-4MHz bandwidth of the TL081 (I note that the old datasheet said 4MHz but the new one says 3MHz.)