Notes For Orcad Pspice E E 2007
Notes For Orcad Pspice E E 2007
EE 2007
1 OVERVIEW
You will learn how to do the following:
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
3 DRAWING A SCHEMATIC
1. Summary of PSpice Parts
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
4 SIMULATING YOUR CIRCUIT
1. General Instructions
2. Bias Point (DC Calculations)
3. DC Sweep on Input Source, Vi
4. Parametric Sweep
5. AC Sweep (Frequency Domain Simulation)
6. Transient Analysis (Time Domain Simulation)
5 GRAPHING IN PSPICE
1. General Instructions
2. Bode Plot
6 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. EE2007_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
Resistor R / ANALOG
Capacitor C / ANALOG
Inductor L / ANALOG
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.
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.
1) All parts must have unique names. You can't have two parts named "R1" in your circuit. If
you are copying and pasting parts or circuits from another project, you will need to rename your
parts because PSpice doesn't do this automatically.
2) Labeling Nodes. I recommend you use aliases to label your input and output nodes. This
makes your node easier to find when you start plotting out your data. V(Vout) is simpler than
finding V(R1:1)
a. Go to Place => Net Alias
b. Enter a name, i.e., Vout or Vin
c. Place the label on the wire connected to the node.
An example of labeling from Lab 1 is shown below.
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
2) Choose the analysis type from the drop down menu.
3) Adjust the settings on the right hand side. More instructions are given in the next four
sections.
4) Press OK.
5) Go PSpice => Run. Or press the play button.
6) A new window (the simulation window) will pop up. Any errors from your circuit will be
displayed on the bottom left text window. Fix those errors before you continue. If there are no
errors, you are now ready to do one of two things: plot data on the simulation window or display
the DC calculations on your schematic.
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.
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
a. Click the "Toggle Cursor" button. (Or go through the menu, Trace => Cursor =>
Display.)
b. Click the "Cursor Max" button to find the highest point. (Or go through the menu,
Trace => Cursor => Max.)
c. Click the "Mark Label" button to label the max point. (Or go through the menu, Plot
=> Label => Mark.) This point is the center frequency fo for a bandpass filter.
d. Click the "Cursor Search" button (Or go through the menu, Trace => Cursor
=>Search Commands)
f. To find the cutoff frequency fc (or cutoff frequencies fcl and fcu for a bandpass filter), enter
"search forward level (max-3)" (don't enter the quotation marks) to move the cursor to the
right to the point which is 3dB below the max. Or enter "search back level (max-3)" (don't
enter the quotation marks) to move the cursor to the left
f. Click the "Mark Label" button to label that cutoff point.
Unclick the Toggle Cursor button to disable the cursor so you can move the label.
Double click on the label to edit the text (to add units, or to name the point)
3) Once you have completed the magnitude plot, you will now need to create a phase plot. To
put the plot on the same window for convenience, go to Plot => Add Plot to Window. To graph
the phase plot, use the PSpice P() function. For example, P(V(Vout)/V(Vin)).
4) To label the cutoff frequencies on the phase plot, simply search for the angles that correspond
to each cutoff frequency. You can find these in the class lecture notes. For example, for a
passive lowpass filter, the cutoff frequency is located where the phase shift is -45 degrees. So on
the plot, you would search for -45 and then label that point.
5) It may help to increase the width of the lines in the plot:
a. The colored symbol at the bottom of the graph, or on the graph line.
b. Note you can select all of the lines by going to Edit => Select All.
c. Right click on the line. Make sure the selection list has Information, Properties, Cursor 1,
and Cursor 2. (If it lists Settings and Properties, you clicked on the background, not on the
line).
d. Select Properties.
e. You can change the width and other settings of that trace.
6) An example of a complete Bode plot with labels is shown below:
6 MISCELLANEUOUS ITEMS
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.
6.3 Creating a Potentiometer
You will not need to use a special part for this. Simply perform a
parametric sweep on a regular resistor. Follow the same instruction
on parametric sweep, which can be found in Section 4.4.
First, you will need to make changes to your circuit so that your resistance RE is now a
parametric variable. Follow the first part of the instructions in section 4.4 on how to do this. Do
not follow the instructions for the simulation settings. You will need to follow these instructions:
1) Analysis type: AC Sweep
2) Options: General Settings and Parametric Sweep
3) For General Settings,
a. AC Sweep Type: Logarithmic Decade
b. Fill in Start, End, and Points/Decade
4) For Parametric Sweep,
a. Sweep variable: Global parameter
b. Parameter name: R (or name of the parameter you used on the schematic minus the curly
braces)
c. Sweep type: Value list
d. Fill in the list box. Make sure to separate each value with a space and not a comma. For
example, you would type in 1k 2k 3k and not 1k, 2k, 3k.
Once you have set up the Sweep Type, press OK and then simulate your circuit. The simulation
window should now include a place for you to plot your data. See Section 5.
1) Connection points 2, 3, and 6 should be self-explanatory. See the circuit diagram in your lab
instructions to figure what to connect to these points.
2) Connection point 7: attach a VDC to supply power to the OpAmp and change the value to
15V. Dont forget to ground the DC source by attaching the 0/source to the negative terminal.
3) Connection point 4: attach a VDC to supply power to the OpAmp and change the value to
-15V. Dont forget to ground the DC source by attaching the 0/source to the negative terminal.
4) Do not connect anything to connection points 1 and 5.
5) An example circuit is shown on the next stage: