What's wrong in my LTspice simulation of an Op-Amp integrator circuit?

AI Thread Summary
The discussion revolves around troubleshooting an LTspice simulation of an op-amp integrator circuit. The user initially encounters an output oscillating around 5V instead of the expected zero. Key suggestions include setting initial conditions with ".IC V(out)=0" and ensuring proper grounding in the schematic. The user resolves the issue by completely removing a disconnected LM741 model, which was causing simulation instability. The conversation emphasizes the importance of including a DC feedback path in real-world applications to prevent op-amp saturation.
Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,180
Reaction score
2,717
I am doing an online course on op-amps. The specific video I am talking about is this one (skip to 24:25). Here, the professor has derived the expression of the op-amp integrator circuit, and in the next slide, he tells that we can create a triangular wave from a square wave using this integrator circuit. He showed us the circuit below, and said that if we simulate using those particular values of resistance and capacitance, we will get the graph as shown on the right.

1622982370945.png

A snapshot from the video

I don't have a function generator at home, so I cannot do this experiment, and hence decided to simulate it with LTspice. I downloaded the Pspice model of LM741 op-amp from the https://www.ti.com/product/LM741/%E2%80%94#design-development##design-tools-simulation, included it in the schematic, and created the circuit shown below. Here, of course, we ignore the input bias currents and the offset voltage.

1622981573688.png

The LTspice schematic that I created

On simulating, this is the output I got:

Op-amp_Integrator.png

Output of simulation. Green line is the output of the pulse generator V3,
and the blue line is the output of the Op-Amp, labelled Vout.

As you can see, the square wave almost matches what the Prof. had shown. But the output does not match: in the Prof's slide, the output wave is oscillating about 0, while in my case, it is oscillating about 5V.

Can anyone point out the mistake in my simulation?

A zip file containing the .asc file of the schematic and the model of the Op-Amp can be downloaded from here. Please remember to change the Spice directive to the location of the LM741.MOD file in your computer in case you want to carry out the simulation yourself.
 
Engineering news on Phys.org
Wrichik Basu said:
Can anyone point out the mistake in my simulation?
The constant of integration is in the history, or how the simulation started.
You must set the initial conditions with; .IC V(out)=0 and .tran 10m uic

Select "uic" in the .tran command by ticking the "Skip Initial operating point solution:" box.
You do not need "startup" so untick "Start external DC supply voltages at 0V:".
 
Baluncore said:
The constant of integration is in the history, or how the simulation started.
You must set the initial conditions with; .IC V(out)=0 and .tran 10m uic

Select "uic" in the .tran command by ticking the "Skip Initial operating point solution:" box.
You do not need "startup" so untick "Start external DC supply voltages at 0V:".
Okay, so the current directives are .tran 10m uic and .ic V(Vout)=0. But I am getting this (and the graph is a disaster):

1622999402670.png

Which time step is too small?
 
The internal simulation step time is selected to give stable results. Maybe there was oscillation somewhere. I expect it is due to a problem with the stability of the 741 op-amp model.
Replace your 741 with a standard OP07 or similar to partition the problem.
Lower your power supplies to something safer, like ±12 V.
Check your grounds are in place.
 
Baluncore said:
The internal simulation step time is selected to give stable results. Maybe there was oscillation somewhere. I expect it is due to a problem with the stability of the 741 op-amp model.
Replace your 741 with a standard OP07 or similar to partition the problem.
Lower your power supplies to something safer, like ±12 V.
Check your grounds are in place.
Changing power supply to ±12 V didn't work. Using OP07 causes the simulation to take a long time. It took 1 minute to compute 50μs. After that, I stopped the execution.
 
Remove the .txt extension and try these LTspice .asc and .plt files.
 

Attachments

  • Love
Likes Wrichik Basu
Baluncore said:
Remove the .txt extension and try these LTspice .asc and .plt files.
Thanks a lot, that works. The only difference between your and my circuits is that I kept the old LM741 disconnected instead of removing it completely. Once I removed that one completely, my schematic started working too.
 
Wrichik Basu said:
The only difference between your and my circuits is that I kept the old LM741 disconnected instead of removing it completely.
If LTspice had known it would have complained about the lack of ground on the model. It was probably fooled by internal current sources and sinks that referenced ground within the model. Those would be very high impedance which means that voltages on the internal nodes would be all over the place, making simulation very slow and indeterminate. When a component is disconnected, but remains in the simulation, drop ground symbols on all external connections to speed the simulation.
 
  • Like
Likes Wrichik Basu
Be aware that in the 'Real World' you will need a DC feedback path from the OP-AMP output to its '-' input, in parallel with the capacitor.

This is because the OP-AMP is not ideal and has a small amount of offset, resulting in some output voltage even when the inputs are identical. The end result is there is a small ramp voltage at the output whose slope (time constant) depends on the effective input offset voltage (6mV for the 741), circuit input impedance, and the capacitor value.

Cheers,
Tom
 
  • Like
Likes Wrichik Basu and DaveE
  • #10
Tom.G said:
Be aware that in the 'Real World' you will need a DC feedback path from the OP-AMP output to its '-' input, in parallel with the capacitor.
Yes, I know that. In fact, the Prof. also covered this in his subsequent lectures. Without that DC path, the op-amp would saturate.
 
Back
Top