Buggy spice model TC4420 corrected

My first part creation went really bad. May someone look into my project and correct my mistake?

power.7z (1.3 MB)

There is analog simulation https://www.microchip.com/en-us/software-library/analogsimtc4420.

First you would have to tell us what you see wrong or what problems you are facing. Digging into projects with null information is very difficult to address.

During simulation I have

No compatibility mode selected!
Warning: Unusual leading characters like ‘(’ or others out of ‘= [] ? () & % $"!:,;\f’
in netlist or included files, will be replaced with ‘*’.
Check line no 72: ((-770m,-1.00)(-700m,-10.0m)(-630m,-10n)(0,0)(20.0,10n))
warning, can’t find model ‘tc’ from line
r21 0 11 1 tc .3m 1.4u
warning, can’t find model ‘tc’ from line
r22 0 12 1 tc .1m -0.8u
warning, can’t find model ‘tc’ from line
r31 31 0 1 tc 3.2m
warning, can’t find model ‘begin_of_the_skype_highlighting’ from line
s31 31 30 31 30 begin_of_the_skype_highlighting 31 30 31 30 end_of_the_skype_highlighting ss31
warning, can’t find model ‘tc’ from line
r32 0 32 1 tc 2.9m 5u
warning, can’t find model ‘tc’ from line
r53 0 50 1 tc -5m 25u
warning, can’t find model ‘tc’ from line
r63 0 63 1 tc 3.3m,-2u
warning, can’t find model ‘tc’ from line
r64 0 64 1 tc 3.3m 6u
warning, can’t find model ‘tc’ from line
r55 55 0 1 tc 5.7m 19u
warning, can’t find model ‘tc’ from line
r57 57 0 1 tc 4.6m 49u
warning, model type mismatch in line
s59 55 0 1 0 ss59
Error: bad syntax in line 76
g11 30 0 table
Error: ngspice.dll cannot recover and awaits to be detached


** ngspice-36 shared library
** Creation Date: Mon Mar 11 21:44:53 UTC 2024


Error: there aren’t any circuits loaded.

oops, when I run Inspect-Simulator in this project with KiCad v8.0.8 Linux the schema completely crashes…
Could anyone confirm this?

The spice model of the TC4420 is buggy. Where did you get it?

Yes, it crashes ngspice due to buggy input. A fix is under way.

The spice model of the TC4420 is buggy. Where did you get it?
From Internet. And I don’t keep originating sites.
Strange enough there is an example here https://ww1.microchip.com/downloads/en/Appnotes/01256a.pdf with the same bugs, on the first glance.

No, absolutely not the same bugs.

The model file is buggy.
The pin assignment is missing (4 model pins need to be translated to 8 symbol pins)
The data sheet talks about 100kHz, not 10 MHz.

Attached you will find the project with a repaired model file (you may compare is to the original one) and some other modifications, running on KiCad 8 with ngspice-44.

power.7z (9.7 KB)

I have all the same. KiCAD Version 6.0.2

No compatibility mode selected!
warning, can’t find model ‘tc’ from line
r21 0 11 1 tc .3m 1.4u
warning, can’t find model ‘tc’ from line
r22 0 12 1 tc .1m -0.8u
warning, can’t find model ‘tc’ from line
r31 31 0 1 tc 3.2m
warning, model type mismatch in line
s31 31 30 31 30 ss31
warning, can’t find model ‘tc’ from line
r32 0 32 1 tc 2.9m 5u
warning, can’t find model ‘tc’ from line
r53 0 50 1 tc -5m 25u
warning, can’t find model ‘tc’ from line
r63 0 63 1 tc 3.3m,-2u
warning, can’t find model ‘tc’ from line
r64 0 64 1 tc 3.3m 6u
warning, can’t find model ‘tc’ from line
r55 55 0 1 tc 5.7m 19u
warning, can’t find model ‘tc’ from line
r57 57 0 1 tc 4.6m 49u
warning, model type mismatch in line
s59 55 0 1 0 ss59
Circuit: KiCad schematic
Error on line 0 :
r.xu1.r21 0 xu1.11 1 tc .3m 1.4u
unknown parameter (1.4u)
Error: circuit not parsed.

Would be good if you do the same in KiCAD 6.0.2

And it would be great if you update to the latest version as well.
If you’re using windows I think different kicad versions can live together.

My connection is really something. Probably I will be able to update in some months time.

I run your project on KiCAD 8 with the following result

Note: Compatibility modes selected: ps a
Circuit: KiCad schematic
Reducing trtol to 1 for xspice ‘A’ devices
Doing analysis at TEMP = 27,000000 and TNOM = 27,000000
Using SPARSE 1.3 as Direct Linear Solver
Warning: singular matrix: check node probe_int_out_c2_1
Note: Starting dynamic gmin stepping
Warning: singular matrix: check node probe_int_out_c2_1
Warning: Dynamic gmin stepping failed
Note: Starting true gmin stepping
Warning: singular matrix: check node probe_int_out_c2_1
Warning: singular matrix: check node probe_int_out_c2_1
Warning: singular matrix: check node probe_int_out_c2_1
Warning: singular matrix: check node probe_int_out_c2_1
Warning: True gmin stepping failed
Note: Starting source stepping
Warning: source stepping failed
Note: Transient op started
Error: Transient op failed, timestep too small
Error: The operating point could not be simulated successfully.
Any of the following steps may fail.!
Transient solution failed -
Last Node Voltages
------ lot of figures are going here ---------------
Then I checked the model of TC4420 and

Parameters tab is empty. As to my humble opinion the part is not included into simulation

What means X NC–0 NC–1 NC–2 NC–3 NC–4 NC–5 NC–6 NC–7 TC4420_I2D_B in Code tab? My guess is NC is Not Connected.

My point is it does not work.

same project but another way KiCAD 8

1.7z (8.6 KB)

and it does not work

I have downloaded my project. It will run out-of-the-box.

Here is another version, using an intermediate subcircuit for pin translation (symbol with 8 pins to model with 4 pins).
power3.7z (10.0 KB)
Expand it into any place.
Call Eeschema, open power-supply-3.kicad_sch
Inspect → simulator → run

You need to match the pins of the schematic symbol to the pins of simulation model (in your screenshot look at the “Pin Assignments” tab). Everything you need to make the simulation work is described in this tutorial: KiCad Eeschema as GUI for ngspice, tutorial for setting up the simulation @holger 's project has everything set up - including the pin assignment - and works as is.

All right. It works. I prepare some more questions. Thank you for your time.

I did not get how you managed to fix everything in your last example. I checked and connected model with the symbol,
1-1.7z (9.0 KB)
you can see in Simulation Model Editor > Pin Assignment and still

Reference value : 1,68860e-05
Reference value : 1,74144e-05
doAnalyses: Too many iterations without convergence
run simulation interrupted
Background thread stopped with timeout = 1