Program crashes after adding an op-amp

I am simulating a portion of a circuit for an Engine Control Unit processing a signal for a variable reluctance sensor. I started with just the first stage and the program responded as expected. When I add a follow-on op-amp with transistor the program crashes (the schematic editor closes) when I start a simulation.

The transistor and op-amp models are vendor models.

I suppose I’ve made a simple mistake but I don’t see what it is. I’ve looked at several previous posts but I could not find anything really applicable.

Below is a copy of the model. If more information is desired, please let me know. Thanks
VR_Amplifier.kicad_sch (21.5 KB)

Could you add your KiCad version information, from Help → About KiCad → Copy version information (button on the upper right)?

I had similar trouble with 7.99 nightly and 7.0.1 when no model was defined, but that got fixed just a couple days ago in 7.99 and will be in 7.0.2.
Could possibly be that a faulty model also causes a crash?

I have KiCad 7.0.1 running; see below for all the details:

Application: KiCad x86_64 on x86_64
Version: 7.0.1, release build
Libraries:
wxWidgets 3.2.2
FreeType 2.12.1
HarfBuzz 5.2.0
FontConfig 2.14.1
libcurl/7.86.0-DEV OpenSSL/3.0.8 zlib/1.2.12 nghttp2/1.52.0
Platform: , 64 bit, Little endian, wxGTK, cinnamon, x11
Build Info:
Date: Mar 11 2023 21:04:29
wxWidgets: 3.2.2 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.81.0
OCC: 7.6.3
Curl: 7.86.0-DEV
ngspice: 39
Compiler: GCC 12.2.0 with C++ ABI 1017
Build settings:
KICAD_SPICE=ON

Also attached are the two models
ZTX553.lib (1.6 KB)
TL972.lib (9.5 KB)

Thanks

The Eeschema/ngspice interface is buggy for 7.0.0 and 7.0.1. You may need to wait for 7.0.2.

Your sample circuit does not contain the bipolar transistor.
You will need to set the Pin Assigment for the OpAmp (match symbol and model).
You are running your circuit from 0 to 5 V power. Setting an OpAmp input to 0.01 V is probably too close to the power supply, e.g. outside of the common mode range of the OpAmp.
Using the current testing build of Eeschema (which is the development towards 7.0.2), and a simple inverting amplifier with the TL972 does show that the OpAmp model is o.k. and that Eeschema/ngspice hopefully will not crash.

holger,
I don’t understand your comment that the circuit does not contain the bipolar transistor, I do see it in the Netlist and on the schematic. I have noticed that when the program crashed, some parameters like OpAmp pins needed to be changed again even though the schematic had been saved. Maybe there were additional changes that I did not notice.

Thanks

Please have a look at the VR_Amplifier.kicad_sch you have uploaded.

This is what the schematic you uploaded in the first message looks like when I open it. It does not show the ZTX553 PNP transistor.

I assume you intended to upload something else, or you are looking at a different schematic.

hmk,
You are correct, I apologize.

See attached

Thanks
Megasquirt.kicad_sch (58.2 KB)

After having redefined the models for the OP-Amp and both PNP transistor and defined the potentiometer model, I can make an operating point simulation in KiCad Nighlty from last night.

When I download the schematic file it has model definitions with the path from your computer, which obviously doesn’t work on mine, so I have to set up the path and settings for the models anew.

The potentiometer is the KICad built in model for Resistor with option potentiometer chosen, here set at 50%.

I also inserted a Nexperia model for the !n4148, as the built in model for a diode gives faulty results unless all the right parameters are given (which is not the case by default).

hmk,
I’m not sure why but things behave very differently now. The only change I can identify is that I started this session with a fresh start of the computer. After the first run,I entered a vendor model for the diode and replaced the pot with (2) resistors.

The model does not crash but I get a number of errors in the Spice Simulator that don’t make sense to me. Is there a resource that will help “decoding” the words? Below is a copy of the errors I’m getting.

Note: No compatibility mode selected!
warning, model type mismatch in line
s_uz_s2 3 4 1 2 _uz_s2
warning, model type mismatch in line
s_uz_s1 3 4 1 2 _uz_s1
warning, model type mismatch in line
sw4 net11 agnd vimon net19 sm1
warning, model type mismatch in line
sw1 net11 agnd vimon net10 sm2
Circuit: KiCad schematic
Error: no such function ‘if’
Error: no such function ‘if’
Error: no such function ‘if’
Error: no such function ‘if’
Error on line:
c.xu7a1.c_cinn xu7a1.gnd_float xu7a1.inn1 200f tc=0,0
unknown parameter (tc)
Error: circuit not parsed.

hmk,
It looks like I found the real problem. For the Compatibility Mode I had selected Spice; when I changed it to PSpice and LTSpice, everything works as I expected and the results identified the changes I need to make to the parent circuit.

I still am interested in a resource to “decode” the simulation errors if that is available.

Thanks to all

I had Pspice and LTspice compatibility set when I ran the simulation.
At a first glance the model type mismatches could very well be because the compatibility mode was not selected, hence the models you had supplied (opamp, transistor) were not parsed correctly.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.