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.
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)