Вы находитесь на странице: 1из 20

PSpice 16.

6 Tutorial
Weidong Kuang
Department of Electrical Engineering
University of Texas Rio Grande Valley
September, 2015

This tutorial is designed for the beginning student interested in simulating and designing circuits
using PSpice in OrCAD 16.6 Lite software. Below is an overview of each lesson.
Lesson 1: DC bias point analysis
This lesson introduces you to the basics of DC bias. It goes over such concepts as connecting
circuit elements, setting values, and grounds. It shows you how to selectively place the
information on the schematic so that it is in a readable format.
Lesson 2: Transient Analysis Basics
Plot a output waveform in timing domain when an input signal is given.
Lesson 3: DC sweep
I-V curves and Voltage transfer characteristics (Vout vs Vin).
Lesson 4: Parametric sweep
Parametric analysis is one of the more useful features for design involving optimization of
circuits.
Lesson 5: Frequency response
This lesson introduces the AC Sweep function as a tool for creating bode plots of circuits.
Advanced markers are used for phase and magnitude measurers.

Lesson 1: The DC Bias Point Analysis


To get started, open Capture Lite Edition from wherever it is in the start menu. You should see
the following screen.

Open a new project:


pop-up. Specify the location for your project.

Unless you are just drawing a schematic for a presentation or for your reference, you want to
always select Analog or Mixed A/D. Schematic only allows you to layout the circuit while

Analog or Mixed A/D allows you to layout the circuit and simulate it. When you click OK after
giving the project a name (for this tutorial and others, they will be called tut#cir# where the first
# is the number of the tutorial in which the circuit can be found and the second # is the number
of the circuit within the tutorial itself), the following screen will come up.

To make things simpler on you, from now on just select Create a blank project and then click
OK. Then you should get a screen that is the one you will be working with to layout your circuits
and it should look similar (the locations of the toolbars may be different due to person
preferences and/or the size of the circuits used by the user).

This screen is the schematic layout that is used by Pspice 16.6. The toolbar on the right-hand side
of the screen is the one associated with building the circuits.
Draw schematic
I will now go over a very simple voltage divider circuit. Start by clicking the Place Part Button.
You should see the following screen. For the first time to run the software, the libraries box is
empty, and you need to add libraries.
Place parts and wires:
the ANALOG_P library twice.

From Man

Click on the Place Wire button and move your cursor over the circuit elements. The cursor has
changed from an arrow to a crosshairs. Each of the circuit elements that we are using has two
terminals. These are where we can connect it to other elements to make our circuit. The terminals
are the gray squares. Click on the gray square on the top of V1 (the voltage source) and then
move your mouse to pin number 2 of R2 or
the closest terminal of your circuit.

Change the values of part: The one thing we


have to go over now is how to change the
values on resistors. Double-click on the 1k
below R1. The following screen will appear:

Just enter the value of the resistor in the Value box. Consult with the chart for different units of
values. For example if you had a 46.7 microbox. The one you have to watch out for is mega-. If you just type in the letter m, you would put a
milliohm resistor in the circuit which would greatly affect the accuracy of your circuit. These
letters work on anything including voltages, currents, resistances, capacitance, inductances, and
wattages.
Now, double-click o
automatically recognize it as a voltage value so there is no need to put the V after it but if you
Simil
,
Simulation
Create a new simulation profile: Go to the Pspice
menu and select (about the only thing you can
select) New Simulation Profile. Enter the name:
tut1cir1_dc. Click create. You get a window with a
selected already) and change the Analysis Type to
Bias Point. (Some of the other ones will be
discussed in later lessons. Now click OK. We have
now told Pspice what it will do to simulate the
circuit.

Run simulation:
opens up. In the lower-left corner of that window you may or may not have gotten any errors. If
the last line says Simulation Complete, you had no errors. Close this window and go back to
OrCad Capture. Your circuit should now have voltages on it like the circuit below. In tool bar

Lesson 2: Transient Analysis Basics


Create a new project. This time get one resistor, one capacitor, and a voltage pulse source. Wire
them up such that it resembles the circuit below.

Create a new simulation profile and call it whatever you feel like (I used tut2cir1_transient).
Since we are dealing with a charging capacitor, we need to do a Time Domain (Transient)
analysis.

I will briefly go over the information on this screen. Run to Time tells PSpice how long to
simulate the circuit for. Start saving data after is if you want PSpice to ignore start-up variations
in the waveform. Maximum step size is very useful. What probe does is gets a bunch of data
points, displays them, and connects the dots. You can force PSpice to put more points in to get a
more accurate curve.
t you can always change them later. Click
OK
We should now tell PSpice that we want to see the voltage across the capacitor. Go to PSpice ->
Markers -> Voltage Level (we would choose voltage differential but one end of the capacitor is
connected to ground). You should see a thermometer with an afro under your mouse. Place one
on the wire between the capacitor and the resistor. If it obstructs any of the numbers, you can
rotate it like circuit elements.
Now, run the simulation (blue triangle). A new window should pop up with the following
graphic.
6.0V

4.0V

2.0V

0V
0s

1us

2us

3us

4us

5us

V(R1:2)
Time

6us

7us

8us

9us

10us

Lesson 3: DC Sweep
Create a new project: tut3cir1. Draw the following schematic.

Use these commands to draw the schematic


Place / Part
MbreakN NMOS transistor, library BREAKOUT
(MbreakP PMOS transistor)
Place / Ground 0
Library Source, you might have to add this library from PSpice
folder to find the ground symbol with the name 0, in SPICE
there has to be one node with the name 0 as an electrical
reference.
Place / Part
VDC DC voltage source, library Source
(IDC DC current source)
Place / Wire
connect components with wires
Place / Net Alias
add name to nets in your design and it will be easier to find signals or
connecting nets without actually drawing wires (VDD and VSS).
Nets with the same name are connected
Double-click on the symbol of NMOS in the schematic to start the Property Editor. Chose
Filter by: Orcad PSpice, select the row, right-click and choose Pivot if you want a vertical
column. Give value 0.5um and 50um to length (L) and width (W) of the transistor. Mark W and
press Display... select name and value, to make it visible in schematic. Do the same with L. (
0.5u means 0.5 m ). To be able to simulate this: change MbreakN to nMOS (property
Implementation). nMOS is the name we give the MOS model.

Next we need a SPICE model for the transistor and to connect the model to the actual transistor.
Highlight (left click to select it) the NMOS transistor, then go to the Edit
PSpice model. A
text, and save.
.model nMOS NMOS
+ LEVEL=1 VTO=0.7 GAMMA=0.45 PHI=0.9
+ NSUB=9E+14 LD=0.08E-6 UO=350 LAMBDA=0.1
+ TOX=9E-9 PB=0.9 CJ=0.56E-3 CJSW=0.35E-11
+ MJ=0.45 MJSW=0.2 CGDO=0.3E-9 JS=1.0E-8

If you have a PMOS transistor Mbreakp in your design, you need to set the pmos transistor
SPICE model in a similar way, but copy and paste the following text:
.model pMOS PMOS
+ LEVEL=1 VTO=-0.8 GAMMA=0.4 PHI=0.8
+ NSUB=5E+14 LD=0.09E-6 UO=100 LAMBDA=0.2
+ TOX=9E-9 PB=0.9 CJ=0.94E-3 CJSW=0.32E-11
+ MJ=0.5 MJSW=0.3 CGDO=0.3E-9 JS=0.5E-8
Simple DC sweep simulation
Create a new simulation profile: tut3cir1_dc_sweep.

Run simulation: plot Ids vs


VGS.
Now the design is ready to be
simulated!
PSpice / Run
button. A new window appears
(Probe Window) where
simulation results can be
plotted.
Trace / Add Trace... and select
I(D)
Tools options to change the
background color from black to
white. Right-click the trace,
select trace property to change
the trace color.

Window / Copy to
Clipboard . Use this instead of taking a screen shot to avoid the black background. It saves toner
or black ink when you are printing your reports!
You can make the program plotting this result immediately after simulation if you add a Current
marker at the drain pin of the transistor. (PSpice / Markers / Current Into Pin)
8.0mA

6.0mA

4.0mA

2.0mA

0A
0V

0.1V

0.2V

0.3V

0.4V

0.5V

0.6V

0.7V

0.8V

0.9V

1.0V

1.1V

1.2V

1.3V

ID(M1)
V_V1

Nested DC sweep simulation (multiple plots)


PSpice / New Simulation Profile and name it tut3cir1_nest_dc_sweep
Give values for
Primary sweep: VDS 0V to 3V with 0.01V step (this is one curve)
Secondary sweep: VGS 0V to 1.5V with 0.1V step (one curve for each VGS-value)

10mA

5mA

0A
0V

0.2V

0.4V

0.6V

0.8V

1.0V

1.2V

1.4V

1.6V

ID(M1)
V_VDS

1.8V

2.0V

2.2V

2.4V

2.6V

2.8V

3.0V

1.4V

1.5V

Lesson 4: Parametric Sweep


4.1 Multiple plots with parameters
Based on the project tut3cir1 in Lesson 3, we will plot Ids vs Vgs for different values of channel
width (W).

Create a parameter for the channel width, width:


1) Place a PARAM component on your
real component just a place to hold the
parameters that we create.2) Double-click the
PARAM block or right-click it and choose the
Edit Properties. This brings up the Property
Editor or spreadsheet for the component.
Sometimes it comes up as a row rather than a
column. If this happens, right-click in the empty
cell at the top left (to the left of A) and choose
Pivot. 3) Choose New property. . . , enter the
name of the parameter (width) and default value
(use its previous, fixed value of 50u). 4) select
the newly added row/column in the spreadsheet,
click the Display. . . button, select Name and
Value and finally click OK.

Use this parameter for the NMOS: 1) Double-click on the value of W.2) change the value from
50u to {width}.
The schematic shows the results.
Create a new simulation profile:
This time it is a good idea to base it on the previous profile, because we just want to add the
parametric sweep to it, so select DC-sweep in the Inherit From list. Enter DC-vary-width as the
name. Click OK, which brings up the usual Simulation Settings box.
Leave the existing DC Sweep as it is and check the box for Parametric Sweep. Select Global
Parameter for the Sweep variable and enter its name, width. Curly brackets are not needed here.
Choose a Linear sweep with a Start value of 10u, End value of 100u and increment of 20u. These
will override the default value of 50u in the parameter block. Finally, click OK.

Run the simulation.


15mA

10mA

5mA

0A
0V

0.1V
ID(M1)

0.2V

0.3V

0.4V

0.5V

0.6V

0.7V

0.8V
V_VGS

0.9V

1.0V

1.1V

1.2V

1.3V

1.4V

1.5V

4.2 Parametric sweep only


Create a new project: tut4cir1. The schematic is shown as follows.

1) Plot the voltage as a function of Rload using voltage/level marker button after simulation.
8.0V

6.0V

4.0V

2.0V
50

100

150

200

250

300

350

400

V(R2:1)
Rload

2) Plot the power as a function of Rload using power dissipation marker button after
simulation
250mW

200mW

150mW
50

100

150

200

250

W(R2)
Rload

300

350

400

Lesson 5: Frequency Response


This
is the RC filter shown as follows. A filter is typically used to remove cer tain frequencies from a
signal or pick out a frequency of interest. For example, a low-pass filter allows signals with low
frequency to pass unaffected but attenuates (makes weaker) high frequency signals. This might
be used to remove high-frequency noise from a signal that is known to vary slowly the
temperature of a room, for instance.
Create a new project ( tut5cir1) in Capture and draw this circuit. The source is a VAC and is in
the source library. I changed its name from V1 to Vin, which is more descriptive. Leave the
voltages at their default values.

The Analysis type is AC Sweep/Noise. Make sure that the AC Sweep Type is Logarithmic by
Decade, which should be the default. Frequency sweeps are almost always logarithmic because
this shows low and high frequencies equally well. Make sure that the range is suitable, based on
the Bode frequency that you calculated above. My entries may not be correct!
Put a voltage marker on Output and run the simulation. You should see a plot of the voltage as a
-pass filter). The frequency
axis is logarithmic, which means that successive labels have the values 1, 10, 100. . . .
1.0V

0.5V

0V
1.0Hz
V(R1:2)

3.0Hz

10Hz

30Hz

100Hz

300Hz
Frequency

1.0KHz

3.0KHz

10KHz

30KHz

100KHz

The behavior of the circuit is clearer if the voltage axis is also logarithmic. There is a button for
this or you can choose Plot > Axis Settings. . . from the menu bar. This makes the low-frequency
part of the plot into a straight line. I made the line thicker by selecting the trace, rightclicking and
choosing Properties. . . . Thicker lines (I usually choose the third) look ugly on the screen but
give a much better printout

The response of filters is traditionally plotted in decibels (dB). These are defined by voltage gain
in decibels = 20log10(vout/vin). The output of a filter often has a smaller magnitude that its
es negative in decibels. Here is the
easiest way of getting a plot in decibels. Return to Capture, remove the existing voltage marker,
and choose PSpice > Markers > Advanced > dB Magnitude of Voltage from the menu bar. Place
the marker on the output, run the simulation again and you will get a plot in decibels. (This
works correctly only if the input voltage is 1 Vac.) (note, you can use function DB() to plot
trace).
-0

-20

-40

-60

-80
1.0Hz
3.0Hz
DB(V(R1:2))

10Hz

30Hz

100Hz

300Hz

1.0KHz

3.0KHz

10KHz

30KHz

100KHz

Frequency

You should know that AC signals also have a phase. A filter changes the phase of a signal as
well as its magnitude and it can be useful to plot this too. Once you have completed the
magnitude plot, you will now need to create a phase plot. To put the plot on the same window for
convenience, go to Plot => Add Plot to Window. To graph the phase plot, use the PSpice P()
function. For example P(V[C1:2]/V[C1:1]).
The scales of both graphs are poorly chosen by default. Make the plot clearer by changing them.
Either double-click on the axis or choose Plot > Axis Settings. . . from the menu bar. Select User

Defined for the Data Range and enter more appropriate numbers. You might like to change the
grid as well.
100d

50d

SEL>>
0d
P(V(C1:2)/V(C1:1))
0

-50

-100
1.0Hz
3.0Hz
DB(V(C1:2)/V(C1:1))

10Hz

30Hz

100Hz

300Hz

1.0KHz

3.0KHz

Frequency

Add a parametric sweep to plot for capacitors of 1, 10, and 100nF.

10KHz

30KHz

100KHz

-50

-100
1.0Hz

3.0Hz
DB(V(C1:2)/V(C1:1))

10Hz

30Hz

100Hz

300Hz

1.0KHz

3.0KHz

10KHz

30KHz

100KHz

1.0KHz

3.0KHz

10KHz

30KHz

100KHz

Frequency

100d

50d

0d
1.0Hz

3.0Hz
P(V(C1:2)/V(C1:1))

10Hz

30Hz

100Hz

300Hz
Frequency

Вам также может понравиться