Upload
trinhnhu
View
224
Download
4
Embed Size (px)
Citation preview
Nurul Arfah Che Mustapha
1. Workshop’s Objectives
2. PSpice Introduction
3. Introduction to PSpice tutorial
4. PSpice Tutorial
Workshop’s Objectives
Workshop’s Objectives
1. To educate & introduce PSpice in basic level
2. To familiarized with the PSpice environment: Design components
Analysis types
Output Display
3. To able student use PSpice for circuit design & simulations
4. Most important: to gather as much info & tips to use this tools
Introduction to PSpice
Spice Circuit Simulation
Spice = Simulation Program for Integrated Circuit Emphasis
1. Developed at UC Berkeley in the ‘60’s 2. Common SPICEs include HSPICE, PSPICE, LTSpice and
B2SPICE. 3. It takes a circuit netlist and performs mathematical simulation
of the circuit's behavior. 4. A netlist describes the components in the circuit and how they
are connected. 5. Netlists are rather non-intuitive, and difficult to create, debug, and
modify.
PSpice Introduction 1. PSPICE uses a schematic capture program to
generate the netlist, so you simply have to draw your circuit in order to simulate it.
2. The PSpice simulator itself uses “netlists” (text files that contain the circuit description) as input.
3. Can perform DC level, AC frequency response, bias point and transient time domain simulations.
4. Allows simulation of circuits without building physical prototypes.
5. Its like your breadboard, without touching the real one.
Basic Steps for Simulation 1. Circuit Design : Component parts, sources, ground
2. Simulation : Analysis Types (time, voltage, frequency based?)
3. Output Results : Know your design & your intended results!!
4. Display the Results : Parameters that you want from the output, e.g: gain Av, slopes, bandwidth, etc
Short cut key: R = Rotate parts I = Zoomed-in O = Zoomed-out W = Wire P = to Place Parts @ find components Ctrl + X = Cut Ctrl + V = Paste Esc = to end current task F11 = to RUN the simulation G = GND N = to Name your wire Insert = Add Trace (simulation o/p)
Additional reminder: 1. Mega in PSpice = ‘meg’
2. PSpice accepts (m = e-3)
3. Its not a case-sensitive : ‘m’ as well as ‘M’ denote “milli” (1e-3)
4. Unit can be omitted: e.g: Change the resistor value to 1k
5. Change the resistor name to R_load (no spaces allowed!)
Introduction to PSpice Tutorial
Introduction to PSpice Tutorial 1. Opening PSpice
2. Drawing the circuit
3. Probe
4. Analysis Menu
5. Libraries & Types of Sources
Introduction to PSpice Tutorial 1. Opening PSpice
2. Drawing the circuit
3. Probe
4. Analysis Menu
5. Libraries & Types of Sources
1. Opening PSpice Orcad 16.0 > OrCAD Capture CIS > New > Project >
Name : RC ckt > Analog or Mixed A/D > Create a Blank Project
1. Opening PSpice Orcad Family Release 9.2 Lite Edition > Capture CIS
Lite Edition > New Project > Analog or Mixed A/D > Create a blank project
PSpice Schematics Editor (V 16.0)
PSpice Schematics Editor (V 9.0)
Introduction to PSpice Tutorial 1. Opening PSpice
2. Drawing the circuit
3. Probe
4. Analysis Menu
5. Libraries & Types of Sources
2. Drawing the Circuit a) Getting the Parts
b) Placing the Parts
c) Connecting the circuit
d) Changing the Name of the Part
e) Changing the Value of the Part
f) Making Sure You Have a GND
g) Voltage and Current Bubbles
h) Saving
i) Printing
2. Drawing the Circuit a) Getting the Parts 1. Click on the board
2. Press ‘P’ or
3. Click on the second icon from menu list.
2. Drawing the Circuit b) Placing the Parts Libraries Component
ANALOG R
SOURCE VDC
CAPSYM GND
R3
1k
R1
1k
V1
0Vdc
R2
1k
2. Drawing the Circuit c) Connecting the circuit Press ‘W’ or
click the third icon from menu list
R3
1k
R1
1k
V1
0Vdc
R2
1k
2. Drawing the Circuit d) Changing the Name of the Part 1. Double click on V1, change the name to Vsource .
2. Drawing the Circuit e) Changing the Value of the Part 1. Double click Voltage Source value, change to 15.
2. Double click Resistor value, change to:
Parts Value
VSource 15
R1 1k
R2 1.5k
R3 6.8k
R3
6.8k
R1
1k
VSource
15Vdc
R2
1.5k
2. Drawing the Circuit f) Making Sure You Have a GND 1. Make sure you have GND in circuit.
2. The name must always be zero, ‘0’.
3. Unsure where to put it?
-place it near the negative side of your voltage source. R3
6.8k
R1
1k
VSource
15Vdc
R2
1.5k
2. Drawing the Circuit g) Voltage and current marker
Place the voltage and current marker.
R3
6.8kV
R1
1kI
VSource
15Vdc
I VV
R2
1.5k
2. Drawing the Circuit h) Simulation 1. PSpice > New Simulation Profile ..or..
Click on the icon
2. Name the simulation: RSeries
3. Click Create.
2. Drawing the Circuit h) Simulation 4. Set the following value in simulation setting:
2. Drawing the Circuit i) Running a simulation 1. Click PSpice > Run ..or.. Press ‘F11’.. or.. Press the
triangle button.
2. Drawing the Circuit j) Understand the circuit
2. Drawing the Circuit k) Another way to view results 1. Click on the Bias Current and Bias Voltage
2. Drawing the Circuit k) Another way to view results
Introduction to PSpice Tutorial 1. Opening PSpice
2. Drawing the circuit
3. Probe
4. Analysis Menu
5. Libraries & Types of Sources
3) Probe a) Before you do the probe
b) To start the Probe
c) Graphing
d) Adding/deleting Traces
e) Doing Math
f) Labelling
g) Finding Points
h) Saving
3) Probe a) Before you do the probe:
You have to have your circuit properly drawn & saved.
There must not be any floating parts on your page (i.e. unattached devices).
You should make sure that all parts have the values that you want.
You have a ground on your circuit.
Make sure that you have done the Analysis Setup
3) Probe b) To start the Probe
Click on the simulation run button or F11.
It will check, to make sure you don't have any errors.
If you do have errors, correct them.
Then a new window will pop up. Here is where you can do your graphs.
VSource
15Vdc
R3
6.8k
R2
1.5k
R1
1k
3) Probe c) Graphing
If you don't have any errors, you should get a window with a black background to pop up (even with errors, it will be OrCAD PSpice A/D Demo).
3) Probe c) Graphing
If you did have errors, in the bottom, left hand side, it will say what your errors were (these may be difficult to understand, so go To "View - Output File").
3) Probe d) Adding/deleting Traces
PSpice will automatically put some traces in. You will probably want to change them.
Go to Trace - Add Trace or on the toolbar. Then select all the traces you want.
To delete traces, select them on the bottom of the graph and push Delete.
3) Probe e) Doing Maths
In Add Traces, there are functions that can be performed, these will add/subtract (or whatever you chose) the lines together.
Select the first output then either on your keyboard or on the right side, click the function that you wish to perform.
There are many functions here that may or may not be useful.
If you want to know how to use them, you can use PSpice's Help Menu.
It is interesting to note that you can plot the phase of a value by using IP(xx), where xx is the name of the source you wish to see the phase for.
3) Probe f) Labelling
Click on Text Label on top tool bar.
Type in what you want to write. Click OK
You can move this around by single clicking and dragging.
3) Probe g) Finding Points
There are Cursor buttons that allow you to find the maximum or minimum or just a point on the line. These are located on the toolbar (to the right).
Select which curve you want to look at and then select "Toggle Cursor" .
Then you can find the max, min, the slope, or the relative max or min ( is find relative max).
Introduction to PSpice Tutorial 1. Opening PSpice
2. Drawing the circuit
3. Probe
4. Analysis Menu
5. Libraries & Types of Sources
4) Analysis Menu a) Time Domain /Transient Analysis
b) DC Sweep Analysis
c) AC Sweep/ Noise Analysis
d) Bias Point Analysis
4) Analysis Menu Transient Analysis
PARAMETERS:
Rv al
0
Vin
R1
{Rv al}
C1
1n
Vout
Vin
TD = 0
TF = 0.1uPW = 25uPER = 50u
V1 = -5
TR = 0.1u
V2 = 5
Time
0s 50us 100us
V(Vout)
-5.0V
0V
5.0V
4) Analysis Menu DC Sweep Analysis
1. The DC sweep allows you to do various different sweeps of your circuit to see how it responds to various conditions. For all the possible sweeps:
Voltage
Current
Temperature
Parameter
Global
2. You need to specify a start value, an end value, and the number of points you wish to calculate.
4) Analysis Menu DC Sweep Analysis
V_Vin
0V 2.5V 5.0V
V(Vout)
0V
2.5V
5.0V
Vin
5Vdc
4) Analysis Menu DC Sweep Analysis Temperature
M1
Mbreakn
L = 0.13um
W = 1.3um
0
Id
Vds
1.2Vdc
Vgs
1.2Vdc
V_Vgs
150mV 200mV 250mV 300mV 350mV
ID(M1)
0.500uA
0.625uA
0.750uA
0.875uA
1.000uA
100 C
50 C
0 C
4) Analysis Menu AC Sweep/Noise Analysis 1. It allows you to plot magnitude versus frequency for
different inputs in your circuit. 2. In the AC sweep menu you have the choice of three types
of analysis: Linear Octave Decade
3. These three choices describe the X-axis scaling which will be produced in probe.
4. For example, if you choose decade then a sample of your X-axis might be 10Hz, 1kHz, 100kHz, 10MHz, etc....
5. Therefore if you want to see how your circuit reacts over a very large range of frequencies choose the decade option.
4) Analysis Menu AC Sweep/Noise Analysis
4) Analysis Menu AC Sweep/ Noise Analysis
To display a gain, |Av|: PSpice > Markers > Advance >
dB Magnitude of Voltage
To display a phase : PSpice > Markers > Advance >
Phase of Voltage
Frequency
10Hz 100Hz 10KHz 1.0MHz 100MHz 10GHz
P(V(VOUT))
-150d
-100d
-50d
-0d
(1.8102M,-87.172)
Phase Margin
5.3936 G
DB(V(VOUT))
-100
-50
0
50
SEL>>
f-3dB = 57.597 kHz
Av = 29.948 dB
-+
+
-
E3
E
GAIN = 0.5
d-+
+
-
E4
E
GAIN = 0.5
dd
0
0
0
0
INN
Vin1Vac
0Vdc
Vcm
0Vdc
INP
4) Analysis Menu Bias Point Analysis
Analysis type: Bias Point > Output Files
Introduction to PSpice Tutorial 1. Opening PSpice
2. Drawing the circuit
3. Probe
4. Analysis Menu
5. Libraries & Types of Sources
5) Libraries & Types of Sources:
5) Libraries
1. 10 Basic Libraries :
Analog, Source, Design
Cache, Op Amp, Eval, Gate,
Special, Breakout etc
5) Types of Sources: Voltage sources
Place Part (P) > add Library > Source > Open
a) VPULSE
b) VDC
Time
0s 20us 40us 60us
V(Vin)
-5.0V
0V
5.0V
Vpulse
TD = 0
TF = 0.1uPW = 25uPER = 50u
V1 = -5
TR = 0.1u
V2 = 5
Time
0s 50us 100us
V(Vin)
2.0V
4.0V
6.0V
8.0V
Vdc
5Vdc
5) Types of Sources: Voltage source
c) VPWL
d) VSIN
Time
0s 2.0us 4.0us 6.0us 7.5us
V(Vin)
0V
2.5V
5.0V
VPWL
Vsin
FREQ = 100kVAMPL = 5VOFF = 0
Time
0s 5us 10us 15us 20us
V(Vin)
-5.0V
0V
5.0V
5) Types of Sources: Current sources
Idc0Adc
Ipulse
TD =
TF =PW =PER =
I1 =I2 =
TR =
IsinIOFF =
FREQ =IAMPL =
Iac
0Adc
1Aac
Ipwl
5) Types of Sources: Negative Source (Ground)
0
Finish…
PSpice
Tutorial
Tutorial 1: RC Circuit DC Sweep Analysis
R1
1k
Vin
5Vdc C1
1n
0
Vin Vout
V
V_Vin
0V 2.5V 5.0V
V(Vout)
0V
2.5V
5.0V
Tutorial 2: Using Netlist to simulate 1. Open PSpice AD Lite > File > New > Text File
2. Write down the netlist file: EXERCISE1.CIR
*
Vpulse 1 0 PULSE(1 0 1ns 1ns 1ns 0.5us 1us)
Rres 1 2 50ohm
Cpulse 2 0 1nf
.TRAN 10ns 1us
.probe
.end
3. Save as EXERCISE1.CIR, run the circuit.
Tutorial 2: Understand the coding/netlist
EXERCISE1.CIR
*
Vpulse 1 0 PULSE(1 0 1ns 1ns 1ns 0.5us 1us)
Rres 1 2 50ohm
Cpulse 2 0 1nf
.TRAN 10ns 1us
.probe
.end
Rres
50
2
VPulse
TD = 1ns
TF = 1nsPW = 0.5usPER = 1us
V1 = 1
TR = 1ns
V2 = 0Cpulse
1n
1
0
Tutorial 2: Using Netlist to simulate 1. Open PSpice AD Lite > File > New > Text File
2. Write down the netlist file: EXERCISE1.CIR
*
Vpulse 1 0 PULSE(1 0 1ns 1ns 1ns 0.5us 1us)
Rres 1 2 50ohm
Cpulse 2 0 1nf
.TRAN 10ns 1us
.probe
.end
3. Save as EXERCISE1.CIR, run the circuit.
Tutorial 2: Using Netlist to simulate 4. Trace > Add Trace ..or.. Press ‘Insert’ button
Tutorial 2: Using Netlist to simulate 5. Select V(2) > OK
Tutorial 2: Using Netlist to simulate 6. Plot > Add Plot to Window >
Tutorial 2: Using Netlist to simulate 7. Press Insert ..or.. Add Trace > Select V(1)
Tutorial 3: RC Circuit
V1
TD = 0
TF = 0PW = 25uPER = 50u
V1 = -5
TR = 0
V2 = 5
0
Vin
R1
{Rv al}
C1
1n
Vout
Time
0s 50us 100us
V(Vout)
-5.0V
0V
5.0V
V(Vin)
0V
5.0V
-6.0V
SEL>>
Time
0s 20us 40us 60us 80us 100us
V(Vout)
-4.0V
0V
4.0V
-6.0V
6.0V
(50.153u,-4.0025)
(52.394u,4.0025)
(27.494u,-4.0025)
(25.253u,4.0025)
Tutorial 4: RC Circuit Parameter Sweep Place Part > Special > PARAM > New Row > Name:
Rval > Value : 1k > display
Double click R1 value > change to {Rval}
Transient > parameter sweep > Global Parameter > Name: Rval > Sweep from 1k to 5k increment 1k
0
Vin
R1
{Rv al}
C1
1n
Vout
Vin
TD = 0
TF = 0.1uPW = 25uPER = 50u
V1 = -5
TR = 0.1u
V2 = 5
Time
0s 50us 100us
V(Vout)
-5.0V
0V
5.0V
Time
0s 20us 40us 60us 80us 100us
V(Vout)
-5.0V
0V
5.0V
1k
1k
5k
5k
Tutorial 5: RC Circuit Vsin supply input
0
Vin
R1
{Rv al}
C1
1n
Vout
Vsin
FREQ = 20kVAMPL = 5VOFF = 0
Time
0s 20us 40us 60us 80us 100us
V(Vout) V(Vin)
-5.0V
0V
5.0V
Tutorial 6: RLC Circuit AC Sweep
0
C1
10p
Vout
R1
{Rv al}
L1
10nH
1
2
Iac
0Adc
1Aac
Frequency
400MHz 440MHz 480MHz 520MHz 560MHz 600MHz
DB(V(Vout))
30
40
50
60
Tutorial 7: RLC circuit Another way to display the gain To display a gain, |Av|: PSpice > Markers > Advance > dB
Magnitude of Voltage
To display a phase : PSpice > Markers > Advance >
Phase of Voltage
0
C1
10p
Vout
R1
{Rv al}
L1
10nH
1
2
Iac
0Adc
1Aac
VDB
Tutorial 8: CMOS Inverter
M1
MbreakN
M2
MbreakP
Vin Vout
0
0
V1
5Vdc
VddVdd
Vpulse
TD = 0
TF = 0.1uPW = 25uPER = 50u
V1 = 0
TR = 0.1u
V2 = 5
0
VVM1
MbreakN
M2
MbreakP
Vin Vout
0
0
V1
5Vdc
VddVdd
Vpulse
TD = 0
TF = 0.1uPW = 25uPER = 50u
V1 = 0
TR = 0.1u
V2 = 5
0
VV
Time
0s 20us 40us 60us 80us 100us
V(VOUT)
0V
2.5V
5.0V
V(VIN)
0V
2.5V
5.0V
SEL>>
Tutorial 9: CMOS Inverter Using Hierarchical Block Save all > New Schematic > Schematic Name : Inverter
>New Page (right click) > Page name : Inverter
Rename Schematic Internal,
Rename PAGE1 Internal
Tutorial 9: contd.. Make sure both of your page is correct
Tutorial 9: contd.. Save the design > right click on schematic: inverter >
make as a root
Tutorial 9: contd.. In Page: Internal > Place Hierarchical Port connector
to input and output inverter > Name: Vi, Vo > save
Tutorial 9: contd..
Tutorial 9: contd.. In Page: Inverter > Place hierarchical Block >
Vpulse
TD = 0
TF = 0.1uPW = 25uPER = 50u
V1 = 0
TR = 0.1u
V2 = 5
0
internal
internal
Vi VoVoutputVinput
Time
0s 40us 80us 120us 160us 200us
V(Voutput)
0V
2.5V
5.0V
V(Vinput)
0V
2.5V
5.0V
SEL>>
Tutorial 10: Integrator Op Amp
C1
1u
R1
1k
Iac
0Adc
1Aac
00
Vin
Vout
U2
uA741
+3
-2
V+7
V-
4
OUT6
OS11
OS25
V1
0.7Vdc
V2
0.7Vdc 0
+
-
+
-
C1
1u
R1
1k
Iac
0Adc
1Aac
00
Vin
Vout
U2
uA741
+3
-2
V+7
V-
4
OUT6
OS11
OS25
V1
0.7Vdc
V2
0.7Vdc 0
+
-
+
-
Frequency
1.0Hz 10Hz 100Hz 1.0KHz 10KHz
ABS(DB(V(Vout)/V(Vin)))
60
80
100
120