Custom Search

Friday, July 18, 2008

Polynomial source - pspice


The symbol for a polynomial or nonlinear source is POLY (n), where n is the number of dimensions of the polynomial .The default value of n is 1.The dimensions depend on the number of controlling sources. The general form is
POLY (n) {(controlling) nodes} {(coefficients) values}
The out put sources of the controlling sources can be voltage or currents.
For voltage controlled sources, the number of controlling nodes must be twice the number of dimensions.
For current controlled sources, the number of controlling sources must be equal to the number of dimensions.
The number of dimensions and the number of coefficients are arbitrary.


Let us call A,B, and C are the three controlling variables, and Y is the output source.
The following figure shows that is controlled by A,B, and C. The output source takes
The form of Y = f(A,B,C…..)
Where Y can be Voltage or Current
A,B,C can be Voltage or Current or any combination
For a Polynomial of n=1 with A as the only controlling variable, the source function takes
The form of Y=P0+P1A+P2A2+P3A3+P4A4+……………..PnAn
Where P0,P1,P2,P3,P4……………..Pn are the coefficient values. this is written in PSpice as
POLY NC1+ NC1- P0 P1 P2 P3 P4……………..Pn
Where NC1+ NC1- are the positive and negative nodes, respectively, of the controlling source A.
For a Polynomial of degree n=2 with A & B as the controlling sources, the source function takes the form of
Y=P0+P1A+P2B2+P3A2+P4AB+P5B2+ P6A3+ P7A2B+ P8AB2+ P9B3+……..
This is described in PSpice as
POLY (2)NC1+ NC1- NC2+ NC2- P0 P1 P2 P3 P4………….Pn
Where NC1+, NC2+,and NC1-, NC2- are the positive and negative nodes, respectively, of the controlling sources.

For a Polynomial of degree n=3 with A , B & C as the controlling sources, the source function takes the form of
Y=P0+P1A+P2B+P3C+P4A2+P5AB+ P6AC+ P7B2+ P8BC+ P9C2+P10A3+P11A2B+P12A2C+P13AB2+P14ABC+P15AC2+
P16B3+P17B2C+P18BC2+P19C3+P20A4+……………………
This is described in PSpice as
POLY (3)NC1+ NC1- NC2+ NC2-,NC3+ NC3- P0 P1 P2 P3 P4 P5……….Pn
Where NC1+, NC2+, NC3+ and NC1-,NC2-,NC3- are the positive and negative nodes, respectively, of the controlling sources.
Typical Model Statements, for Y=2V(10),The model is POLY 10 0 2.0
For Y=V(5)+2[V(5)]2+3[V(5)]3 +4[V(5)]4,
the model is POLY 5 0 0.0 1.0 2.0 3.0 4.0
For Y=0.5+V(3)+2V(5)+3[V(5)]3 +4[V(3) V(5),the model is
POLY(2) 3 0 5 0 0.5 1.0 2.0 3.0 4.0

Independent voltage and current sources - pspice

The symbol of an independent voltage source is V, and the general form for assigning dc and transient value is
V (Name) N+ N- [DC (value)]
+ [(transient value)]
+ [PULSE] [SIN] [EXP] [PWL] [SFFM] [source arguments]
[Note:-The first column with +(plus) signifies continuation of the P Spice statement .After the + sign, the statement can continue in any column.]
N+ is the positive node, and N- is the negative node as shown in the above fig(a),. Positive current flows from node N+ through the voltage source to the negative node N- .
The voltage source need not be grounded. For the dc and transient values, the default value is zero. None or all of the dc and transient values may be specified.
A source can be assigned either a dc value or a transient value. The source is set to the dc value in dc analysis. The time dependent source (e,g,.PULSE,EXP, or SIN) is specified for transient analysis. A voltage source may be used as an Ammeter in P Spice by inserting a zero-valued voltage source in to the circuit for the purpose of measuring current.
Typical Statements
V1 15 0 6V
V2 15 0 DC 6V
VPULSE 10 0 PULSE (0 1 2NS 2NS 2NS 50NS 100NS)
VIN 12 3 DC 15V SIN (0 2V 10KHZ)


INDEPENDENT CURRENT SOURCE
The symbol of an independent current source is I, and the general form for assigning dc and transient value is
I(Name) N+ N- [DC (value)]
+ [(transient value)]
+ [PULSE] [SIN] [EXP] [PWL] [SFFM] [source arguments]
N+ is the positive node, and N- is the negative node as shown in the above fig(b),. Positive current flows from node N+ through the current source to the negative node N- .
The current source need not be grounded. The source specifications are similar to those for independent voltage sources.
Typical Statements
I1 15 0 2MA
I2 15 0 DC 2MA
IPULSE 10 0 PULSE (0 1V 2NS 2NS 2NS 50NS 100NS)
IIN 22 22 DC 2 SIN(0 2V 10KHZ)

SINGLE- FREQUENCY FREQUENCY MODULATION - pspice

The symbol of a source with single –frequency frequency modulation is SFFM, and the general form is :

SFFM (V0 VA FC MOD FS)

The Model Parameters Of an Single- Frequency Frequency Modulation
Name Meaning Units Default
VO Offset Voltage Volts None
VA Amplitude of Voltage Volts None
FC Carrier Frequency Hertz 1/ TSTOP
MOD Modulation Index 0
FS Single Frequency Hertz 1/ TSTOP

VO and VA must be specified by the user and can be either voltage or currents.
TSTOP is the stop time during transient (.TRAN) analysis. The wave form is of the form by
V = VO + VA sin[(2πfct)+M sin(2πfSt)]

Typical statements.
VO =0,
VA=1V,
fc=30MHz,
MOD=5,
fS=5KHz,the model statement is,

SFFM ( 0 1V 30MHZ 5 5KHZ )

With VO =1Mv and VA=2V, the model becomes

SFFM ( 1MV 2V 30MHZ 5 5KHZ

PIECEWISE LINEAR SOURCE - pspice




The symbol of Piecewise linear source is PWL. And the general form is
PWL (T1 V1 T2 V2 T3 V3 …..TN VN)

A point in a wave form can be described by (Ti, Vi) or (Ti, Ii), and every pair of values (Ti, Vi) or (Ti, Ii), specifies the source value at Time Ti, The voltage at times between the intermediate points is determined by P Spice by using linear interpolation.

MODEL PARAMETERS OF PWL SOURCES
Name Meaning Units Default
Ti Time at a Point Seconds None
Vi Voltage at a Point Volts None
Typical Statements for the above wave form
T0 = 0
V0 = 0
T1 = 5
V1 = 3
T2 = 10us
V2 = 3V
T3 = 15us
V3 = 6V
T4 = 40us
V4 = 6V
T5 = 45us
V5 = 2V
T6 = 60us
V6 = 2V
T7 = 65us
V7 = 0
PWL (0 0 5 3 10US 3V 15US 6V 40US 6V 45US 2V 60US 2V 65US 0)

small signal Transfer Function - pspice


.TF (Small Signal Transfer Function)

the small signal Transfer function capability of P Spice can be used to compute the small signal DC gain , the input resistance and the output resistance of a circuit.
If V(1) and V(4) are the input and output variables respectively, P Spice calculate the small signal dc gain between nodes 1 and 4,defibned by
AV = ∆ V out / ∆ V in = V(4) / V(1)
Pspice calculates the small signal dc transfer function by linearizing the circuit around the OP. The statement for transfer function has one of the following forms

.TF VOUT VIN
.TF IOUT IIN
The .TF command calculates the parameters of an equivalent circuit for the circuit file, it automatically prints the out put and does not require .PRINT, .PLOT, .PROBE statements

.DC (DC Sweep)
The dc sweep is also known as the dc transfer characteristic. The input variable is varied over a range of values. For each value of the input variable, the dc operating point and the small signal dc gain are computed.
The simple statement for dc sweep
.DC LIN SWNAME SSTART SEND SINC
.DC OCT SWNAME SSTART SEND NP
.DC DEC SWNAME SSTART SEND NP
.DC SWNAME LIST (Value)
SWNAME is the sweep variable (voltage or current).
SSTART → sweep start value
SEND → sweep end value
SINC → sweep incremental value (it must be positive, not –ve or zero)
NP→ number of steps
LIN→ linear sweep
OCT→ sweep by octave
DEC→ sweep by decade
LIST→ list of values

simple dc circuit simulation using pspice

The following circuit is to be simulated on P Spice to calculate and print all node voltages and currents, and the power dissipation of all voltage sources (Vs, Vx, and Vy).
The circuit file stored as DC circuit.cir, and the Outputs stored in the file as DC circuit.out

The circuit file contains the following statements:
•VS 1 0 DC 20V : DC Voltage source of 20V
IS 0 4 DC 50MA : DC Current source of 50mA
••R1 1 2 500 : Resistance of 500Ohms
R2 2 5 800 : Resistance of 800Ohms
R3 2 3 1KOHM : Resistance of 1000Ohms
R4 4 0 200 : Resistance of 200Ohms
VX 3 0 DC 0V : Measures the current through R3
VY 5 4 DC 0V : Measures the current through R2
•••.OP : Directs the Bias Point to output file
.END : End of circuit file

The results that appear in the out put file are shown below
****SMALL SIGNAL BIAS SOLUTION TEMPERATURE=27.000 DEG C
NODE VOLTAGE
1 20.000
2 12.500
3 0.000
4 10.500
5 10.500
VOLTAGE SOURCE CURRENT
NAME CURRENT
VS -1.500E-02 IR1=15mA
VX 1.250E-02 IR3=12.5mA
VY 2.500E-02 IR2=2.5mA

TOTAL POWER DISSIPATION 3.00E-01 WATTS.

Modeling of Transient sources in pspice

MODELING OF TRANSIENT SOURCES
P Spice allows the generation of dependent (or independent) voltage and current sources. Independent sources can be time variant .A nonlinear source can also be simulated by a polynomial.
The independent voltage and current sources that can be modeled by P Spice as follows:
1. Exponential
2. Pulse
3. Piecewise linear
4. Sinusoidal
5. Single- frequency frequency modulation

1. EXPONENTIAL SOURCE:
The symbol of exponential source is EXP. and the general form is
EXP (V1 V2 TRD TRC TFD TFC)
The waveform of an exponential waveform:










V1 and V2 must be specified by the user and can be either voltage or currents (TSTEP is the incrementing time during transient [.TRAN] analysis. In an exponential wave form, the voltage remains V1 for the first TRD seconds .Then the voltage raises exponentially from V1 to V2 with a fall time constant of TFC.
MODEL PARAMETERS OF EXPONENTIAL SOURCES
Name Meaning Units Default
V1 Initial Voltage Volts None
V2 Pulsed Voltage Volts None
TRD Rise Delay Time Seconds 0
TRC Rise Time Constant Seconds TSTEP
TFD Fall Delay Time Seconds TRD+TSTEP
TFC Fall Time Constant Seconds TSTEP
Typical Model Statements
V1=0,V2=1V
TRD=2ns , TRC=20ns
TFD=60ns , TFC=30ns
EXP ( 0 1 2NS 20NS 60NS 30NS)

The other sources will be discussed in future posts

Inductor parameters - PSPICE

INDUCTOR
The symbol for a Inductor is L .The name of a Inductor must start with L, and it takes the following general form
L(name)N+ N- LNAME LVALUE IC=Vo
N+ is the positive node and N- is the negative node. The voltage of node N+ is assumed positive with respect to node N-, and the current flows from node N+ through the Inductor to node N-. LNAME is the model name, and LVALUE is the nominal value of the Inductor, IC defines the initial (time zero) current of the Inductor, Io.
If LNAME is omitted, LVALUE is the Inductance in Henrys, and the LVALUE can be positive or negative but must not be zero.

MODEL PARAMETERS FOR INDUCTORS
Name Meaning Units Default
L Inductance multiplier 1
IL1 Linear Current Co efficient Amps -1 0
IL2 Quadratic Current Co efficient Amps -2 0
TC1 Linear Temperature Co efficient °C -1 0
TC2 Quadratic Temperature Co efficient °C -2 0

IND=LVALUE * L * (1+IL1*I+IL2*I2
* [1+TC1 * (T – To) + TC2 * (T – To) 2 ]
where T is the operating temperature in degrees Celsius ,and To is the room temperature in
degrees Celsius.
Note:- L is an inductance multiplier, rather than the value of the inductance .It scales the actual inductance value .LVALUE ,thus ,L=1.1 means that LVALUE is multiplied by 1.1,not that LVALUE is 1.1H
Some Inductor statements

L1 6 5 10MH
LLOAD 12 11 5UH IC=0.2MA
LLINE 15 14 ACAP 5MH
LCHOKE 20 19 ACAP 20NF IC=0.5MA
.MODEL LMOD IND (L=1 IL1=0.1 IL2=0.002 TC1=0.02 TC2=0.005)

CAPACITOR parameters - pspice

CAPACITOR

The symbol for a capacitor is C .The name of a capacitor must start with C, and it takes the following general form
C(name)N+ N- CNAME CVALUE IC=Vo
N+ is the positive node and N- is the negative node. The voltage of node N+ is assumed positive with respect to node N-, and the current flows from node N+ through the capacitor to node N-. CNAME is the model name, and CVALUE is the nominal value of the capacitor, IC defines the initial (time zero) voltage of the capacitor, Vo.
If CNAME is omitted ,CVALUE is the capacitance in farads ,and the CVALUE can be positive or negative but must not be zero .

MODEL PARAMETERS FOR CAPACITORS
Name Meaning Units Default
C Capacitance multiplier 1
VC1 Linear Voltage Co efficient Volt -1 0
VC2 Quadratic Voltage Co efficient Volt -2 0
TC1 Linear Temperature Co efficient °C -1 0
TC2 Quadratic Temperature Co efficient °C -2 0


C is a capacitance multiplier, rather than the value of the capacitance .It scales the actual capacitance value .CVALUE ,thus ,C=1.1 means that CVALUE is multiplied by 1.1,not that CVALUE is 1.1F
Some Capacitance statements
C1 6 5 10UF
CLOAD 12 11 5PF IC=2.5V
CINPUT 15 14 ACAP 10PF
C2 20 19 ACAP 20NF IC=1.5V
.MODEL ACAP CAP (C=1 VC1=0.01 VC2=0.002 TC1=0.02 TC2=0.005)

variables and their meanings in PSPICE

Voltage Output
For DC Sweep and Transient Analysis, the output voltages can be obtained by the following statements:

VARIABLES MEANING
V(5) Voltage at Node 5 with respect to Ground
V(4,2) Voltage of Node 4 with respect to Node2
V(R1) Voltage of Resistor R1,where the first Node(as defined in the circuit file) is positive with respect to the second Node.
V(L1) Voltage of Inductor L1,where the first Node(as defined in the circuit file) is positive with respect to the second Node.
V(C1) Voltage of Capacitor C1,where the first Node(as defined in the circuit file) is positive with respect to the second Node.
V(D1) Voltage across Diode D1,where the first Node is positive with respect to the cathode.

Current Output
For DC Sweep and Transient Analysis, the output currents can be obtained by the following statements:

VARIABLES MEANING
I(VS) Current Flowing into DC Source Vs.
I(R5) Current Flowing into Resistor R5,where the Current is assumed to flow from the first Node(as defined in the Circuit file )through R5 to the second Node.
I(D1) Current into diode D1.
IA(T1) Current at Port A of Flowing in to DC Source Vs.

symbols for two terminal elements - pspice

SYMBOLS FOR TWO TERMINAL ELEMENTS
C Capacitor
D Diode
E Voltage Controlled Voltage Source
F Current Controlled Current Source
G Voltage Controlled Current Source
H Current Controlled Voltage Source
I Independent Current Source
L Inductor
R Resistor
V Independent Voltage Source