working varistor model

This commit is contained in:
Brendan Haines 2024-08-03 11:07:18 -06:00
parent 4b7b23cb32
commit 0d86b32320
3 changed files with 46 additions and 76 deletions

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"xuanli.spice"
]
}

View File

@ -72702,7 +72702,7 @@
(hide yes) (hide yes)
) )
) )
(property "Sim.Device" "SPICE" (property "Sim.Device" "SUBCKT"
(at 0 0 0) (at 0 0 0)
(effects (effects
(font (font
@ -72711,7 +72711,34 @@
(hide yes) (hide yes)
) )
) )
(property "Sim.Params" "model=\"A NC--1 NC--2 NC--3 NC--4 NC--5 NC--6 NC--7 NC--8 VARISTOR rclamp=${Value}\"" (property "Sim.Library" "common_libraries/spice/generic/varistor.lib"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Sim.Name" "VARISTOR"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Sim.Pins" "1=IN_N 2=IN_P 3=R_P 4=R_N"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Sim.Params" "gain=${VALUE}"
(at 0 0 0) (at 0 0 0)
(effects (effects
(font (font
@ -72812,78 +72839,6 @@
) )
) )
) )
(pin passive line
(at 0 -3.81 90)
(length 0) hide
(name "~"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "3"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 0 -3.81 90)
(length 0) hide
(name "~"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "4"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 0 -3.81 90)
(length 0) hide
(name "~"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "5"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line
(at 0 -3.81 90)
(length 0) hide
(name "~"
(effects
(font
(size 1.27 1.27)
)
)
)
(number "6"
(effects
(font
(size 1.27 1.27)
)
)
)
)
(pin passive line (pin passive line
(at 0 3.81 270) (at 0 3.81 270)
(length 1.27) (length 1.27)
@ -72894,7 +72849,7 @@
) )
) )
) )
(number "7" (number "3"
(effects (effects
(font (font
(size 1.27 1.27) (size 1.27 1.27)
@ -72912,7 +72867,7 @@
) )
) )
) )
(number "8" (number "4"
(effects (effects
(font (font
(size 1.27 1.27) (size 1.27 1.27)

View File

@ -0,0 +1,10 @@
*BEGIN MODEL VARISTOR
*//////////////////////////////////////////////////////////////////////
* (C) Brendan Haines
*/////////////////////////////////////////////////////////////////////
.SUBCKT VARISTOR IN_P IN_N R_P R_N PARAMS: gain=1
*/////////////////////////////////////////////////////
* .PARAM gain=1
R R_P R_N {abs(V(IN_P) - V(IN_N)) * gain + 1n}
.ENDS
* END MODEL VARISTOR