Errors when simulating simple fuse

I am using KiCad stable and ngspice with PSPICE compatibility enabled.

I was trying to simulate a simple fuse with this library: http://espice.ugr.es/espice/src/modelos_subckt/spice_complete/THERMAL.LIB

Attached is a minimal example trying to use F8AG1.
Fuse.zip (3.2 KB)

However I get the following errors:

Error on line 0 :
g.xf1.g2 xf1.59 xf1.12 xf1.59 xf1.12 0, 4.7847m, -10.873u, 21.648n, -18.204p, 5.9532f
unknown parameter (4.7847m) 
Error on line 0 :
g.xf1.g3 xf1.11 xf1.12 xf1.11 xf1.12 0, 4.7847m, -10.873u, 21.648n, -18.204p, 5.9532f
unknown parameter (4.7847m) 
Error on line 0 :
e.xf1.e1 xf1.42 0 xf1.59 0 -620.00 1
unknown parameter (1) 

Does someone know how to hack the spice model so that it is compatible with ngspice?

I was checking here for possible syntaxes, but I couldn’t figure it out: http://ltwiki.org/index.php?title=G_Voltage_Dependent_Current_Source

I tried with other subcircuits such as FUSEN, but it complains about the question marks.

Error: unknown subckt: xf1 net-_f1-pad1_ net-_f1-pad2_ fusen {???temp=???hcte=2.0} 5.3u .5}

Should I remove the question marks? Or is this a bug in ngspice/pspice parser?

I think I figured it out, but not 100% sure it’s going to work how it’s intended to. These are super duper old behavior modeling syntax. I could only find examples of them in the old SPICE2 manual, before the B-source was introduced. I added POLY(1) to the G2, G3, and E1 sources, as such (ignore the green):

*SRC=8AG1;F8AG1;Fuses;Normal Blow;250V 1A
*SYM=FUSE
*HELP issyntax.hlp "Fuse Modeling"
.SUBCKT F8AG1 1     4     
*CONNECTIONS  FUSE+ FUSE-
*BEL 8AG 1A FUSE Normal Glass Tube Type, Voltage Rating 250V   
*FUSE FILAMENT CIRCUIT  
V1 1 8  
H1 14 0 V1 1    
E10 8 37  POLY(2) 14 0 9 0 0 0 0 0 100.000M     
G8 0 59  POLY(2) 14 0 8 37 0 0 0 0 1    
R2 59 12 1MEG   
G2 59 12 POLY(1) 59 12 0, 4.7847M, -10.873U,    
+ 21.648N, -18.204P, 5.9532F    
C1 59 0 900.00U 
G3 11 12 POLY(1) 11 12 0, 4.7847M, -10.873U,    
+ 21.648N, -18.204P, 5.9532F    
C2 12 0 900.00U 
V3 11 0 300     
*V3'S VALUE IS THE AMBIENT TEMPERATURE IN DEGREES K     
E2 9 0 59 0 3.333M      
R3 8 37 1MEG    
R4 14 0 1E12    
R5 9 0 1E12     
R7 11 12 1MEG   
R6 11 59 1MEG   
*FUSE OPENING CIRCUIT   
E1 42 0 POLY(1) 59 0 -620.00  1 
R8 43 44 10K    
V4 43 0 1       
Q1 39 45 0 NPN; OFF      
.MODEL NPN NPN(BR=100 CJC=10PF) 
R9 42 45 100MEG 
R10 43 39 1MEG  
Q2 45 39 44 PNP; OFF     
.MODEL PNP PNP(BR=100 CJC=10PF) 
X1 37 4 39 LSWITCH2     
.ENDS

For the 2nd problem, this file appears to be meant to be used with IsSpice. The IsSpice manual explains the deal with the three question marks. IsSpice supports unknown default values for subcircuit parameters via the ???, and it flags their UI to force you to enter something into the values prior to running a simulation. So you’re going to have to change these manually to a real default parameter. Unfortunately, I have no idea what the IB is supposed to be, or what TEMP is meant to refer to either (or if it’s supposed to be specified in C or K). Looks like there is supposed to be a help file that ships with IsSpice that might help explain all this.

1 Like

Thanks!
If i understand correctly POLY(1) is a polynomial acting on one node, but that does not mean is a grade-1 polynomial, right? Its grade is as high as the number of coefficientes behind?

In the links below, I did not find this explained specifically.
http://ltwiki.org/index.php?title=G_Voltage_Dependent_Current_Source
https://techdocs.altium.com/display/AMSE/GSRC+-+Voltage-Controlled+Current+Source+Model

This is the final list of modifications I did to make it work:

V1 1 8 0
G2 59 12 POLY(1) 59 12 0, 4.7847M, -10.873U, 
G3 11 12 POLY(1) 11 12 0, 4.7847M, -10.873U,
E1 42 0 POLY(1) 59 0 -620.00  1 

The breakdown current is apparently at 1.8A rather than at 1A as in the description, but otherwise I have it working now, thanks!

Yeah, pretty much. More info here: http://www.wrcad.com/manual/wrsmanual/node100.html
And here (Appendix B) is where I noticed that POLY(1) is assumed the default if you don’t specify POLY(n) in at all but start listing out node pairs: https://people.ece.umn.edu/~harjani/courses/common/spice2G6.pdf

As for the unexpected voltage…this model appears to have lots of parameters including temperature. So depending on HOW you blow the fuse might affect the result.

1 Like

Thanks so much for the two links, they are pretty well explained!

No problem!


I should’ve elaborated more. What I meant is that if these models are indeed sophisticated and accurate enough to model many real world effects, then there are many more factors than just the stated current rating. A common one with fuses is the time it takes to blow at certain currents. Here is an example snip from this datasheet:
https://www.mouser.com/datasheet/2/240/Littelfuse_Fuse_232_Datasheet.pdf-1317251.pdf

According to this, it will take a couple minutes to blow the 1A fuse when dumping 1.5A through it. So maybe DC sweep simulations, like in your screenshot, might not be the best for testing out these models.

1 Like

The issue with POLY(1) is fixed now in ngspice by holger in branch pre-master, see https://sourceforge.net/p/ngspice/bugs/509/

1 Like

Dang, that’s pretty fast resolution for an obscure problem. Maybe I should’ve created my ngspice sourceforge tickets as bugs instead of feature requests???

Yes, definitely, hehe.

1 Like