Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
1
EEE 232 – ORCAD / PSPICE Tutorial İzmir University of Economics
ORCAD/PSPICE Tutorial
Course Coordinator: Asst. Prof. Pınar Oğuz Ekim
Edited by Sertaç Kılıçkaya, Barış Dal and Prof. Dr. Murat Aşkar
ORCAD/PSPICE is an integrated package that is used to describe a circuit and simulate it under a predefined scenario. The circuit is described using the schematic editor named ORCAD. You can use the components available in the libraries attached to this package, or you can describe new components and add them to a library for a possible use. Internet accommodates several components libraries.
PSPICE is a well known electrical circuit simulator. It simulates the circuit entered using ORCAD, based on the descriptions given in the simulation file. Using ORCAD and PSPICE, it is possible to check the circuit operation before the circuit is to be constructed.
Types of Analysis Performed by PSpice
PSpice is a general - purpose circuit simulator capable of performing four main types of
analysis: Bias Point, DC Sweep, AC Sweep/Noise, and Time Domain (transient).
Bias Point The Bias Point analysis is the starting point for all analysis. In this mode, the simulator
calculates the DC operating point of the circuit. Options include calculating the detailed
bias points for all non- linear controlled sources and semiconductors (.OP), performing
sensitivity analysis (.SENS), and calculating the small signal DC gain. (.TF)
DC Sweep The DC Sweep analysis varies a voltage source over a range of voltages in an
assigned number of increments in a linear or logarithmic fashion.
AC Sweep/Noise The AC Sweep/Noise analysis varies the operating frequency in a linear or logarithmic
manner. It linearizes the circuit around the DC operating point and then calculates the
network variables as functions of frequency. The start and stop frequencies as well as
the number of points can be assigned. Spice will compute the effective noise voltage
spectral density that appears at the Output Voltage node because of internal noise
sources (.NOISE). In this analysis the detailed bias points for all non-linear controlled
sources and semiconductors (.OP) can also be performed.
Time Domain (transient) The Time Domain (transient) analysis is probably the most popular analysis. In this
mode, you can plot the various outputs as a function of time. The starting and ending
times for the various plots can be input. The accuracy (smoothness) of the output plots
can also be controlled by regulating the maximum (time) step size.
2
ORCAD Capture
1. Time Domain (Transient Analysis) a) Start 1) Launch the ORCAD schematic editor by double-clicking on the OrCAD Capture CIS Demo icon
(Fig. 1).
Fig. 1 2) Click on File from the main menubar and then select Open New Project (Fig.2).
Fig. 2
3
ORCAD/PSPICE Manual İzmir University of Economics
3) You should then see the following dialog box (Fig. 3). Give a name to your project as "NAME_SURNAME_no". Enter the Location of the folder as “D:\MY WORKS\CE206_OrCAD” where the schematics and your simulation results is to be saved. Use the Browse button to select the location where you would like to save your files. Then select the option Analog or Mixed A/D and click the OK button
Fig. 3
4) On the dialog box (Fig. 4) select Create a blank project and then click the OK button.
Fig. 4
5) An empty page in Schematic Editor will be then opened (Fig. 5).
Fig. 5
4
ORCAD/PSPICE Manual İzmir University of Economics
b) Schematic Editor
A simple voltage divider (Fig. 6) with two resistors, each with a value of 1 K is to be simulated. Input is a sinusoidal voltage with the peak value of 10V and the frequency of 1kHz. The output voltage is expected to be the half of the input voltage.
Fig. 6
6) To enter the components, from the menu at the top, select Place and then Part. Alternatively, you can do this using the toolbox at the right of the screen as shown below (Fig. 7).
Fig. 7
7) Add the resistor R1 as described in Annex A. Similarly add the resistor R2. It may be needed to rotate R2 by 90 degrees.
5
ORCAD/PSPICE Manual İzmir University of Economics
8) To rotate the resistor R2, with the resistor R2 selected, right mouse click on it. The following menu will appear. (Fig. 8)
Fig. 8
9) Select the Rotate option and observe the following (Fig. 9). Or use the short key R.
Fig. 9
10) At this point, it is a good idea to save your work. This can be done by either typing Ctrl-S or by clicking on the diskette icon in the toolbar or selecting File >> Save.
11) To add input voltage source, choose Place Part again. This time add the Source library, and
from the Source library, select VSIN (Fig. 10). Place the sine wave generator.
Fig. 10
6
ORCAD/PSPICE Manual İzmir University of Economics
12) Then set the parameters of voltage source. VOFF should be 0. VAMPL should be set to 10V. FREQ should be set to 1k. To connect the components of the circuit select wire from the toolbox on the right part of the screen (Fig. 11).
Fig. 11
13) Now place the ground symbol. Choose Place and Ground (Fig. 12). Choose the 0/CAPSYM symbol (Fig. 13).
Fig. 12
Fig. 13
7
ORCAD/PSPICE Manual İzmir University of Economics
c) Simulation
14) To simulate the circuit, a simulation profile must be prepared. The simulation Profile describes the conditions how we want the simulation to be done. To do this select New Simulation Profile as shown below (Fig. 14).
Fig. 14
15) On the dialog box appears, enter the simulation profile file name as “NAME_SURNAME_no”. Click on the Create button to create the profile (Fig. 15).
Fig. 15
16) After clicking on the Create button, the following dialog box will appear. Since the input frequency is 1 kHz which has a corresponding period of 1 ms, we can choose Run to time as 5 ms i.e. 5 periods of the waveform. To get 100 data points per period of the sinusoid choose maximum step size as 10 s (Fig. 16). Note: We perform time domain analysis.
Fig. 16
8
ORCAD/PSPICE Manual İzmir University of Economics
17) To specify the voltages at which nodes we would like to get plot, we should select the Voltage / Level Marker as shown in the figure below (Fig. 17).
Fig. 17
18) Place the measurement marker on the input source and on the output of the voltage divider as shown below (Fig. 18).
Fig. 18
19) To save your work, select File Save, type Ctrl-S or click on the diskette icon in the toolbar.
9
ORCAD/PSPICE Manual İzmir University of Economics
d) PSPICE Simulation
20) To run the PSPICE simulation, select PSpice from the main menubar and then Run. PSPICE simulation may also be activated through the arrow icon on the toolbar. Another window will be opened and the input and output voltage waveforms will be displayed (Fig. 19). The red trace indicates the output and the green trace indicates the input. Note that output has one-half the amplitude of the input.
Fig. 19
AC Inputs
Shown below are the five types of AC inputs, along with sample inputs:
V1 = 1V V2 V2 = 5V TD1 = 7ms TC1 = 1ms TD2 = 15ms
TC2 = 5ms
VEXP V4 VPWL VPWL_RE_N_TIMES VPWL_RE_FOREVER
V1 = 0V V1 V2 = 5V TD = 2ms TR = 0.1us TF = 0.1us PW = 5ms PER = 10ms
VPULSE V1 VOFF = 2V
VAMPL = 10V FREQ = 5kHz
VSIN
VOFF = 0V VAMPL = 1V FC = 30MHz MOD = 5V FM = 5kHz
V1 VSFFM 1Vac
0Vdc
V8 VAC
10
VSIN - a sine wave input used for transient analysis; that is for viewing an output as a function of time. VAC - a sine wave input used for AC Sweep Analysis; that is for viewing an output as a function of frequency. VSFFM - creates a Single-Frequency Frequency Modulation source. VPULSE - creates a rectangular repetitive pulse having the parameters specified. VPWL - an pulse input where you can create your own type of single pulse or triangular waveform. Used in a transient analysis simulation. Points on the piecewise linear source are entered in the Property Editor. VPWL_RE_N_TIMES - is the VPWL repeated N times. VPWL_RE_FOREVER - is the VPWL run continuously. VEXP - Creates a single exponential waveform.
Markers
In Probe, you have the ability to preset which parameters you want to display. On the Action
toolbar, there are four toolbar buttons that can be used for this purpose.
They are, Voltage/Level Marker Voltage Differential Markers
Current Marker
Power Dissipation Marker
Placing one, or more, of these Markers on your schematic before running the Simulation
automatically sets up the Probe display.
2. DC Sweep Analysis
Non-Linear Resistance (Diode I -V Curve)
In this segment you will plot out the current vs. voltage characteristics of a non-linear
resistive device, specifically the D1N4148 diode.
The diode network is shown below.
11
ORCAD/PSPICE Manual İzmir University of Economics
Re-wire your circuit, change the values of the components, and add a 1N4148 diode.
Again create a New Simulation Profile. The simulation profile set up for a DC Sweep
is shown below.
Click OK to close this window and run PSpice. When the circuit is finished
simulating, the Probe window will appear. At that point, you will want to change the x
axis from V_V1 to V1(D1). Pull down the Plot menu and click on the Axis Settings…
option. This will bring up the following menu.
Click on the Axis Variable button and then choose V1(D1). After you have chosen the
x- axis the above window will reappear. Now set the Data Range to User Defined and
adjust the settings to what you prefer. In the above example 0V to 1.0V was selected.
When you close this window, you can now select your Y-axis trace. Use the I(D1)
selection to plot the ID vs. VD diode characteristics.
12
3. AC Sweep Analysis
From the source library, choose the “VAC” source, as shown below, and place it in the
drawing window.(Note: The VSIN part is used for the Transient Analysis simulations)
From the analog library, add a resistor and a capacitor to the drawing window. Add a ground a
connection, and then wire the parts together, as shown below.
13
Change the capacitor value to 47 nF (47n in PSPICE terminology) and the resistor to 2.2 kΩ.
That amplitude of the source can remain at the default value of 1 V. You can change the
component labels to whatever you like. We should recognize this is as a simple 1st-order low-
pass filter circuit with cutoff frequency of
Set up the Simulation profile
Set up a new simulation profile. (Give it whatever name you like.) From the pop-up menu,
choose the “AC Sweep/Noise” analysis type.
You can choose the range of frequencies for which the circuit will be simulated. For this
example, we will sweep over several orders of magnitude, so choose the “Logarithmic”
Sweep Type. Enter the start frequency (10 Hz), stop frequency (1 MHz) and how many
points per decade (10). (The more points used, the longer the computation will take.)
Add probes and run the simulation
PSPICE calculates all of the complex node voltages and branch currents at each frequency.
We use probes to indicate which voltages or currents should be graphed in the frequency
response plot. For now, choose the single voltage probe from the toolbar at the top and place it
on the node between the resistor and capacitor. (Recall that the single probe will calculate the
voltage at that node with respect to ground.)
14
Once the probe is in place, run the simulation by clicking on the “run” button at the top.
The Plot
If the simulation runs successfully, a plot window will open. Initially, it may be hidden behind
the drawing window – click the flashing icon in the tray at the bottom to bring the plot to the
front. The plot should show the frequency response of the magnitude of the output voltage,
with a linear voltage axis.
Of course, we generally prefer using a Bode plot to display the magnitude information. There
are two ways to have the voltage expressed in decibels.
The first way to get decibels is to change the probe. Back in the circuit diagram, select the
voltage problem and delete it. Then choose a dB probe from the PSPICE menu item
(Pspice markers advanced dB magnitude of voltage), and place it on the node
between the capacitor and resistor.
Run the simulation again – we now have a Bode plot.
15
We can use the same technique to plot the phase. From the PSPICE menu, choose a phase
probe (Pspice markers advanced phase of voltage) and place it on the same node.
Run the simulation again, and the plot now shows the phase as a function of frequency. (The
units on the vertical axis are “d” for degrees.)
16
Annex A
Adding a Component
A. 1. General
i. To enter the components, from the menu at the top, select Place >> Part. Alternatively, you can do this using the toolbox at the right of the screen as shown below (Fig. A.1).
Fig. A.1
ii. A dialog box will be opened (Fig. A.2). To add a component, click on the “Part Search” button.
Fig. A.2
A. 2. Placement of a Resistor
i. To add resistor, after completing the steps given in (A.1.i) and (A.1.ii), write “R” in the Part Name box and select R\analog.olb. Then click the OK button (Fig. A.3).
Fig. A.3
17
ORCAD/PSPICE Manual İzmir University of Economics
ii. Now, select the resistor R for placement. This can be done by double clicking on R/ANALOG or choosing R/ANALOG and clicking the OK button (Fig. A.4). Place the component R by clicking somewhere near the middle of the schematic page. You should then hit the Esc key or “end mode” with right clicking to exit the placement mode.
Fig. A.4
A. 3. Placement of a Capacitor
i. To add a capacitor into the circuit, first select Place >> Part as explained before. With ANALOG library chosen, select C and click OK (Fig. A.5). Then place the capacitor on the Schematics.
Fig. A.5
ii. Change the capacitor’s value by double clicking. Write the value of C and click OK (Fig. A.6).
Fig. A.6
18
ORCAD/PSPICE Manual İzmir University of Economics
A. 4. Diode Placement
i. To add a diode you need to know the component part number. Assume the diode 1N914 is to be added into your circuit. After selecting Place >> Part from toolbar, choose D1N914 as your diode (Fig. A.7).
Fig. A.7
A. 5. Sinusiodal Voltage Source Placement
i. To add input voltage source, choose Place Part again. This time add the Source library, and from the Source library, select VSIN (Fig. A.8). Place the sine wave generator.
Fig. A.8
ii. Then set the parameters of voltage source. Click on the components VSIN. A dialog box will be opened. Enter the desired parameter values. VOFF should be 0. VAMPL should be set to 10. FREQ should be set to 1k.
19
ORCAD/PSPICE Manual İzmir University of Economics
A. 6. Wire Connection
i. To connect the components of the circuit select wire from the toolbox on the right part of the screen (Fig. A.9).
Fig. A.9
A. 7. Ground Connection
i. To place the ground symbol, choose Place and Ground (Fig. A.10). Choose the 0/CAPSYM (Fig. A.11).
Fig. A.10
Fig. A.11
20
ORCAD/PSPICE Manual İzmir University of Economics
Annex B
Screen Capture in ORCAD/PSPICE
B. 1. Circuit Schematic Capture
In ORCAD, it is possible to take a copy of circuit by selecting the circuit with mouse as shown in Fig. B. 1
Fig. B. 1
21
ORCAD/PSPICE Manual İzmir University of Economics
B. 2. Circuit Simulation Capture
To copy output of circuit you can use Window >> Copy to Clipboard as shown in Fig. B. 2.
Fig. B. 2
When you select Copy to Clipboard, you will see the dialog box given in Fig. B. 3.
Fig. B. 3
22
ORCAD/PSPICE Manual İzmir University of Economics
Select make window and plot backgrounds transparent and use screen colors. An example output graphic copied with this method can be seen from Fig. B. 4.
10V
5V
0V
-5V
-10V
0s 5ms 10ms 15ms 20ms 25ms 30ms 35ms 40ms 45ms 50ms
V(D1:1) V(R1:2)
Time
Fig. B. 4