Trying to simulate a part in old kicad 6. What am I doing wrong? Edit: Still doesn't work in KiCad 8

Hello,

I’m currently giving KiCad a try, and ran into a problem with the simulation. In short, I’m trying to simulate a MCP1501 voltage reference with a model that I got from
here
with the zip-archive being directly available
here

I’m using one of the .txt files that I got from this archive, but so far I’ve been unable to get that simulation running. I suspect, that it may have something to do with the fact, that the physical part has six legs, three of which are GND, whereas the SPICE model having only four “pins”, if that’s how it’s called.

The header of the spice-model is:

* source MCP1501
.SUBCKT MCP1501 GND nSHDN OUT VDD  
*                |    |    |   |  
*                |    |    |   Power supply input
*                |    |    Buffered VREF Output
*                |    Shutdown Pin
*                System Ground

Meanwhile the pins of the physical part are enumerated as:

1: OUT
2: GND
2: GND
4: SHDN
5: GND
6: VDD

I’ve tried to set a alternative node-order in the dialog where the spice-file is being imported, and did try the following two lines:

3 1 1 2 1 4
OUT GND GND nSHDN GND VDD

I’ve also tried to switch the pins in this alternative pin settings dialog, which however appeared to not work at all with another part, i.e. seems broken in my version, whereas specifying the line with the new ordering worked.

I always get the following error-message from the simulator:

Too many parameters for subcircuit type "mcp1501" (instance: xxu2)

So what am I doing wrong? I’m using version 6.0.11 with ngspice-34, and would have to install another OS to run the newer versions, which I’d be hesitant to do without knowing if it would fix this issue.


footprint



output



I can’t help, as I have only once, year ago, tried that ‘simulation (simple RLC) works’.
I think there were no Spice in V5.
I have heard that there were a significant progres in the Spice subject between V7 and V8.
Trying it in V6 is probably not a good idea.

1 Like

good-news-everyone


Good News Everyone! I’ve found the Flatpak-Way of installing KiCad 8, and it still doesn’t work! This means, that even more of you are able to help me with finding out why this does not work as expected.

In short, I’ve recreated the following circuit:

and the spice-part has been set up as follows:


The spice lib that I’m using is this one here: MCP1501 -50.txt (13.7 KB)

You could also download that same file from the microchip site, but uploading it here might make things easier.

Well, and after having set everything up as shown, I get the following error-message:

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 -

I’ve had this earlier with another tool, where it was fixable by changing some default internals of the spice simulation. But that was more luck than anything, because I really did not know what I’ve been doing, and still don’t.

So maybe someone here can check, if I’m making some stupid mistake here, or if it really is something that requires debugging, and if the latter is the case, maybe this person also knows a resource where such a debugging process is explained. I’m still pretty clueless when it comes to the internals of spice simulations…

Here’s the redacted output of the simulation run:

Note: Codel model file loading path is /home/username/Projekte/Electronics/projects/KiCAD/vref/vref/
Background thread stopped with timeout = 0
Note: Compatibility modes selected: ps lt 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
Note: Starting dynamic gmin stepping
Warning: Dynamic gmin stepping failed
Note: Starting true gmin stepping
Warning: True gmin stepping failed
Note: Starting source stepping
Warning: singular matrix:  check node xu2.x_u1.98
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 -

--- ENDLESS ROWS OF NODES AND VOLTAGES ---

doAnalyses: TRAN:  Timestep too small; initial timepoint: trouble with xu2.x_u1:desd-instance d.xu2.x_u1.d4
run simulation(s) aborted

The unredacted output will all the voltages is here: output.txt (31.2 KB)

So, is anyone of you able to spot what I did wrong, or point me to a resource that explains how such issues are best debugged?

1: wire the voltage source directly and get rid of the power symbols.
2: get rid of the “PWR_FLAG” labels. Simulation does not need them.
3: add a single “0” ground from the simulation library.

Try again.

moregoodnews


More good News everyone!

I’ve managed to get this simulation going in KiCad 8, by adding a resistor to the input, because I somehow got the feel, that the simulation fails because of some oscillation. So I added 10 Ohms at the power input of the chip, and now it almost works.

The new circuit is here:



However, it only almost works, because the simulation reaches it’s end only with 10 Ohms Input Resistance, but not with 1 Ohm or 100 Ohm, and it also does something, that the real part probably does not do:

This kinda doesn’t look like the device that I’ve been working with. In my tests, this device jumped up to 5V, oscillated for some microseconds with less than 100mVpp and then sat straight at it’s output voltage. I’ve never seen such drops to 0V in the real device.

I did some more random testing, and found out, that this device generates a straight voltage that is higher than the input voltage for 1.6ms, when the input resistance is lowered to 0.1 Ohm, and the output resistance is increased to 10k. Which of course should be impossible in the real world, so something odd is going on with this spice library on one side, and ngspice on the other.

Which leads me to the question: Where are the limitations of KiCad simulations using the libs that the manufacturers provide? What can be expected to work, and what can’t, and what would be the best approach to deal with such parts? And how would I debug such issues without adding random parts to random places in the schematics?

Doned.

I’ve made the following schematic:



It still failed. The output is:

Note: Codel model file loading path is /home/username/Projekte/Electronics/projects/KiCAD/vref/vref/
Note: Compatibility modes selected: ps lt 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
Note: Starting dynamic gmin stepping
Warning: Dynamic gmin stepping failed
Note: Starting true gmin stepping
Warning: True gmin stepping failed
Note: Starting source stepping
Warning: singular matrix:  check node xu2.x_u1.98
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


---- SNIPPED AWAY LONG LIST OF VOLTAGES ---

No. of Data Rows : 0
doAnalyses: TRAN:  Timestep too small; initial timepoint: trouble with xu2.x_u1:desd-instance d.xu2.x_u1.d4
run simulation(s) aborted

Starting the circuit seems to be difficult. Sometimes it helps to ramp the supply voltage. Then the operating point for the tran simulation is evaluated at 0V.
circuit