Convert an.sch project in a.opj project Create an.Olb library from a.Lib library Fuse Model For Over-Current Protection Simulation of DC Distribution Systems.
Pspice to IsSpice4 Conversion
1) Look for all resistor .MODEL lines that look like:
.MODEL <model_name> RES ....
In these lines the type of the model must be changed from RES to R.
Convert them according to the following rule:
.MODEL <model name> RES ....
.MODEL RMOD RES TC1 = 0.002
IsSpice model:
.MODEL <model_name> R ....
.MODEL RMOD R TC1 = 0.002
2) Look for all lines starting with the letter 'R'. They should look like:
R<name> <node_1> <node_2> <model_name> <resistance_value> ...
Here, the ordering of the model name and resistance value must be swapped.
The conversion rule is:
Pspice model:
R<name> <node_1> <node_2> <model_name> <resistance_value> ...
Rd 1 10 RMOD 1K TEMP=25
IsSpice model:
R<name> <node_1> <node_2> <resistance_value> <model_name> ...
Rd 1 10 1K RMOD TEMP=25
3) Look for .MODEL lines containing the T_MEASURED parameter:
.MODEL <model_name> <model_type> .... T_MEASURED = <value> ....
The T_MEASURED parameter must be renamed to TNOM:
Pspice model:
.MODEL <model_name> <model_type> .... T_MEASURED = <value> ....
.MODEL DLMOD D IS = 1E-012 T_MEASURED = 25 N = 2
IsSpice model:
.MODEL <model_name> <model_type> .... TNOM = <value> ....
.MODEL DLMOD D IS = 1E-012 TNOM = 25 N = 2
4) Look for .model lines containing the T_ABS parameter:
.MODEL <model_name> <model_type> T_ABS = <temp_value> ....
The T_ABS parameter must be renamed to TEMP and moved to the instance line that calls the .model.
Change the instance and the model line according to the following rule:
Pspice model:
<instance_name> .... <model_name>
.MODEL <model_name> <model_type> T_ABS = <temp_value> ....
Ddg 25 24 ddgmod
.model ddgmod d t_abs = 25 is = 1E-024 cjo = 3.97482E-010 vj = 0.289018 m = 0.284643 fc = 1E-006
IsSpice model:
<instance_name> .... <model_name> TEMP = <temp_value>
.MODEL <model_name> <model_type> ....
Ddg 25 24 ddgmod temp = 25
.model ddgmod d is = 1E-024 cjo = 3.97482E-010 vj = 0.289018 m = 0.284643 fc = 1E-006
Note that the .MODEL line you are looking for may occur before the instance line that addresses it.
Netlists are insensitive to the ordering of instance and MODEL lines.
5) Look for .model lines containing vswitch:
.model <model_name> vswitch ron=??? roff=??? von=??? voff=???
Change the device type from vswitch to sw. Use the same RON and ROFF parameters, but replace VON and VOFF with VT and VH calculated as follows: |
|
Pspice model
.model smod vswitch ron=.1m roff=1e15 von=-1.19 voff=-1.21
IsSpice model
.model smod sw ron=.1m roff=1e15 vt=-1.2 vh=.01
6) Convert G and E tables
G tables become:
Pspice model
G1 3 4 table {v(1,2)}=(...{table values}...)
IsSpice model
AG1 %vd(1,2) %id(3,4) tmod
.model tmod pwl
+ fraction = FALSE,input_domain=0.0, xy_array = [...{table values}...]
E tables become:
Pspice model
E1 3 4 table {v(1,2)}=(...{table values}...)
IsSpice model
AE1 %vd(1,2) %vd(3,4) tmod
.model tmod pwl
+ fraction = FALSE,input_domain=0.0, xy_array = [...{table values}...]
7) Convert E/G/S elements and equations to B element equations
For E/G elements:
Pspice model
gout 101 102 VALUE={V(201,202)*i(vsense)}
etmax tmax 0 value={Tr*v(tm1) + (Ts-Tr)*v(tm2)}
IsSpice model
Bgout 101 102 I=V(201,202)*i(vsense)
Betmax tmax 0 v={Tr}*v(tm1) + {(Ts-Tr)}*v(tm2) ; see how {} went around Ts-Tr
- AddB to beginning of line
- Replace VALUE with V for e source and I for g source
- Removecurly braces before and after expression
- Place curly braces around one or more parameters that can be evaluated.
Be careful not to mix nodes and parameters in expressions.
For S elements:
Pspice model
s1 1 2 201 0 switch
IsSpice model
As1 1 2 201 0 switch
Pspice To Ltspice
- Add A to beginning of line
Download Ltspice Models
8) Convert IF-THEN-ELSE syntax:
Pspice model
Format: IF(argument,then,else)
E1 1 0 Value = { IF ( V(3) > 5, 10, 100m ) }
E1 1 0 Value = { IF (V(3) > 5, 5, IF ( V(3) < 100m, 100m, V(3) ) ) };nested if-then-else
Format: | EVALUATION?OUTPUT_VALUE1 or EXPRESSION :OUTPUT_VALUE2 or EXPRESSION |
ifEVALUATION is true thenOUTPUT_VALUE1elseOUTPUT_VALUE2 |
BE1 1 0 V = V(3) > 5 ? 10 : 100m
BE1 1 0 V = V(3) > 5 ? 5 : V(3) < 100m ? 100m : V(3) ;nested if-then-else
9) Analog Behavioral In-line Equations, Expressions, and Functions:
Note: IsSpice4 uses B-elements and Pspice uses G-element or E-elements with keyword Value=. See item 7 above. This is only a list of Pspice syntax and the IsSpice4 equivalent. IsSpice has a lot more functions which you can read about in the IsSpice4 User's Guide. To make it easier to read I highlight in red what is different or not supported.
Pspice syntax | IsSpice syntax | |
addition | + | + |
subtraction | - | - |
multiplication | * | * |
division | / | / |
exponentiation | ** | ^ |
unary NOT | ~ | ~ |
boolean OR | | | | |
boolean XOR | ^ | ---not supported--- |
boolean AND | & | & |
equality test | ---not supported--- | |
non-equality test | != | ---not supported--- |
greater than test | > | > |
greater than or equal to test | >= | >= |
less than test | < | < |
less than or equal to test | <= | <= |
|x| | ABS(x) | ABS(x) |
x1/2 | SQRT(x) | SQRT(x) |
ex | EXP(x) | EXP(x) |
ln(x) | LOG(x) | ln(x) |
log(x) | LOG10(x) | log(x) log10(x) |
|x|y | PWR(x,y) | PWR(x,y) |
+|x|y (if x > 0) -|x|y (if x < 0) | PWRS(x,y) | PWRS(x,y) |
sin(x) | SIN(x) | SIN(x) |
sin-1(x) | ASIN(x) | ASIN(x) |
sinh(x) | SINH(x) | SINH(x) |
cos(x) | COS(x) | COS(x) |
cos-1(x) | ACOS(x) | ACOS(x) |
cosh(x) | COSH(x) | COSH(x) |
tan(x) | TAN(x) | TAN(x) |
tan-1(x) | ATAN(x) ARCTAN(x) | ATAN(x) |
tan-1(y/x) | ATAN2(y,x) | ATAN2(y,x) |
tanh(x) | TANH(x) | TANH(x) |
magnitude of x | M(x) | M(x) mag(x) magnitude(x) |
phase of x | P(x) | P(x) ph(x) phase(x) |
real part of x | R(x) | R(x) re(x) real(x) |
imaginary part of x | IMG(x) | IMG(x) im(x) imag(x) |
time derivative of x | DDT(x) | ---not supported--- |
time integral of x | SDT(x) | ---not supported--- |
y value as a function of x | TABLE(x,x1,y1,...) | Use Code Model (See item 6 above) |
minimum of x and y | MIN(x,y) | MIN(x,y) |
maximum of x and y | MAX(x,y) | MAX(x,y) |
limit (x,min,max) | LIMIT(x,min,max) | ---not supported--- |
+1 if x > 0 0 if x = 0 -1 if x < 0 | SGN(x) | SGN(x) |
1 if x > 0 0 otherwise | STP(x) | STP(x) |
x if t is true y otherwise | IF(t,x,y) | t ? x : y |