Cadence PSpice & Excel Simulation Guide
Cadence PSpice & Excel Simulation Guide
SIMULATION USING
CADENCE
ORCAD/PSPICE AND
EXCEL
ECE2200 – Activity 5
Abstract
Pagnon, Andrew C.
acpagnon@cpp.edu
Contents
1. Launching PSpice & creating a new project .................................................................................... 3
Launch Cadence: ........................................................................................................................ 3
Open Design Entry CIS ........................................................................................................... 3
Create a new project ................................................................................................................... 3
New Project ............................................................................................................................. 3
Add Project path ..................................................................................................................... 3
Enter project name .............................................................................................................. 3
Select Analog or Mixed A/D ................................................................................................... 3
Click <OK> on the “New Project’ pop-up window below ....................................................... 4
Create blank project ........................................................................................................... 4
2. Create a Schematic ........................................................................................................................ 5
Add Libraries ........................................................................................................................... 5
Select Place part icon .......................................................................................................... 5
Select the add Library Icon ................................................................................................... 5
Browse for Libraries ................................................................................................................. 6
Select all Libraries ................................................................................................................ 6
Add Libraries ........................................................................................................................ 6
Placing parts ............................................................................................................................ 6
Adding a resistor part and rotating it ............................................................................... 6
Adding an NMOS transistor............................................................................................... 7
Adding a ground: ............................................................................................................... 8
Create the intermediate schematic shown below: ........................................................... 9
Connecting parts with wires....................................................................................................... 10
Adding wires: ................................................................................................................... 10
Drawing wires (shown below) ......................................................................................... 10
Add wires to connect the following circuit ..................................................................... 11
Naming wires: ................................................................................................................... 11
Modifying Properties .............................................................................................................. 13
Select and change Resistor Component value ................................................................... 13
Select and change Voltage Source value ........................................................................... 13
Sampling of notations that PSPICE recognizes .................................................................. 13
Save schematic ..................................................................................................................... 13
3. DC Bias Simulation ....................................................................................................................... 14
Creating a Variable ................................................................................................................ 14
Enter component variable value ..................................................................................... 14
Add Variable definition part PARAM ................................................................................... 14
Exit create variable command......................................................................................... 14
Enter Variable property name and value in PARAM........................................................ 14
Placing Current and Voltage Probes ...................................................................................... 16
1
Place voltage probes to plot voltages or current probes for currents. .............................. 16
DC sweep with a Nested Parametric sweep simulation ............................................................. 17
Create a simulation profile .............................................................................................. 17
Edit Primary Sweep Parameters ........................................................................................ 18
Edit Parametric Sweep Parameters ................................................................................ 19
Simulate ......................................................................................................................... 20
Netlist Generation ........................................................................................................... 21
Errors – Session Log ...................................................................................................... 21
Parametric Sweep options .............................................................................................. 22
Add simulation traces ..................................................................................................... 22
Simulation waveform window.......................................................................................... 23
Export simulation data to Excel ....................................................................................... 23
4. Excel Data Analysis – Plot data .................................................................................................... 24
Plot excel data ....................................................................................................................... 24
Format Excel data .......................................................................................................... 24
Plot Data ............................................................................................................................ 26
Analyze excel data (Load Line analysis) ............................................................................ 28
Design Bias circuit parameters ........................................................................................... 28
5. Bias Point Simulation .................................................................................................................... 29
Replace the parametric sweep Voltage source with 2 resistor bias circuit .............................. 29
Modify schematic ............................................................................................................... 29
Run Bias Point Simulation ..................................................................................................... 30
Edit Simulation profile ........................................................................................................ 30
Run Simulation ................................................................................................................... 30
6. Time Domain (Transient) Simulation ............................................................................................. 32
Replace 2 resistor bias circuit with AC Voltage Source VSIN/SOURCE................................. 32
Modify Schematics ............................................................................................................. 32
Run Time Domain (Transient) Simulation .............................................................................. 33
Edit Simulation profile ........................................................................................................ 33
Run Simulation ............................................................................................................... 34
7. Quiz 7 – May 23th 2018 ................................................................................................................. 36
2
How to use PSPICE – Schematic design, simulation, analysis
3
Click <OK> on the “New Project’ pop-up window below
4
2. Create a Schematic
Add Libraries
Select Place part icon
Place part
icon
Add Library
icon
5
Browse for Libraries
In the Browse File pop-up menu select ‘Look in’
Local Disk (C:) Cadence/SPB_17.2/tools/capture/library/pspice
Select all Libraries
Click on the blank part of the window and hit <ctrl a> to select all the libraries (see below)
Add Libraries
Select Open to add the selected libraries (see below)
Add path
click here
and select
<ctrl a>
Placing parts
Adding a resistor part and rotating it
a. Search for Part
In the Place part pop-up menu enter the name of the part you wish to add (Here we have entered R)
IMPORTANT: You can find the part R in several libraries. Ensure all libraries are selected
Select the part R from the library Analog. (Notation: R/ANALOG)
b. Add the part
Hit <enter> to add the part
If the part was not in the design cache you will see a pop-up menu.
Hit <yes> If you should get this menu.
Move your cursor on the schematic to where you want to place the part.
Click r to rotate it
Click your mouse on the schematic screen to place the resistor
You will continue to be able to place parts that are of the type that you selected. Hit <esc> to end
placing parts.
c. Bindkeys for rotating or flipping
If you wish to rotate or flip a part as you place it use the following bindkeys
i. Rotate r
ii. Horizontal flip h
iii. Vertical flip v
6
Select the
part R from
the
ANALOG
library
7
Adding a ground:
g. Search for Ground/0
Select bindkey G OR click ground icon
Select: 0/CAPSYM
h. Place Ground
Hit <OK> to start placing the ground
Hit : <esc>to end the place ground part command
8
Create the intermediate schematic shown below:
i. Add 2 resistors R from the library ANALOG (rotated vertical)
j. Add 2 DC voltage sources Vsrc from the library SOURCE.
k. Add 1 NMOS transistor MbreakN from the library BREAKOUT
l. Note parts can be repositioned by dragging them.
After placing the parts you will need to connect them with wires (also called nets).
9
Connecting parts with wires
Adding wires: Place wire
m. Select wire tool icon
Select the Place wire icon (toolbar on rhs) OR use bindkey w
Drawing wires (shown below)
n. Start wire
Click your mouse at the starting position of your wire
o. Bend wire
Move (do not drag) your mouse to where you want a bend.
Click your mouse. (You may repeat this step for multiple bends)
p. End wire
Move (do not drag) your mouse to the end location click again.
q. Exit wire command
Hit the <esc> key to exit the place wire command.
r.
Click mouse (starting point)
Move mouse
Click mouse (bend)
Move mouse
Click mouse (bend)
Move mouse
Click mouse (end point)
Hit <esc> to end command
10
Add wires to connect the following circuit
Naming wires:
It is much easier to maintain a design if you name the wires (nets) on your schematic.
Try to create schematics that are readable and less cluttered with wires
IMPORTANT ideas
If wires have the same name (net alias) they are viewed as being connected
To simulate a PSpice schematic there needs to be a net named 0 (zero)
11
s. Name a wire (net):
iv. Create wire Name
Selecting bindkey n OR
Selecting the place net alias icon (right hand side toolbar) OR
Selecting the Place->net alias (top toolbar)
In the resulting pop-up menu enter the name (Vin for this example)
v. Place wire name
Click your mouse on the net that you wish to name. (The input of the amplifier.)
Click your mouse again on the wire at the top of one of the two voltage sources
vi. End name command
Hit <esc> to end the place net alias command
Note: do NOT use the place text icon. PSpice text offers no functionality. It is, however, helpful for
annotating schematics with comments.
Place net
alias icon
Place text
icon
12
Modifying Properties
Select and change Resistor Component value
Double click the value of resistors (1K) R1 and R2.
Change them to 470 and 150
Click <OK> to close the window.
Select and change Voltage Source value
Double click the DC value of the voltage source (source V2) (DC=)
Change it to be 15V, click <OK> to close the window.
Right Click on M1 a select “Edit Spice Model”
An “AMS Model Editor” window should open. May be minimized.
Type “Kp=9m Vto=0.7V” after “.model Mbreakn NMOS” (don’t type in a new line)
Click on “Save Library” icon
Save schematic
From the main menu: File->Save
Your schematic is now complete!
13
3. DC Bias Simulation
Creating a Variable
Enter component variable value
Double click on the DC= of the voltage source V1
Change it to the equation {ving*1V} (curly brackets are needed)
ving is a variable.
Add Variable definition part PARAM
Hit bindkey p and add the part PARAM from the library special.
This part defines variables
Exit create variable command
Click on <OK> to close the window and place the part
14
In the Add New Column window type the variable name
Give it a default value (as shown below)
Click OK to close the Add New Column window
Close window
15
Placing Current and Voltage Probes
Place voltage probes to plot voltages or current probes for currents.
Automatically plots results when a simulation is complete
Place a voltage probe at the output of the amplifier as shown below
Place current probe to plot the collector current.
Note current probes must be placed on the pins of devices (the very edge – look for the red/blue
transition)
16
DC sweep with a Nested Parametric sweep simulation
Create a simulation profile
Select Pspice->New Simulation Profile from the top toolbar
17
A Simulation Settings window will open (may be minimized)
18
Edit Parametric Sweep Parameters
Select Parametric Sweep (ensure it is checked)
Select Global Parameter
Specify the parameter you wish to sweep (ving)
Specify the range for ving (start: 1.5, stop: 6, Increment 0.75)
Click on <OK> to close the window
19
Simulate
Click on the run Pspice icon at the top of the schematic
Run
Pspice
icon
20
Netlist Generation
Pspice will generate a netlist of the schematic
Simulation
window
minimized
21
Parametric Sweep options
22
Simulation waveform window
The simulation waveforms will be displayed as below
23
4. Excel Data Analysis – Plot data
Plot excel data
Format Excel data
Open excel csv file
Select all cells (click on top right corner)
Right click on cell area and select “format cells”
Double
click to
format
cell
width
Click to
select all
cells
24
Create columns for Id in mA (multiply Id by 1000) and Vds (Vd-Vs) for each of the 7 Vg values
You can do this pretty quickly in Excel. For example for Vds (showing only 2 values below instead of 7)
Find the first free column (H in the example below)
Write Vds1 in the first row
In the second row write “=”, click on the first value from the “(V(M1:d))@1” column, write “-”, click on the
first value from the “(V(M1:s))@1” column. Type Enter
Double click on the bottom right corner of the cell (cursor should become a cross). This will autofill the
column.
Select all the cells filled in this column (including Vds1 on row 1)
Grab the bottom right corner of this selection and drag it right across 6 empty columns to auto fill them
Double
Click to
autofill
25
Plot Data
Create XY scatter plots for Id versus Vds in Excel with these steps:
Select the “Insert” tab and under “Charts” click on “Scatter with straight lines and Markers”
Right click on the new chart area and click on “Select Data”
26
Click on “Add” under “Legend Entries” and fill in the “Series name” (Id1), “Series X Values” by selecting
all the Vds1 values (column H in the example below) and “Series Y Values” by selecting the values in
Column B below. Hit OK.
Click “Add” 6 more times to repeat the “Select Data” process for Id2 to Id7
25
20
15
Ic (mA)
10
0
0 5 10 15 20 25 30
Vds (V)
27
Create XY scatter plots for Id versus Vo (Vd)
25
Vomin with Vdd=15V
20 Vg=1.5V
Vg=2.25V
15 Vg=3V
Id (mA)
Vg=3.75V Voq
10 Vg=4.5V
Vg=5.25V
5 Vg=6V
Vomax with Vdd=15V
load line
0 Linear (load line)
0 5 10 15 20 25 30
Vo (V)
28
5. Bias Point Simulation
Replace the parametric sweep Voltage source with 2 resistor bias circuit
Modify schematic
Remove “V1 voltage Source” and “Parameter”
Add 2 resistors (112.5K, 37.5K) for a 2-resistor Vg bias circuit to set Vg to about 3.75V
Note the large resistance values to minimize the impact on the NMOS bias current
Ensure M1 parameters are still KP=9m and VTO=0.7V
29
Run Bias Point Simulation
Edit Simulation profile
Analysis type = Bias Point
Run Simulation
u. Enable Bias Voltage Display
Run Enable Bias
Simulation Voltage Display
30
v. Enable Bias Current Display
Current Display
31
6. Time Domain (Transient) Simulation
Replace 2 resistor bias circuit with AC Voltage Source VSIN/SOURCE
Modify Schematics
Replace V2 with a VSIN/SOURCE part
Set VSIN parameters
VOFF = 5V (Offset voltage)
VAMPL = 5V (Peak Voltage)
FREQ = 1K (1KHz sinewave)
32
Run Time Domain (Transient) Simulation
Edit Simulation profile
33
Run Simulation
w. Open simulation window, right click and add traces V(Vin) and V(Vo)
34
x. Analyze Simulation Results
35
7. Quiz
The simulation is based on this exercise used in ece2200 class
Assume:
KN=9mA/V2
VTN=0.7V
Equations (when MOSFET is in Saturation.):
𝐾𝑛
𝐼𝑑 = ∗ 𝑉𝑑𝑠𝑎𝑡 2
2
𝑉𝑑𝑠𝑎𝑡 = 𝑉𝑔𝑠 − 𝑉𝑇𝑛
Determine R2 and R3 to bias M1 at midswing Vo
𝐾𝑛
𝐼𝑑𝑚𝑖𝑛 = ( ) ∗ 𝑣𝑑𝑠𝑎𝑡𝑚𝑖𝑛2
2
𝑚𝐴
𝐼𝑑𝑚𝑖𝑛 = 4.5 2 ∗ (2.1464𝑉)2 = 20.7316mA = 𝐼𝑑𝑚𝑖𝑛
𝑉
36