Simulation Error Help!

I have no idea what I did wrong. Help me out!!
This is the error message during simulation:
Note: can’t find the initialization file spinit.


** ngspice-42 shared library
** Creation Date: Jan 19 2024 07:06:53


Note: No compatibility mode selected!
Circuit: *
Note: Compatibility modes selected: ps lt a
Circuit: KiCad schematic
Netlist line no. 0:
Undefined parameter [rt]
Netlist line no. 0:
Expression err: rt*(1-((ternary_fcn(1m>.999,max(min(set,1m),.999),max(min(set,.999),1m)))))}
Netlist line no. 0:
Cannot compute substitute
Netlist line no. 0:
Undefined parameter [rt]
Netlist line no. 0:
Expression err: rt*(((ternary_fcn(1m>.999,max(min(set,1m),.999),max(min(set,.999),1m)))))}
Netlist line no. 0:
Cannot compute substitute
Please check your input netlist.
Error: ngspice.dll cannot recover and awaits to be detached
Note: can’t find the initialization file spinit.


** ngspice-42 shared library
** Creation Date: Jan 19 2024 07:06:53


Note: No compatibility mode selected!
Circuit: *
Warning: No job (tran, ac, op etc.) defined:
run simulation not started

Simulation results:

V(planck): 6.62607e-19fV
V(boltz): 1.38065e-08fV
V(echarge): 0.000160218fV
V(kelvin): -273.15V
V(i): 0V
V(c): 299.792MegV
V(e): 2.71828V
V(pi): 3.14159V
V(FALSE): 0V
V(no): 0V
V(TRUE): 1V
V(yes): 1V


This is what I got

The error message probably stems from the potentiometer model for RV1. ngspice does not get and thus does not know the value of the parameter rt (total resistance?).

Where did you get this model? Is there an example how to use it?

Could you zip your project (including all models) and post it here?

ClassDAmp.zip (767.9 KB)
I included all the library files for simulation model, and sym file of LM393 and IR2113. The rest components are already embedded on Kicad.

There are several issues with your simulation trials.

A general recommendation: Don’t try to draw a complex circuit and hope to get its simulation up and running immediately, with all parts active. Split your project into small projects to test individual parts (copy it each time and delete the unused portions).
E.g. check if the 555 oscillator is running.
Is the amplifier o.k.?
Is the compatator (plus inverter) running?
Does the half-bridge driver deliver suitable outputs when driven by a pulse source?

Concerning the models:
Potentiometer:
Most of the LTSPICE pot models are not usable in KiCad/ngspice. Attached you will find a suitable model.
pot1.zip (286 Bytes)

Use a fresh Device:R_Potentiometer.
Attach the model to the symbol.
In the Simulation Model Editor’s ‘Parameter’ window, copy the default values 1k, 0.4 into the ‘Value’ column, then hit o.k…
In the ‘Symbol Properties’ window, deselect ‘Show’ for the ‘Value’ field, select ‘Show’ for Sim.Params instead. Hit o.k.
On the Eeschema canvas, move the line ‘Rtot=1k wpos=0.4’ to a suitable place near the pot. You now may change its values (wiper position or total resistance) by double clicking and editing this line.

The Infineon model for the IR2113 is not compatible with ngspice. I will have to have a look and edit it as I did for the IR2125 (see Kicad 6.0 & ngspice 31 - #18 by Ste).

Concerning the circuit:
I do assume that driving the power MOS with 5 V on their gates only will not be enough.
Using the potentiometer to short-circuit the output of the amp to either 0 or 5V is probably not a good idea.

Thank you for your help! I have a question how I should replace IR2113 with IR2125. All the pin symbols are the same?

I do not remember. You will have to consult the data sheets.

I have made another model available, the the Full-bridge, 200 V, 20 A example at Simulation examples for KiCad/Eeschema/ngspice - #4 by holger, where I have used and modified the model of a modern 2ED2109S06F SOI EICE half bridge driver.

Where can I find the lib file for 2ED2109S06F?


I was trying to use the full bridge you provided, but the simulation didn’t work. I think there is a problem with lib file. Am I supposed to edit the lib file or do something else? I added the spicemodel from Infineon site.

I have just downloaded the Full-bridge, 200 V, 20 A from Simulation examples for KiCad/Eeschema/ngspice - #4 by holger, expanded it into an arbitrary folder D:\temp, opend the Eeschema file in KiCad 8.0.2 (Windows 10), and started the simulation. It ran out-of-the-box:

E.zip (507.9 KB)
Can you help me out with this class D amplifier circuit? I got PWM+ and PWM- signals right, but I keep having problems with they go thru half bridge gate driver. Every lib file is in the zip folder. What did I do wrong? can you try simulating my circuit? I am uploading the UCC27200 datasheet as well.
ucc27200 datasheet.pdf (2.0 MB)

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