EXPERIMENTS ON PSPICE SIMULATI
ON
EXPERIMENT # O
TITLE
Familiarization and Circuit Analysis with PSPICE Software
OBJECTIVE
To know what it is. 2) How to invoke and quit the system. and 3) Basics of
programming with PSPICE Commands
FAMILARISATION
Introduction
SPICE it is very popular software for analysis of electrical & electronics circuit.
The acronym SPICE stands for Simulation Program with Integrated Circuit
Emphasis.
In 1948 Microsim Corporation introduced the PSpice simulator that can run on
personal computer. The student version of PSpice is, however, ideal for class
room use & assignment requiring computer-aided simulation & analysis.
PSpice is a member of the SPICE family, equally useful for simulating all
types of circuit in a wide range of applications. A circuit is described by
statements that are stored in a “Circuit File”. The circuit file is read by the
SPICE simulator.
The circuit file is the input file to the SPICE (PSpice) program, which after
executing the commands, produces the results in another file called the
“Output File”.
PSpice Platform
The PSpice platform used depends on the SPICE version. The three
platforms for Spice are as follows:
PSpice A/D or OrCAD PSpice A/D (version 9.1 or above)
PSpice Schematics (version 9.1 or below)
OrCAD Capture Lite (version 9.2 or above)
Working in PSpice A/D
The circuit that is described by statements & analysis commands is simulated
by the run command from the platform. The output results can be displayed &
viewed from platform menus.
Start
Programs
pspice
PSpice A/D
“Platform for PSpice A/D (version 9.1)”
A circuit must be specified in terms of elements names, element values,
nodes, variable parameters, and sources. The description & analysis of a
circuit require specifying the following:
Element values
Nodes
Circuit elements
Sources
Types of analysis
Output variables
PSpice output commands
Format of circuit files
Format of output files
Element Values
The element values are written in standard floating-point notation with optional
scale & units suffixes. There are two types of suffixes: the scale suffix & units
suffix.
The scale suffixes recognized by PSpice are
Page 2 of 13
F = 1E – 15
P = 1E – 12
N = 1E – 9
U = 1E – 6
MIL = 25.4E – 6
M = 1E – 3
K = 1E3
MEG = 1E6
G = 1E9
T = 1E12
The unit suffixes used normally are
V = volt
A = amp
HZ = hertz
OHM = ohm ()
H = henry
F = farad
DEG = degree
The scale suffix is always the first suffix, and the unit suffix follows the scale
suffix. In the absence of a scale suffix, the first suffix may be a units suffix,
provided it is not the symbol of a scale suffix.
Nodes
The location of an element is identified by the node numbers. Each element is
connected between two nodes. Node 0 is predefined as the ground. All nodes
must be connected to at least two elements 7 should, therefore, appear at
least twice. The node names shown in table are reserved and cannot be
used.
Table:-1 “Reserved Node Names”
Reserved Node Names Value Description
0 0 volts Analog ground
$D_HI 1 Digital high level
$D_LO 0 Digital low level
$D_X X Digital unknown level
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.
The format for describing passive elements is
<element name> <positive node> <negative node> <value>
Where positive current is assumed to flow into positive node N+ and out of
negative node N-. If the nodes are interchanged, the direction of the current
through the element will be reversed.
Table:-2 “Symbols of Circuit Elements & Sources
First Letter Circuit Elements & Sources
B GaAs MES field-effect transistor
Page 3 of 13
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
J Junction field-effect transistor
K Mutual inductors (transformer)
L Inductor
M MOS field-effect transistor
Q Bipolar junction transistor
R Resistor
S Voltage-controlled switch
T Transmission line
V Independent voltage source
W Current-controlled switch
Sources
Voltage (or current) sources can be dependent or independent. The letter
symbols for the names of sources are also listed in Table:-2. the format for
sources is
<source name> <positive node> <negative node> <source model>
Where the voltage of node N+ is specified with respect to node N-. The
positive current is assumed to flow of the source (from positive) node N+
through the circuit to negative node N-. If the nodes are interchanged, the
polarity of the source will be reversed. The order of nodes N+ and N- is
important.
An independent voltage (or current) source can be dc, sinusoidal, pulse,
exponential, polynomial, piecewise linear, or single-frequency frequency
modulation.
Types of Analysis
PSpice allows various types of analyses. Each analysis invoked by including
its command statement. For example, a statement beginning with the .DC
command invokes the DC sweep. The types of analyses & their
corresponding. (dot) commands are described below:
Dc Analysis is used for circuit with time-invariant sources. It calculates all
node voltages & branch currents over a range of values, and qytescent (dc)
values are the outputs:
● Dc sweep of an input voltage/current source, a model parameter,
or temperature over a range of values (.DC)
● Determination of the linearized model parameters of nonlinear
devices (.OP)
● Dc operating point to obtain all node voltage (.OP)
● Small-signal transfer function with small-signal gain, input
resistance, and output resistance (Thevenin’s equivalent) (.TF)
● Dc small-signal sensitivities (.SENS)
Page 4 of 13
Transient Analysis is used for circuit with time-variant sources. It calculates all
node voltages & branch currents over a time interval, and their instantaneous
values are the outputs:
● Circuit behavior in response to time-varying sources (.TRAN)
● Dc and Fourier components of the transient analysis results
(.FOUR)
Ac Analysis is used for small-signal analysis of circuit with sources of variable
frequencies. It calculates all node voltages & branch currents over a range of
frequencies, and their magnitudes & phase angles are the outputs:
● Circuit response over a range of source frequencies (.AC)
● Noise generation at an output node for every frequency (.NOISE)
Output Variables
PSpice has some unique features for printing or plotting output voltages or
currents. The output variables can be divided into two types: voltage output
and current output.
A dc dummy voltage source of 0 V (say, Vz = 0 V) is normally added & used
as an ammeter to measure the current of that source, for example, I (Vz).
VX N+ N- DC 0V
Voltage output
For dc sweep & transient analysis, the output voltage can be obtained by the
following statements:
V(<node>) Voltage at <node> with respect to ground
V(<N1,N2>) 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 port z of transmission line, <name>
Current output
For dc sweep & 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 z of transmission line <name>
AC output variables
In ac analysis, the output variables are sinusoidal quantities and are
represented by complex numbers. An output variable can have magnitude in
decibels, phase, group delay, real part, and imaginary part. Augmented by
adding a suffix as follows:
Suffix Meaning
(none) Peak magnitude
M Peak magnitude
DB Peak magnitude in decibels
P Phase in radians
G Group delay (PHASE/FREQUENCY)
R Real part
I Imaginary part
Page 5 of 13
Voltage output & current output
The statements for ac analysis are similar to those for the dc sweep & the
transient analysis.
PROGRAMMING
Format of Circuit Files
A circuit file that can be read by SPICE/PSpice may be divided into five parts:
(1) the title, which describes the type of circuit or any comments; (2) the circuit
description, which defines the circuit elements & the set of model parameters;
(3) the analysis description, which defines the type of analysis; (4) the output
description, which defines the way the output is to be presented; and (5) the
end of the program (the .END command). The format for a circuit file is as
follows:
Title
Circuit description
Analysis description
Output description
.END (end-of-file statement)
Format of Output Files
The result of simulation by SPICE/PSpice is stored in an output file. It is
possible to control the type & amount of output by various commands. If there
is any error in the circuit file, SPICE/PSpice will display a message on the
screen indicating that there is an error & will suggest looking at the output file
for details. The output falls into four types:
1. A description of the circuit itself that includes the net list, the device list, the
model parameter list, and so on.
2. Direct output forms some of the analysis with the .PLOT and .PRINT
commands.
3. Prints & plots by .PLOT and .PRINT commands.
4. Run statistics.
Some Useful Format
Resistors
R<name> N+ N- <value>
Inductor
I<name> N+ N- <value>
Capacitor
C<name> N+ N- <value>
Independent DC voltage sources
V<name> N+ N- DC <value>
Independent DC current sources
I<name> N+ N- DC <value>
Piecewise linear source
V<name> N+ N- PWL (T1 V1 T2 V2 . . . TN VN)
T1 = Time at a point in second
V1 = Voltage at a point in volt
Sinusoidal source
V<name> N+ N- SIN (VO VA FREQ TD ALP THETA)
Where,
VO = Offset voltage in volt
Page 6 of 13
VA = Peak voltage in volt
FREQ = Frequency in Hz
TD = Delay time in second
ALPHA = Damping factor
THETA = Phase delay in degree
AC source
V<name> N+ N- AC <(magnitude)value> <(phase) value>
I<name> N+ N- AC <(magnitude)value> <(phase) value>
Pulse source
V<name> N+ N- PULSE (V1 V2 TD TR TF PW PER)
Where,
V1 = Initial voltage in volt
V2 = Pulsed voltage in volt
TD = Delay time in second
TR = Rise time in second
TF = Fall time in second
PW = Pulse width in second
PER = Period in second
Dc sweep
.DC LIN SWNAME SSTART SEND SINC
+ [(nested sweep specification)]
.DC OCT SWNAME SSTART SEND NP
+ [(nested sweep specification)]
.DC DEC SWNAME SSTART SEND NP
+ [(nested sweep specification)]
where,
SWNAME=The sweep variable name( voltage or current source)
SSTART = The sweep start value
SEND = The sweep end value
SINC = The sweep increment value
NP = Number of step per octave/decade
.DC SWNAME LIST <value>
+ [(nested sweep specification)]
where,
SWNAME=The sweep variable name(voltage or current source)
LIST = A key word
<value> = List of sweep values
Types of Output
The commands that are available to get output from the resultsof simulations
are as follows:
.PRINT Print
.PLOT Plot
.PROBE Probe output
.WIDTH Width
.PRINT (Print Statement)
The results from analysis (dc, ac, transient etc.) can be obtained in the
form of tables. The print statement for outputs (dc, ac, transient etc.) takes
the form
.PRINT <analysis type> [output variables]
Page 7 of 13
.PLOT (Plot Statement)
The results from analysis (dc, ac, transient etc.) can be obtained in the
form of line printer plots. The plot are drawn by using characters, and the
results can be obtained from any kind of printer. The plot statement for
outputs (dc, ac, transient etc.) takes the following form:
.PLOT <analysis type> [output variables]
+ [<(lower limit) value>, <(upper limit) value>]
.PROBE (Probe Statement)
Probe is a graphics waveform analyzer for PSpice. The command takes
one of these forms:
.PROBE
.PROBE <one or more output variables>
.WIDTH (Width Statement)
The width of the output in columns can be set by the .WIDTH statement,
which has the general form of :
.WIDTH OUT=<VALUE>
Transient Analysis
Transient analysis can be performed by the .TRAN command, which has one
of the general forms
.TRAN TSTEP TSTOP
where,
TSTEP = The printing increment
TSTOP = The final time (or stop time)
Transient Output Commands
The output commands are similar to those for the dc sweep. The .PRINT,
.PLOT, and .PROBE statements for transient outputs are
.PRINT TRAN [output variables]
.PLOT TRAN [output variables]
+ [<(lower limit) value>, <(upper limit) value>]
.PROBE
AC Analysis
The ac analysis calculates the frequency response of a circuit over a range of
frequencies. The command for performing frequency takes one of the
following general forms:
.AC LIN NP FSTART FSTOP
AC OCT NP FSTART FSTOP
AC DEC NP FSTART FSTOP
Where,
NP = Number of points
FSTART = Starting frequency
Page 8 of 13
FSTOP = Ending frequency
LIN Linear sweep: The frequency is swept linearly from the starting
frequency to the ending frequency.
OCT Sweep by octave: The frequency is swept logarithmically by
octave.
DEC Sweep by decade: The frequency is swept logarithmically by
decade.
AC Output Commands
The output commands are similar to those for the dc sweep. The .PRINT,
.PLOT, and .PROBE statements for transient outputs are
.PRINT AC [output variables]
.PLOT AC [output variables]
.PROBE
EXAMPLES OF CIRCUIT ANALYSIS
1. The circuit of Fig. 1 is to be simulated on PSpice to calculate & print all node
voltages and the current and power of all voltage sources (V s, Vx, and Vy).
The circuit file contains the following statements:
Simple dc circuit
VS 1 0 DC 20V
IS 0 4 DC 50MA
R1 1 2 500
R2 2 5 800
R3 2 3 1KOHM
R4 4 0 200
VX 3 0 DC 0V
VY 5 4 DC 0V
.OP
.END
The results are stored by default in an output file that has the input file & is on
the same drive, but has the extension .OUT.
2. The circuit of Fig. 1 is to be simulated on PSpice to calculate & print the
voltages at node 4; the current I R2 and IR3 for Vs = 5 V, 20 V, and 30 V for each
value of Is = 50 ma, 100 mA, and 150 mA. The current I R2 is to be plotted.
The circuit file contains the following statements:
Page 9 of 13
Dc sweep of VS and IS
VS 1 0 DC 20V
IS 0 4 DC 50MA
R1 1 2 500
R2 2 5 800
R3 2 3 1KOHM
R4 4 0 200
VX 3 0 DC 0V
VY 5 4 DC 0V
.DC VS LIST 5V 20V 30V IS 50MA 150MA 50MA
.PRINT DC V(4) I(VX) I(VY)
.PLOT DC I(VY)
.PROBE
.END
3. Three RLC circuit with R = 2Ω, 1Ω, and 8Ω and are shown in Fig. 2. The
inputs are identical step voltages. Use PSpice to calculate & plot the transient
response from 0 to 400 µs with an increment of 1 µs. The capacitor voltages
are the outputs V(3), V(6), and V(9), which are to be plotted.
The circuit file contains the following statements:
Step response of series RLC circuit
VI1 1 0 PWL (0 0 1NS 1V 1MS 1V)
VI2 4 0 PWL (0 0 1NS 1V 1MS 1V)
VI3 7 0 PWL (0 0 1NS 1V 1MS 1V)
R1 1 2 2
L1 2 3 50UH
C1 3 0 10UF
R2 4 5 1
L2 5 6 50UH
C2 6 0 10UF
R3 7 8 8
L3 8 9 50UH
C3 9 0 10UF
.TRAN 1US 400US
.PLOT TRAN V(3) V(6) V(9)
.PROBE
.END
4. Three RLC circuit with R = 2Ω, 1Ω, and 8Ω and are shown in Fig. 2,
calculate & print the frequency response over the frequency range from 100
Page 10 of 13
Hz to 100 KHz with a decade increment and 100 points per decade. The peak
magnitude & phase angle of the voltage across the capacitors are to be
plotted on the output file. The results should also be available for display by
the .PROBE command.
The circuit file contains the following statements:
Frequency response of RLC circuit
VI1 1 0 AC 1V
VI2 1 0 AC 1V
VI3 1 0 AC 1V
R1 1 2 2
L1 2 3 50UH
C1 3 0 10UF
R2 4 5 1
L2 5 6 50UH
C2 6 0 10UF
R3 7 8 8
L3 8 9 50UH
C3 9 0 10UF
.AC DEC 100 100HZ 100KHZ
.PLOT AC VM(3) VP(3)
.PROBE
.END
PROBLEMS
1. The circuit of Fig. 3 is to be simulated on PSpice to calculate & print (a) all
node voltages, (b) the current & power dissipation of voltage sources V A and VB,
and (c) the currents through all resistors.
2. Repeat Problem 1 for VA = 100 V, 120 V, and 140 V.
3. Repeat Problem 1 for VA = 100 V, 120 V, and 140 V and for V B = 40 V, 60 V,
and 80 V.
4. Repeat Problem 1 for V A = 100 V, 120 V, and 140 V; and for V B = 40 V, 60 V,
and 80 V; and IS = 50 mA, 100 mA, 150 mA.
5. The RLC circuit of Fig. 4 is to be simulated to calculate & plot the transient
response from 0 to 2 ms with an increment of 10 µs. The voltage across resistor
R is the output voltages are to be plotted in the output file. The results should
Page 11 of 13
also be available for display by the .PROBE command.
6. Repeat Problem 5 for the circuit of Fig. 5, where the output is taken across
capacitor C.
7. Plot the transient response of the circuit in Fig. 6 from 0 to 5 ms with a time
increment of 25 µs. The output voltage is taken across the capacitor. Use Probe
for graphical output.
8. Use PSpice to plot the frequency response of the low-pass RC circuit in Fig. 7
Assume that VS = 1 V (peak ac), R = 1kΩ, and C = 0.1µF. The frequency f is
varied from 1 Hz to 100 khz. Plot the magnitude and phase angle of the voltage
gain Vo/Vs against the frequency.
9. Plot the frequency response of the high-pass CR circuit in Fig. 8 using
PSpice. Assume that VS = 1 V (peak ac), R = 1kΩ, and C = 0.1µF. The frequency
f is varied from 1 Hz to 100 khz. Plot the magnitude and phase angle of the
Page 12 of 13
voltage gain Vo/Vs against the frequency.
Page 13 of 13