Académique Documents
Professionnel Documents
Culture Documents
circuits. A circuit is described to a computer by using a file called the circuit file, which is normally typed in from a keyboard. The circuit file contains the circuit details of components and elements, the information about the sources, and the command for what to calculate and what to provide as output. The circuit file is the input file to the PSPICE program, which, after executing the commands, produces results in another file called the output file.
Title Circuit description Analysis description Output description END (end of file statement)
Note:
1) The first line is the title line, and it may contain any type of text. 2) The last line must be the End command. 3) Continuation of line is identified by a plus sign (+) in the first column of the next line. 4) A comment line may be included anywhere, preceded by on asterisk (*).
2. Format of output files: The results of simulation by PSPICE are stored in on output file. The output file may be divided into following types: i) A description of the circuit itself that includes the net list, the device list, the model parameter list, and so on.
ii)
.TRAN analysis.
iv)
Run statements. These include the various kinds of summary information about the whole run, including times required by various kinds of analysis and the amount of memory used.
v)
In electrical circuits, subscriptions are normally assigned to symbols for voltages, currents and circuit elements. However, in PSPICE, the symbols are represented without subscripts. For example, VS, IS, and RI are represented by VS, IS and RI, respectively.
3. Element values: There are two types of suffixes: The scale suffix and units suffix. Scale Suffix:
Value 1E-15 1E-12 1E-9 1E-6 25.4E-6 1E-3 1E3 1E9 1E9 1E12
Unit Suffix V A HZ
OHM H F DEG
Note: The first suffix is always the scale suffix, and the unit suffix
follows the scale suffix.
3. Nodes: -
The location of an element is identified by the node numbers. Each element is connected between two nodes. Node numbers must be integers from 0 to 9999 for Spice 2, but need not be sequential. PSPICE allows any alphanumeric string up to 131 characters long. The node names shown in table are reserved and cannot be used. Reserved node names 0 $ D-HI $ D-LO $ D-X Value 0volts 1 0 X Description Analog Ground Digital High level Digital low level Digital unknown level
4. Circuit Elements:Circuit Elements are identified by names. A name must start with a letter symbol corresponding to the element, but after that it can contain either letters or numbers. Names can be up to 8 characters long for SPICE 2, and up to 131 characters long for PSPICE. However, names longer than 8 characters are not normally necessary and not recommended.
Table: A: Symbols of circuit elements and sources. First Letter B C D E F G H I J K L M Q R S T V W Circuit elements and Sources Ga As MES field effect transistor Capacitor Diode Voltage controlled voltage source Current controlled current source Voltage controlled voltage source Current controlled voltage source Independent source. Junction field transformer Mutual Inductors (transformer) Inductor Mos. Field effect transistor. Bipolar junction transistor. Resistor Voltage controlled switch Transmission line Independent voltage source Current controlled switch.
Passive Elements: -
Resistor:-
The symbol for a resistor is R. The name of resistor must start with R. The General form of Resistor is:
Example: a) R5 b) RL 1 5 2 2 5 1K
5.1.2(a) Inductor:-
The symbol for an inductor is L The name of inductor must start with L.
N+ 1 5 3 6
N-
L VALUE
IC = IO
a) LI b) L LOAD
The symbol for capacitor is c. The name of capacitor must start with c.
Example: -
a) C2 b) C LOAD
1 5
0 2
9UF 10F
5.2 Sources:The General format for source is < Source name > < positive node > < negative node > < source model >
5.2(i) DC Circuit Analysis: 5.2.1: Independent DC Sources:The Independent DC sources can be time invariant or time variant. They can be currents or voltages. 5.2.1.1.(a). Independent DC Voltage Source:-
Voltage source
Current source
The symbol for an independent voltage source is V The General form is: V < name > Example: V5 VS 5 1 1 2 DC 5V 5V N+ N[DC < value >]
5.2.1.1(b) Independent DC Current Source:The symbol of an independent current sources in I. The General form is: I < name > Example:I3 I4 1 1 0 5 DC 1A 1A ; N+ N[DC(value)]
The general form polynomial source is: POLY (n) < (controlling nodes)> <(coefficients) Values >
Polynomial source:
Let call A, B, and C be the three controlling variables, and y be the output source. The polynomial source output takes the form of Y = F( A, B, C, .). For a polynomial of n=1 with A as the only controlling variable, The source function takes the form of Y = Po + P1A + P2A2 + P3A3 + P4A4 + .+ Pn An. Where Po, P1, P2,. Pn are the coefficient values. This is written in Pspice as POLY NCI+ NCIPo P1 P2 P3 .Pn.
Where NCI+ and NCI- are the positive and negative nodes respectively of controlling source A. For a polynomial of degree n=2 with A and B controlling. Sources the source function takes the form of Y = Po + P1A + P2B + P3A2 + P4AB + P5B2 + P6A3 + P7 A2B + P8AB2 + P9B3 + P10A4 + .. This is described in Pspice as POLY(2) NC+ NCNC2+ NC2 Po P1 P2.Pn.
Example:(a). For Y = 2 V(10), The model is POLY 10 0 2.0 (b).For Y= V(5) + 2[V(5)]2 + 3[V(5)]3 + 4[V(5)]4 The model is POLY 5 0 0.0 2.0 3.0 4.0. (c). For Y = 0.5 + V (3) + 2 V (5) + 3[V (3)]2 + 4 V(3)V(5). The model is
POLY (2) 3
0.5
1.0
2.0
3.0
4.0,
The symbol of a voltage controlled voltage source is E. The General form is: E< name > N+ N NC+ NC<(voltage gain) value>
The non-linear form is: E< name > + + N+ N [POLY (< value >)
< <(+ Controlling) node> (-controlling) node > > (pairs) [< (Polynomial coefficients) values >]
Example:a) EAB 1 2 4 6 1.0 3 0 5 0 0.0 1.0 1.5 1.2 b) E NON LIN 25 40 POLY (2)
5.2.1.2 (c): Voltage Controlled Current Source:The symbol of a voltage controlled current source is G. The General form is: G< name > N+ NNC+ NC- <(trans conductance) value >.
The non-linear form is: G < name > N+ N[poly < (value) >
+ < < (+ Controlling) node> < ( - controlling ) node > > (pairs) + < (Polynomial coefficients) values >].
Example: a) GAB 2 4 6 1.0 1.7 b) G NON LIN 25 40 POLY(2) 3 0 5 0 0.0 1.0 1.5 1.2
5.2.1.2 (d): Current controlled Current Source: The symbol of the current controlled current source is F. The General form is: F< name > N+ NVN< (Current gain) value >.
The non-linear form is: F< name > N+ + N[POLY (< value > > VNI, VN2, VN3, ..
Example:a) FAB 1 2 25 40 VIN 10 0.0 1.0 1.5 1.2 1.7 b) F NON LIN POLY VN
5.2.1.2 (e): Current controlled Voltage Source:The symbol of a current controlled source is H. The General form is: H< name > N+ NVN < (Trans resistance) value>
The non linear form is: H< name > N+ N[POLY (< value >)
Example:a) HAB 1 2 VIN 10 b) H NON LIN 25 40 POLY VN 0.0 1.0 1.5 1.2 1.7. V = I [VN] + 1.5 [I (VN)]2 + 1.2 [I(VN)]3 + 1.7 [I(VN)]4
V2 V1 0 TD TR PW PER TF t
The waveform and parameters of a pulse waveform are shown in figure and table. The symbol of pulse source is pulse. The General form is: PULSE (V1 V2 TD TR TF PW PER)
Name Meaning V1 V2 TD TR TF PW PER Initial voltage Pushed voltage Delay time Rise time Fall time Pulse Period
Example:
PULSE (-1 1 2NS 2NS 2NS 50NS 100NS)
5.2.2.1 (b) : Piece wise Linear Source: The General form is: PWL ( T1 V1 T2 V2 T3 V3..TN VN)
Name Ti Vi
Units
Default
Example: V
10V
10ms
The model statement for above ware form is: PWL (0 0 10MS 10V 20MS 0)
5.2.2.1 (C): Sinusoidal Source:The symbol of sinusoidal source is SIN, The General form is: SIN (VO VA FREQ TD ALP THETA)
Meaning Offset Voltage Peak voltage Frequency Delay time Damping factor Phase delay
Voltage source
Current source
The general form for assigning DC and transient values is: V< name > N+ N[DC < value >]
5.2.2.2 (b): Independent current source: The symbol of independent current source is I. The General form for assigning DC and transient values is: I< name > + N+ N[DC < value >]
5.2.3: AC Analysis: Independent AC sources: The statements for a voltage and current source have the following general forms: V< name > I< name > N+ N+ NN[AC < (magnitude) value > (phase) value >] [AC < (magnitude) value > <phase) value >]
The < (magnitude) value > is the peak value of sinusoidal voltage. The < (phase) value > is in degrees.
6. OUTPUT VARIABLES: -
is normally added
and used as an ammeter to measure the current of that source eq. I(Vx) 6.1. DC Circuit analysis: D.C output variables; 6.1.1: Voltage output: -
For DC sweep and transient analysis, the output voltages can be obtained by the following statements.
V (< name >): Voltage at node N1 with respect to node N2 V (< name >): Voltage across two Terminal device, < name >
Vx (< name >): Voltage at terminal x of three- terminal device, < name > Vxy(< name >): Voltage across terminals x and y of three terminal device, < name >
Vz (< name >): Voltage at point Z of transmission line, < name >
6.1.2: Current output:For DC sweep and transient analysis, the output currents can be obtained by the following statements: I( < name > ) current through < name > Ix( < name > ) current into terminal x of < name > Iz (< name >) current at port x of transmission line, < name >
The output variables of transient analysis are similar those of D.C. circuit analysis.
SUFFIX (None) M DB P G R I
MEANING Peak Magnitude Peak Magnitude Peak Magnitude in decibel Phase in radians Group delay (S phase / S flow) Real Part Imaginary Part
6.3.1: Voltage output: The statements for AC analysis are similar to those for the DC sweep and the transient analysis. Provided the suffixes are added as follows: Variables VM(5) VM VP (D1) Meaning Magnitude of voltage at node 5 w. r.t. Ground. Magnitude of voltage at node 4 w. r.t node 2. Phase of anode voltage of diode (D1) w. r.t. Cathode
VR (2,3) Real part of voltage at node 2 w.r.t. Node 3 VI (2,3) Imaginary part of voltage at node 2 w.r.t. node 3.
Meaning Magnitude of current through resistor R5 Real part of current through resistor R5 Imaginary part of current through resistor R5. Magnitude of current through source in.
7. PSPICE output commands: The most common forms of output are print tables and plots, and they require output commands. However, with .OP command, PSPICE automatically direct all node voltages and the current and power dissipation of all voltage sources to the output file, and therefore does not require any output command.
7.1: DC Circuit analysis: 7.1.1: Types of output: The commands that are available to get output from the result of simulations are: 1) . PRINT 2) . PLOT 3) . PROBE Print Plot Probe output.
The plot statement for the DC outputs takes the following form: . PLOT DC < output variables >
+ [< (Lower limit) Value > < (Upper limit) value >]
The command makes one of these forms: . PROBE . PROBE < one or more output variables >.
7.2: Transient analysis:Transient output commands: The .PRINT, .PLOT and .PROBE statements for transient output are:
8. Types of Analysis: D.C. circuit analysis, Transient analysis and A.C. analysis.
8.1.: DC Circuit Analysis: The commands that are commonly used for DC analysis are: 1) 2) 3)
.OP DC operating point .TF small signal transfer function .DC DC sweep.
The statement for performing the DC sweep is: .DC LIN SWNAME SSTART SEND SINC
+ [(nested sweep specification)]. Another form of DC sweep is: .DC SWNAME LIST < value > + [(nested sweep specification)] 8.2: Transient Analysis: A Transient response determines the output in the time domain in response to an input signal in time domain. The determination of the transient analysis required statements involving. 1) 2) .IC .TRAN Initial transient conditions. Transient analysis.
8.2.1: .IC(Initial Transient Conditions): The various nodes can be assigned to initial voltages during transient analysis, and the general form for assigning initial value is
.TRAN [/op]
TSTEP
TSTOP 0.1NS
8.3: AC ANALYSIS: The command for performing frequency response takes one of the following general forms. . AC LIN NP F START F STOP.
9: Modeling of circuit elements : The general from of model statement is . MODEL MNAME TYPE (P1 =A1 Type Name RES CAP D IND NPN PNP V SWITCH I SWITCH P2 A2..PN =AN) Element Resistor Capacitor Diode Inductor NPN bipolar junction Transistor PNP bipolar junction Transistor Voltage Controlled Switch Current controlled switch
10. Advanced Spice Commands: 10.1: SUBCKT (Subcircuit): Pspice allows one to define a small circuit as a sub circuit, which then can be called upon in several places in the main circuit.
The General form for sub circuit definition is: .SUBCIRCUIT SUBNAME [< (two or more) nodes >]
The symbol for a sub circuit call is X. The general form of a call statement is: X <Name> [< (two or more) nodes >] SUBNAME
10.2: .ENDS (End of sub circuit): A sub circuit must end with .ENDS statement. The end of a sub circuit definition has the general form
.ENDS
10.3: .Options: -
SUBNAME.
Pspice allows various options to control and to limit parameters for the various analyses. The general form is
.OPTIONS [< (options) name >] [< (options) name > = < value >]
10.4: .PARAM ( Parameter): The parameter definition is one of the following form:
.STEP . STEP
SSTART
SEND SINC
SEND
SINC
.DC
SWNAME LIST<value>
11 .SWITCHES: -
a) Switch
b) On state
c) Off State
The symbol for voltage controlled switch is S. The name of this switch must start S, and it takes the general form of S< name > N+ Name NNC+ NC- S NAME Units Default Volts Volts 0hms 0hms 1.0 0 1.0 106
Meaning Control Voltage for On VON Start Control Voltage for off VOFF start On Resistance RON Off Resistance ROFF
11.2: Current Controlled Switch: The symbol for current controlled switch is W. The name of the switch must start with W. and the general form is W< Name > N+ NVN W NAME.
Units Amps
Control current for off state Amps On resistance Off resistance Ohms Ohms
12. DIODES: The symbol for a diode is D. The name of a Diode must start with D, and it takes the general form D< name > NA NK DNAME .MODEL DNAME D [(area) Value ]
13.Transister: The symbol for BJT is Q. The name of BJT must start with Q, and it takes the general form: Q< name > NC NB NE NS QNAME
1. The thyristor switch to the ON state with the application of a small positive gate voltage, provided that the anode-to-cathode voltage is positive. 2. It should remain in the ON state as long as the anode current flows. 3. It should switch to the off state when the anode current goes through zero toward the negative direction.
The switching action of the thyristor can be modeled by a voltage controlled switch and a polynomial source and is shown in fig (2).
1. For a positive gate voltage Vg between nodes 3 and 2, the gate current is Ig = I(VX) =
Vg RG
2. The gate current Ig activates the current controlled current source F1 and produces a current of value Fg = P1 Ig = P1 . I (VX) such that F1 = Fg + Fa. 3. The current source Fg produces a rapidly rising voltage VR across resistance RT. 4. As the voltage VR increases above zero. The resistance RS of the voltage controlled switch S1 decreases from ROFF toward RON. 5. As the resistance RS of switch S1 decreases, the anode current Ia = I(VY) increases, provided that the anode to cathode voltage is positive. This increasing anode current Ia produces a current Fa = P2 Ia = P2 . I(VY). This results in an increased value of voltage VR. 6. This produces a regenerative condition with the switch rapidly being driven into low resistance (ON State). The switch remains on if the gate voltage Vg is removed. 7. The anode current Ia continues to glow as long as it is positive and the switch remains in the on state. During te turn off, the gate current is off and Ig = 0. That is, Fg = 0, F1 = Fg + Fa = Fa.
1. As the anode current Ia goes negative, the current F1 reverses provided that the gate voltage Vg is no longer present. 2. With a negative F1, the capacitor discharges through current source F1 and the resistance RT. 3. With the fall of voltage VR to a low level, the resistance RS of switch S1 increases from low (RON) to high (ROFF). 4. This is again a regenerative condition with the switch resistance being driven rapidly to ROFF value as the voltage VR becomes zero.
This model works well with a converter circuit in which the thyristor current falls of the current. But for a full wave AC DC converter with a continuous load current, the current of a thyristor is diverted to another thyristor and this model may not give the true output. This problem can be remedied by adding diode DT as shown in fig (2). The diode prevents any reverse current flow through the thyristor resulting form the firing of another thyristor in the circuit.
This thyristor model can be used a sub circuit. switch S1 is controlled by the controlling between nodes 6 and 2. the switch and / or anode parameters can be adjusted to yield the desired on state drop of the thyrisor we shall use diode parameters IS = 2.2 E 15, BV = 1800V, TT = 0, and switch parameters RON = 0.125, ROFF = 10E + 5, VON = 0.5V, VOFF = 0V.
The sub circuit definition for the thyristor model SCR can be described as follows:
SUBCKT Subcircuit for SCR AC 1 thyristor 2 model. 3 2 - Ve control voltage
Model Anode Cathode + Control Name voltage SUBNAME [ < (two or more) nodes > ]
S1
S < name>
RG VX VY DT 3 4 5 7
N + N - NC +
4 2 7 2 50 DC 0V DC 0V DMOD
NC- SNAME
; Switch diode
D <name>
RT CT F1 6 6 2
NA NK DNAME
2 2 6 1 10UF POLY (2) VX VY 0 50 11
BV = 1800V
TT = 0)
SUBNAME