Electric Automation Forum
Forum » General Discussion » use of varistors in SPICE simulations
Topics: use of varistors in SPICE simulations on General Discussion
#1

# use of varistors in SPICE simulations

Hi All,
I'm trying to do a SPICE simulation of an AC-powered circuit, including varistors and a combined wave generator model to simulate the effects of a line surge.The problem is that placing the varistor in parallel to the AC voltage source will cause the simulation to crash (convergence problems). I have added some line source impedence also on the schematic. Doing some research on the web, I found out that usually MOVs are modelled in spice as current-controlled voltage sources. The relationship between voltage and current is quite complex and involves the logharitm of the current flowing in the varistor. If that is the case, than with an AC voltage source the current will reverse in the varistor, so that the math is no longer valid (the log argument cannot be negative). I was thinking of define a behavioral model for the varistor using the absolute value of the current flowing in the varistor instead of the current itself. Looking at some MOVs characteristic, the real behavior should be the same no matter the direction of the current. What do you think? Is there anyone who ran in the same problem? Thanks in advance for your help and Happy new year. Andrea.
01-14-2014 11:03 AM
Top #2
Hello Andrea,

First off, it is not surprising that you are having convergence problems because current controlled voltage sources placed in parallel with other voltage sources are the most problematic for admittance matrix solvers (which SPICE is) to handle. SPICE will run much smoother if you can reformulate your model into voltage controlled current source form. Here is an example of a popular varistor.

.subckt V320LA40B 1 2 ; (320 Vac, 40 Joules)
* 20mm diameter disc, 420 Vdc max, 810 Vmax @ 100A
R1 1 3 54m ; series resistance
B1 3 2 I= 2.2e-15*(exp(abs(V(3,2))/22)-1)*sgn(V(3,2)) ; varistor equation
* Note the use of abs and sgn functions to achieve bidirectional current flow
C1 3 2 750p ; parallel capacitance (real value and aids convergence)
R2 3 2 4.4G ; parallel resistance
.ends V320LA40B

This is a basic model, but the match is quite good for such a simple equation (a very slightly better match is possible with a more complex equation and thermal feedback from self heating).
01-14-2014 01:12 PM
Top #3
Hi David, thanks a lot for your useful comment and subcircuit example. The model I used is one from EPCOS, and should include lead parasitic inductance, series resistor and parallel capacitance, so I assumed the system matrix to be easier to solve. However, I will try to adapt the model you proposed to my needs. The model form EPCOS is working nicely if a DC voltage source is used instead of an AC one.
Again, thanks a loto for your help.
01-14-2014 03:38 PM
Top #4
If you can write the resistance as an expression, try using a resistor with its value set to R=[expression]. The value can be positive or negative, but not zero. I doubt that you want negative values, so you might model the resistance in a behavioral voltage source, then set the resistor R=abs(v(Vx)) +1e-6, where "Vx" is the node of the behavioral voltage source output.

The 1e-6 prevents the value from being zero, which v(Vx) may be at t=0. That might make it crash.
01-14-2014 05:57 PM
Top #5
This is the Intusoft syntax from the MovMaker software.
**********
* MOV Library version 1.0
**********
*SRC=Mov1_1;Mov1_1;MOV;New;
*SYM=MOV
.SUBCKT Mov1_1 1 7
*No Comment
* (I1,V1)=(1.00E-003,2.20E+002)
* (I2,V2)=(1.00E+002,3.25E+002)
* Inom = 1.00E+002
* Upturn exp = 2
* %Bulk voltage drop = 1.00E+000
LIN 1 2 1.00E-008H
B1 5 0 V = (ABS(V(2)-V(3)))*4.22E-002
BUPTURN 100 0 V = ABS(I(VC)) < 1.00E+002 ? 30 : 30 - ((ABS(I(VC))/1.00E+002)-1)^2
B2 6 0 V = 1E-32 * (V(5)^V(100))
B3 2 3 I = V(2,3) > 0 ? V(6) : -1 * V(6)
ROFF 2 3 1G
C1 2 3 1.00E-011
RON 3 4 3.25E-002
VC 4 7
.ENDS
**********
01-14-2014 08:02 PM
Top #6
Andrea,

Decades ago I created just a few MOV Spice models (many years apart and using different simulators). They were current-dependent voltage sources but worked fine over many orders of magnitude of current and with voltage reversals. I used sgn() or abs() functions and/or symmetric functions in the formulas so that the voltage-vs-current characteristics were entirely symmetric about zero bias. Try to avoid models that have discontinuous changes or use only polynomial functions (these ALWAYS "blow up"!). A series resistance can also be useful (and realistic).

R. Steve Scott
01-14-2014 10:43 PM
Top #7
In order to get good transient convergence, a good model should, as much as possible, contain elements with only voltage inputs and only current outputs (Norton equivalents should be used to produce voltage sources). The only voltage sources should be zero volt sources used for current sensing. It can't be stressed enough that stiff voltage sources (especially nonlinear behavioral types) are problematic because, unlike current sources and/or resistors, they will not yield to capacitances at small time steps during convergence difficulties in a transient analysis.

Whenever the simulator reduces the time step, it is because of nonlinear circuit behavior. The implicit assumption is that, as the time step is reduced, the various explicit, parasitic and stray capacitances will come to dominate the nonlinear bits (which don't depend on time). At really small time steps, only the capacitances will matter and, since capacitances are linear, the circuit will converge and the simulator will be able to get past the nonlinear behavior. Of course this can't work if the models omit the "parasitic" capacitances (and resistance).

To follow these rules means that p/n junctions (and other nonlinear element nodes) should never be without some series resistance and some parallel capacitance.
01-15-2014 01:02 AM
Top #8
David,

I found your comment very interesting, especially the "Norton equivalent" suggestion. I will definitely consider using that in the future!

But I must disagree, just a bit, about an almost total ban on voltage source models. Even thirty years ago my first MOV voltage-source-based model worked fine in both DC and transient modes. I suspect, and in my experience, the Spice solvers are pretty darn effective regardless of whether or not they get the most ideal inputs for matrix-solving. If "stiff" voltage inputs are anathema, should I never try to simulate, for example, a negative unity-gain inverter using a voltage source input with a series resistor to the minus input of an op-amp, and a feedback resistor from the output to the minus input, and the plus input grounded? The amplifier input source (voltage source and series resistance) has a current-dependent voltage source characteristic. Must I convert the input into a Norton equivalent before simulating?

I suspect a bigger issue, typically, is lack of smoothness in device models, perhaps, when an MOV model's voltage passes through zero voltage. Then I would agree that there should NEVER be any discontinuities, or maybe even discontinuities in the I vs V derivative, if possible.

I can't recall any other models I've ever created, except my old MOV models, that mainly consisted of a current-dependent voltage source. But they still worked OK for me in SPICE.

R. Steve Scott
01-15-2014 06:45 AM
Top #9
Practically speaking we have found the current output style only an issue for LTspice. We translate a lot of the PSpice models we develop for IC vendors and only LTSpice has convergence problems with the voltage output orientation. Though not always either. Other simulators (SIMetrix, IsSpice, Microcap, etc.) don't have different convergence properties (same iteration counts) with the voltage outputs. I guess you could say they run equally (bad or good). It might be a good test to see if some run in fewer iterations or faster though with current outputs. My gut is that the run times and convergence will be comparable given all the advancements in simulator technology/core algorithms over the years by the aforementioned vendors (at least).
01-15-2014 09:39 AM
Top #10
Edward and Charles,

Thanks for the fascinating details; excellent food for thought! And a correction to my first comment: my oldest MOV model was created only 20 years ago (not really "decades") and used SABER (which had the world's worst transient algorithm, empirically, by far). I also created a more recent MOV model about 12 years ago and this used PSpice. I'm still scratching my head a bit about how "I got away" with using voltage source models. But I recall that they really were very smooth through zero voltage. LTSpice is also my simulator of choice these days but I haven't tried using either type of my old MOV models in it.

R. Steve Scott