Introduction to PSPICE

winetediousElectronics - Devices

Oct 7, 2013 (3 years and 8 months ago)

99 views



1

INTRODUCTION

TO

P
SPICE



I.

OBJECTIVES

-
Start and invoke the necessary tools to run P
SPICE
.

-
Introduce the
P
SPICE

9.1 “student version”
circuit
simulation
part
.

-
Learn how to build circuits and simulation in time and frequency domains.


II.

ALL

ABOUT

P
SPICE



P
SPICE

V
9.1 is a user friendly

with a simple graphical interface

version of the well known

analog circuit simulator SPICE

“Simulation program for Integrated Circuits Emphasis”.
Other
versions of SPICE include B2SPICE
and HSPICE
which have

been used

for the same purpose as
PSIPCE

to mathematically simulate the circuit’s behavior. The common part among all circuit
simulation engine
s

is the script used to describe the circuit components and the connectivity
.
This script is known as the circuit
NETLIST

that

describes the topology of the circuit or
a

group
of

numbered nodes in a very simple
,

easy to learn
structure.

In general
,

any SPICE version can
evaluate the circuit behavior in DC, AC and Transient mode but t
he main difference between
HSPICE and PSPIC
E is the user friendly factor
. HSPICE require
s

the user to prepare and
compile the NE
TLIST while the PSPICE input simply
drag
s

and drop
s

all
circuit

elements

and
the rest

will be automatically generate
.


PSPICE student version V9.1 is available in WINDOW
S on

the

laboratory
Desktop
. You can
download the same version from
http://www.engr.uky.edu/~cathey/pspice061301.html



I
I
I.

G
ET

S
TARTED WITH

PSPICE

V9.1

(
STUDENT VERSION
)

Log into
your WINDOWS account and create a new folder on windows Desktop. Rename the
folder “Pspice1” as shown in figure 1. This folder will be used to save the circuits you will
shortly create using PSPICE.

Create a short cut for
C
apture

S
tudent

on windows deskt
op as

follows
:

-

Left click

once
on
Start

(
lower

left corner in figure1),

click

once on
all programs
,
then move
the

mouse
cursor
to

Pspice student

and
,

Capture Student
. At this moment
,

all the previous
selections are highlighted, without loosing this con
dition right click once on
Capture student

and
select

create shortcut

, click
Y
es

on the pop up window.






2


Figure
1

Windo
w
s Desktop


To open

the capture student, double click on the short cut and maximize

OrCAD capture,

as
show
n in f
igure 2
.

Now you are ready to input your own circuit and conduct the simulation

as
described in
the
steps

below:



Figure
2

Capture window



3

1
-

Click on the first menu’
s icon in figure 2 (
the arrow
is
point
ing to the icon), or c
lick on
File

menu and select
New

project…
….
Project window shown in figure 3 will appear.
The new project name will be the same

name “RCCIRCUIT”
given to the circuit you
intend to enter and simulate. Select
Analog or Mixed A/
D
,

click on Brows
e

to locate
the
folder Pspice1
,

then click OK to open another

window

en
title
d

Create Pspice
Project

as

shown in figure 4.

O
n this window select

Create a blank project


then hit OK.



Figure
3


New Project window



Figure
4




4

2
-

After you
click

OK,
a blank OrCAD Capture window
(
figure 5
)

with
a
grid and
Tool
Pallet will pop up.
If
you don’t see the Tool Pallet attached vertically to the left side of
the capture widow
,

click

anywhere

on the window to appear.



Figure
5


Before going further you need to know the function of each button o
n

the Tool Pallet. Please
examine carefully figure 6 and get familiar with
the
function of each button. Some of them
are essential to build electric and/or electro
nic circuits while other
s

look

similar to

the
ones
found in any paint brush application.
The brief definition of each Tool b
a
llet button is given
below in alphabetic
al

order:


A

End mode
,

this button will deactivate any active component selection mode.

B

Open
Place Part

window
.


C

Place Wire
mode.



D

Open

Place Power
Window
.


E

Open

Place ground
window
.


F

Place
Text
.




G

Voltage/Level Marker
.



5

H

Current Marker
.



K

Enable Bias Voltage Display.

N

Enable Bias Current Display.

M

Place Off
-
Page Connector.





G

H

K

N


M






Figure
6

Tool ballet



A

B

C








D

E






F

Place th
e components and connect the parts


4
-

Open P
lace P
art window (click on button B) then click on
Add Library

button, the
B
rowse

F
ile

window shown in figure 7 will open. Select all library file
s

then
,

press
O
pen.



Figure
7

Add to t
he project these Library files



6

Three

of the above library file
s will be used extensively
in electric/electronic

circuits,
the
Analog, the
S
ource and the Eval libraries.

Analog
:
co
ntains all passive elements RLC
, mutual

inductance, transmission line, and vo
ltage
and current dependent sources
.


E
val
:

contains all electronic devices

such as
Diodes (
D…..), Bipolar
transistors (
Q….)
, MOS

transistor, JFETs(J….), real OpAmp (u741), switches, various digital gates and components.

S
ource
:

contains all type of
inde
pendent voltage and current sources such as Vac, Vdc Iac, Idc,
Vsin, Vexp, Vpulse…..etc
. Make sure
to include at least

these three files with the project.

After addi
ng the library files, the
Place Part

window
,

shown i
n figure 8 will
open.

C
hoose the
parts

of the circuit

and

place

them
on the C
apture window. For example
,

we will select R part
and place it on the capture window as follow:

-

Select Analog
Library;

scroll up/down to locate R
,

once it
appears

in the designated block
press O.K.

-

The
Place P
art

window will close and the element you
selected will

be glu
ed to the
mouse cursor. One left click
on
the mouse will place one element on
the
capture window.
This process will continue until you deactivate this mode by clicking on button A.


Place
one R and
on
e C on the drawing area
. Rotate

C

90 degree
s
,
which

can be done by
selecting the element
,

then right click to open the menu that contains Mirror, Rotate…etc.

-

Place voltage source V
pulse

from source library

(Place Part)

in capture window.

-

Place a
GND
,

this can be done as follows: depress the
button E

(
figure6
)
, in the pop up
window
en
title
d

Place Ground

select
GND/CAPSYM
, the symbol of the circuit ground
will appear in the little
block at the

low

right corner
. Change what is written in the field

N
ame
:


from GND to 0

then c
lick
on
O.K. to place the element.


Figure
8


-

To connect the circuit elements press
button C

(figure 6), place
the wire cursor

“+”

on

one end of the element then left click once. Drag the wire to the point wh
ere you want to
connect and again left click once.

-

Add

Voltage Level Markers


button G

(figure 6) at the input and the output.




7

The final circuit must look like the one shown below.


Figure
9

RCCIRCUIT Project



Assign Values
and Numbers to the parts

5
-

Changing the values
/name

of the resistors, capacitors or any other elements can be done
by double
-
clicking on the number/name next to the element. As you finish a Display
Properties

window will pop up to allow you to enter the n
ew value or name. Press O.K. for
the replacement of the old value to take place. You can add text to your circuit such as
Input/Output, your name on the circuit…etc…… Press
button F

(figure 6) to activate text
mode.

Save the project.

The
values of element
s can be specified using scaling factors (upper or lower case):

T or Tera (=1E12);


G or Giga (=E9);


MEG or Mega (=E6);

K or Kilo (=E3);



M or Milli (=E
-
3);


U or Micro (=E
-
6);

N or Nano (=E
-
9);



P or Pico (=E
-
12)


F or Femto (=E
-
15).

Both upper and low
er case letter are allowed in PSPICE and HSPICE. For example a
capacitor of 220 picofarad can be written as:

220P; 220p; 220pF; 220pFarad; 220E
-
12; or 0.22N

Set the value

of capacitor to 22u, leave the default value

1K for R
, and set the parameters of the

Vpulse as follow:


V1

V2

TD:

Delay Time

TR:
Rise Time

TF:

Fall Time

TW: P.

Width

P
ER: P
eriod

0

4

0

1

u

1
u
Sec

100
m
Sec

200
m
Sec



8

Time Domain Analysis


6
-

From the
top menu of the OrCad Capture (figure9) click on
Pspice
from the pull
-
down menu
click on
New Simulation Profile
,
write

the name of the new simulation as shown in figure 10
.




Figure
10

New Simulation and Simulation Settings

Windows


Press
C
reate

to open the Simulation Settings window. Enter 200m in the Run to Time, then
apply and
press
O.K. Now you are ready to Run the simulation. There are two ways to start the
simulation: a) From the OrCAD Capture menu press
Pspice
,
then
R
un
.

b) On the Capture press ►

“Play button”.

If any error window appears, press O.K. then run again or press ► again
. Once you
have
done
this the simulation results window will pop up displaying
all wave

forms that currently exist on
the node or the poin
t you had placed a Voltage/
Level marker

on. For instant
,

if you forget to
place any of the Voltage/Level markers on the circuit you will have
blank results. Try (as

a
practice)
to change the location of the Markers and Save the schematic and run the simul
ation
again.


Notice

that the Result Display Window shown in figure 11 is
different

from the one you have on
the screen. You can customize the view of the window as you wish. If you want to have the
window exactly like the on
e in figure 11 do the follow
ing
: click on
View

top

menu to open up a
side menu. Deselect the
Output Window
,
and

Simulation Status Windo
w.

You can alter the appearance

of the results and add text in a way you prefer to according to your
taste for example
,

increase the line wid
th, the
color of the
wave forms,
adding labels and your
name on the graph.
These are simply done by selecting the waveform then right click

to open the
side menu with optio
ns information and properties.
Take your time to explore all available
options.





9




Printi
ng the Results


If you have
a
little experience with MS
-
Windows you will
find
no difficulties in printing, saving
and most menu’s options. The only thing you should be aware of, is that, if you press the printer
icon, the file will go directly to the defau
lt printer
.

You can print your results in the printer
Quill

located in H852.




Figure
11

Result Display Window



After printing the results, close the result window and the OrCAD Capture window to
start a

new
project f
or frequency domain analysis with different circuit.












10


Frequency

Domain Analysis


1
-

Double
-
click on the short cut of Capture student.
Open a

new project
and type

LOWPASS under name, select
Analog or

Mixed A/D, browse to place the new project in
the P
spice1 folder on the Desktop, and create a blank project.

2
-

Build the circuit shown in figure 12. The OpAmp can be in eval library “last
element of
the library content
”, the
power sources

VDC

(
+15
V
,
-
15
V

for the OpAmp)

form

SOURCE
library.

Place two VDC sour
ces next to the circuit and connect them as shown
in figure 12. Now you need to connect the
-
15V and +15V to the pin # 4 and 7 of uA741
respectively. This can be done using the Off
-
Page connectors
,

button
M

figure 6. The
final element in the circuit is the

signal generator (VAC)
from
the
SOURCE

library.
Make the amplitude of the input source 1V

if set to different value
.

Use Vertical Mirror
(select the OpAmp and right click) to
rotate

the OpAmp as shown in the figure.




Figure
12


LOWPASS Circuit

3
-

Create a

new

Simulation Profile “Frequency Response”. In the Simulation Settings
Window,
select AC Sweep/Noise

for Analysis type
, and e
nter the start

frequency
,

the end
frequenc
y

and
, number

of points per decade as given in figure 13 belo
w.

4
-

Place
a marker on the output node

as follows:
From

P
S
pice

menu select
Marker
s
/Advance
/dB Magnitude of Voltage
.
The
maker VDB
is shown

in figure 12.



11

5
-


Run the simulation.



Figure
13

The Result Display Window will open with th
e frequency response of the LOPASS circuit.
Notice that the horizontal axis scale is a logarithmic scale and the Display window is shown in
figure 14.


Figure
14



Frequency response of LOWPASS



12


Use
Cursors

to extract information

from the Result Display Window as follows:

On the probe
Toolbar
,

click on “Toggle Cursor
“button to

activate the Cursor

toolbar
, then click on “Cursor
Peak”. Click on any point on the frequency response to display the frequency and the gain in dB
in a li
ttle window with entries A1=, A2
= and

dif=. Move this window to a convenient place on
the result. In figure 14 , the 3dB point occurs at 1.796KHz.











Toggle Cursor


Cursor Peak


To display the phase versus frequency do the followings: delete t
he Marker dB Magnitude of
Voltage. Place the Marker “Phase of Voltage” form the same menu (PSpice/Markers/Advanced).

The result Display Window now displays the phase versus frequency. The vertical axis scale is in
degrees and the horizontal is
in KHz as sh
own in figure 15.

You can display both, frequency and phase responses on the same display window. This can be
done by placing the two markers on the output at the same time.

Please do that as a practice.



Figure
15

Phase respon
se of LOWPASS





13

DC ANALYSIS


1
-

Build the circuit shown in figure 1
6

( hint :
Create

New project with name DCBJT,….).

2
-

From PSpice menu choose New Simulation Profile, Type the name “DC Analysis”

3
-

When the simulation settings opens, choose Bias point for Analysi
s Type, then click OK.

4
-

Run the simulation.

5
-

Click on button k “Enable Bias Voltage Display” (figure 6) and button N “ Enable
current Display” to show voltage and currents at all nodes and circuit branches as show in
figure 16.



Figure
16

DC Analysis with

the

display of the bias voltage