Doc Sumir Saurabh

25
LAB MANUAL ELECTRICAL SIMULATION LAB (PSPICE Based) (B.Tech. IV th SEM) TEE 454 TEE 454 : Electrical Simulation Lab (List of Experiments (PSPICE based) Note : Select any 10 out of the following: 1. Study of various commands of PSPICE. 2. To determine node voltages and branch currents in a resistive network. 3. To obtain Thevenin’s equivalent circuit of a resistive network. 4. To obtain transient response of a series R-L-C circuit for step voltage input. http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119... 1 of 25 3/27/2009 2:30 PM

Transcript of Doc Sumir Saurabh

Page 1: Doc Sumir Saurabh

LAB

MANUAL

ELECTRICAL SIMULATION LAB

(PSPICE Based)

(B.Tech. IVth

SEM)

TEE 454

TEE 454 : Electrical Simulation Lab

(List of Experiments (PSPICE based)

Note : Select any 10 out of the following:

1. Study of various commands of PSPICE.

2. To determine node voltages and branch currents in a resistive network.

3. To obtain Thevenin’s equivalent circuit of a resistive network.

4. To obtain transient response of a series R-L-C circuit for step voltage input.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

1 of 25 3/27/2009 2:30 PM

Page 2: Doc Sumir Saurabh

5. To obtain transient response of a parallel R-L-C circuit for step current input.

6. To obtain transient response of a series R-L-C circuit for alternating square

voltage waveform.

7. To obtain frequency response of a series R-L-C circuit for sinusoidal voltage

input.

8. To determine line and load currents in a three phase delta circuit connected to

a 3-phase balanced ac supply.

9. To plot magnitude, phase and step response of a network function.

10. To determine z,y,g,h and transmission parameters of a two part network.

11. To obtain transient response of output voltage in a single phase half wave

rectifier circuit using capacitance filter.

12. To obtain output characteristics of CE NPN transistor.

13. To obtain frequency response of a R-C coupled CE amplifier.

14. To obtain frequency response of an op-Amp integrator circuit.

15. To verify truth tables of NOT, ANDor OR gates implemented by NAND gates

by plotting their digital input and output signals.

Reference Books:

1. Irvine, Calif, “PSPICE Manual” Microsim Corporation, 1992.

2. Paul W. Tuinenga, “SPICE : A guide to circuit Simulation and Analysis Using

PSPICE”, Prentice Hall, 1992.

3. M.H. Rashid, “SPICE for Circuits and Electronics Using PSPICE” Prentice

Hall of India, 2000.

EXPERIMENT NO. I

Object: Study of various commands of PSPICE.

Use of the .STEP Command

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

2 of 25 3/27/2009 2:30 PM

Page 3: Doc Sumir Saurabh

Use of the .STEP Command

The .STEP statement performs a parametric sweep to be performed on a specified variable. This variable

can be, for example, a resistance, capacitance, inductor, temperature, etc. If, for example, we wanted to

look at how a resistance affected a DC output voltage, we could run the circuit, change the value of

resistance, and run the circuit again. This would be repeated over and over. Or we could place the .STEP

statement in the PSpice input file, and PSpice would do it automatically for us.

In the statement above, RES is the sweep variable name (a model type), RMOD is the model name, and R

is the parameter within the model to step (i.e. the line value). To step the value of the resistor, the line

value of the resistor is multiplied by the R parameter value to achieve the final resistance value, that is:

Final resistor value = Line resistor value * R

Therefore, if you set the line value of the resistor to 1 ohm, the final value is 1*R. Thus by stepping R

from 1 to 5 ohms will then step the resistor value from 1*1 ohms to 1*5ohms. An added benefit is that you

could display all of the results simultaneously in a plot or as a text output.

TYPE: is optional; LIN (linear increments), DEC (increment points per decade), OCT (increment points

per octave), STEP defaults to LIN if no sweep type is defined.

Review of the "DOT" commands used with .STEP function

The following is a review of useful "DOT" commands discussed in earlier tutorials.

.MODEL command

The .MODEL statement defines a set of device parameters for a specific device, which can be referenced

in the circuit.

* <model name> <model variable [model parameters (line value)]>

.MODEL RMOD RES(R=1)

In the statement above, a model type and a model name followed by a model parameter name in

parenthesis. The parameter in the model is set to the sweep value.

.TRAN command

The .TRAN statement causes a transient analysis to be performed on the circuit. The transient analysis

calculates the circuit's behavior over time, always starting at TIME = 0s and finishing at a time specified

by the user.

* < print step value > < final time > < print delay> <Max step>

.TRAN 500us 100ms 0s 500us UIC

In the statement above < print step value > is the time interval used for printing or plotting the results of

the transient analysis to a specified output file. < final time value > is the ending value of the time

interval. Note that the transient analysis always starts off at 0s and ends at the time specified by the final

time value. <print delay> is the print delay time this specified value is the no-print value and the results

from this value are not plotted, printed, or given to probe. <max step> is the maximum time step size

PSpice is allowed to take during the simulation. Since PSpice automatically adjusts its time step size during

the simulation, it may increase the step size to a value greater than desirable for displaying the data.

When the variables are changing rapidly, PSpice shortens the step size, and when the variables change

more slowly, it increases the step size. The last parameter in our list is "UIC." is an acronym for "

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

3 of 25 3/27/2009 2:30 PM

Page 4: Doc Sumir Saurabh

more slowly, it increases the step size. The last parameter in our list is "UIC." is an acronym for "

UseInitialConditions."

.PROBE command

The .PROBE statement writes the results from DC, AC, and transient analysis to a data file named

PROBE.DAT. It saves information for all voltages and currents. This file can then be called up by the

Probe waveform analyzer for graphic display of the results. If we create a circuit listing named

"CIRCUIT1.CIR" containing a ".TRAN" statement and a ".PROBE" statement, PSpice will create a file

named "CIRCUIT1.DAT" holding the data as well as the usual "CIRCUIT1.OUT" file with basic

information about the circuit. By default, the data file created by PSpice is a binary data file; i.e., you

can't read it with a text editor.

.DC command

The .DC command causes the DC sweep analysis to be performed on the circuit. One or more sweep

variables are varied over a specific range for specific points. At each point, the DC operating point (all of

the DC voltages and currents in the circuit) are calculated.

* < Sweep Variable > <Starting Value > < Stopping Value> <increment>

.DC Vs 20.0 20.0 1.0

For our example problem, we choose the voltage source and set the sweep variable range so that it cannot

run more than one value. Since the starting value equals the stopping value, the analysis will only run for

one case, i.e., for Vs at 20 volts. Remember that the only reason we are running the DC sweep statement

is to enable the .PRINT command.

EXPERIMENT NO.2

OBJECT: To determine node voltages and branch currents in a resistive network.

Example of DC Analysis with a Resistor Value Sweep

RES_Dc_Analysis

Vs 1 0 DC 20.0V

Ra 1 2 RMOD 1

.MODEL RMOD RES(R=1)

.STEP RES RMOD(R) 1k, 5k, 2k

Rb 2 0 4.0k

Rc 3 0 1.0k

Is 3 2 DC 2.0mA

.DC Vs 20 20 1

.PRINT DC V(1,2) I(Ra)

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

4 of 25 3/27/2009 2:30 PM

Page 5: Doc Sumir Saurabh

.PRINT DC V(1,2) I(Ra)

.END

In the example above, we have three resistors; we can determine the DC analysis (i.e. voltage and current

characteristic on each of the node or devices). Here we can step the value of a Resistor (Ra) between 1K

to 5K and study the corresponding voltage and current response with the help of the .PRINT command.

You may choose to sweep the value of the resistor Rb or Rc in the same manner. The output file

"CIRCUIT1.OUT" is shown below, showing the voltage across the node 1 and 2, and the current for the

specified values of the Resistor in the .STEP statement.

The output file has been edited to remove the extra lines to obtain the necessary information only. In

practice you will find other information pertaining to the analysis.

RMOD R 1

**** 08/09/04 11:34:49 *********** Evaluation PSpice (Nov 1999) **************

RES_Dc_Analysis

**** DC TRANSFER CURVES TEMPERATURE = 27.000 DEG C

**** CURRENT STEP RMOD R = 1.0000E+03 ;(1st sweep value)

Vs V(1,2) I(Ra)

2.000E+01 2.400E+00 2.400E-03

**** 08/09/04 11:34:49 *********** Evaluation PSpice (Nov 1999) **************

RES_Dc_Analysis

**** DC TRANSFER CURVES TEMPERATURE = 27.000 DEG C

**** CURRENT STEP RMOD R = 3.0000E+03 ;(2nd sweep value)

Vs V(1,2) I(Ra)

2.000E+01 5.143E+00 1.714E-03

**** 08/09/04 11:34:49 *********** Evaluation PSpice (Nov 1999) **************

RES_DC_Analysis

**** DC TRANSFER CURVES TEMPERATURE = 27.000 DEG C

**** CURRENT STEP RMOD R = 5.0000E+03 ;(3rd sweep value)

Vs V(1,2) I(Ra)

2.000E+01 6.667E+00 1.333E-03

JOB CONCLUDED

TOTAL JOB TIME .02

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

5 of 25 3/27/2009 2:30 PM

Page 6: Doc Sumir Saurabh

The output file EXMPL02.OUT is below. This has been edited to remove extra lines

EXPERIMENT NO. 3

OBJECT: To obtain Thevenin’s equivalent circuit of a resistive network.

Simple Dependent Sources

We now extend our circuit parts list by adding the most basic dependent sources. The four dependent

sources we now encounter are simple multiples of the controlling voltage or current. It is possible to

model dependent sources that are complex nonlinear functions of several controlling voltages and/or

currents. However, we will now concentrate on the basic linear dependent sources.

Voltage Controlled Dependent Voltage Source

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

6 of 25 3/27/2009 2:30 PM

Page 7: Doc Sumir Saurabh

In the above figure, we find the dependent source whose positive terminal is designated as "n+" and

whose negative terminal is designated as "n-." The controlling voltage is a branch voltage at some other

circuit location. In this case, the positive terminal of the controlling branch is designated as "nc+" while

the negative terminal is designated as "nc-" The "gain" of the dependent voltage source is a, a

dimensionless quantity. For example, if vx happened to be 16.0 volts while a = 4, then node "n+" would

be at 64.0 volts higher potential than node "n-."

The first letter of the part name for the voltage-controlled dependent voltage source is "E." This is the

letter that must appear in column 1 of the *.CIR file describing the circuit. Some examples of the voltage-

controlled dependent voltage source PSpice entries follow.

Voltage Controlled Dependent Current Source

In the above voltage-controlled dependent current source a current equal to g times vx flows from node

"n+" through the source and out node "n-." γ is called the transconductance and has the dimensions of

siemens (inverse ohms). For example, if the controlling branch voltage, vx , equals 6.0 volts and the

transconductance, γ, is 0.25 siemens, the current produced by the dependent source is 1.5 amps.

The first letter of the part name for the voltage-controlled dependent current source is "G." Some

examples of how this part is coded into the *.CIR file are shown below.

Current Controlled Dependent Voltage Source

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

7 of 25 3/27/2009 2:30 PM

Page 8: Doc Sumir Saurabh

The current-controlled dependent voltage source as shown above, produces a voltage proportional to the

current, ix, in a different branch of the network. The transresistance, ρ, in ohms is multiplied by ix in amps

to produce the dependent source voltage in volts. Unlike the two previous examples, we cannot simply

designate the controlling branch by its nodes. Since there could be multiple branches carrying very

different currents between any pair of nodes, we must explicitly identify the branch of the controlling

current. Eventually, we will be able to do this with any type of element. However, the only reliable

method of doing this at present is to use an independent voltage source as an ammeter to report the

current of the controlling branch to the dependent source. Usually, this means you must insert a

zero-valued independent voltage source in series with the branch containing the controlling current so that

the controlling current enters the positive terminal of the independent voltage source. However, if there

happens to be an independent voltage source that monitors the controlling current you can use it. If

necessary, use a minus sign to get the right polarity.

The first letter of the part name for the current-controlled dependent voltage source is "H." Some

examples follow for this device.

Current Controlled Dependent Current Source

The current-controlled dependent current source produces a current proportional to the controlling

current, ix, flowing in a different branch. The current gain, β, is dimensionless. Designating the control

scheme is similar to setting up the current-controlled dependent voltage source previously discussed. We

must use a voltage source connected in series with the controlling element so that the controlling current

enters the positive terminal of the independent voltage source used as an ammeter. If no voltage source is

needed for its voltage, we use a zero-valued voltage source as shown in the figure.

The first letter in the part name for this dependent source is "F." The syntax for entering this part in *.CIR

files is shown in several examples below.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

8 of 25 3/27/2009 2:30 PM

Page 9: Doc Sumir Saurabh

Using PSpice to find Thévenin Equivalent Circuit

In addition to performing general purpose circuit analysis, PSpice can be used to determine the Thévenin

resistance and open circuit voltage of a circuit. This can be of great advantage if the circuit is complex,

with several dependent sources, or if the circuit cannot be reduced by successive source transformations.

The PSpice "dot command" that makes this easy, is ".TF," where "TF" indicates "transfer function." The

transfer function is intended to find the ratio between a source voltage or current, and a resulting voltage

difference or branch current. This is useful in characterizing circuits. In addition to reporting the

calculated transfer function ratio and input resistance at the source, PSpice reports the output resistance

at the terminal pair of interest. The voltage across the terminal pair of interest is the Thévenin voltage and

the output resistance is the Thévenin resistance. At this point we will ignore the transfer function ratio

and the input resistance at the source. In fact, we do not care which source is chosen as long as we only

want the Thévenin equivalent circuit parameters. An example of the syntax for the .TF command is

shown below.

The above command will report the ratio between source Vs and node voltage V(4). If we wanted the

Thévenin circuit from nodes 4 to 0, the output resistance reported would be our Thévenin resistance, and

the voltage V(4) would be the Thévenin (open circuit) voltage. The input source can be a voltage or a

current source, and the output variable can be a node voltage, branch voltage or a device current. Now

we examine a specific example.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

9 of 25 3/27/2009 2:30 PM

Page 10: Doc Sumir Saurabh

In this example, we want the Thévenin equivalent circuit from nodes 1 to 0. The 1 Megohm resistor is

placed in the circuit because PSpice requires at least two connections to each node. This resistor is large

enough that it will not have an effect on the calculations. Note the use of voltage source Vc which has the

purpose of monitoring the control current, ix, used for the current-controlled dependent current source,

Fx. The input lines in the *.CIR file are shown below.

Portions of the output file produced by this case will now be listed.

We conclude that the Thévenin resistance is 5 ohms and the open circuit voltage is 180 volts. Use of the

.TF function allows us to get the answers in a single job. The alternative to using the .TF function would

be to run one case with a large resistor across the terminal pair of interest (if necessary) to get the open

circuit voltage; and then run a second case with a zero-valued voltage source across the terminal pair to

get the short circuit current. Then divide the short circuit current into the open circuit voltage to get the

Thévenin resistance. We prefer the ".TF" method for obtaining Thévenin equivalent circuits.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

10 of 25 3/27/2009 2:30 PM

Page 11: Doc Sumir Saurabh

Thévenin resistance. We prefer the ".TF" method for obtaining Thévenin equivalent circuits.

EXPERIMENT NO. 4

OBJECT: To obtain transient response of a series R-L-C circuit for step voltage input.

Example of Transient Circuit Analysis with Resistor value Sweep

RES_TRANSIENT R 0 1 RMOD 1

.MODEL RMOD RES(R=1)

.STEP RES RMOD(R) 1, 5, 2

Rp 1 0 Rmod 1

Lp 1 0 8mH IC=20A

Cp 1 0 10mF IC=0V

.TRAN 500US 100MS 0S 500US UIC

.PROBE

.END

In the above example, the Resistor value is swept between 1ohm and 5ohms with an increment of 2. The

eight millihenry inductor, Lp, has an initial current of 20 amps flowing from node 1 through the inductor to

node 0. The 10 millifarad capacitor, Cp, has an initial voltage of 0 volts. Both the print step size and the

maximum step size are set to 500?s and the final time is 100ms. There is no print delay, and PSpice is

instructed to use the initial conditions provided.

The output file ""RES_CIR.OUT" is shown below.

**** 08/07/04 14:23:36 *********** Evaluation PSpice **************

RES_TRAN

Rp 0 1 RMOD 1

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

11 of 25 3/27/2009 2:30 PM

Page 12: Doc Sumir Saurabh

Rp 0 1 RMOD 1

.MODEL RMOD RES(R=1)

.STEP RES RMOD(R) 1,5,2

Lp 1 0 8mH IC=20A

Cp 1 0 10mF IC=0V

.TRAN 500US 100MS 0S 500US UIC

.PROBE

.END

**** Resistor MODEL PARAMETERS

RMOD

R 1

JOB CONCLUDED

TOTAL JOB TIME .13

For meaningful information about the transient response we need to use another program that is bundled

with PSpice. This program is named PROBE. You can launch Probe from the Start menu of Windows, but

you will then need to go to Probe's File menu and open the DAT file you want to see. After you have

Probe running with the proper DAT file open, choose "Add" in the Probe Trace menu. You will see a list

of circuit variables that can be displayed. Choose V2(R), the voltage at node 1, and then click "OK." You

should see the following trace in Probe.

Each of the curves above represents the three Resistor values specified in the .STEP statement. (Right

click on a curve, click on information to see the corresponding value of the Resistor). In Probe, click on

the V2(R) at the lower left corner and then hit the "Delete" key. Then go to Trace menu in the Probe and

choose "Add" again. This time choose I2(R) and click "OK". You should be able to see the transient

current response for the three different Resistors sweep values.

Similarly, in another example you can decide to sweep the Capacitor and Inductor values using the .STEP

statement to study the transient analysis of the RLC circuit. The second example shows the sweep of the

Inductor values of our RLC circuit. The parameter of the .STEP command stays the same, only the

.MODEL statement has changed to an Inductor.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

12 of 25 3/27/2009 2:30 PM

Page 13: Doc Sumir Saurabh

EXPERIMENT No.5

OBJECT : To obtain frequency response of a series R-L-C circuit for sinusoidal voltage

Example of Frequency response analysis with Resistor value Sweep

The purpose of this type of analysis is to study the frequency response of different kinds of circuits. Since

frequency sweeps produce a lot of data that needs to be graphed to be clearly understood, we will

reintroduce Probe, the graphing program that is bundled with PSpice. In order to sweep the frequency we

need to use the .AC command. The .AC statement is used to calculate the frequency response of a circuit

over a range of frequencies. In addition to the frequency sweep, we will sweep the passive devices in the

circuit, to simply recognize the particular value of the devices that produces optimum response.

, we will use a second-order high pass filter to sweep the value of the Resistor over a range of frequency

to study its response.

RES_FREQUENCY RESP. SECOND ORDER HIGH PASS FILTER

Vs 1 0 AC 10V 0

Rf 1 2 RMOD 1

.MODEL RMOD RES(R=4)

.STEP RES RMOD(R) 4, 8, 2

Cf 2 3 2uF

Lf 3 0 127uH

.AC DEC 20 100Hz 1MEG

.PROBE

.END

This time also we did not use 1V for the input voltage. Therefore, we will need to have PROBE actually

divide the input into the output to get the gain. We show this gain in decibels.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

13 of 25 3/27/2009 2:30 PM

Page 14: Doc Sumir Saurabh

Notice that the gain below the resonant frequency of 10 kHz slopes upward at 40 dB/decade. We show

this gain in decibels by dividing the input into the output.

When we plot the phase shift of this filter, we only need to specify the phase angle of the output voltage

since the input voltage was specified at 0 degrees.

Example of Frequency response analysis with Capacitor value Sweep

In a similar example we can decide to sweep the Capacitor and Inductor values using the .STEP statement

to study the Steady-state AC analysis of the RLC circuit. The second example shows the sweep of the

capacitor value of the second-order high pass filter circuit. The parameter of the .STEP command is the

same, only the .MODEL statement has changed to a Capacitor.

CAP_FREQUENCY RESP. SECOND ORDER HIGH PASS FILTER

Vs 1 0 AC 10V 0

R 1 2 4

C 2 3 CMOD 1

.MODEL CMOD CAP(C=2uF)

.STEP CAP CMOD(C) 2uF, 6uF, 2uF

L 3 0 127uH

.AC DEC 20 100Hz 1MEG

.PROBE

.END

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

14 of 25 3/27/2009 2:30 PM

Page 15: Doc Sumir Saurabh

We only need to specify the phase angle of the output voltage since the input voltage was specified at 0

degrees.

Examples of Frequency Sweeps

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

15 of 25 3/27/2009 2:30 PM

Page 16: Doc Sumir Saurabh

The above circuit is a first-order low-pass filter. Since we want the gain of this filter, it is convenient to

make the input voltage 1 volt so the output voltage is numerically equivalent to the gain. However, the

post-processer within PROBE is fully capable of performing arithmetic such as dividing the input voltage

into the output voltage. The source code for the CIR file follows.

After running this in PSpice, we start PROBE, choose "Add" from the "Trace" menu and plot the output

voltage. PROBE provides the following graph.

Another option is to have PROBE plot the gain in decibels. To do this choose "Add" from the "Trace"

menu in PROBE. Then select the "DB" function in the right-hand column and choose "V(2)" from the

left-hand column.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

16 of 25 3/27/2009 2:30 PM

Page 17: Doc Sumir Saurabh

After selecting "OK," you should see the following trace.

Notice that the gain is -3db at a frequency of 1 kHz (the half-power frequency) and declines at

20 dB/decade thereafter. The remaining demonstration for this example is to have PROBE plot the phase

shift of the low-pass filter as a function of frequency. We simply specify "VP(2)" from the "Add Trace"

dialog box. Notice that this is the same format used in the .PRINT AC command in PSPICE. PROBE

automatically shows the angles in degrees.

We will now examine a second-order high-pass filter as our second example.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

17 of 25 3/27/2009 2:30 PM

Page 18: Doc Sumir Saurabh

This time we did not use 1V for the input voltage. Therefore, we will need to have PROBE actually divide

the input into the output to get the gain. We show this gain in decibels.

Notice that the gain below the resonant frequency of 10 kHz slopes upward at 40 dB/decade. When we

plot the phase shift of this filter, we only need to specify the phase angle of the output voltage since the

input voltage was specified at 0 degrees.

Your browser may not support display of this image.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

18 of 25 3/27/2009 2:30 PM

Page 19: Doc Sumir Saurabh

Modifying PROBE Display

In PSpice Tutorial No. 4 we promised to show in a future tutorial how to make PROBE display a white

background (as you have been seeing in the above examples) instead of a black one . We now fulfill this

promise. However, we must make clear that we are modifying a file needed by PSpice and all of its

associated programs for successful operation. Therefore, we strongly suggest that you make a back-up

copy of this file before you modify it. If this file is lost or destroyed, you may have to reinstall PSpice on

your computer. Also, making these modifications requires that you have WRITE as well as READ

privileges in the WINDOWS folder of the computer you are using; i.e., don't try this on the school's lab

workstations.

The file to be modified depends on which version of PSpice that you have. If you are running version 7 or

8 of the old MicroSim evaluation release, the file name will be "msim_evl.ini" whereas the new OrCAD

release 9 evaluation version of PSpice uses the file name "pspiceev.ini" to specify the same start-up

information. In either case the file will be found in the "WINDOWS" folder of your computer if you are

running Windows 95 or Windows 98. It will be in the WINNT folder if you are running Windows NT or

Windows 2000. If you are running Windows XP, you will have either a WINNT or a WINDOWS folder.

Be sure to open this file with an ASCII-type text editor such as NOTEPAD or the DOS EDIT program. A

word processor such as MS Word™ or WordPerfect™ may ruin the file unless you are very careful to

save it as a DOS or TXT type file. The safest editor to use is the text editor that comes with PSpice. This is

called TEXTEDIT in MicroSim releases 7 and 8. In the new OrCAD release the text editor is run from

PSpiceAD itself. In either case, search for the following sequence of statements starting with "[PROBE

DISPLAY COLORS]":

There may be minor variations in some of these statements depending on your version; for instance, most

MicroSim evaluation releases only define 6 trace colors. The most important two lines to change are the

background and the foreground colors. You need to make the background color BRIGHTWHITE and the

foreground color BLACK. If you specify just WHITE for the background color, it will actually be a light

gray. This does not look very good when you paste a graph into a document for a report. The following

listing is what I use in my own file:

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

19 of 25 3/27/2009 2:30 PM

Page 20: Doc Sumir Saurabh

You will find other editable features in this file such as schematic colors. Just be sure to back up the file

before you make any changes.

Steady-State AC Analysis in PSpice

In addition to DC circuit analysis and transient analysis, PSpice can be used to work steady-state phasor

problems. To see the results of this analysis in the .OUT file, we will want to use a new form of the

.PRINT command. In the first tutorial, we learned that the .PRINT DC command would not work unless

we enabled it with the .DC command. This was the DC sweep command although we only allowed it to

sweep a single value of voltage. We have a somewhat similar situation when we need to print AC values;

i.e., we will use the .AC command to enable the .PRINT AC command to print our phasor voltages and

currents.

AC Voltage and Current Sources`

Up to now, all our voltage and current sources were DC. We learned the syntax of the DC source in the

first tutorial. The syntax for an AC source is very similar. The AC source is assumed to be a cosine

waveform at a specified phase angle. Its frequency must be defined in a separate ".AC" command that

defines the frequency for all the sources in the circuit. The unique information for the individual source

is: the name, which must start with "V" or "I," the node numbers, the magnitude of the source, and its

phase angle. Some examples follow.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

20 of 25 3/27/2009 2:30 PM

Page 21: Doc Sumir Saurabh

Notice that the type, AC, must be specified, because the default is DC. If the phase angle is not specified

it will be assumed as zero degrees. The units of the phase angle will be in degrees. As before, the "V"

after the voltage value is optional, as is the "A" after the current value in a current source. The polarity

of the AC voltage source is determined as if the voltage were a cosine function of ωt at t = 0. Then the

node on the left is the positive node and the node on the right is the negative node. Similarly, the polarity

of the AC current source is determined as if the current were a cosine function of ωt at t = 0. Then

positive current flows into the source from the node on the left, passes through the source, and leaves the

source from the node on the right.

A note of caution is needed here. By now, some of you may have discovered the "SIN" type of source by

reading some of the supplementary material. The SIN is one of several useful source types (also EXP,

PULSE, PWL & SFFM to name a few) that are used for transient analysis. Do not attempt to use SIN for

steady-state (phasor) AC analysis nor for frequency sweeps. The SIN type is a time-based function for

time-based analysis, whereas the AC type is used in frequency-based modeling. Since phasor analysis uses

frequency-based models of circuit elements, always use the AC type as described in this tutorial for

phasor analysis of circuits.

Use of the .PRINT AC Command

Before the .PRINT command will work, it must be enabled by the .AC command. The .AC command was

designed to make a sweep of many frequencies for a given circuit. This is called a frequency response

and will be discussed in a later tutorial. Three types of ranges are possible for the frequency sweep: LIN,

DEC and OCT. At this time we only want a single frequency to be used so it does not matter which one

we choose. We will pick the LIN (linear) range to designate our single frequency. Some examples of the

.AC statement follow.

The first statement above performs a single analysis using the frequency of 60 Hz. Placing the units "Hz"

after the value is optional. The second statement would perform a frequency sweep using frequencies of

100Hz, 110Hz, 120Hz, 130Hz, 140Hz, 150Hz, 160Hz, 170Hz, 180Hz, 190Hz and 200Hz. This will not be

used here. The third statement performs a logarithmic range sweep using 20 points per decade over a

range of four decades. This will be useful later for studying frequency response of circuits.

Finally, we can discuss the actual .PRINT AC command. Printing the components of phasor values

(complex numbers) requires some options. There are four expressions needed for this: magnitude, phase

(angle), real part, and imaginary part. In addition, we can print voltages or currents. For instance, to print

the magnitude of a voltage between nodes 2 and 3, we would specify "VM(2,3)." The phase angle of this

same voltage would be "VP(2,3)" and would be printed in degrees. If we need the current magnitude

through resistor Rload, we would specify "IM(Rload)." The real part of the voltage on node 7 would be

specified "VR(7)" and its imaginary part, "VI(7)." As with the .PRINT DC command, there is no limit on

the number of times it can be used in a listing; nor is there a limit on how many print requests can be on a

single line. Some complete examples follow:

Example Circuit

We will analyze the following circuit at a frequency of 60 Hz.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

21 of 25 3/27/2009 2:30 PM

Page 22: Doc Sumir Saurabh

In the above listing, the .AC command sets up the analysis for a single solution at 60 Hz. The .PRINT AC

command tells PSpice to report on the voltage magnitude and phase angle at node 3, and the current

magnitude and phase angle for the current through resistor Rm and the current magnitude and phase angle

through capacitor Cx. The resulting output file (edited to delete clutter) follows:

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

22 of 25 3/27/2009 2:30 PM

Page 23: Doc Sumir Saurabh

Notice that the small signal bias solution yields zero for the voltages. This is the DC part of the solution

which is zero in this case because there was no DC excitation. The AC analysis has been printed in blue.

The voltage at node 3 is 120.3 -3.332° volts and the current through the capacitor is 6.014 86.67°

amps. Theory predicts that the current through a capacitor leads the voltage across the capacitor by 90°,

which it does.

Summary of AC Phasor Circuit Analysis Using PSpice

Use AC as the type for all independent sources

Specify phase angle of sources if other than zero degrees

There must be a ".AC" command to specify the frequency to be used for all sources

Use a .PRINT AC command to specify which voltages and currents are to be listed in the output file

M indicates magnitude, P indicates phase angle, R indicates real part and I indicates imaginary

part, when these letters follow V (for voltage) or I (for current).

EXPERIMENT NO. VI

OBJECT: To obtain transient response of a parallel R-L-C circuit for step current input.

PSpice simulation of the time-domain response

Capture the circuit schematic of Figure 1 and use a pulse source for V1 and R1 = 200 W.

1. Set the properties of the V1 source for zero rise, fall, and delay time, a low voltage of zero and

a high voltage of +5 V, a pulse width of 5 ms, and a period of 10 ms.

2. Create a new simulation profile for transient analysis over a time of 15 ms with a maximum

step size of 10 ms.

3. Run the PSpice simulation and create a Probe graphical display of the voltages V1, V2 and V3

versus time.

4. Save a copy of the graphic display into another document.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

23 of 25 3/27/2009 2:30 PM

Page 24: Doc Sumir Saurabh

4. Save a copy of the graphic display into another document.

5. Calculate, from this PSpice output, the degree of overshoot present in V2, and note whether the

response is underdamped, critically damped, or overdamped.

Repeat the above procedure for R1 = 2.0 kW and R1 = 20 kW.

PSpice simulation of the frequency-domain response

Return to the captured circuit schematic and modify the properties of the V1 source by setting VAC

to 5 V. This will create a 5 V AC source for the AC analysis, which will ignore the other transient

parameters of V1 that were entered previously.

Simulate the circuit for each of these R1 values: 200 W, 2.0 kW, and 20 kW.

1. Create a new simulation profile for AC analysis that sweeps the frequency from 100 Hz to 10

kHz in 2 logarithmic decades with 50 points per decade.

2. Run the PSpice simulation and create a Probe graphical display of the voltages V1, V2 and V3

versus frequency.

3. Measure the amount of peaking present in V2, and save a copy of the graphical display to a

document.

4. Experiment with other ways to display the frequency-domain simulation results. Plot the

magnitude of the voltage in decibels versus frequency (magnitude Bode plot). Next, plot the

phase of the voltage in degrees versus frequency (phase Bode plot). Practice with Probe to

display a magnitude and phase Bode plot in the same window (two different vertical axes) and

save these to a document.

EXPERIMENT NO. VII

OBJECT: To obtain transient response of output voltage in a single phase half wave

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

24 of 25 3/27/2009 2:30 PM

Page 25: Doc Sumir Saurabh

rectifier circuit using capacitance filter.

Half Wave Rectifier

In PSpice construct a half wave rectifier using a sinusoidal voltage source (VSIN), a diode (D1N4002) , a

resistor (R), and an earth ground (GND_EARTH). Be sure to use the VSIN voltage source NOT the VAC

voltage source. You will need to edit the voltage source parameters you can do this by double clicking the

source to open the part editor. In the part editor you can change amplitude and frequency of the source.

All other fields should be set to 0. You can pick your own values for the amplitude and frequency but 5V

and 100Hz will work very well. The part editor should look like this:

After setting up the voltage source wire the circuit and connect the ground. Your circuit should look like

this:

You must place the voltage markers on the circuit before running the simulation. You can get the voltage

markers in the upper right hand corner of the schematic editor. Next you need to enter the simulation

setup. Uncheck the box next to bias point detail and check the box next to transient. Click on the

transient button to setup the transient analysis. If you chose to use 100Hz as the frequency of the voltage

source you should set the final time field to 0.1 second so you can see several oscillations in the printout

screen. Your transient setup screen should look similar to this:

Finally, run the simulation and look at the graphical output of the input and output voltage. Be sure to

include these graphs in your report. You might want to show the output and input on separate graphs.

http://mail.google.com/mail/?ui=2&ik=2c2eb5556b&view=att&th=119...

25 of 25 3/27/2009 2:30 PM