EEE250 Lab Manual
EEE250 Lab Manual
LABORATORY
MANUAL FOR
ELECTRICAL AND ELECTRONIC SIMULATION
LAB COURSE
Student Name:
Student ID:
Prepared by
RASEL AHMMED
ASSISTANT PROFESSOR, DEPT. OF EEE, BSMRSTU
Laboratory Manual Electrical and Electronic Circuits Simulation
LIST OF EXPERIMENTS
Text Books
1. Basic Electrical Engineering- By M.S.Naidu and S. Kamakshiah — TMH.
2. Basic Electrical Engineering —By T.K.Nagasarkar and M.S. Sukhija Oxford
REFERENCES
1. Theory and Problems of Basic Electrical Engineering by D.P.Kothari & I.J.Nagrath PHI.
2. Principles of Electrical Engineering by V.K Mehta, S.Chand Publications.
In addition, PSpice has analog and digital libraries of standard components (such as NAND,
NOR, flip-flops, MUXes, FPGA, PLDs and many more digital components,). This makes it a
useful tool for a wide range of analog and digital applications.
All analyses can be done at different temperatures. The default temperature is 300K.
The circuit can contain the following components:
• Independent and dependent voltage and current sources
• Resistors
2
• Capacitors
• Inductors
• Mutual inductors
• Transmission lines
• Operational amplifiers
• Switches
• Diodes
• Bipolar transistors
• MOS transistors
• JFET
• MESFET
• Digital gates
• and other components (see users manual).
An alternative way is to use a schematic entry program such as OrCAD CAPTURE. OrCAD
Capture is bundled with PSpice Lite AD on the same CD that is supplied with the textbook.
Capture is a user-friendly program that allows you to capture the schematic of the circuits and
to specify the type of simulation. Capture is non only intended to generate the input for PSpice
but also for PCD layout design programs.
The following figure summarizes the different steps involved in simulating a circuit with
Capture and PSpice. We'll describe each of these briefly through a couple of examples.
3
Figure 1: Steps involved in simulating a circuit with PSpice.
The values of elements can be specified using scaling factors (upper or lower case):
Both upper and lower case letters are allowed in PSpice. As an example, one can specify a
capacitor of 225 picofarad in the following ways:
Notice that Mega is written as MEG, e.g. a 15 megaOhm resistor can be specified as 15MEG,
15MEGohm, 15meg, or 15E6. Be careful not to use M for Mega! When you write 15Mohm or
15M, Spice will read this as 15 milliOhm!
We'll illustrate the different types of simulations for the following circuit:
4
Note that the only program you need to start is “Capture Lite Edition.” The other programs will
run automatically as they’re needed.
2. Click the “Create Document” button on the toolbar.
5
Choose “Create a blank project” and click OK.
5. The schematic editor will open. Enter the following schematic into the program:
A new page will open in the Project Design Manager as shown below.
Figure 3: Design manager with schematic window and toolbars (OrCAD screen capture)
2.1.2. Place the components and connect the parts
1. Click on the Schematic window in Capture.
2. To Place a part go to PLACE/PART menu or click on the Place Part Icon. This will open a
dialog box
shown below.
6
Figure 4: Place Part window
3. Select the library that contains the required components. Type the beginning of the name in the
Part box.
The part list will scroll to the components whose name contains the same letters. If the library is
not available, you need to add the library, by clicking on the Add Library button. This will bring
up the Add Library window. Select the desired library. For Spice you should select the libraries
from the Capture/Library/PSpice folder.
Analog: contains the passive components (R,L,C), mutual inductane, transmission line,
and voltage and current dependent sources (voltage dependent voltage source E, current-
dependent current source F, voltage-dependent current source G and current-dependent
voltage source H).
Source: give the different type of independent voltage and current sources, such as Vdc,
Idc, Vac, Iac, Vsin, Vexp, pulse, piecewise linear, etc. Browse the library to see what is
available.
Eval: provides diodes (D…), bipolar transistors (Q…), MOS transistors, JFETs (J…),
real opamp such as the u741, switches (SW_tClose, SW_tOpen), various digital gates
and components.
Abm: contains a selection of interesting mathematical operators that can be applied to
signals, such as multiplication (MULT), summation (SUM), Square Root (SWRT),
Laplace (LAPLACE), arctan (ARCTAN), and many more.
Special: contains a variety of other components, such as PARAM, NODESET, etc.
7
Part Name Symbol Part Name Symbol
Resistor R Sinusoidal VSIN
Voltage
Source
Capacitor C Sinusoidal ISIN
Current Source
8
4. Place the resistors, capacitor (from the Analog library), and the DC voltage and current source.
• You can place the part by the left mouse click.
• You can rotate the components by clicking on the R key.
• To place another instance of the same part, click the left mouse button again.
• Hit the ESC key when done with a particular element.
• You can add initial conditions to the capacitor. Double-click on the part; this will open the
Property window that looks like a spreadsheet. Under the column, labeled IC, enter the
value of the
initial condition, e.g. 2V. For our example we assume that IC was 0V (this is the default
value).
5. After placing all part, you need to place the Ground terminal by clicking on the GND icon (on
the right side toolbar – see Fig. 3). When the Place Ground window opens, select GND/CAPSYM
and give
it the name 0 (i.e. zero). Do not forget to change the name to 0, otherwise PSpice will give an
error or
"Floating Node". The reason is that SPICE needs a ground terminal as the reference node that has
the
node number or name 0 (zero).
AUST/EE
E
Figure 5: Place the ground terminal box; the ground terminal should have the name 0
6. Now connect the elements using the Place Wire command from the menu (PLACE/WIRE) or by
clicking
on the Place Wire icon.
9
7. You can assign names to nets or nodes using the Place Net Alias command (PLACE/NET
ALIAS menu).
We will do this for the output node and input node. Name these Out and In, as shown in Figure 2.
2.1.4. Netlist
The netlist gives the list of all elements using the simple format:
R_name node1 node2 value
C_name nodex nodey value, etc.
1. You can generate the netlist by going to the PSPICE/CREATE NETLIST menu.
2. Look at the netlist by double clicking on the Output/name.net file in the Project Manager
Window
(in the left side File window).
Since we are interested in the current direction from the OUT node to the ground, we need to rotate
the
resistor R2 twice so that the node numbers are interchanged:
10
2.2.1 BIAS or DC analysis
1. With the schematic open, go to the PSPICE menu and choose NEW SIMULATION
PROFILE.
2. In the Name text box, type a descriptive name, e.g. Bias
3. From the Inherit From List: select none and click Create.
4. When the Simulation Setting window opens, for the Analyis Type, choose Bias
Point and click OK.
5. Now you are ready to run the simulation: PSPICE/RUN
6. A window will open, letting you know if the simulation was successful. If there are
errors, consult the Simulation Output file.
7. To see the result of the DC bias point simulation, you can open the Simulation
Output file or go back to the schematic and click on the V icon (Enable Bias Voltage
Display) and I icon (current display) to show the voltage and currents (see Figure 6).
The check the direction of the current, you need to look at the netlist: the current is
positive flowing from node1 to node1 (see note on Current Direction above).
PRACTICE:
11
Example 1:
Use the PSpice Schematics to construct the circuit below and obtain the node voltages.
Schematics Netlist
**** INCLUDING "dc analysis-SCHEMATIC1.net" ****
* source DC ANALYSIS
R_R1 V1 V3 500
R_R2 V1 V2 120
R_R3 0 V3 200
R_R4 0 V2 400
V_V1 V2 V3 4
I_I1 0 V1 DC 1A
Example 2
Use the PSpice Schematics to construct the circuit below and obtain the node voltages and
12
mesh currents. Assume a clockwise direction for the mesh current To obtain the node voltages
a VIEWPOINT is placed at each node labeled V1, V2, and V3 (To assign a name or a number
to a node double click on that node). To obtain the three mesh currents an IPROBE is placed in
each mesh. Note that each IPROBE is rotated (Ctrl R) in such a way as to obtain the mesh
current for the assumed clockwise direction.
Schematics Netlist
R_R1 V1 V2 1K
R_R4 V1 $N_0001 0.5K
R_R3 $N_0002 0 0.33333K
R_R2 V2 0 0.25K
I_I1 0 $N_0003 DC 0.2A
I_I2 V2 V3 DC 0.3A
v_V2 $N_0001 V3 0
v_V3 V3 $N_0002 0
v_V1 $N_0003 V1 0
Example 3
Determine the node voltages for the circuit containing a Voltage-Controlled Voltage Source as
shown.
13
Schematics Netlist
R_R3 2 0 0.5K
R_R1 4 1 0.25K
V_V2 3 2 DC 4
E_E1 2 1 4 1 4
R_R2 1 0 1K
I_I1 0 3 DC 0.1A
V_V1 0 4 DC 2V
R_R4 1 3 0.5K
Example 4
14
* Schematics Netlist *
R_R5 5 6 4
R_R4 6 0 1
R_R3 3 4 4
R_R2 3 5 2
R_R1 2 1 2
V_V1 4 6 DC 5V
E_E1 1 0 6 0 3
H_H1 0 5 VH_H1 2
VH_H1 8 3 0V
v_V2 2 8 0
Example 5
15
(b) Obtain the Thevenin's equivalent circuit with respect to the terminal of the 3.5 Ω resistor.
With the 3.5 Ω resistor removed, we find the open-circuit voltage, and with load resistance
shorted we find the short-circuit current. Then, the Thevenin's impedance is
AUST/EEE
Schematics Netlist
V_V1 $N_0001 0 DC 3V
R_R2 $N_0002 0 5
R_R1 $N_0001 $N_0002 1
G_G1 $N_0003 $N_0002 $N_0002 0 2
R_R4 $N_0002 $N_0003 2
R_R3 $N_0003 $N_0004 3
16
V_V3 $N_0005 0 DC 3V
R_R6 $N_0006 0 5
R_R7 $N_0005 $N_0006 1
R_R8 $N_0006 $N_0007 2
G_G2 $N_0007 $N_0006 $N_0006 0 2
R_R12 $N_0009 $N_0008 1
R_R13 $N_0008 $N_0010 2
V_V5 $N_0009 0 DC 3V
R_R11 $N_0008 0 5
R_R14 $N_0010 $N_0011 3
G_G3 $N_0010 $N_0008 $N_0008 0 2
R_Rth $N_0013 $N_0012 2.5
V_Vth $N_0013 0 DC -7.5
R_Rload $N_0014 0 3.5
R_R5 $N_0015 0 3.5
v_V2 $N_0004 $N_0015 0
v_V7 $N_0011 0 0
v_V9 $N_0012 $N_0014 0
2. Transfer function
Computes the gain and the input and output resistances and automatically sends the results to
the output file. To specify the transfer function, choose Setup from the Analysis menu and
open the Transfer Function dialog box. In the Output Variable box specify the output voltage,
and in the Input Source box type the input source name. The transfer function analysis can be
used conveniently to obtain the Thevenin's equivalent circuit. The use of this analysis to
obtain the Thevenin's equivalent circuit is demonstrated in the following example
Example 6
Use the transfer function analysis to obtain the Thevenin's equivalent circuit for the circuit of
Example 5.
We want to obtain the Thevenin's equivalent circuit with respect to the 3.5 Ω resistor. The 3.5
Ω resistor is replaced by an open circuit. Since in PSpice two or more elements must be
connected to each node, the 3.5 Ω resistor is replaced by an infinitely high value resistor as
shown. A VIEWPOINT is added at node 4 to display the open-circuit voltage (Thevenin's
voltage). To obtain the output or Thevenin's resistance, the transfer Function is enabled. In
the Output variable box we type V(4), and in the Input Source box, we type V1.
17
Laboratory Manual Electrical and Electronic Circuits Simulation
Schematics Netlist
V_V1 1 0 DC 3V
R_R1 20 5
R_R2 12 1
G_G1 32202
R_R3 23 2
R_R4 34 3
R_R5 4 0 999999MEG
In addition to the DC analysis result, the output file contains the Transfer Function analysis results as
follows
SMALL-SIGNAL CHARACTERISTICS
V(4,0)/V_V1 = -2.500E+00
INPUT RESISTANCE AT V_V1 = 6.000E+00 OUTPUT
RESISTANCE AT V(4,0) = 2.500E+00
Thus, the Thevenin's voltage is V4 = -7.5 V, and the Thevenin's resistance is the output
resistance 2.5 W.
Exercice:
As instructed by the lab teacher.
AIM: To Simulate the DC Circuit for determining the all-node voltages using PSPICE.
SOFTWARE REOUIRED: PSPICE — Personal Computer Simulated Program with Integrated Circuit Emphasis.
Program:
Vs 1 0 DC 20 O
V
Ra 1 2 5.Ok
Rb 2 0 4.Ok
Rc 3 0 1.Ok
Is 3 2 DC 2 0mA
.END
Circuit diagram:
Output :
NAME CURRENT
Vs -1.333E-03 <== Current entering node 1 of Vs
CONCLUDED
TOTAL JOB TIME .26
Result:
Home work:
1. Complete the above task by equipment value= (Given value+ last 2 digit of your
student ID).
2. Use the PSpice Schematics to construct the circuit below and obtain the node voltages.
A DC Circuit is as shown in the figure. It Consists of Voltage Source whose Value is 10V; the
Current source has the Value of 2A. It has the resistance values as 5f2, l0f2, 20f2, 40f2, and l0f2
respectively. Use PSPICE to plot and calculate the Thevenin's Equivalent Circuit across the nodes 2 and
4. Obtain the transfer function between the two nodes 2 and 4.
CIRCUIT DIAGRAM:
PROGRAM:
Thevenin’s theorem:
VIN 1 0 DC 10V
IS 4 3 2A
VX 4 5 DC 0V
R1 1 2 5
R2 2 3 10
R3 2 0 20
R4 3 4 40
R5 5 0 10
.TF V(2,4) VIN
.END
Norton’s theorem:
CIRCUIT DIAGRAM:
R3
OUTPUT:
RESULT:
HOME WORK:
1. Complete the above task by equipment value= (Given value+ last 2 digit of your
student ID).
Theory:
Coding a Subcircuit
Each subcircuit used in a study must have a unique name. This is true of any other circuit
element. Also, there must be a list of at least two nodes that can be connected to
elements external to the subcircuit. A subcircuit can have many external node
connections, if needed. Later, we will find that parameters can be passed to a subcircuit
in order to allow unique behavior and responses from an instance of a subcircuit.
The initial line of a subcircuit section must begin with ".SUBCKT," followed by the
name and then the external node list. After that, optional features (not to be discussed
yet) can be added. The best method of understanding the use of a subcircuit is by
example. Below, we find a cluster of components that can be combined into a
subcircuit.
Sub circuit:
Note that nodes 5, 12 and 18 have external connections. Therefore, they must be
included in the node list in the subcircuit definition. Nodes 10 and 13 do not have
external connections and need not be (indeed should not be) included in this node
list. They are internal nodes and will be used to help define the subcircuit.
Now, we can code the above subcircuit as follows. Note that the code could be
embedded into the rest of the code for the main circuit or could be placed in a
separate include file.
Program for sub circuit:
.SUBCKT Example_1 5 12 18
Iw 10 12 DC 10A
Ra 5 12 2.0
Rb 5 13 5.0
Rc 12 13 2.0
Rd 5 18 8.0
Re 13 18 3.0
Rf 10 13 1.0
Rg 10 18 6.0
.ENDS
Main circuit diagram:
6.0.ENDS
Vs 1 0 DC 50V
Ra 1 2 1.0
RD 3 4 3.0
Rc 7 0 25.0
Rd 6 0 45.0
X1 2 7 3
X2 4 6 5
.END
Output:
Result:
HOME WORK:
1. Complete the above task by equipment value= (Given value+ last 2 digit of your
student ID).
SYNTAX USED:
For example, Three RLC circuits with R=2f2, 1 I), and 8 f2 respectively, with L having the values
of 50[iH each, with C having the values of 10[iF each. The inputs are identical Step Response. The Step
having the Time at points as lnsec and lmsec respectively and Voltage at a point as lV respectively. Use
PSPICE to plot and calculate the transient response from 0 to 400pseconds with an increment of
lpsecond. Plot the voltages across the capacitors.
CIRCUIT DIAGRAM:
PROGRAM:
OUTPUT:
RESULT: Analysis of Series RLC Circuit with STEP Response has been Successfully
completed.
HOME WORK:
1. Complete the above task by equipment value= (Given value+ last 2 digit of your
student ID).
REPRESENTATION
S.NO TYPE OF SOURCE DECLARATION FORMAT
OF SOURCE
PULSE (Initial Value) (Pulsed Value)
1. PULSE RESPONSE PULSE (Delay Time)( Rise Time)(Fall Time) (
Pulse Width) ( period)
2. TRANSIENT ANALYSIS .TRAN .TRAN TStep Tstop [TStart TMa•I [UIC]
3. PROBE STATEMENT .PROBE It is a wave form analyzer
CIRCUIT DIAGRAM:
OUTPUT:
RESULT: Analysis of Series RLC Circuit with PULSE Response has been
Successfully completed.
HOME WORK:
1. Complete the above task by equipment value= (Given value+ last 2 digit of your
student ID).
AIM: To find out the transient response and parametric analysis by simulation of RLC
circuits Using Sinusoidal Responses.
SYNTAX USED:
REPRESENTATION
S.NO TYPE OF SOURCE DECLARATION FORMAT
OF SOURCE
SIN ( Offset Value) ( Peak Value)
1. SINUSOIDAL RESPONSE SIN ( Frequency)( Delay Time) ( Damping Factor) (
Phase Delay)
2. TRANSIENT ANALYSIS .TRAN .TRAN TStep Tstop [TStart TMax]
3. PROBE STATEMENT .PROBE It is a wave form analyzer
4. PLOT STATEMENT .PLOT .PLOT (Output Variables) ((Lower limit
Value), (Upper Limit Value))
For example, Three RLC circuits with R=2f2, 1 f2, and 8 f2 respectively, with L having the values
of 50ptH each, with C having the values of l0{tF each. The inputs are identical Sinusoidal Response.
The Sinusoidal response having the offset voltage as 0V, RMS voltage as l20V and the frequency as 50Hz.
Use PSPICE to plot and calculate the transient response from 0 to 60mseconds with an increment of
lpsecond. Plot the voltages across the capacitors.
CIRCUIT DIAGRAM:
fNI
RESULT: Analysis of Series RLC Circuit with Sinusoidal Response has been
Successfully completed.
HOME WORK:
1. Complete the above task by equipment value= (Given value+ last 2 digit of your
student ID).
SYNTAX USED:
REPRESENTATION
S.NO TYPE OF SOURCE DECLARATION FORMAT
OF SOURCE
SIN ( Offset Voltage) ( Peak Voltage)
1. SINUSOIDAL RESPONSE SIN ( Frequency)( Delay Time) ( Damping
Factor) ( Phase Delay)
2. TRANSIENT ANALYSIS .TRAN .TRAN TStep Tstop
3. PROBE STATEMENT .PROBE It is a wave form analyzer
.PLOT (Output Variables) |(Lower limit
4. PLOT STATEMENT .PLOT
Value), (Upper Limit Value))
For example, the circuit consists of Generators, transmission lines and loads. It is fed with a
three phase balanced supply. Arrange the generators in STAR connection and connect the Transmission
lines and loads to it. The generator is having a resistance of 0.5f2 and the transmission line is having a
resistance of 1 f2 and consists of loads having Ri=10f2, R2 l0f2, and Rs=10f2 respectively, Li=120mH
and Ci=l20pF. The Sinusoidal having the offset voltage as 0V, RMS voltage as l20V, the frequency as
60Hz, the Delay Time and the Damping Factor are given as 0 and the Phase angle as 1200. Use PSPICE
to plot the instantaneous currents. Plot the transient response from 0 to 50mseconds with an increment of
5ptsecond.
CIRCUIT DIAGRAM:
PROGRAM:
*
VIN1 1 0 SIN(0 169.7V 50)
VIN2 2 0 SIN(0 169.7V 50 0 0 120)
VIN3 3 0 SIN(0 169.7V 50 0 0 240)
RA 1 4 0.5
RB 2 5 0.5
RC 3 6 0.5
RX 4 7 1
RY 5 8 1
RZ 6 9 1
R1 7 10 5
R2 8 11 10
R3 9 12 10
VX 12 0 DC 0V
.TRAN 5US 50MS
.PLOT TRAN I(RA) I(RB) I(RC)
.PROBE
.END
OUTPUT:
Result:
HOME WORK:
1. Complete the above task by equipment value= (Given value+ last 2 digit of your
student ID).
Laboratory Manual Electrical and Electronic Circuits Simulation
AIM: To find out the unknown resistance and maximum power for dc circuits
Circuit diagram:
1.0OHM
Program:
VS 1 0 DC 100
R1 1 2 10
R2 2 0 30
R3 1 3 20
R4 3 0 40
RL 2 3 RLOAD 1
.MODEL RLOAD RES(R=25)
.DC RES RLOAD(R) 0.001 40 0.01
.TF V(2,3) VS
.PROBE
.END
Output:
Result:
HOME WORK:
1. Complete the above task by equipment value= (Given value+ last 2 digit of your
student ID).