Integrator circuit misbehaving?

I’m at the end of my rope. I’ve made a simple integrator work many times in real life but I can’t get this example to function.

I’m using an integrator in another, larger circuit and the results were as expected in practice but not in simulation. The circuit in this example came from someone else doing a KiCAD 5 demo.

I’m pretty sure I’m using the same National spice model that he was, but in KiCAD 8 the circuit acts like the op-amp is dead, or at least mostly dead. I’ve also attached the model.

Please point out my bone-headed oversight. Sorry if this is covered elsewhere in the forum. My search turned up no clearly related post.

Integrator example.zip (8.7 KB)
LM741.lib (2.6 KB)

Rather than sending the whole project, maybe just a PDF of the schematic?

I’d run into problems with spice – while being overtired and entering in 1 megohm resistors as 1M, which is really 1 milliohm.

That project also was using an opamp as an integrator. Amazing how much little resistor can cause problems when it’s off by one billion.

When we put values on resistors and caps, we can provide nearly any units we want, but when spice sees the netlist - that megohm must be 1Meg.

Thank you. I thought of that. You’re right that Meg is better than M, but it didn’t make a difference.

The problem exists with and without the load resistor. The integrator should not need a load resistor if the opamp is acting like a real opamp.

The most curious thing to me is that this example exactly matches (except for the load resistor) the example that clearly functioned under KiCAD 5.

I sent the whole project so that one could “see what I see,” if one were so inclined. The project files are often requested by a few of the most prominent helpers in this forum.

I got it to work after fiddling a bit around.

First was the location of the LM741 model. I just dumped it into your project directory, and then set the path to it. After the usual suspect: pin assignment of the model: **LM741 properties / Simulation Model / Pin Assignments. Pins in spice models are often from another world and have to be mapped to the actual pin numbers.

Last was your power symbol. Get into a habit of always adhering to a flow of signals from left to right, and power from top to bottom. As you can see I rotated the symbol for your “negative” power supply. Then I noticed it also had a negative voltage. And double negative is a positive again.

No. Without the project itself there is no way I could have figured out how to get it to work.

1 Like

Thank you, @paulvdh. I’ve been burning the candle at both ends lately. :sleeping:

So, the LM741 lib is incorrect…

No, it is not. It has 5 pins, in+, in-, vcc, vee, out, as is typical for an opamp, in a sequence which has been common in spice modeling for many years. And the model even does not provide the nulling pins for offset trimming (as the model does not have offset).

However, spice has no notion of footprints and device packages. But KiCad has to have with its footprints and symbols, as the opamp is typically available in a package (e.g. DIP) with 8 pins.

So you need to have some translation between the model and the symbol. As this is device type specific, it has to be done by the user. In the ‘Simulation Model Editor’ you have the ‘Pin Assignment’ window for this task.

If you don’t want to spend time on this, and do not insist on the 741 (a 50+ years veteran), you may use the generic opamp symbol from the Simulation_SPICE library, ready to use including model and pin assignment.

1 Like

@Dennis_Heidner , To back @holger up, I addressed the pins and the flipped power supply, both entirely my user error for rushing myself and not using a checklist (thank you @paulvdh for not speaking directly to my idiocy), and the LM741 model gives the expected answer within the ability of the model to do so.

Yes, spice modeling is fussy, but when is simulation of any kind ever not fussy?

I typically just use the KiCad ready spice models unless I need some special feature of the opamp.

I also have had to remap/translate inputs for the models on other parts. I’d presumed that was already done. Prior to the simulation and problem post.