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

Click For Summary

Discussion Overview

The discussion revolves around issues encountered in simulating an op-amp integrator circuit using LTspice. Participants explore the discrepancies between expected and actual simulation outputs, focusing on initial conditions, component selection, and circuit configuration.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant describes their attempt to simulate an op-amp integrator circuit and notes that the output does not match the expected behavior shown in a video lecture.
  • Another participant suggests setting initial conditions in the simulation to address the output discrepancy, specifically recommending the use of .IC V(out)=0 and .tran 10m uic.
  • A participant questions the time step settings in the simulation after attempting the recommended changes, indicating that the output remains problematic.
  • Concerns are raised about the stability of the LM741 op-amp model, with suggestions to replace it with a different model like OP07 and to lower power supply voltages for safety.
  • One participant reports that changing the power supply did not resolve the issue and that using OP07 resulted in significantly longer simulation times.
  • Another participant provides a solution by removing a disconnected LM741 from the schematic, which leads to successful simulation results.
  • Discussion includes a note about the importance of grounding in the simulation and the potential effects of disconnected components on simulation performance.
  • A participant mentions the need for a DC feedback path in real-world applications of the op-amp integrator to prevent saturation, referencing the professor's lectures on the topic.

Areas of Agreement / Disagreement

Participants express differing views on the causes of the simulation issues, with some focusing on initial conditions and others on component selection and grounding. There is no consensus on a single solution, as multiple approaches and suggestions are offered.

Contextual Notes

Limitations include potential issues with the stability of the LM741 model, the impact of disconnected components on simulation accuracy, and the need for proper grounding in circuit design.

Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,180
Reaction score
2,690
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   Reactions: 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   Reactions: 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   Reactions: 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.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
1
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K
Replies
34
Views
4K
  • · Replies 24 ·
Replies
24
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
14
Views
2K