Notes For Orcad Pspice (V5.1) Ece 65
Notes For Orcad Pspice (V5.1) Ece 65
1)
ECE 65
Created by: Kristi Tsukida (Spring 2006)
Edited by: Eldridge Alcantara (Winter 2009)
Updated by: Alex Bishop (Fall 2009)
1 OVERVIEW
This tutorial will teach you all you need to know about PSpice for ECE 65. You will learn how
to do the following:
Start a Project Draw a schematic Simulate circuit Graph data
Each part will be discussed in more detail in the next five sections. Here is a detailed list of
topics covered in each section:
2
STARTING A PROJECT
DRAWING A SCHEMATIC
1. Summary of PSpice Parts for ECE 65
2. What your Schematic Needs
3. Adding Parts to your Circuit
4. Using Wires
5. Adding a Ground
6. Changing the Value of a Part
7. Other Notes: Unique Names and Labeling Nodes
GRAPHING IN PSPICE
1. General Instructions
2. Bode Plot
MISCELLANEOUS ITEMS
1. Creating an IV Plot (for Lab #1)
2. Using the Zener Diode (for Lab #3)
3. Creating a Potentiometer (for Lab #5)
4. Family of Curves Option for Resistance (for Lab #3)
5. Using the OpAmp (for Lab #3 and Lab #4)
2 STARTING A PROJECT
1) To Open PSPICE, go to folder ORCAD 16.0 and choose the program OrCAD Capture CIS
a) Vista Users should run Capture as Administrator (under the right click menu).
2) Choose OrCAD Designer PSCPICE as your Cadence Product Choice.
3) Go to File => New => Project
4) Enter a name (i.e. Ece65_Kristi_Lab1)
5) Choose "Analog or Mixed A/D"
6) Set the location. (You should create a new directory for your project since PSpice will
generate a bunch of project files in this folder.)
7) Click OK
8) Choose "Create blank project" and click OK
9) You should now see a window where you can draw the schematic (i.e., your circuit diagram).
3 DRAWING A SCHEMATIC
3.1 Summary of PSpice Parts for ECE 65
PART
PART NAME
DC Source
VDC / SOURCE
AC Source
VAC / SOURCE
VSIN / SOURCE
0 / SOURCE
Resistor
R / ANALOG
Capacitor
C / ANALOG
Inductor
L / ANALOG
741 OpAmp
uA741 / OPAMP
Diode
D1N4148 / DIODE
Zener Diode
D1N5232 / EVAL
npn BJT
Q2N3904 / BIPOLAR
PICTURE
NOTES
2) Click on the library you want to use, or select multiple libraries by holding Ctrl or dragging
the mouse. In the parts window you should see at least the ANALOG, BIPOLAR, OPAMP,
DIODE, and SOURCE libraries. If you don't see these libraries already listed, you will need to
add them:
a. Click Add Library
b. Navigate to C:\Program Files\OrCad_Demo\Capture\Library\Pspice (This is the location in
the PSpice lab computers. The location may be different if you install PSpice on your own
computer, but find the ...\Capture\Library\Pspice folder)
c. Highlight all the *.olb files in this folder. You can hold Ctrl and click on the files, or drag
the mouse to select multiple files.
d. Click Open. You should now see a list of libraries in the "Libraries:" section.
3) Find the part you want to add and press OK.
4) Click where you want to place the part on your schematic. (Press R to rotate the part by 90
degrees)
5) When you are finished with the part, right click and select End Mode to return to the pointer.
3.4 Using Wires
1) Select Parts => Wire. The pointer changes to a cross-hair.
2) Drag cursor from one connection point to another. Clicking on any valid connection will end
the wire.
If you don't see the 0/source ground, you will need to add the "source" library:
a. Click Add Library
b. Navigate to C:\Program Files\OrCad_Demo\Capture\Library\Pspice (This is the location in
the PSpice lab computers. The location may be different if you install PSpice on your own
computer, but find the ...\Capture\Library\Pspice folder)
c. Highlight source.olb.
d. Click Open. You should now see the source library and the 0/source ground.
2) Connect the ground to your circuit.
For the parts above, V2 and R4 are the names of the components, while 0Vdc and 1k are the
values. To change a parts value, double-click the value of the part. A new window will pop up
where you can type in the value you want.
Special Characters
M
K
MEG
Meaning
milli (10-3)
kilo (103)
mega (106)
Example
10 mH
1 k
10 M
What to Type
10m
1k
10MEG
1) Go to PSpice => New Simulation Profile. Or if you already have a profile and would like to
edit it, go to Edit Simulation Profile
Simulation Settings:
1) Analysis type: DC Sweep
2) Options: Primary Sweep (not Parametric Sweep!)
3) Sweep variable: Global parameter
4) Parameter name: RL (or name of the parameter you used without curly braces)
5) Sweep Type: Linear
6) Fill in the Start, End, and Increment values. Note for resistance, the start value cannot be 0!
Use 0.1 instead.
Press OK and simulate. The simulation window should now include a place for you to plot your
data. See Section 5 on how to make plots.
4.5 AC Sweep (Frequency Domain Simulation)
1) Set up your circuit with VAC voltage sources.
2) Go to PSpice => New or Edit Simulation Profile
3) Analysis Type: AC Sweep/Noise
4) Sweep Type: choose logarithmic and decade. Then select the frequency range of interest.
Don't start frequency sweeps at 0!
5) Set the Points/Decade to be at least 20.
Press OK and simulate. The simulation window should now include a place for you to plot your
data. See Section 5 on how to make plots.
4.6 Transient Analysis (Time Domain Simulation)
1) For a sine wave, use VSIN for your voltage source instead of VAC (VOFF is the DC offset,
VAMPL is the amplitude, and FREQ is the frequency of the sine wave).
2) For a square or triangular wave, use VPULSE (Set delay time, TD = 0, for simulations in
ECE65). The values you type in for V1 and V2 will depend on the amplitude specified on the
lab instructions. If a 5V amplitude signal is specified, then V1 = 5V and V2 = -5V.
a. Square Wave is the VPLUSE function in the limit of TR = TF = 0 and PW = 0.5 * PER (PER
is the period of the wave). This limit case, however, causes numerical difficulties in calculations.
In any case, we can never make such a square function in practice. In reality, square waves have
very small TR and TF. Typically, we use a symmetric function, i.e., we set TR = TF and PW =
0.5 * PER - 2 * TR. Thus, for a given frequency we can set up the square function if we choose
TR. If we choose TR too large, the function does not look like a square wave. If we choose TR
too small, the program will take a long time to simulate the circuit and for TR smaller than a
certain value, the simulation will not converge numerically. A good choice for TR is to set it to
be 1% of the PER (a period): TR = TF = 0.01 * PER, PW = 0.48 * PER. This usually results in a
nice signal without a huge amount of computational need. Note that TR does not have to be
exactly 1% of PER. You can choose nice round numbers for TR, TF, and PW.
b. Triangular Wave is the VPLUSE function in the limit of TR = TF = 0.5* PER and PW = 0
(convince yourself that this is the case). As before, the limit case of PW = 0 causes numerical
difficulties in calculations. So we have to choose PW to be a reasonably small value. A good
choice for PW is to be set at 1% of the PER (period): PW = 0.01* PER, TR = TF = 0.49 * PER
(and not TR = TF = 0.495 * PER so that we get a symmetric function). This usually results in a
nice signal without a huge amount of computational need. Again, note that PW does not have to
be exactly 1% of PER. You can choose nice round numbers for TR, TF, and PW.
3) Simulation settings:
a. Analysis Type: Time Domain (Transient)
b. Options: General Settings
c. Enter a Run to time so that a few periods will be displayed. Remember that the period
(seconds) = 1/frequency (Hz), i.,e, if you are using a 1kHz sine wave, it has a 1/1kHz=1ms
period, so use a Run to time of 5ms for 5 periods
d. Set the Maximum step size to be much smaller than the period. i.,e, for a 1kHz sine
wave: It has a 1ms period, so set a maximum step size of approx .01ms. (This works out to 100
data points per period). If you don't set the maximum step size, PSpice may choose one which
is too big, making your sine wave look angular and ugly.
Press OK and simulate. The simulation window should now include a place for you to plot your
data. See Section 5.
5 GRAPHING IN PSPICE
5.1 General Instructions
On the simulation window,
1) Go to Trace => Add Trace
2) Select the variable you want to plot on the simulation window. Or type in an expression on
the Trace Expression prompt at the bottom of the window. Press OK
3) To mark points:
(Or go through the menu, Trace => Cursor =>
a. Click the "Toggle Cursor" button.
Display.) You will now be able to move the cursor along your plot.
b. Click the "Mark Label" button
Label => Mark.)
6 MISCELLANEUOUS ITEMS
6.1 Creating an IV Plot (e.g., for Lab #1)
Here, you will need to make a plot of current vs. voltage.
1) Use the same schematic and settings you made for a parametric sweep on the resistance.
2) Simulate the circuit.
3) On the simulation window, go to Trace => Add Trace.
4) Select the current through the load resistance. If the name of your parametric resistor is R3,
the variable you want to choose is I(R3).
5) Add a negative sign in the trace expression, so that you have I(R3). You will need to do this
because you want the current going into the voltage divider circuit. Without the negative sign,
you will be plotting the current coming out of the voltage divider circuit.
6) Change the x-axis variable from resistance to voltage:
a. Go to Plot => Axis Setting
b. Under the X Axis tab, click Axis Variable
c. Select the voltage across the load. This will probably be V2(R3) if R3 is the name of your
parametric resistor.
7) Press OK. Your graph should now be a plot of I vs. V.
6.2 Using the Zener Diode (for Lab #3)
PSpice Lab computers have the full version of ORCAD PSpice. You can find 1N5232
zener diode in the diode library.
If you are using the Demo version of ORCAD PSpice, follow the instructions below
1) You need 2 files (posted on the Web site):
a. D1N5232.lib (PSpice library file)
b. D1N5232.olb (Orcad Capture library file)
2) PSpice Instructions:
a. Go to the menu: 'PSpice => Edit Simulation Settings'
b. Go to the 'Libraries' tab. Click the 'Browse...' button. Open the D1N5323.lib file
c. Click 'Add as Global'
d. Press 'OK' to exit the simulation settings.
e. Now go to the menu: 'Place => Part...'
f. Click 'Add Library'
g. Open the D1N5232.olb file
h. You should now see a part named D1N5232. Select it and press OK to use the part.
3) PSpice Demo v16.2 users or if the above did not work correctly:
a. Go to the menu: 'PSpice => Edit Simulation Settings'
b. Verify under the 'Configuration Files' Library tab that nom.lib or equivalent is
installed globally (path = ~\OrCAD\OrCAD_16.x\tools\PSpice\Library).
c. Instead of Add as Global Click Add to Design
d. Otherwise:
i. Navigate and open ~\OrCAD\OrCAD_16.x\tools\pspice\pspice.ini
ii. Insert LINE1=.lib ~\path of file\D1N5232.lib under [PSPICE DEMO]. This will
force it global.