SIMULATION OF ELECTRONIC CIRCUITS USING PSPICE (LINEAR INTEGRATED CIRCUITS LAB)
SWAGAT KARNANY 109/EC/07
INDEX
S.No. Expt No.
AIM
Page no.
1.
I
Basic applications of op-amps: AC, DC, and transient response of non-inverting and inverting amplifiers.
3
2.
II
To plot transient response of op-amp integrator and differentiator giving input as square and triangle wave respectively.
10
3.
III
Create a macro-model of op-amp taking into account Ao, w p, Rin and Rout. Simulate a non-inverting amplifier , its compensated version and compensated inverting amplifier.Plot the magnitude response and phase response.
14
4.
IV
To simulate differential amplifier based with current mirror .Carry out the DC, AC and transient analysis.
22
5.
V
PSpice simulation of KHN Biquad filter.
27
2
Sign .
EXPERIMENT NO. 1 AIM: Basic applications applications of op-amps: AC, DC and transient response of non-inverting and inverting amplifiers. THEORY: An operat operation ional al ampli amplifie fierr is a DC-cou DC-couple pled d high-g high-gain ain elect electron ronic ic voltag voltage e ampl amplif ifie ierr with with diff differ eren enti tial al inpu inputs ts and, and, usual usually ly,, a sing single le outp output ut.. In its its ordi ordina nary ry us usag age, e, the the outp output ut of the the op-a op-amp mp is cont contro roll lled ed by nega negati tive ve feedback which, because of the amplifier's high gain, almost completely determines the output voltage for any given input. The usual circuit symbol for an op-amp is:
where: V +: non-inverting input V −: inverting input V out out : output V S+ S+: positive power supply (sometimes also V DD DD, V CC CC, or V CC CC + ) V S− S−: negative power supply (sometimes also V SS SS, V EE EE, or V CC CC − )
Types of Analysis: Pspice allows various types of analysis. The types of analysis and their corresponding .(dot) commands are follows: DC analysis DC sweep of an input voltage/current source, a model parameter, or temperature (.DC) Linearized device model parameterization (.OP) DC operating point (.OP) Small signal transfer function (Thevenin’s equivalent) (.TF) Small signal sensitivities (.SENS) Transient Analysis Time domain response (.TRAN)
3
Fourier analysis (.FOUR)
AC Analysis : Small signal frequency response (.AC) Noise analysis (.NOISE) Non-inverting Non-inverting amplifier
*Non-Inverting Amplifier - AC Analysis
R1 0 2 1k R2 2 6 2k X 3 2 7 4 6 UA741 .lib c:\msimev71\lib\eval.lib c:\msimev71\lib\eval.lib VP 7 0 DC 12V VN 0 4 DC 12V VIN 3 0 AC 0.1V .AC DEC 50 1Hz 1MegHz .PROBE .END *Non-Inverting Amplifier - DC Analysis R1 0 2 1k R2 2 6 2k X 3 2 7 4 6 UA741 .lib c:\msimev71\lib\eval.lib c:\msimev71\lib\eval.lib VP 7 0 DC 12V VN 0 4 DC 12V VIN 3 0 DC 0V
4
.DC LIN VIN -10 - 10 10 0.1V .PROBE .END
* Non-Inverting Amplifier - Transient Analysis R1 0 2 1k R2 2 6 2k X 3 2 7 4 6 UA741 .lib c:\msimev71\lib\eval.lib c:\msimev71\lib\eval.lib VP 7 0 DC 12V VN 0 4 DC 12V VIN 3 0 sin(0.005 0.01 1KHz) .TRAN 0.01ms 5ms 0ms 0.01ms .PROBE .END
5
Inverting Amplifier
*Inverting Amplifier - AC Analysis R1 1 2 1k R2 2 6 10k X 0 2 7 4 6 UA741 .lib "nom.lib" VP 7 0 DC 12V VN 0 4 DC 12V VIN 1 0 AC 0.1V .AC DEC 50 1Hz 1MegHz .PROBE .END
6
*Inverting Amplifier - DC Analysis R1 1 2 1k R2 2 6 2k X 0 2 7 4 6 UA741 .lib "nom.lib" VP 7 0 DC 12V VN 0 4 DC 12V VIN 1 0 DC 0V .DC LIN VIN -10 - 10 10 0.1V .PROBE .END
7
*Inverting Amplifier - Transient Analysis R1 1 2 1k R2 2 6 10k X 0 2 7 4 6 UA741 .lib "nom.lib" VP 7 0 DC 12V VN 0 4 DC 12V VIN 1 0 sin(0 0.01 1KHz) .tran 0.01ms 5ms 0ms 0.01ms .PROBE .END
8
EXPERIMENT NO. 2 9
AIM: To plot transient response of op-amp integrator integrator and differentiator differentiator giving input as square and triangle wave respectively. THEORY: Op-amp integrator A circuit in which output voltage is directly proportional to the integral of the input is known as an integrator or the integration amplifier. Such a circ circui uitt is obta obtain ined ed by us usin ing g oper operat atio iona nall ampl amplif ifie ierr in the the inve invert rtin ing g configuration with the feedback resistor R replaced by a capacitor, C. The transfer function is derived as follows: Vin/R = -Vout x sC
Vout/Vin = -1/sCR
Op-amp differentiator A circuit in which output waveform is the derivative of the input waveform is known as the differentiator or the differentiation amplifier. Such a circuit is obtained obtained by using operational operational amplifier amplifier in the invertin inverting g configurat configuration ion connecting a capacitor, C at the input. The transfer function is derived as follows: Vin x sC = -Vout/R
Vout/Vin = -Scr
10
INTEGRATOR PROGRAM
* OPAMP INTEGRATOR SURBHI .LIB "NOM.LIB" X 0 2 7 4 6 UA741 R1 1 2 .5K C1 2 6 10U Vdd 7 0 DC 12V Vss 0 4 DC 12V Vin 1 0 PULSE( -2V 2V 0S 1NS 1NS .05S .1S) .TRAN 10MS 1S .PROBE .END
INTEGRATOR FREQUENCY RESPONSE * OPAMP INTEGRATOR SURBHI .LIB "NOM.LIB" X 0 2 7 4 6 UA741 Vdd 7 0 DC 12V Vss 0 4 DC 12V Vin 2 0 AC 1V .AC DEC 50 .5HZ 1MEGHZ .PROBE .END
INTEGRATION:
11
20V
10V
0V
-10V 0s
0.1s V (6 ) V (1 )
0.2s
0.3s
0.4s
0.5s
0.6s
0.7s
0.8s
0.9s
1.0s
Time
FREQUENCY RESPONSE: 200KV
150KV
100KV
50KV
0V 100mHz V(6)
1.0Hz
10Hz
100Hz
1.0KHz Frequency
DIFFERENTIATOR PROGRAM
12
10KHz
100KHz
1.0MHz
10MHz
* OPAMP DIFFERENTIATOR BY SURBHI .LIB "NOM.LIB" X 0 2 7 4 6 UA741 R1 2 6 .5K C1 1 2 10U Vdd 7 0 DC 12V Vss 0 4 DC 12V Vin 1 0 PWL(0 0 .5M 5 1M 0 1.5M 5 2M 0 2.5M 5 3M 0 3.5M 5 4M 0) .TRAN 10NS 4MS .PROBE .END 20V
10V
0V
-10V
-20V 0s V( 1)
0.5ms V ( 6)
1.0ms
1. 5ms
2.0 ms
2.5ms
Time
EXPERIMENT NO. 3
13
3. 0ms
3.5 ms
4.0ms
AIM: Create a macro-model of op-amp taking into account Ao, w p , Rin and and Rout out. Sim Simulat ulate e a nonnon-in inve vert rtin ing g amplifi ifier , its compensated version and compensated inverting amplifier . Plot the magnitude response and phase response.
THEORY: The following circuit diagrams are attached: 1. Macro-model of op-amp 2. NonNon-in inve vert rtin ing g ampl amplif ifie ierr (wi (with thou outt comp compen ensa sati tion on)) 3. Comp Compe ens nsat ated ed non-i on-inv nver erti ting ng ampl ampliifier fier 4. Compensated iin nverting am amplifier The parameters of the one-pole op-amp macro-model are: Ao = 2 x 10 5 w p = 10Π Hz. Rin = 2 Mega ohm Rout = 75 ohm The transfer function for the non-inverting amplifier is: Vo/Vin = 1 + R2/R1 The compensated non-inverting amplifier behave like a low pass filter, the transfer function of which is given by T(s) = 1+R2/R1 ts(1+R2/R1)+1 where: t = 1/ w p Ao.
MACROMODEL OF OPAMP
14
*MACROMODEL OF OPAMP BY SURBHI X 3 2 6 OPAMP1 .SUBCKT OPAMP1 3 2 6 R1 3 0 10MEG R2 3 2 2MEG R3 0 2 10MEG E1 4 0 3 2 2E5 RP 4 5 1K CP 5 0 32U E2 10 0 5 0 1 R0 10 6 75 .ENDS OPAMP1
UNCOMPENSATED NON-INVERTING AMPLIFIER
15
*NON INVERTING AMPLIFIER BY SURBHI .LIB "NOM.LIB" X 3 2 7 4 6 UA741 R1 2 0 1K R2 2 6 1K Vdd 7 0 DC 15V Vcc 0 4 DC 15V Vin 3 0 AC .1V .AC DEC 50 10HZ 1MEGHZ .PROBE .END
MAGNITUDE RESPONSE
16
200mV
160mV
120mV
80mV 10Hz V(6)
100Hz
1.0KHz
10KHz
100KHz
1.0MHz
10KHz
100KHz
1.0MHz
V(3) Frequency
PHASE RESPONSE 0d
-50d
-100d 10Hz 100Hz P (V ( V ( 6) 6 ) ) P (V ( V ( 3) 3) )
1.0KHz Frequency
COMPENSATED NON-INVERTING AMPLIFIER
17
*COMPENSATED NON INVERTING AMPLIFIER GAIN VS FREQUENCY BY SURBHI .LIB C:\EC2\MACROOP1.LIB C:\EC2\MACROOP1.LIB X1 3 2 6 OPAMP1 X2 6 5 4 OPAMP1 R1 2 0 1K R2 2 4 1K R3 6 5 1K R4 5 4 1K Vin 3 0 AC .1V .AC DEC 50 10HZ 1MEGHZ .PROBE .END
18
MAGNITUDE RESPONSE 400mV
300mV
200mV
100mV 10Hz V(3)
100Hz
1.0KHz
10KHz
100KHz
1.0MHz
V(6) Frequency
PHASE RESPONSE 50d
0d
-50d
-100d 10 Hz 100Hz P (V ( V (6 ( 6 ) ) P (V ( V ( 3) 3) )
1.0KHz
10KHz Frequency
COMPENSATED INVERTING AMPLIFIER 19
10 0K Hz
1.0MHz
*COMPENSATED INVERTING AMPLIFIER BY SURBHI .LIB C:\EC2\MACROOP1.LIB C:\EC2\MACROOP1.LIB X1 1 2 4 OPAMP1 X2 1 3 7 OPAMP1 X3 1 9 6 OPAMP1 R1 4 3 2K R2 3 0 2K R3 3 6 2K R4 7 9 .5K R5 9 6 .5K R6 2 0 2K R7 6 2 .5K Vin 1 0 AC .1V .AC DEC 50 10HZ 1MEGHZ .PROBE .END MAGNITUDE RESPONSE
20
150mV
100mV
50mV 10Hz V(6)
100Hz
1.0KHz
10KHz
100KHz
1.0MHz
100KHz
1.0MHz
V(1) Frequency
PHASE RESPONSE -0d
-20d
-40d
-60d 10Hz 100Hz P (V ( V ( 6) 6 ) ) P ( V( V ( 1 )) ))
1.0KHz
10KHz Frequency
EXPERIMENT NO. 4 21
AIM-To simulate differential amplifier amplifier based with current mirror .Carry out the DC, AC and transient analysis.
DC ANALYSIS
22
Vcm=0,Rc1 & Rc2 are removed and Vd is varied from -5V to 5V. * DC ANALYSIS OF DIFFERENTIAL AMPLIFIER BIASED WITH CURRENT MIRROR BY SURBHI .LIB "NOM.LIB" Q1 4 1 2 Q2N2222 Q2 5 3 2 Q2N2222 Q3 8 8 9 Q2N2222 Q4 2 8 9 Q2N2222 Vd 10 0 DC 1V Rd 10 0 1 Vcc 6 0 DC 5V Vee 0 9 DC 5V Vc1 6 4 DC 0V Vc2 6 5 DC 0V E1 1 0 10 0 0.5 E2 0 3 10 0 0.5 Rb 8 0 4.3K .DC Vd -5V 5V .1V .PROBE .END 1.2mA
0.8mA
0.4mA
0A -5.0V -4.0V -3.0V I ( Vc 1) I (V c 2)
-2.0V
-1.0V
0.0V Vd
23
1.0V
2.0V
3.0V
4.0V
5.0V
AC ANALYSIS Vc1 and Vc2 are removed and Rc1=Rc2=1kohms * AC ANALYSIS OF DIFFERENTIAL AMPLIFIER BIASED WITH CURRENT MIRROR BY SURBHI .LIB "NOM.LIB" Q1 4 1 2 Q2N2222 Q2 5 3 2 Q2N2222 Q3 8 8 9 Q2N2222 Q4 2 8 9 Q2N2222 Vd 10 0 AC 1V Rd 10 0 1 Vcc 6 0 DC 5V Vee 0 9 DC 5V E1 1 7 10 0 0.5 E2 7 3 10 0 0.5 Rb 8 0 4.3K Vcm 7 0 AC 1V Rc1 6 4 1K Rc2 6 5 1K .AC DEC 50 1HZ 10MEGHZ .PROBE .END 20.0mA
19.5mA
19.0mA 1.0Hz 10Hz IC(Q1)-IC(Q2)
100Hz
1.0KHz
10KHz
Frequency
24
100KHz
1.0MHz
10MHz
TRANSIENT ANALYSIS * TRANSIENT ANALYSIS OF DIFFERENTIAL AMPLIFIER BIASED WITH CURRENT MIRROR BY SURBHI .LIB "NOM.LIB" Q1 4 1 2 Q2N2222 Q2 5 3 2 Q2N2222 Q3 8 8 9 Q2N2222 Q4 2 8 9 Q2N2222 Vd 10 0 SIN(0 0.1V 1KHZ) Rd 10 0 1 Vcc 6 0 DC 5V Vee 0 9 DC 5V E1 1 7 10 0 0.5 E2 7 3 10 0 0.5 Rb 8 0 4.3K Vcm 7 0 AC 0V Rc1 6 4 1K Rc2 6 5 1K .TRAN 1US 10MS .PROBE .END 1.0V
0.5V
0V
-0.5V
-1.0V 0s
1ms 2ms V(4)-V(5)V(10)
3ms
4ms
5ms Time
25
6ms
7ms
8ms
9ms
10ms
1.2mA
0.8mA
0.4mA
0A 0s
1ms 2ms I C ( Q1 ) I C ( Q2 )
3ms
4ms
5ms Time
OUTPUT Differential mode gain, Ad=19.949 Common mode gain, Ac=6.614 * 10^-3 Common mode rejection ratio, CMRR=2994.71(normal CMRR=2994.71(normal scale) =69.52(DB)
26
6ms
7ms
8ms
9ms
10ms
EXPERIMENT NO. 5 AIM-PSpice simulation of KHN Biquad filter
X1: Adder X2: Integrator X3: Integrator R1 = R2 = 20k R3 = Rf = 10k Ra = Rb = 707ohm C1 = C2 = 0.01 Uf
27
*KHN BIQUAD FILTER BY SURBHI .LIB "NOM.LIB" X1 3 2 7 4 6 UA741 X2 0 5 7 4 8 UA741 X3 0 9 7 4 10 UA741 Vdd 7 0 DC 10V Vss 0 4 DC 10V R1 2 10 20K R2 1 3 20K R3 3 8 10K Rf 2 6 10K Ra 6 5 707 Rb 8 9 707 C1 5 8 0.01UF C2 9 10 0.01UF Vin 1 0 AC 10V .AC DEC 50 1HZ 10MEGHZ .PROBE .END 12V
8V
4V
0V 1.0Hz 10Hz 100Hz V(8) V(10) V(1) V(6)
1.0KHz
10KHz
Frequency
28
100KHz
1.0MHz
10MHz
29