PSpice Guide 3-1

40
1 ECSE-2050 Introduction to Electronics: PSpice Guide Tristan Lawry January 23, 2010 Please send any questions, concerns, or corrections to [email protected] NOTE: The last two pages of this document contain a PSpice Quick Reference Sheet which you may want to print out and keep handy for HW problems.

Transcript of PSpice Guide 3-1

Page 1: PSpice Guide 3-1

1

ECSE-2050 Introduction to Electronics:

PSpice Guide

Tristan Lawry

January 23, 2010

Please send any questions, concerns, or corrections to [email protected]

NOTE: The last two pages of this document contain a PSpice Quick

Reference Sheet which you may want to print out and keep handy for

HW problems.

Page 2: PSpice Guide 3-1

2

Table of Contents

Creating a ew Project .................................................................................................................3

Schematic Editor Toolbar .............................................................................................................5

Select Tool ....................................................................................................................................6

Place Part ......................................................................................................................................7

Place Wire ..................................................................................................................................10

Label Wire/Net ...........................................................................................................................11

Place Ground ..............................................................................................................................13

Editing Component Properties ...................................................................................................14

Adding Global Parameters..........................................................................................................16

Simulation Toolbar ......................................................................................................................19

New Simulation Profile ..............................................................................................................20

Time Domain (Transient) .......................................................................................................20

DC Sweep ...............................................................................................................................21

AC Sweep/Noise ....................................................................................................................22

Bias Point................................................................................................................................23

Edit Simulation Settings .............................................................................................................24

Run PSpice .................................................................................................................................25

View Simulation Results ............................................................................................................31

Markers .......................................................................................................................................32

Bias Displays ..............................................................................................................................36

Fixing Undefined Model / nom.lib Problems .............................................................................37

PSpice Quick Reference Sheet ....................................................................................................39

Page 3: PSpice Guide 3-1

3

Creating a ew Project

1. Open OrCAD Capture (Design Entry CIS)

2. In some cases (depending on your installation/version) the software may prompt you for

a license. In this case enter ‘[email protected]’ in the file server field. If you are

using the ECSE department’s license server you will need to be connected to the RPI

network (through VPN if you are off campus) to use the tool. However, most of you will

not have to point to the license server. In addition – the tool may bring up a Cadence

Product Choices dialogue box:

3. If you see a window like this, select to use the tool with Design CIS option and check the

Use as default box at the bottom of the window, then click OK.

4. Once the software starts, go to File New Project. This should bring up the New

Project dialogue box:

5. Give the project a name

6. Select the location/folder where you want to store your project files (the Location field)

7. Check the Analog or Mixed A/D option – this will allow you to use the SPICE simulator

in addition to the schematic editor [If you don’t end up with any simulation related icons

in your project, it’s likely because you forgot this step]

8. Click OK and you should see the Create PSpice Project dialogue box:

Page 4: PSpice Guide 3-1

4

9. Select Create a blank project and click OK. The following environment should appear [I

have resized some windows so that you can see everything]:

10. The panel on the left with the header Analog or Mixed A/D is the project

organization/hierarchy window. Here you can add or remove schematic pages from your

project, and do many other things. For this course, however, you will not need to use this

window much at all.

11. The panel in the lower right is the Session Log where you will be able to see the output

from a number of different tools (you may need to look here if you have trouble netlisting

your schematic – any errors or warnings from netlisting will show up here, and should

give you a good clue as to what may be wrong with your schematic)

12. The panel in the upper right is the Schematic Editor which will be where you will place

components, wire up your schematic, etc. For now, enlarge the Schematic Editor

window to begin drawing your schematic.

Page 5: PSpice Guide 3-1

Along the right hand side of the design environment you will see a toolbar. You will primarily

use the top for tools listed below:

5

Schematic Editor Toolbar

Along the right hand side of the design environment you will see a toolbar. You will primarily

use the top for tools listed below:

Along the right hand side of the design environment you will see a toolbar. You will primarily

Page 6: PSpice Guide 3-1

1. The Select Tool is the default pointer, used to move items around. Typically pressing

Esc from any other mode will return you to the

6

is the default pointer, used to move items around. Typically pressing

Esc from any other mode will return you to the Select Tool

is the default pointer, used to move items around. Typically pressing

Page 7: PSpice Guide 3-1

2. Place Part (hotkey p) is used to

order to place them in the sche

a. The box on the left shows a list of parts in the libraries that you have selected in

the lower left Libraries list. If this is your first time using PSpice, you will have

to add the libraries avail

will bring up the file selection window on the right. Here, you should select all

files ending in .olb, and select Open. These libraries should now be accessible

from the Libraries list on the lef

libraries in the list on the left (a shift

available parts in the parts list. [Note: my library list will likely look different

than yours, but this shouldn’t matte

libraries from your installation]

b. Now, after highlighting all of the libraries, you can type

name of a part that you wish to place in your schematic

List and show any corresponding components.

be used to filter the Part List

but didn’t know what its part name is, you could search for *741* which will

all parts with 741 somewhere in their name.

list and find a resistor:

7

(hotkey p) is used to browse through the available part/component libraries in

order to place them in the schematic. The Place Part dialogue window is shown below:

The box on the left shows a list of parts in the libraries that you have selected in

the lower left Libraries list. If this is your first time using PSpice, you will have

to add the libraries available to your installation, by clicking Add Library, which

will bring up the file selection window on the right. Here, you should select all

files ending in .olb, and select Open. These libraries should now be accessible

from the Libraries list on the left. I would recommend highlighting all of the

libraries in the list on the left (a shift-click will work), so that you may browse all

available parts in the parts list. [Note: my library list will likely look different

than yours, but this shouldn’t matter, as long as you have added all available

libraries from your installation]

Now, after highlighting all of the libraries, you can type a portion

part that you wish to place in your schematic. This will

List and show any corresponding components. Wildcard characters (*) can also

to filter the Part List. For instance if you were looking for a 741 opamp,

but didn’t know what its part name is, you could search for *741* which will

all parts with 741 somewhere in their name. Below, I have typed ‘R’ to filter the

a resistor:

browse through the available part/component libraries in

matic. The Place Part dialogue window is shown below:

The box on the left shows a list of parts in the libraries that you have selected in

the lower left Libraries list. If this is your first time using PSpice, you will have

able to your installation, by clicking Add Library, which

will bring up the file selection window on the right. Here, you should select all

files ending in .olb, and select Open. These libraries should now be accessible

t. I would recommend highlighting all of the

click will work), so that you may browse all

available parts in the parts list. [Note: my library list will likely look different

r, as long as you have added all available

a portion of, or all of, the

. This will filter the Part

Wildcard characters (*) can also

. For instance if you were looking for a 741 opamp,

but didn’t know what its part name is, you could search for *741* which will find

typed ‘R’ to filter the

Page 8: PSpice Guide 3-1

8

c. All available parts beginning with R have shown up, however, the first entry

R/ANALOG is the resistor component that I was looking for. Selecting the

appropriate part and clicking OK will bring you into placement mode

d. Click anywhere on the Schematic Editor to place the component. If you wish to

rotate the component, you can press ‘R’ before you place it, or you can highlight

the component at any time after placement, and press ‘R’. Below I have placed

two resistors with two different orientations:

e. Note: Once you become comfortable with PSpice, you may want to save yourself

time and not use the Place Part tool all of the time. Instead, once you are familiar

with the component names that you want to place, simply type them into the text

box at the top of the Capture environment and hit enter. Functionally, this is

exactly the same as using the Place Part tool, however, you have to know the

exact name of the component you want to place. See below:

Page 9: PSpice Guide 3-1

f. As an example, I typed ‘C’ in the quick placement box to select a Capacitor, hit

enter, and then placed the capacitor in my schematic.

removed from the schematic, as i

placement box.

g. A list of commonly used part names

the PSpice Quick

9

As an example, I typed ‘C’ in the quick placement box to select a Capacitor, hit

enter, and then placed the capacitor in my schematic. This capacitor was then

removed from the schematic, as it was only added to illustrate the quick part

ist of commonly used part names and their relevant parameters

uick Reference Sheet at the end of this tutorial

As an example, I typed ‘C’ in the quick placement box to select a Capacitor, hit

This capacitor was then

t was only added to illustrate the quick part

and their relevant parameters are provided in

Page 10: PSpice Guide 3-1

3. The Place Wire tool is very straight forward. Clicking on this toolbar button (or pressing

the hotkey ‘w’) will enable you to place wires to connect the components in your

schematic. As your schematics grow, you may find the need to overlap some wires in

order to make all required connections. This is not a problem,

at the intersection of two wires means that they are connected. No purple dot implies that

they are not connected. See below:

10

tool is very straight forward. Clicking on this toolbar button (or pressing

the hotkey ‘w’) will enable you to place wires to connect the components in your

As your schematics grow, you may find the need to overlap some wires in

all required connections. This is not a problem, but be careful, a purple dot

two wires means that they are connected. No purple dot implies that

they are not connected. See below:

tool is very straight forward. Clicking on this toolbar button (or pressing

the hotkey ‘w’) will enable you to place wires to connect the components in your

As your schematics grow, you may find the need to overlap some wires in

but be careful, a purple dot

two wires means that they are connected. No purple dot implies that

Page 11: PSpice Guide 3-1

4. The Label Wire tool allows you to lab

help keep schematics clean, and minimize rats nest wiring. By clicking on the Label

Wire icon (or hitting the hotkey ‘n’),

a. Type the name you want to use to label a parti

click OK. Next, clicking on one or more nets throughout your design will add the

Alias you entered to that net in red text, see below:

b. Above, the DC voltage supply’s positive terminal was labeled ‘Vin’ and the

output between the resistive divider was labeled ‘Vout’.

c. Note: Two or more nets with the same net name are physically connected just as

if they had been wired together with the Place Wire tool:

11

tool allows you to label nodes/nets throughout your schematic. This can

help keep schematics clean, and minimize rats nest wiring. By clicking on the Label

Wire icon (or hitting the hotkey ‘n’), the Place Net Alias box appears:

Type the name you want to use to label a particular net in the Alias text box, and

click OK. Next, clicking on one or more nets throughout your design will add the

Alias you entered to that net in red text, see below:

Above, the DC voltage supply’s positive terminal was labeled ‘Vin’ and the

between the resistive divider was labeled ‘Vout’.

Two or more nets with the same net name are physically connected just as

if they had been wired together with the Place Wire tool:

el nodes/nets throughout your schematic. This can

help keep schematics clean, and minimize rats nest wiring. By clicking on the Label

cular net in the Alias text box, and

click OK. Next, clicking on one or more nets throughout your design will add the

Above, the DC voltage supply’s positive terminal was labeled ‘Vin’ and the

Two or more nets with the same net name are physically connected just as

Page 12: PSpice Guide 3-1

d. This can be particularly useful for connecting subcircuits that

different areas of your schematic page, or even on separate schematic pages.

12

This can be particularly useful for connecting subcircuits that are spread out on

different areas of your schematic page, or even on separate schematic pages.

are spread out on

different areas of your schematic page, or even on separate schematic pages.

Page 13: PSpice Guide 3-1

5. The Place Ground tool is critical, and ground

common problems I’ve seen with students who are beginning to use PSpice.

used to add a reference node for all voltages in your circuit, and neglecting to place a

ground in your circuit or placing the wrong ground from the available libraries in your

circuit will lead to many simulation problems.

the following Place Ground dialogue box:

a. This window will look almost identical to the Place Part

you have the CAPSYM library in your Libraries list, since this includes the

ground you will need to be using

Library and find capsym.olb. Once this is done, type ‘0’ (Zero, not the letter o) in

the Symbol field, and select the 0/CAPSYM part. This will allow you to place a

ground symbol in your circuit with the name

any net tied to that symbol has a potential of 0V.

ground symbol in your schematic wherever it is appropriate.

b. Note: Tying two separate nodes to the 0 ground is the same as physically wiring

those two nodes together and tying them to

to labeling two separate nets with the same name

which physically connects them in the schematic.

6. Placing Sources (Voltage, Current, Controlled, etc)

a. You can place all sources just as you would components with the Pla

or the Quick Part

library (e.g. VDC/SOURCE). If you enter the name of a source in the Quick Part

Placement field, it should pull the component from the SOURCE library

automatically.

b. A list of various sources and which simulations they will work with is provided in

the PSpice Quick Reference

13

tool is critical, and ground-related errors are some of the most

common problems I’ve seen with students who are beginning to use PSpice.

used to add a reference node for all voltages in your circuit, and neglecting to place a

ground in your circuit or placing the wrong ground from the available libraries in your

circuit will lead to many simulation problems. Clicking on the toolbar icon will bring up

following Place Ground dialogue box:

This window will look almost identical to the Place Part window. Make sure that

you have the CAPSYM library in your Libraries list, since this includes the

ground you will need to be using. If the CAPSYM library is not there, use Add

Library and find capsym.olb. Once this is done, type ‘0’ (Zero, not the letter o) in

the Symbol field, and select the 0/CAPSYM part. This will allow you to place a

ground symbol in your circuit with the name ‘0’, which will tell the simulator that

any net tied to that symbol has a potential of 0V. Click OK and place the 0

ground symbol in your schematic wherever it is appropriate.

Note: Tying two separate nodes to the 0 ground is the same as physically wiring

those two nodes together and tying them to a single 0 ground. This is very similar

labeling two separate nets with the same name, using the Name Wire/Net tool,

ally connects them in the schematic.

(Voltage, Current, Controlled, etc)

You can place all sources just as you would components with the Pla

Part Placement field. All sources should be used from the SOURCE

(e.g. VDC/SOURCE). If you enter the name of a source in the Quick Part

Placement field, it should pull the component from the SOURCE library

A list of various sources and which simulations they will work with is provided in

k Reference Sheet

related errors are some of the most

common problems I’ve seen with students who are beginning to use PSpice. This tool is

used to add a reference node for all voltages in your circuit, and neglecting to place a

ground in your circuit or placing the wrong ground from the available libraries in your

lbar icon will bring up

window. Make sure that

you have the CAPSYM library in your Libraries list, since this includes the

. If the CAPSYM library is not there, use Add

Library and find capsym.olb. Once this is done, type ‘0’ (Zero, not the letter o) in

the Symbol field, and select the 0/CAPSYM part. This will allow you to place a

‘0’, which will tell the simulator that

Click OK and place the 0

Note: Tying two separate nodes to the 0 ground is the same as physically wiring

d. This is very similar

using the Name Wire/Net tool,

You can place all sources just as you would components with the Place Part tool

Placement field. All sources should be used from the SOURCE

(e.g. VDC/SOURCE). If you enter the name of a source in the Quick Part

Placement field, it should pull the component from the SOURCE library

A list of various sources and which simulations they will work with is provided in

Page 14: PSpice Guide 3-1

14

Editing Component Properties

1. You can edit the properties of simple components, like passive elements (R, L, C) and

sources, by double-clicking on the displayed property value. This will bring up a Display

Properties dialogue box as shown below:

a. In the Display Properties window, you can change the Value field to alter the

value of the component property. In the example above, the R1 resistance (which

was previous 1kΩ) is changed to 10MΩ.

b. In the Display Properties window, you also have the option to change the Display

Format of the property. Typically only its value is shown (Value Only), but it

may be more convenient to display both the Name and Value of the property,

especially in cases where a component may have more than one property of

interest.

2. In addition, all component properties can be modified by double-clicking on the part

symbol itself. This brings up the following Property Editor window:

3. In the Property Editor many columns are displayed, each of which represents some

property of the component. Most of these properties will not be used, since they are

specific to the particular device model, package, library, etc. You should look for the

columns that corresponds to the properties of interest (most often this will be Value, IC –

initial conditions, DC – DC voltage or current value, etc) and modify the value below that

Page 15: PSpice Guide 3-1

15

column header. A list of common components and the properties you will need to be

aware of are presented in a table on the PSpice Quick Reference Sheet.

4. PSpice is very specific when it comes to interpreting power prefixes (e.g. kilo: k, milli:

m, etc). A list of these prefixes is presented in a table on the PSpice Quick Reference

Sheet for your convenience. Please review this table carefully, because many of the

prefixes are not immediately obvious. [For instance, you may be tempted to write ‘M’ for

Mega, however, since PSpice is not case-sensitive, ‘M’ is the same as ‘m’ (milli) and you

would be off by 9 orders of magnitude! Instead ‘meg’ should be used for Mega.]

Page 16: PSpice Guide 3-1

16

Adding Global Parameters

1. In many cases, you may wish to parameterize one or more aspects of your design and its

components. This can be used so that you can easily modify and update values in your

design. It can also be used to perform parametric sweeps within your simulation profile.

This is incredibly useful when trying to assess the effect of a particular component value

on the performance of your circuit (e.g. the effect of a capacitor’s size on the cutoff

frequency of a filter).

2. To parameterize a component value, go into the component’s properties and replace that

component value with ‘parameter_name’. The figure below shows an example where

a resistor’s value is replaced with ‘Rvar’ to signify that its value of resistance is now a

global parameter:

3. Next, a PARAM block has to be added to the schematic. Use the Place Part tool (or the

Quick Part Placement Field) to place a part called ‘PARAM’ somewhere on your

schematic. You should see the following:

4. After you place the PARAM block, you have to add all global variable names from

properties you have parameterized (any names in ). To do this, double-click on the

PARAM block to access its properties.

5. Inside the Property Editor window, you will have to add each variable as a new column

by clicking on New Column…

Page 17: PSpice Guide 3-1

17

6. Enter the name of the variable you wish to add (do not include the ), give the variable

an initial value (this is arbitrary, and can be changed later), and click Apply. Repeat this

process until all variables have been entered. Finally, close out of the Add New Column

window. The variables you added should now appear as columns in the Property Editor

window:

7. To make the newly entered parameters visible on the schematic page, you will need to

right click on the column header for that variable and select Display. This will bring up

the following window:

Page 18: PSpice Guide 3-1

18

8. Under Display Format select Name and Value and then click OK. Repeat this process for

every variable you added to the PARAM block, click Apply in the Property Editor, and

then close the Property Editor.

9. You should now see a name and value for each of the variables that you added

underneath the PARAMETERS header on the schematic:

10. Now you may change the parameterized values simply by changing their entries in the

PARAM block. This can come in handy if, for instance, you have 4 resistors that should

always be the same value, but you would like to sweep that value and see its impact. By

giving their values all the same variable name you only have to alter a single field in the

PARAM block in order to modify all of their values.

11. Any variables in the PARAM block can also be used in simulation sweeps which will be

discussed in more detail in the following section.

Page 19: PSpice Guide 3-1

Once you have completed placing all of your sources, components, and wiring, you will need

to simulate your circuit to assess its performance.

Editor you will find the simulation toolbar:

19

Simulation Toolbar

pleted placing all of your sources, components, and wiring, you will need

to simulate your circuit to assess its performance. Along the top edge of the Schematic

simulation toolbar:

pleted placing all of your sources, components, and wiring, you will need

Along the top edge of the Schematic

Page 20: PSpice Guide 3-1

1. This will allow you to create a new simulation profile for your circuit.

option will open the following dialogue box:

2. Give the simulation profile a name (it helps to be somewhat specific, for example

AC_sweep_1, or DC_operating_point, etc.) and click create. [Don’t change the

Inherit From option, it should be left as ‘none’]

should appear with the Analysis tab selected by default

3. The Analysis Type pull

would like to run with your circuit.

a. Time Domain (Transient)

and observe signals in time throughout your circuit. The

specifies when you would like the transient simulation to stop (

after 0 seconds). Specifying a value other than 0 in the

field allows you to only observe the data between the specified time and the

end of the simul

control the smoothness of your waveforms. For example, if you are trying to

observe a sine wave at 1kHz, specifying a maximum step size of 100us will

guarantee that you will have at least 10 dat

20

This will allow you to create a new simulation profile for your circuit.

option will open the following dialogue box:

Give the simulation profile a name (it helps to be somewhat specific, for example

or DC_operating_point, etc.) and click create. [Don’t change the

, it should be left as ‘none’] The Simulation Settings window

with the Analysis tab selected by default:

The Analysis Type pull-down list specifies the type(s) of simulation(s) that you

would like to run with your circuit. This list has 4 simulation options:

Time Domain (Transient) – this is shown above. This allows you to simulate

and observe signals in time throughout your circuit. The Run to time

specifies when you would like the transient simulation to stop (

after 0 seconds). Specifying a value other than 0 in the Start saving data after

field allows you to only observe the data between the specified time and the

end of the simulation. Specifying the Maximum step size field allows you to

control the smoothness of your waveforms. For example, if you are trying to

observe a sine wave at 1kHz, specifying a maximum step size of 100us will

guarantee that you will have at least 10 data points per period of that wave.

This will allow you to create a new simulation profile for your circuit. Selecting this

Give the simulation profile a name (it helps to be somewhat specific, for example

or DC_operating_point, etc.) and click create. [Don’t change the

The Simulation Settings window

pe(s) of simulation(s) that you

This list has 4 simulation options:

this is shown above. This allows you to simulate

Run to time field

specifies when you would like the transient simulation to stop (some point

Start saving data after

field allows you to only observe the data between the specified time and the

field allows you to

control the smoothness of your waveforms. For example, if you are trying to

observe a sine wave at 1kHz, specifying a maximum step size of 100us will

a points per period of that wave.

Page 21: PSpice Guide 3-1

21

b. DC Sweep – This performs a standard DC simulation of your circuit, with the

additional option of sweeping a design parameter. The swept parameter can

be specified as one of the following:

i. Voltage Source – Enter the name of the voltage source (e.g. ‘V1’)

ii. Current Source – Enter the name of the current source (e.g. ‘I1’)

iii. Global Parameter – Enter the name of a global parameter from a

PARAM block in the schematic (do not include the )

iv. Model Parameter – You will not need to use this in this course

v. Temperature – You will not need to use this in this course

Once the sweep variable is selected, its sweep values can be specified in the

Sweep Type region of the Simulation Settings window. Three options exist:

i. Linear – A linear sweep of the selected variable from Start value to

End value with steps specified by the Increment value (e.g. sweep

Rvar from 1k to 10k with an increment of 1k)

ii. Logarithmic – A logarithmic sweep of the selected variable from Start

value to End value. Points/Decade specifies the number of data points

you want to include in the sweep for every factor of 10 that the sweep

variable increases by.

iii. Value list – Here you can enter a comma-separated list of specific

values you would like to use for the swept variable

Page 22: PSpice Guide 3-1

22

c. AC Sweep/)oise – This will simulate your circuit in the AC domain, across a

range of frequencies. You can specify a linear or logarithmic sweep of the

frequency, where you can specify a starting and ending frequency for the

sweep, as well as a the number of data points to use (linear) or the number of

data points per decade (logarithmic) to collect. For this course, you will not

need to enable the Noise Analysis option. You may, however, wish to keep

some DC operating point information (especially when you start to simulate

the small-signal behavior of single-transistor amplifiers), and checking the

box in the Output File Options section will tell the simulator to save that

information and dump it to a Simulation Output File, which you can access

from the Allegro AMS Simulator window. The Simulation Output File is

discussed in more detail in the Run PSpice section of this document.

Page 23: PSpice Guide 3-1

23

d. Bias Point – This will only perform a single DC operating point analysis on

your circuit based on any DC sources present. You can use the Bias Voltage

Display, Bias Current Display, and Bias Power Diplay tools on the schematic

once this simulation has been run to display information about node voltages,

device terminal currents, and component power dissipation. If you check the

‘Include detailed bias point information…’ option, any MOSFET or BJT

operating point information will be dumped in the Simulation Output File

which you can access from the Allegro AMS Simulator window. The

Simulation Output File is discussed in more detail in the Run PSpice section

of this document.

Page 24: PSpice Guide 3-1

1. This will allow you to e

Selecting this should bring up the Simulation Settings window with any options you

had configured before in it.

24

This will allow you to edit previously created simulation settings for your circuit.

Selecting this should bring up the Simulation Settings window with any options you

had configured before in it.

dit previously created simulation settings for your circuit.

Selecting this should bring up the Simulation Settings window with any options you

Page 25: PSpice Guide 3-1

1. This will use the configuration specified in the Simulation Settings window, n

your circuit (translate your graphical schematic to a text

SPICE simulator), and run your simulation.

2. If some portion of the netlist generation fails, you should see the following warning:

3. Click OK, and view the Session

how you might be able to fix it. A very common mistake is forgetting to put a ground

in your circuit (or placing the wrong ground symbol in your circuit). This will

typically result in the following Session

4. Notice the WARNING line with the text ‘Your design does not contain a Ground (0)

net.’ Messages like these should help you debug your schematic quickly. In some

instances, the errors or warnings may be more cryptic

for the problem or get in contact with a TA to help you figure the situation out.

5. Once all critical warnings and errors have been addressed, clicking on Run PSpice

should cause a successful netlist generation, and open up the Allegro AMS Simulator

window:

25

This will use the configuration specified in the Simulation Settings window, n

your circuit (translate your graphical schematic to a text-based format useab

SPICE simulator), and run your simulation.

If some portion of the netlist generation fails, you should see the following warning:

Click OK, and view the Session Log window to debug what the problem was, and

how you might be able to fix it. A very common mistake is forgetting to put a ground

in your circuit (or placing the wrong ground symbol in your circuit). This will

typically result in the following Session Log error:

Notice the WARNING line with the text ‘Your design does not contain a Ground (0)

net.’ Messages like these should help you debug your schematic quickly. In some

instances, the errors or warnings may be more cryptic – just do a quick google

for the problem or get in contact with a TA to help you figure the situation out.

Once all critical warnings and errors have been addressed, clicking on Run PSpice

should cause a successful netlist generation, and open up the Allegro AMS Simulator

This will use the configuration specified in the Simulation Settings window, netlist

based format useable by the

If some portion of the netlist generation fails, you should see the following warning:

Log window to debug what the problem was, and

how you might be able to fix it. A very common mistake is forgetting to put a ground

in your circuit (or placing the wrong ground symbol in your circuit). This will

Notice the WARNING line with the text ‘Your design does not contain a Ground (0)

net.’ Messages like these should help you debug your schematic quickly. In some

just do a quick google search

for the problem or get in contact with a TA to help you figure the situation out.

Once all critical warnings and errors have been addressed, clicking on Run PSpice

should cause a successful netlist generation, and open up the Allegro AMS Simulator

Page 26: PSpice Guide 3-1

26

6. Typically you will see a black screen with no plotted data at first. This is because you

will need to select the voltages, currents, powers, component parameters, or

expressions that you wish to plot relative to your simulation. You can add voltages,

currents, and powers using the markers described later in this Simulation Toolbar

section.

7. You can also use Trace Add Trace which will bring up a large list of all possible

parameters that you can plot:

8. From here, you can select any parameters from the left, and use them in conjunction

with the functions/macros/arithmetic operators from the list on the right. For

example, the expression ‘DB(ABS(V(R2:1)/V(V1:+)))’ would find the ratio of the

voltage on resistor R2’s terminal 1, divide it by the voltage of voltage source V1’s

positive terminal, take the absolute value of this ratio, and then convert that to

decibels.

Page 27: PSpice Guide 3-1

27

9. Typically it’s difficult to tell which terminal is which on a particular device unless

you double-click on the terminal itself in the schematic. But that tends to be tedious

and time consuming. Instead, if you use the Label Wire/Net tool to give the

particular nets of interest descriptive names (like Vin and Vout), it’s much easier to

piece these expressions together:

10. You may wish to plot two trace expressions on very different scales (maybe one is a

power in mW, and the other is a gain on the order of 1000). When these traces are

added to the same plot, you will lose a lot of detail since they are separated by many

orders of magnitude. Instead, you can add another plot window using Plot Add

Plot to Window. Now you can plot on either window, or cut and paste plots between

windows to make viewing your results much easier:

11. To select a trace once it has been plotted, you have to click on the trace name located

underneath the plot window on the left:

Page 28: PSpice Guide 3-1

12. Once selected, you can cut

text in Windows, using

13. You can enable cursors on your traces by first selecting the trace of interest, and then

using Trace Cursors

the Allegro AMS Simulator window.

to set cursor A1, and right

read off the individual cursor values, or their differential value from the Probe Cursor

window in the bottom right

14. It is very likely that you will want to simulate your circu

default, once you re-run your simulation, all traces that you have added to your plot

will be erased and you will have to re

least. If you would like the traces that you have added to stay on the plot, and simply

update once you re-run the simulation, you should go to edit the simulation profile

(either using Simulatio

using the Edit Simulation Profile tool from the Schematic Editor window). One the

Simulation Settings window is open, go to the

right):

28

Once selected, you can cut, copy, and paste traces between plots just as you would

text in Windows, using ctrl+x, ctrl+c, and ctrl+v, respectively.

You can enable cursors on your traces by first selecting the trace of interest, and then

Cursors Display or using the icon from the toolbar at the top of

the Allegro AMS Simulator window. Now, you can left-click anywhere on the trace

to set cursor A1, and right-click anywhere else on the trace to set cursor A2. You can

read off the individual cursor values, or their differential value from the Probe Cursor

window in the bottom right where results are in x,y format:

It is very likely that you will want to simulate your circuit more than once. By

run your simulation, all traces that you have added to your plot

will be erased and you will have to re-enter them. This can be a huge pain, to

least. If you would like the traces that you have added to stay on the plot, and simply

run the simulation, you should go to edit the simulation profile

(either using Simulation Edit Profile from the Allegro AMS Simulator wind

using the Edit Simulation Profile tool from the Schematic Editor window). One the

Simulation Settings window is open, go to the Probe Window tab (all the way to the

just as you would

You can enable cursors on your traces by first selecting the trace of interest, and then

icon from the toolbar at the top of

ck anywhere on the trace

click anywhere else on the trace to set cursor A2. You can

read off the individual cursor values, or their differential value from the Probe Cursor

it more than once. By

run your simulation, all traces that you have added to your plot

enter them. This can be a huge pain, to say the

least. If you would like the traces that you have added to stay on the plot, and simply

run the simulation, you should go to edit the simulation profile

Edit Profile from the Allegro AMS Simulator window, or

using the Edit Simulation Profile tool from the Schematic Editor window). One the

Probe Window tab (all the way to the

Page 29: PSpice Guide 3-1

29

15. Under the Show area, check the Last Plot option. This will keep all of your

previously added plots open when you re-run your simulation, and should save you

quite a bit of time.

16. Finally, if you have saved any operating point information for your schematic, you

should be able to view a summary of device operating points in the Simulation Output

File, which can be accessed from the Allegro AMS Simulator window by selecting

View Output File. This should bring up a text file, and if you scroll down you

should be able to find a section called ‘OPERATING POINT INFORMATION’

which will tell you many of the large and small-signal characteristics of any

transistors in your circuit. Below is an example of a common-source MOSFET

amplifier schematic, and the operating point information from the simulation output

file:

Page 30: PSpice Guide 3-1

30

Page 31: PSpice Guide 3-1

1. This will bring up the Allegro AMS Simulation window and display any traces and

plots with data from the last simulation you ran. This is a quick way to switch back

to the plot window when viewing/editing the schematic.

31

bring up the Allegro AMS Simulation window and display any traces and

plots with data from the last simulation you ran. This is a quick way to switch back

to the plot window when viewing/editing the schematic.

bring up the Allegro AMS Simulation window and display any traces and

plots with data from the last simulation you ran. This is a quick way to switch back

Page 32: PSpice Guide 3-1

1. The four markers shown above can be used

powers that you wish to plot, by marking them in the schematic.

a. Clicking on the

markers on single nodes all throughout your circuit. For example, below I

have added two

i. If a simulation has been run, adding these markers will automatically

add the voltages selected to the active plot in the AMS Simulation

window.

them. The marker color corresponds to the waveform color that is

plotted in the Allegro AMS Simulation window

32

The four markers shown above can be used to signify particular voltage, currents, or

powers that you wish to plot, by marking them in the schematic.

Clicking on the Voltage Level Marker will allow you to click and place

markers on single nodes all throughout your circuit. For example, below I

ave added two separate markers to my schematic:

If a simulation has been run, adding these markers will automatically

add the voltages selected to the active plot in the AMS Simulation

window. The markers will change color automatically as you place

them. The marker color corresponds to the waveform color that is

plotted in the Allegro AMS Simulation window:

to signify particular voltage, currents, or

will allow you to click and place

markers on single nodes all throughout your circuit. For example, below I

If a simulation has been run, adding these markers will automatically

add the voltages selected to the active plot in the AMS Simulation

The markers will change color automatically as you place

them. The marker color corresponds to the waveform color that is

Page 33: PSpice Guide 3-1

33

ii. Although the blue waveform may be difficult to see, it is along the top

edge of the plot and stays at 10V throughout the sweep.

iii. Adding voltage markers is no different than adding traces in the AMS

Simulator window. However, it may be more convenient in some

instances since there is a direct color mapping between the plots and

the markers in your schematic.

b. Clicking on the Voltage Differential Markers will allow you to measure the

difference between two voltages in your circuit. You will be prompted to

place 2 markers – the voltage difference calculated will be the first marker

voltage minus the second marker voltage. Below, I have used the differential

markers to find the voltage drop across Rvar:

i. Here, the markers are automatically labeled as V+ and V- to help you

identify the polarity of the voltage difference being taken. In addition,

they are both the same color – the same color of the difference

waveform added to the AMS Simulator window:

c. The Current Marker can only be used on a terminal of a device in your

schematic. This is because the marker determines how much current is

Page 34: PSpice Guide 3-1

34

passing into that particular component terminal. Below, a current marker has

been added to determine the current flowing down through R2:

i. Similarly, this will add a current waveform to the AMS Simulator

window, and the color of the marker corresponds to the color of the

waveform:

d. The Power Dissipation Marker is used to determine the amount of power

dissipated in a particular component/device. This can only be used on certain

devices in the library (power supplies, resistors, etc.) and in order to use this

marker, you have to place it on the component symbol of interest (not a

wire/net/terminal). Below, I have added a power dissipation marker to

calculate the power lost in R2:

Page 35: PSpice Guide 3-1

35

i. Similarly, this will add a plot to the AMS Simulator window, and the

color of the marker and plot will be identical:

Page 36: PSpice Guide 3-1

1. These tools can be used to display node voltages, device terminal currents,

power dissipation on your schematic for a particular operating point. Below shows

the result of activating all three of these displays after running a DC operating point

simulation:

2. All operating point node voltages are highlighted in

connecting to the nodes that they represent. All operating point terminal currents are

highlighted in light-red with dashed lines connecting to the terminals that they

reference. Additionally, all operating point power dissipat

in blue with dashed lines connecting to the devices that they reference.

3. These display tools are a useful alternative to plotting for operating point analyses,

since plotting a single data point (voltage, current, or power) seems

36

se tools can be used to display node voltages, device terminal currents,

power dissipation on your schematic for a particular operating point. Below shows

the result of activating all three of these displays after running a DC operating point

All operating point node voltages are highlighted in dark-red with dashed lines

connecting to the nodes that they represent. All operating point terminal currents are

red with dashed lines connecting to the terminals that they

reference. Additionally, all operating point power dissipation levels are highlighted

in blue with dashed lines connecting to the devices that they reference.

These display tools are a useful alternative to plotting for operating point analyses,

since plotting a single data point (voltage, current, or power) seems unnecessary.

se tools can be used to display node voltages, device terminal currents, and device

power dissipation on your schematic for a particular operating point. Below shows

the result of activating all three of these displays after running a DC operating point

red with dashed lines

connecting to the nodes that they represent. All operating point terminal currents are

red with dashed lines connecting to the terminals that they

ion levels are highlighted

in blue with dashed lines connecting to the devices that they reference.

These display tools are a useful alternative to plotting for operating point analyses,

unnecessary.

Page 37: PSpice Guide 3-1

37

Fixing Undefined Model / nom.lib Problems

Many people may experience issues with missing models while simulating – for example, you

get an error similar to the following:

ERROR -- Model D1N4004 used by D_D1 is undefined

One correction to the pspice.ini initialization file can take care of this issue. First, locate the

initialization file. It will very likely be in the following folder:

…[OrCAD installation directory]…\tools\pspice

On my machine, the file is located in:

C:\OrCAD\OrCAD_16.2\tools\pspice\

Open up pspice.ini with any text editor, and make the following modifications.

1. Find the folder that contains the nom.lib file (you can use the windows search tool if

necessary). It should be located in the following folder:

…[OrCAD installation directory]…\tools\pspice\library

On my machine, nom.lib is located in

C:\OrCAD\OrCAD_16.2\tools\pspice\library

2. Find the line that begins with ‘LIBPATH=’ and add the full path to the nom.lib file to the

list of directories. Each directory list is separated by a semicolon, and you are free to add

the nom.lib directory to either the beginning or end of the list. As an example, below, I

have added the path to the beginning to the LIBPATH list:

[OLD]

LIBPATH=C:\OrCAD\OrCAD_16.2\tools\pspice\library;C:\OrCAD\OrCAD_16.2

[MODIFIED]

LIBPATH=C:\OrCAD\OrCAD_16.2\tools\pspice\library;C:\OrCAD\OrCAD_16.2\too

ls\pspice\library;C:\OrCAD\OrCAD_16.2

3. Next, find the section in pspice.ini that starts with the line ‘[PSPICE NETLIST]’.

Underneath this line there should be a line ‘LINE1=’ with either nothing after it or the

test ‘.lib “nomd.lib”’ after it. Change that line so that it reads:

LINE1 = .lib “nom.lib”

Page 38: PSpice Guide 3-1

38

4. If there is another section that starts with the line ‘[PSPICE DEMO]’, find it, and if an

entry exists with “nomd.lib” in it, change it to the following:

LINE1 = .lib “nom.lib”

5. Finally, save and close the pspice.ini file, and you should be good to go. The next time

you create a simulation profile, nom.lib should be added by default to the Configuration

Files Category:Library list, and you shouldn’t get any more undefined model errors.

Page 39: PSpice Guide 3-1

PSPICE QUICK REFERECE SHEET

Schematic Editor Toolbar

Tool Icon Hotkey

Select

None

Place Part/Source

p

Place Wire

w

Label Wire/Net

n

Place Ground

g

Component ame Part ame

Resistor

Capacitor

Inductor

Generic OpAmp OPAMP

OpAmp [LF351] LF351

Diode [1N4004] D1N4004

Zener Diode [1N751] D1N751

Bipolar NPN [2N2222] Q2N2222

Bipolar NPN [PN2222A] PN2222A

MOSFET N-Channel [2N7000] 2N7000

Source Part ame

DC Voltage Source

AC Voltage Source

Sinusoidal Voltage Source

DC Current Source

AC Current Source

Sinusoidal Current Source

Voltage-Controlled Voltage Source

Current-Controlled Current Source

Voltage-Controlled Current Source

Current-Controlled Voltage Source

Ground

Component ame Part ame Library

Ground 0 CAPSYM

39

PSPICE QUICK REFERECE SHEET (Front)

Power Prefixes

umber Prefix ame

109 ‘G’ or ‘g’ Giga

106 ‘MEG’ or ‘meg’ Mega

103 ‘K’ or ‘k’ Kilo

10-3

‘M’ or ‘m’ Milli

10-6

‘U’ or ‘u’ Micro

10-9

‘N’ or ‘n’ Nano

Common Components

Part ame Library Parameter(s) Description

R ANALOG Value Resistance Value

C ANALOG Value Capacitance Value

IC Initial Condition V

L ANALOG Value Inductance Value

IC Initial Condition I

OPAMP ANALOG GAIN Open Loop Gain (V/V)

VPOS Positive Supply Voltage

VNEG Negative Supply Voltage

LF351 NAT_SEMI - -

D1N4004 DIODE - -

D1N751 DIODE - -

Q2N2222 BIPOLAR - -

PN2222A BIPOLAR - -

2N7000 PWRMOS - -

Common Sources

Part ame Simulation Parameters Description

VDC DC DC DC Voltage (V)

VAC AC ACMAG AC Voltage Magnitude (V)

DC DC Voltage (V)

VSIN Tran FREQ Frequency (Hz)

VAMPL SIN Voltage Amplitude (V)

VOFF DC Offset Voltage (V)

IDC DC DC DC Current (A)

IAC AC ACMAG AC Current Magnitude (A)

DC DC Current (A)

ISIN Tran FREQ Frequency (Hz)

IAMPL SIN Current Amplitude (A)

IOFF DC Offset Current (A)

E DC, AC, Tran GAIN Vout/Vin (V/V)

F DC, AC, Tran GAIN Iout/Iin (A/A)

G DC, AC, Tran GAIN Iout/Vin (A/V or S)

H DC, AC, Tran GAIN Vout/Iin (V/A or

Library

CAPSYM

Resistance Value

Capacitance Value

Initial Condition VCAP(0-)

Inductance Value

Initial Condition IIND(0-)

Open Loop Gain (V/V)

Positive Supply Voltage

Negative Supply Voltage

Description

DC Voltage (V)

AC Voltage Magnitude (V)

DC Voltage (V)

Frequency (Hz)

SIN Voltage Amplitude (V)

DC Offset Voltage (V)

DC Current (A)

AC Current Magnitude (A)

DC Current (A)

Frequency (Hz)

SIN Current Amplitude (A)

DC Offset Current (A)

Vout/Vin (V/V)

Iout/Iin (A/A)

Iout/Vin (A/V or S)

Vout/Iin (V/A or Ω)

Page 40: PSpice Guide 3-1

PSPICE QUICK REFERECE SHEET (Back)

Simulation Toolbar

Tool Icon

New Simulation

Profile Edit Simulation

Settings

Run PSpice

View Simulation

Results

Markers

Bias Displays

40

PSPICE QUICK REFERECE SHEET (Back)

Hotkey

None

None

F11

F12

None

None