ECEN.2611-Lab.05

advertisement
ECEN 2611
Introduction to PSpice/OrCAD
Lab #5
Your Name:
Group Partner(s):
Objectives: The purpose of this lab is to become familiar with the DC sweep, nested DC sweep, and
parametric sweep capabilities of PSpice.
Introduction:
PSpice is a simulation tool used to analyze complex circuits. It is based on the Spice simulator
developed in the early 1970s by the University of California at Berkeley. PSpice was developed by
MicroSim, which merged with OrCAD in late 1997. OrCAD PSpice is available in an evaluation
edition that can be downloaded and freely copied. The evaluation version has some restrictions, but
for this and some other classes it may be sufficient. You may use the computers in our lab rooms or in
the engineering computer lab room on the second floor. Our YSU licensed versions have significantly
more capability than the evaluation versions but require access to the license server.
To start PSpice locate the OrCAD 16.2 or 16.3 folder on your computer and click on Capture CIS
Version with Orcad PCB Designer PSpice. OrCAD Capture is the entry portion of the design flow.
Once OrCAD Capture loads, click on File −> New −> Project… You should see a screen similar to
one shown in Figure 1.
Figure 1. OrCAD New Project screen
Fill in a Name perhaps as your lab name (Lab6, Lab7, etc.). Choose Analog or Mixed A/D for your
project. Save your file onto your Y drive in a location you will remember so you will be able to access
again as needed. Since OrCAD creates several folders and files, you may wish to create a special startup folder for your PSpice work.
Once the next window pops up, choose Create a blank project as your PSpice Project and then
click OK as shown in Figure 2.
ECEN 2611 Lab #5
P.Munro 06-March-2016 06:37 PM
Page 1 of 7
Figure 2. Project creation
You should now observe a blank Schematics page next to your Project Manager window as shown
in Figure 3. Circuits are built by selecting parts from the Place Parts browser and wiring them together
on this schematics page.
Figure 3. Blank schematics page
To add circuit parts, first highlight and maximize your schematics page, then click on Place −>
Part. The Place Part browser window shown in Figure 4 should then appear to the right.
If you know the exact name of the part you want, you can type it in the part name textbox.
Otherwise you will have to search through the list. If you can’t find the part in the list, select the add
libraries button below the part list. When the library browser appears, select all libraries in the folder
and then click open.
ECEN 2611 Lab #5
P.Munro 06-March-2016 06:37 PM
Page 2 of 7
At times you may want to rotate, flip, or mirror a part to set up a circuit. You can click the R key
to rotate a part 90°, and two consecutive rotations will flip the object.
Figure 4. Place part screen
R
L
C
VDC
VAC
Vsin
0
Common Part Names
Resistor
Inductor
Capacitor
DC Voltage Source
AC Voltage Source
AC/DC/Tran V Source
Ground Node
To change a part value, double click on the part’s current value in the schematic display window.
The Display Properties window should appear allowing you to enter the new value. To change the
name of the part, double click on the part’s current name to open the Display Properties window also.
When you have placed the parts you need to build your circuit, you must then wire them together.
To wire the parts together, click on Place −> Wire. A shortcut to doing this is to just hit the W key to
allow you to place a wire.
Before you can start the simulation process, make sure that your circuit has a “0” ground. Click on
Place −> Ground and choose 0/CAPSYM from the Parts List. If you place a different ground, you
must name it 0, in order for PSpice to recognize it as a ground.
Before you can setup your simulation settings, you must save your simulation. To do this, click on
PSpice −> New Simulation Profile. You may name your Simulation the same as your Project (Lab6,
ECEN 2611 Lab #5
P.Munro 06-March-2016 06:37 PM
Page 3 of 7
Lab7, etc.) as shown in Figure 5 and select Create. Now, the Simulation Settings window should
appear as shown in Figure 6.
Figure 5. Simulation naming
Figure 6. Simulation settings
PSpice is capable of performing the following analysis types: Transient (Time Domain), DC and
AC sweeps, all with the following options: Parametric and Temperature sweeps, Monte Carlo, and
Bias Points.
For this laboratory you will learn how to use the DC and parametric sweep analyses. After you set
up the analysis you want to perform, click on the Run icon or click on PSpice −> Run. If your circuit
contains an error, a dialog box will appear stating the error, otherwise the simulation will proceed, and
Probe (shown in Figure 7) will automatically load.
Probe is used to display and analyze the data generated by PSpice. Probe generates high quality
graphs of analysis results. If a voltage or current marker is placed on the schematic, Probe will
automatically load and display the marker results of the simulation. If no marker is placed on the
ECEN 2611 Lab #5
P.Munro 06-March-2016 06:37 PM
Page 4 of 7
schematic, you can graph a value by selecting it in the Add Traces dialog box by clicking on Trace −>
Add Traces.
Figure 7. Probe screen
Laboratory Experiment
DC sweep
DC sweep is a PSpice analysis that allows you to change a value automatically over a specified
range and simulate and graph the results. With the DC sweep feature you can sweep temperature
values, currents, or voltages. In order to carry out a DC sweep simulation you have to tell PSpice your
requirements.
To set up the DC sweep, click on the PSpice menu and then choose the Edit Simulation Profile
option. The Simulation Settings dialog box will then appear. Choose DC Sweep under the Analysis
Type drop-down menu. If, for example, we wanted to sweep a current source, we must select the
current source sweep variable type. Next, choose the appropriate sweep type for the simulation. In
many cases the sweep type will be linear. In the Name field, type in the name of the element you
desire to sweep. Then type in the Start Value, End Value, and the Increment Value, and then click the
OK button.
Experiment A
Now that you know how to set up the DC sweep, examine the effects of changing the voltage, V1,
in the circuit shown in Figure 8.
R1
R2
5k
1k
IR3
V1
R3
3.5k
20Vdc
R4
6.5k
IR5
R5
2.5k
0
Figure 8. Circuit Diagram
ECEN 2611 Lab #5
P.Munro 06-March-2016 06:37 PM
Page 5 of 7
For this exercise, determine the voltage required for the current IR5 to be 750μA by sweeping the
voltage V1 from 0V to 15V.
Set up the DC sweep as follows:
1.
Choose Edit Simulation Profile under the PSpice menu.
2.
Select DC Sweep as your Analysis Type.
3.
Set the Sweep Variable to Voltage Source and its Name to V1. Set Sweep Type to Linear, with Start Value equal
to 1, End Value equal to 15, and Increment Value equal to 0.01 Volts.
4.
Save the circuit and click the simulate icon.
After a successful simulation PSpice will automatically run Probe. To plot IR5, choose Add Trace
in the Trace menu. Select I(R5) in the variable list and click ok. Print out or sketch the graph
obtained. Watch for incorrect signs which can occur with I(Rx) values depending on which way the
Rx is put into the circuit. In order to get high-precision readings, you could enable and use the Probe
Cursor by selecting Trace −> Cursor −> Display.
Experiment B
Use the PSpice DC sweep capability to determine the required value of V1 so that IR3 = 0.35mA.
You should be able to determine the voltage value for V1 by looking at the graph or by using the Probe
Cursor. Print the graph and indicate how you determined the proper value of V1.
In your report calculate the current IR3 with the source voltage, V1, equal to 20V. Find the
equivalent resistance and use current division to find your answer. Recall that the principle of current
division is that the current into parallel resistors divides in direct proportion to resistors’ conductances. Compare this calculated value if IR3 with the 0.35mA value.
Parametric and nested sweeps
Nested DC sweeps allow you to run through a series of DC sweeps all in one simulation. A nested
sweep works in the following fashion:
1.
The sweep (AC, DC, or Transient) runs once with the start value of your parameter (resistance in the following
examples).
2.
Then the parameter value is incremented according to your settings.
3.
The sweep runs again with the new value of your parameter.
4.
Steps 2 and 3 are repeated until the set end value of your parameter is reached.
The result is a family of curves, each curve representing a complete sweep with a different
parameter value.
Experiment C
We will now simulate the circuit in Figure 8 to obtain a family of curves for a set of resistance
values for R2. First, replace the value of R2 by a "global parameter" named “R” contained in curly
brackets: {R}. The default value of a global parameter is specified by using the part name PARAM,
so add part PARAM into your schematic. Double-click on PARAM to start the spreadsheet editor to
specify the name of the global parameter and its default value. Click New Column, enter the
parameter name: “R”, and its default value: 1k. In order to display this default value and the parameter
name on your schematic, right-click the 1k value and turn on its display. Click OK for the changes to
take effect, and describe what happens.
ECEN 2611 Lab #5
P.Munro 06-March-2016 06:37 PM
Page 6 of 7
Follow the steps below to sweep R2 over the following list of values: parameter R = 1k, 2k, 4k,
and 5k. Print your plot and label which curve corresponds to which value of R2. Note that the voltage
of your source does not change in subsequent sweeps with this simulation. Only R2 is changing.
1.
In the Simulation Settings dialog box, from the Analysis Type list box, select Time Domain (Transient).
2.
Under Options, select Parametric Sweep if it is not already enabled.
3.
Specify the required parameters for the sweep.
4.
Click OK to save the simulation profile.
5.
From the PSpice menu, choose Run to start the simulation.
6.
Choose I(R2) as the Probe trace to display.
Figure 9 Parametric Analysis
Experiment D
When a current or voltage source is being swept in a DC analysis, a global parameter can also be
swept using a "nested sweep." Modify your experiment by changing your Analysis Type from
Transient to DC Sweep, using the settings from Experiment A. Also check Parametric Sweep and
sweep R4 using the same values as listed above. Run the analysis, and when Probe appears plot the
current in R4. Express which curve corresponds to which value of R4.
Report: Whenever you do PSpice work, you should write notes and labels on your printed work.
This is especially important for Probe output which is not always labeled automatically. Also, it is a
good thing to print at least some of your simulation .OUT files. These will show what your settings
were.
Due Date: Next week, 15-June-2011, at the beginning of your lab period.
ECEN 2611 Lab #5
P.Munro 06-March-2016 06:37 PM
Page 7 of 7
Download