[go: up one dir, main page]

0% found this document useful (0 votes)
33 views37 pages

Cadence PSpice & Excel Simulation Guide

Uploaded by

serget1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views37 pages

Cadence PSpice & Excel Simulation Guide

Uploaded by

serget1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

SCHEMATIC ENTRY AND

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

1. Launching PSpice & creating a new project


Launch Cadence:
Open Design Entry CIS
Start→ type ‘cis’ → click on ‘Design Entry CIS’ or ‘Capture CIS’ → click OK on selection below

Create a new project


New Project
On the top toolbar select: File->New->Project
Add Project path
In your student account on the H: drive
in ‘Location’ click on ‘Browse’
Enter project name
For example ece2200l_m1
Select Analog or Mixed A/D
So you will be able to simulate

3
Click <OK> on the “New Project’ pop-up window below

Create blank project


In the pop-up menu select: Create blank project then click <OK>

4
2. Create a Schematic
Add Libraries
Select Place part icon

Place part
icon

Select the add Library 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

Adding an NMOS transistor


d. Search for NMOS transistor
Click hotkey p to place part
Select part MbreakN from the BREAKOUT library
click <OK> to close the window
e. Place the part
left click with your mouse to position the NMOS in your schematic window
click <esc> to stop placing the part
f. Common Editing Commands
p Place part w Create wire
^c Copy ^ c cut ^ v paste
r rotate
v flip vertically
h flip horizontally
<delete> delete
Parts can be repositioned by dragging them

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

Below are two equivalent schematics. Which is more readable/maintainable?

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.

t. Name the wires on your schematic as follows

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

Sampling of notations that PSPICE recognizes


PSpice Notation PSpice Notation
103 K E3 10-3 m E-3
106 Meg (not M) E6 10-6 u E-6
109 G E9 10-9 n E-9
10-12 p (pico) E-12
10-15 f (femto) E-15

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

Enter Variable property name and value in PARAM


On the schematic, double click on the word PARAMETERS.
You will see the window below.
Click on New Column (or New Row or New Property) - It is different for different versions
If prompted answer yes

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

Close the Property Editor Window (top right)


Now you are ready to simulate

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)

Voltage Current probe


probe

16
DC sweep with a Nested Parametric sweep simulation
Create a simulation profile
Select Pspice->New Simulation Profile from the top toolbar

Enter a name (like ece2200l_sim_m1)


Click on create to close the window

17
A Simulation Settings window will open (may be minimized)

Edit Primary Sweep Parameters


Select the analysis tab (it should be the default)
Select DC sweep analysis
Specify that you wish to sweep a voltage source
Specify the voltage source that you wish to sweep (V2)
this one is connected to the output of the amplifier
Specify the Start: 0, stop: 25 voltages as well as the voltage increment: 1
Note: Spice understands m to be 10-3

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

Errors – Session Log


If your simulation fails check for errors:
from top toolbar: Window->Session Log
If netlist runs successfully a simulation window will open (may be minimized as above)

21
Parametric Sweep options

Click on <OK> to run all seven parametric sweep simulations

Add simulation traces


Open the simulation window (if minimized) and right click on waveform screen
Select “add traces” and add the 4 waveforms I(M1:d) VG(M1) VD(M1) VS(M1)

22
Simulation waveform window
The simulation waveforms will be displayed as below

Export simulation data to Excel


Select File -> Export -> comma-separated values (.csv file) and click ok
Provide a file name (like ece299_sim_m1) and save in your H drive account

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

Grab and drag right across 6


empty columns to autofill them

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)

Analyze excel data (Load Line analysis)


Add a load line for Id versus Vo from Vomax (15V) to Vomin (5.26V)
Label 2 free columns as “VLoad” and “ILoad”
In the VLoad column enter the Vomin (5.26V) and Vomax (15V) values
In the Iload column enter the current at Vomin in mA (roughly the highest current with Vg=1.5V, about
20.95mA), and at Vomax (ILoad=0mA)
Add a new series to the Scatter plot with X axis Vload and Y axis ILoad

Design Bias circuit parameters


Graphically determine ideal DC bias point operating input and output parameters
Amplifier output voltage VOQ = about 10V
Amplifier output current IDQ= about 10mA
Amplifier input Voltage VINQ = Vg = about 3.75V

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

Analysis type = Time Domain (Transient)


Run To Time = 2ms
Maximum Step Size = 0.1m

33
Run Simulation
w. Open simulation window, right click and add traces V(Vin) and V(Vo)

34
x. Analyze Simulation Results

Linear/Triode Saturation CutOff


Vgs>Vtn Vgs>Vtn Vo=15V (max)
Vds<Vdsat Vds>Vdsat Vgs<Vtn=0.7V
Poor gain Maximum gain
VOQ
DC Bias Operating Point when
VIN=3.75V and VO=10V

Identify the 3 different NMOS transistor mode regions


Identify DC Bias Operating Point
𝑉𝑜 15−5
Identify Amplifier Gain = =2
𝑉𝑖𝑛 6−1

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

Vomax=15V when M1 is in cutoff and Id=0

Vomin at the onset of saturation when Vds=Vdsat


KVL from 15V supply rail to ground through M1
15𝑉 − 470Ω ∗ 𝐼𝑑𝑚𝑖𝑛 − 𝑉𝑑𝑠 − 150Ω ∗ 𝐼𝑑𝑚𝑖𝑛 = 0
15𝑉 − 620Ω ∗ 𝐼𝑑𝑚𝑖𝑛 − 𝑉𝑑𝑠𝑎𝑡𝑚𝑖𝑛 = 0
𝐾𝑛
𝐼𝑑 = ( ) ∗ 𝑉𝑑𝑠𝑎𝑡 2
2
𝑚𝐴
15𝑉 − 620Ω ∗ 9 2 ∗ 𝑉𝑑𝑠𝑎𝑡𝑚𝑖𝑛2 − 𝑉𝑑𝑠𝑎𝑡𝑚𝑖𝑛 = 0
𝑉
Vdsatmin = -2.5048V or 2.1464V.
Since M1 is on at Vomin, then Vdsatmin = 2.1464V>0V

𝐾𝑛
𝐼𝑑𝑚𝑖𝑛 = ( ) ∗ 𝑣𝑑𝑠𝑎𝑡𝑚𝑖𝑛2
2
𝑚𝐴
𝐼𝑑𝑚𝑖𝑛 = 4.5 2 ∗ (2.1464𝑉)2 = 20.7316mA = 𝐼𝑑𝑚𝑖𝑛
𝑉

𝑉𝑜𝑚𝑖𝑛 = 150Ω ∗ 𝐼𝑑𝑚𝑖𝑛 + 𝑉𝑑𝑠𝑎𝑡𝑚𝑖𝑛 = 150Ω ∗ 20.7316𝑚𝐴 + 2.1464𝑉 = 5.2561𝑉 = 𝑉𝑜𝑚𝑖𝑛

𝑉𝑜𝑚𝑎𝑥 + 𝑉𝑜𝑚𝑖𝑛 15𝑉 + 5.2561𝑉


𝑽𝒐𝒒(𝒎𝒊𝒅𝒔𝒘𝒊𝒏𝒈 𝑽𝒐) = = = 10.128𝑉 = 𝑉𝑜𝑞
2 2
15𝑉 − 𝑉𝑜𝑞 15𝑉 − 10.128𝑉
𝐼𝑑𝑞 = = = 10.366𝑚𝐴 = 𝐼𝑑𝑞
470Ω 470Ω
𝑚𝐴
𝐼𝑑𝑞 = 𝐾𝑛 ∗ 𝑉𝑑𝑠𝑎𝑡𝑞 2 = 10.366𝑚𝐴 = 4.5 2 ∗ 𝑉𝑑𝑠𝑎𝑡𝑞 2
𝑉

𝑉𝑑𝑠𝑎𝑡𝑞 = 1.5177𝑉 = 𝑉𝑔𝑠𝑞 − 𝑉𝑇𝑛 = 𝑉𝑔𝑠𝑞 − 0.7𝑉


𝑉𝑔𝑠𝑞 = 2.2177𝑉

𝑉𝑔𝑞 = 𝑉𝑔𝑠𝑞 + 150Ω ∗ 𝐼𝑑𝑞 = 2.2177𝑉 + 150Ω ∗ 10.366𝑚𝐴 = 3.7726𝑉 = 𝑉𝑔𝑞


𝑅3
𝑉𝑔𝑞 = 15𝑉 ∗
𝑅2 + 𝑅3
15𝑉 − 𝑉𝑔𝑞
𝑅2 = 𝑅3 ∗
𝑉𝑔𝑞
15𝑉−3.78𝑉
If R3=37.726KΩ, then 𝑅2 = 37.726𝐾Ω ∗ 3,78𝑉 = 𝟏𝟏𝟐. 𝟐𝟕𝟒𝑲Ω = 𝑹𝟐 and R2+R3=150KΩ>>R1+R4

36

You might also like