PSPICETutorial.pdf

OrCad Capture

Release 15.7

Robert J. Hofinger
Purdue University

1/15/08

(i)

Table of Contents

Part I – Capture

1. Introduction to PSpice

Computer Simulations ……………………………………………………………………………………………1
An Outline of PSpice ……………………………………………………………………………………………1
Types of Analysis Performed by PSpice ………………………………………………………………1

2. Getting Started with Orcad Capture CIS, Release 15.7

Starting a new project …………………………………………………………………2

3. DC Simulations

PSpice Component Layout …………………………………………………………..5
DC Bias Simulation ……………………………….…………………………………6
Linear Resistance ……………………………………………………………………………………………..8
Non-Linear Resistance ………………………………………………………………………………………10
Operating Point …………… ………………………………………………………………………………………12
Markers ……………………………………………………………………………………………………………13
Parametric DC Sweep ………………………………………………………………………………………..14
Thévenin and Norton Equivalents ……………………………………………………………………….18

4. AC Simulations

AC Inputs…………………………………………………………………………………………………………….20
Time Domain (transient analysis)……………………………………………………… 21
AC Sweep Analysis …………………………………………………………………………………………..24

5. Digital Simulations

Digital Simulations …………………………………………………………………………………………….27
Use of Digital Input Stimuli ………………………………………………………………………………..29
Use of Bus Wires ……………………………………………………………………………………………….32

6. Components

(ii)

Part II – Allegro

1. Introduction to OrCad PCB Editor

OrCad PCB Editor 15.7 ………………………………………………………………………………………. 34

(1) 1/16/08

1: Introduction to PSpice

In the past, students traditionally verified their laboratory electronic circuits by building them on
breadboards and measuring the various nodes with the appropriate laboratory equipment. By using a
computer simulation program, such as PSpice, students can obtain results before they come to lab.
Hence the laboratory experiments become reinforcement to the subject matter at hand.

The use of a computer simulation program allows the student to easily subject the circuit to various
stimuli (such as input signals and power supply variations) and to see the results in either a tabular
format or plotted out graphically using PSpice’s post processor called Probe.

An Outline of PSpice

PSpice simulates the behavior of electronic circuits on a digital computer and tries to emulate both
the signal generators and measurement equipment such as multimeters, oscilloscopes, curve tracers,
and frequency spectrum analyzers.

Types of Analysis Performed by PSpice

PSpice is a general-purpose circuit simulator capable of performing four main types of analysis: Bias
Point, DC Sweep, AC Sweep/Noise, and Time Domain (transient).

Bias Point
The Bias Point analysis is the starting point for all analysis. In this mode, the simulator calculates the
DC operating point of the circuit. Options include calculating the detailed bias points for all non-
linear controlled sources and semiconductors (.OP), performing sensitivity analysis (.SENS), and
calculating the small signal DC gain. (.TF)

DC Sweep
The DC Sweep analysis varies a voltage source over a range of voltages in an assigned number of
increments in a linear or logarithmic fashion.

AC Sweep/Noise
The AC Sweep/Noise analysis varies the operating frequency in a linear or logarithmic manner. It
linearizes the circuit around the DC operating point and then calculates the network variables as
functions of frequency. The start and stop frequencies as well as the number of points can be
assigned. Spice will compute the effective noise voltage spectral density that appears at the Output
Voltage node because of internal noise sources (.NOISE). In this analysis the detailed bias points for
all non-linear controlled sources and semiconductors (.OP) can also be performed.

Time Domain (transient)
The Time Domain (transient) analysis is probably the most popular analysis. In this mode, you can
plot the various outputs as a function of time. The starting and ending times for the various plots can
be input. The accuracy (smoothness) of the output plots can also be controlled by regulating the
maximum (time) step size.

(2)

2: Getting Started with Orcad Capture CIS, Release 15.7

You start a new project (program) by going to the File menu in the upper left corner, then New, and
then Project.

The following screen will appear. Be sure that the Analog or Mixed A/D button is activated. (see
figure below) Change it if necessary. This is VERY important.

You will need to fill in the top line Name with a file name (use Start-Up Example) and then the
bottom line Location with the path name. This is the directory where you will be storing your
“Project”.

Now the following screen will appear. Since you are starting a new project, change the button
settings as shown below. Activate the Create a blank project button and left-click OK.

(3)

Now you should come up to a blank schematic entry screen.

You can now start adding components and symbols to your schematic, by using the Place, Part…
menu sequence, or the special icon (the uppermost one) on the right hand toolbar.

The following screen will appear.

(4)

If all of the Libraries shown do not appear on your screen, and they probably won’t, go to Add
Library . There you will find a list of available libraries. For this first example, you will need the
analog.olb, the eval.olb, and the source.olb libraries. Add them now.

Note: that only parts from the Libraries that are highlighted are shown in the Part List window.

At this time, highlight all of the libraries. Then start entering your parts. When you have found the
required part, either by entering its name in the Part window or by highlighting its name in the Part
List window, left-click OK to place the part onto the schematic. You can continue left-clicking to
place multiple copies of the same part or right click to end this selection.

Practice now by entering the schematic shown below. Change the default values and orientations to
those shown below.

0

R1

100

V1
4Vdc

To change a value, or a reference, highlight the appropriate value (left-click) and then double left-
clicking. When you have added the resistor (R), and the power supply (Vdc) symbols, enter the
ground symbol labeled “0”, which is located in the “…./PSpice/source.olb” library. Recall that every
circuit has to have a node “0”. Left-click Apply and close the page.

You can rotate parts by highlighting the part (left-click) and bringing up the part menu (right click),
or by pressing the “r” key on the keyboard. See PSpice Component Layout description on the
next page.

Now its time to add the connecting wires.

Use the Place, Wire menu sequence or the icon on the right hand side toolbar. (second one from the
top) Connecting wires requires that you drag the “cross hair” over the end of the part and left-click.
This “solders” one end of the wire. Drag the wire to another connecting point and left-click again.
You have now “soldered” the other end.

You are now ready to simulate your circuit.

(5)

PSpice Component Layout

All two leaded passive components have an implied “1” end and a “2” end. Whenever you place a
component, it takes a default position, for example, a resistor, capacitor, or inductor will take a
default position with its “1” end to the left as shown in (a). A component may be rotated by
activating it, then right-clicking and selecting Rotate, or by typing the letter “r” (see example b).
Each rotation moves the component counterclockwise by 90º. To get the “1” end facing up, you
must rotate the component 3 times from its default position as indicated in (c)

1k

1

(b) First rotation (90 deg)

2 1k

1k

1k

1

1

12

2

2

(a) Default (c) Second rotation (90 deg) (d) Third rotation (90 deg)

PSpice utilizes the implied “1” and “2” ends for its handling of current directions and voltage
polarities, for example, it represents current as entering a device from its “1” end and leaving its “2”
end, and it represents a positive voltage at its “1” end with respect to its “2” end. Knowing about
component layout is important when you are viewing your results in Probe and especially important
when setting up initial conditions. For example if you set a capacitor’s initial voltage to 10V, PSpice
will place 10 volts across the capacitor with its “1” end positive with respect to its “2” end.

If you have placed the device in your circuit upside down, its polarity will be reversed from what you
expect. If this happens, disconnect its wiring, rotate it 2 times (to get it to the desired direction)
rewire, and reset any initial conditions.

(6)

DC Bias Simulation

To start the simulation process, open the PSpice menu. The first choice available is New
Simulation Profile. Left-click on it and the following window will appear.

Give the New Simulation a Name. For now use “Voltage Points”

Note: You could have done the same thing by left-clicking on the button on the toolbar.

Left-click Create and the next screen will appear

For a DC analysis, select the Bias Point setting in the Analysis type: window. Since we do not need
that process in this part of our example, go to the Probe Window tab, uncheck the box next to the
Display Probe Window setting and then left-click OK.

Now you are ready to Run a simulation.

(7)

Go to the PSpice tab and select Run.

The simulation window will appear. When the simulation has completed, close this window and the
schematic will reappear. When the V, I, and W tool buttons are activated, the results of the voltage,
the current , and the power dissipated in that component will be shown. The tool buttons alongside
the V, I, and W buttons allow you to alternately toggle a highlighted value OFF and ON

(8)

Linear Resistance

In this segment you will plot out the current vs. voltage characteristics of a linear resistor.

The resistor network is repeated below.

V1
4Vdc R1

100

0

As before, go to the PSpice tab, or the button, and create a New Simulation Profile. This time
give it the Name “Resistance”

The simulation profile setup for a DC Sweep is shown below.

Click OK to apply the values and close this window. Now re-run PSpice. When the circuit is
finished simulating, the Probe window will appear. The X-AXIS will already be set up with a scale
of -4V to +4V in increments of 1V. Left-click on the Trace menu or on the toolbar menu. This
brings up the Add Traces window. Highlight and left-click I(R1) to add it to the Trace Expression

(9)

line at the bottom of the screen. Left-clicking OK brings up the plot of the resistor current vs. the
resistor voltage.

If your resistor “curve” is negative that means your resistor is “backwards” in the circuit. Disconnect
the resistor, rotate it 180° and reconnect the wires. Re-simulate the circuit to get an image similar to
that shown above.

(10)

Non-Linear Resistance

In this segment you will plot out the current vs. voltage characteristics of a non-linear resistive
device, specifically the D1N4148 diode.

The diode network is shown below.

V1
10Vdc

R1

500

D1
D1N4148

0

Re-wire your circuit, change the values of the components, and add a 1N4148 diode.

Again create a New Simulation Profile. The simulation profile set up for a DC Sweep is shown
below.

Click OK to close this window and run PSpice. When the circuit is finished simulating, the
Probe window will appear. At that point, you will want to change the x-axis from V_V1 to
V1(D1). Pull down the Plot menu and click on the Axis Settings… option. This will bring
up the following menu.

(11)

Click on the Axis Variable button and then choose V1(D1). After you have chosen the x-
axis the above window will reappear. Now set the Data Range to User Defined and adjust
the settings to what you prefer. In the above example 0V to 1.0V was selected. When you
close this window, you can now select your Y-axis trace. Use the I(D1) selection to plot the
ID vs. VD diode characteristics.

(12)

Operating Point

In the previous section we used the variable voltage supply, V1, to plot the characteristics of a
1N4148 diode. Let us now add the load line to the above plot to find the operating point, commonly
called the “Q” point of the circuit.

Bring down the Trace menu and click on the Add trace… , or click the Add Trace icon on the
toolbar. This brings up the Add Traces window. In the Trace Expression box, using the double
brackets from the Analog Operators and Functions section on the right side of the window, include
the following expression [-2e-3*V1[D1]+20e-3]. Left Clicking OK adds the second straight line,
the load line, to the plot.

Activating the Toggle cursor Icon on the toolbar brings up the Probe cursor, along with the data
point window. When the cursors are placed on the point of crossing of the two plots, the results can
be seen on the first row. In this example V1(D1) = 760 mV and I(D1) = 18.485 mA.

(13)

Markers

In the two previous examples we chose the parameters to be displayed on the Y-Axis in the Add
Traces window.

In Probe, you have the ability to preset which parameters you want to display. On the Action
toolbar, there are four toolbar buttons that can be used for this purpose.

They are, from left to right: Voltage/Level Marker
Voltage Differential Marker(s)
Current Marker
Power Dissipation Marker

Placing one, or more, of these Markers on your schematic before running the Simulation
automatically sets up the Probe display.

Below is an example of adding the Current Marker .

V1
4Vdc R1

100

0

I

Now when you run your simulation, the Probe display with the result(s) will automatically appear.

(14)

Parametric DC Sweep

As an example of performing a parametric DC sweep, that is, varying the parameter or value of a
component, let’s find the power dissipated in a resistor as the value of that resistor varies and plot the
results.

You will recognize that this is the Maximum Power Transfer curve.

Starting with the basic schematic:

In to do a sweep of the values of resistor RL, you need to change its value from a fixed number
to a variable text. Say we call it {OHMS}

Note: the text OHMS is enclosed in curly brackets { }. OrCad will treat this as a parameter.

Now go to the Place Part menu, under the SPECIAL library, select a “part” called PARAM . If this
library is not on your list, you will have to add it using the Add Library… button. It is called
special.olb in the pspice folder. Now place this selected “part”(PARAM) near your “variable” load
resistor. Double left-clicking on it, brings up the Property Editor . Left-click on the New Column
button give the variable a name, in this case we are using the variable name OHMS, and a value (one
that is reasonable for your design). This value will be used as the default condition if you choose to
do another type of simulation on this design. Use the value 2. Apply it and then highlight this new
column. Left-click Display… and then activate the button labeled Name and Value. When you
close out the [Property Editor] your schematic should look like this:

(15)

To start the simulation process, open the PSpice menu. The first choice available is the New
Simulation Profile. Left-click on it and the following window will appear.

Give the New Simulation a Name. For now, use “Max Power Sweep”.

Left-click Create and the next screen will appear

(16)

Activate the Global parameter button and add the name of your parameter, without the curly
brackets, that you are sweeping. In this case it is OHMS. The sweep type will be Linear . Since you
will want to sweep the resistor value from 0 Ω’s to 30 Ω’s in steps of 1 Ω you will enter these values
in the appropriate places. Note that you could not enter a Start value of 0 Ω’s since this would result
in a divide by zero, which is illegal. If you try it you will get an error message. Go try it, run PSpice
and see the results. Instead, you can use 0.001 Ω, a small number close enough to 0.

If everything was entered correctly, the simulation will run without any errors, and the following
screen will appear:

Add a trace by left-clicking on the Trace menu or on the toolbar button:

This brings up the Add Traces menu. Since you are looking for the power dissipated in a resistor as
a function of its value, highlight the W(RL).

(17)

Left-clicking OK brings up the plot on the power vs. OHMS graph.

To confirm your result:

Left-click the Toggle cursor toolbar button: Then left-click the Cursor Max toolbar button.
(the leftmost one) The cursor will move over to the maximum point on the curve and in the Probe
Cursor window, the result A1 = 9.0010 (9.0 Ω) and 100.000 (100 watts) will appear.

(18)

Thévenin and Norton Equivalents

You can use the Bias Point simulation method to find the Thévenin and Norton equivalent circuits.
As you recall, the Thévenin’s Theorem states that any two-terminal bilateral dc network can be
replaced by an equivalent circuit consisting of an ideal voltage source and a series resistance, as
shown below.

Thévenin Equivalent

The voltage source Eth is also the “open circuit” voltage or Eoc. The resistance Rth is also the internal
resistance of the circuit Rint.

The Norton Equivalent circuit consists of an ideal current source and a series resistance.

Norton Equivalent

The current source IN is also the “short circuit” current or ISC The resistance RN is also the internal
resistance of the circuit Rint (as above)

With this in mind, you need to solve, i.e., run the OrCad circuit simulation, PSpice, three times; once
to find the “open circuit” voltage, once to find the “short circuit” current, and a third time to find the
“internal resistance”. Using the following circuit as an example

(19)

First, solving for the “open circuit” voltage, leads to VOC = 9.302 volts.

Note: the placement of the 100Meg Ω resistor across the output A-B. Since PSpice does not
simulate properly with a “floating” component, you can simulate an open connection by inserting a
very large resistor.

Second, solving for the “short circuit” current, leads to ISC = 58.97 mA.

Third, to solve for the “internal resistance”, since PSpice cannot measure resistances directly, you
have to do it indirectly. First set all internal sources to zero, i.e. voltage sources to “shorts” and
current sources to “opens”. Now connect a current source of 1 Adc to points A-B, the resultant
voltage at points A-B will be the “internal resistance”. In this example, Rint = 157.7 Ω.

This confirms our previous simulations since OCint th
SC

V 9.302 V
R R 157.7

I 58.97 mA
= = = = Ω

(20)

AC Inputs

Shown below are the five types of AC inputs, along with sample inputs:

VAC VSFFM

VSIN VPULSE

VPWL VEXP
VPWL_RE_N_TIMES
VPWL_RE_FOREVER

TABLE OF AC INPUT STIMULI

VAC – a sine wave input used for AC Sweep Analysis; that is for viewing an output as a function of
frequency.

VSIN – a sine wave input used for transient analysis; that is for viewing an output as a function of
time.

VSFFM – creates a Single-Frequency Frequency Modulation source.

VPULSE – creates a rectangular repetitive pulse having the parameters specified.

VPWL – an pulse input where you can create your own type of single pulse or triangular waveform.
Used in a transient analysis simulation. Points on the piecewise linear source are entered in the
Property Editor.

VPWL_RE_N_TIMES – is the VPWL repeated N times.

VPWL_RE_FOREVER – is the VPWL run continuously.

VEXP – Creates a single exponential waveform.

V8
1Vac
0Vdc

V4

V1

FM = 5kHz

VAMPL = 1V
VOFF = 0V

FC = 30MHz
MOD = 5V

V1

FREQ = 5kHz
VAMPL = 10V
VOFF = 2V V1

TD = 2ms

TF = 0.1us
PW = 5ms
PER = 10ms

V1 = 0V

TR = 0.1us

V2 = 5V

V2

TD1 = 7ms

V1 = 1V

TD2 = 15ms
TC1 = 1ms

V2 = 5V

TC2 = 5ms

(21)

Time Domain (Transient Analysis)

In the transient analysis mode simulation, you will be displaying the amplitude of an ac signal as a
function of time.

The example series RL circuit, being driven by an ac source, is shown below. Use the VSIN
component part for the voltage source V2.

1

2

L1
1mH

R2

100

R3
60

V2

FREQ = 1kHz
VAMPL = 1Vpk
VOFF = 0V

0

Vin Vout

Note, any time you simulate a circuit with an inductor, it is a good practice to include a series
resistance. The inductor model is an ideal model with no series resistance. When OrCad performs
any type of AC simulation, it first does a DC Bias simulation to calculate the quiescent (DC)
operating points. An inductor with no series resistance, i.e. a DC short circuit, could result in
erroneous results.

Before we can simulate, we must create a Simulation profile. As before, open the PSPice menu tab,
and create a New Simulation Profile. This time give it the Name “AC Transient”

(22)

The simulation profile setup for an AC Transient analysis is shown below.

We will be using the General Settings option. Since the AC generator was set to a frequency of
1kHz, I have set the Run to time to 3msec to display 3 complete cycles. Also I have chosen to
display approximately 100 points per cycle, therefore I have set the M aximum step size (under the
Transient options) to 10usec.

Click OK to apply the values and close this window. Now run PSpice. When the circuit is finished
simulating, an empty Probe window will appear. The X-AXIS will already be set up with a time
scale set to 3msec in increments of 0.5msec. Left-click on the Trace menu or the shortcut on the
toolbar menu. This brings up the Add Traces window. Highlight and left-click the outputs that you
would like to have displayed. I have chosen V(Vout), the voltage across inductor L1 and its series
resistance R3, and V(Vout) – V(Vin), the voltage drop across resistor R2, to add it to the Trace
Expression line at the bottom of the screen.

Note that I have created the second expression by doing a subtraction operation on V(Vout) and
V(Vin).

(23)

Left-clicking OK brings up the plot of both voltage drops as a function of time..

(24)

AC Sweep Analysis

In this mode you will be looking at the ac signals and using the results to determine the ac gain of the
circuit.

You will use the circuit shown in the following schematic.

V1
1mVac
0Vdc

0

0

0

0

Rs

1k

Rb
560k

Rc
4.3k

RL
2.7k

Cin

10uF

Cout

10uF

Q1

Q2N2222

V2

24Vdc

Vout
PHASE = OK
MAG = OK

Vs

PHASE = OK
MAG = OK

For the voltage source V1, use the VAC part. The VSIN part is used for the Transient Analysis
simulations.

Note the use of a new symbol: In the Part menu, this is listed as VPRINT1 (in the
SPECIAL library). This symbol is used to tell PSpice that you wish to include some characteristics
of this node in your output file.

Double-left clicking on the symbol will bring up the Properties Editor screen.

Under the column designated AC enter OK . Under the columns designated MAG and PHASE,
enter OK . Continue entering OK under any other characteristic that you wish to examine and record.
You don’t have to enter OK as I have. Entering anything will activate the property.

If you wish to display the name and/or the value of the characteristic on the schematic, as shown on
the input node Vs, highlight the column and press the Display… button.

The following screen will appear:

(25)

Here you can make your choices for displaying the symbol properties.

To start the simulation process, open the PSpice menu. The first choice available is New
Simulation Profile. Left-click on it and the following window will appear.

Give the New Simulation a Name. For this example, use “ac Gain”. Left-click Create and the next
screen will appear

Choose the AC Sweep/Noise under the Analysis type option. Since in this example we will be
looking at only one frequency, (i.e. 1kHz) set the AC Sweep Type as shown above. Under the
Probe Window uncheck the Display Probe Window setting.

(26)

Run the simulation and open the output file (either using the shortcut icon on the left side or under
PSpice, and View Output File). At the end of the output file you will find the AC Analysis results,
a portion of which is shown below.

**** AC ANALYSIS TEMPERATURE = 27.000 DEG C

*************************************************** ***************************

FREQ VM(VOUT) VP(VOUT)

1.000E+03 2.798E-03 -1.789E+02

**** 12/31/06 23:08:44 ******** PSpice Lite (July 2006) ******* ID# 10813 ****

** Profile: “SCHEMATIC1-ac Gain” [ F:Orcad Capture CIS, Release 15.7ac example-pspicefilesschematic1ac gain.sim]

**** AC ANALYSIS TEMPERATURE = 27.000 DEG C

*************************************************** ***************************

FREQ VM(VS) VP(VS)

1.000E+03 1.000E-03 0.000E+00

In this example, the frequency (FREQ), magnitude (VM) and phase (VP) are displayed for the output
signal node (Vout) and the input signal node (Vs).

Recall that for your reports, you can modify, add to, or delete anything from the output file, just as
you would with a text file (which it is). Hence we could calculate the ac gain and include it in the
simulation report.

(27)

Digital Simulations

After creating your new project, (as was described in page 1) we can now start the digital simulation
process. Open the PSpice menu. The first choice available is New Simulation Profile. Left-click
on it and the following window will appear.

Give the New Simulation a Name. For now we can use “Digital”.

Left-click Create and the next screen will appear

Notice that the Run to time: and the Start saving data after: times were set to 4.0 ms and 0 seconds
respectfully. This is because we will run our simulation from t = 0 to t = 4.0 ms.

Next go to the Options tab and set the Category: to Gate-level Simulation.

(28)

When simulating digital circuits that contain flip-flops or their derivatives, or circuits that contain
both analog components and digital flip-flops or their derivatives, you need to initialize the data
storage devices. In OrCad Capture, you do this by accessing the Options tab under the Simulation
Settings menu and then highlighting the Gate-level Simulation in the Category window. An example
is shown below.

On the …

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your paper today and save 30% with the discount code HAPPY

X
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 323 412 5597

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 30% with the discount code HAPPY