Chapter 8 - Linear Op-amp Systems

Example 8_1 Page No. 245

In [1]:
from __future__ import division  
Amin=8000
print "Amin=%0.2f"%(Amin) # Minimum gain of OP-AMP
Amax=64000
print "Amax=%0.2f"%(Amax) # Maximum gain 
print "part (i)"
delta_Af=0.01
print "delta_Af=%0.2f"%(delta_Af) # Change in overall feedBack gain 
delta_A=(Amax-Amin)/Amin
print "delta_A= (Amax-Amin)/Amin = %0.2f"%(delta_A) # Change in open loop gain 
Sg = delta_Af/delta_A
B = (1/Sg - 1)/Amax
print "Sg = delta_Af/delta_A = %0.2f"%(Sg)#desensitivity factor
print " B = (1/Sg - 1)/Amax = %0.2f"%(B)#feedBack factor
print " part (ii)"
Af_min = Amin/(1+B*Amin)#minimum change in overall feedBack gain 
Af_max = Amax/(1+B*Amax)#/maximum change in overall feedBack gain 
print "Af_min = Amin/(1+B*Amin) = %0.2f"%(Af_min)
print "Af_max = Amax/(1+B*Amax) = %0.2f"%(Af_max)
print "variation in Af = %0.2f"%(Af_max/Af_min)#variation in Af with feedBack factor 'B'


# for above problem author has divided question in two parts but during solution has written 3 parts. 
# part (i) and part (ii) combinedly equivlent to part (i) 
# part (iii) is equivalent to part (ii)
Amin=8000.00
Amax=64000.00
part (i)
delta_Af=0.01
delta_A= (Amax-Amin)/Amin = 7.00
Sg = delta_Af/delta_A = 0.00
 B = (1/Sg - 1)/Amax = 0.01
 part (ii)
Af_min = Amin/(1+B*Amin) = 90.52
Af_max = Amax/(1+B*Amax) = 91.43
variation in Af = 1.01

Example 8_2 Page No. 248

In [3]:
from __future__ import division  
Avf=-100
print "Avf=%0.2f"%(Avf) # Voltage gain 
Rif=1
print "Rif= %0.2f"%(Rif)," ohm"  #Input resistance of OP-AMP
R1=Rif
RF=-R1*Avf # using formulae Vo=(-RF/R1)*Vi
print "RF= -R1*Avf=%0.2f"%(RF)," ohm"  #Feedback resistance of OP-AMP
# NOTE:Error in value of RF since they have given value of Rif=1ohm but calculated RF by using Rif=1 Kilo ohm
# So i have calculated using Ri=1ohm and hence RF=100 ohm
Avf=-100.00
Rif= 1.00  ohm
RF= -R1*Avf=100.00  ohm

Example 8_3 Page No. 249

In [4]:
from __future__ import division  
R11=1*10**(3)
print "R11= %0.2f"%(R11)," ohm"  # resistance at input terminal of OP-AMP Adder
RF=100*10**(3)
print "RF= %0.2f"%(RF)," ohm"  #Feedback resistance
R12=10*10**(3)
print "R12= %0.2f"%(R12)," ohm"  # resistance at input terminal of OP-AMP  Adder
R13=100*10**(3)
print "R13= %0.2f"%(R13)," ohm"  # resistance at input terminal of OP-AMP  Adder
print "vo = -(%0.2f"%(RF/R11),"vs1 +%0.2f"%(RF/R12),"vs2 +%0.2f"%(RF/R13),"vs3)" # output voltage of opamp adder in terms of input vs1,vs2 vs3

# for average value of input signal
n = 3# given inputs are '3'
R11 = n*RF
R12 = n*RF
R13 = n*RF
print "vo = -(%0.2f"%(RF/R11)," vs1 +%0.2f"%(RF/R12)," vs2 +%0.2f"%(RF/R13)," vs3)" # output voltage of opamp adder 


# note : the output voltage of inverting adder is negative 
# but while calculating weighted output voltage in above question ..author has neglected  or miss the negative sign
R11= 1000.00  ohm
RF= 100000.00  ohm
R12= 10000.00  ohm
R13= 100000.00  ohm
vo = -(100.00 vs1 +10.00 vs2 +1.00 vs3)
vo = -(0.33  vs1 +0.33  vs2 +0.33  vs3)

Example 8_4 Page No. 250

In [2]:
from __future__ import division  
Ir=10*10**(-3)
print "Ir = %0.2f"%(Ir)," ampere/lumen of radiant energy " #photodiode Reverse saturation current for constant reverse bias VR
RF=10*10**(3)
print "RF= %0.2f"%(RF)," ohm"  #Feedback resistance
E=1*10**(-2)
print "E = %0.2f"%(E)," lumens"#  radiant energy
IR=Ir*E
print "IR =Ir*E= %0.2e"%(IR)," ampere" # Reverse saturation current
Vo=IR*RF
print "Vo=IR*RF= %0.2f"%(Vo)," volts" #  output voltage
s=E/Vo
print "scale factor=E/Vo= %0.2f"%(E)," lumens/V" #  Scale factor of photometer
Ir = 0.01  ampere/lumen of radiant energy 
RF= 10000.00  ohm
E = 0.01  lumens
IR =Ir*E= 1.00e-04  ampere
Vo=IR*RF= 1.00  volts
scale factor=E/Vo= 0.01  lumens/V

Example 8_5 Page No. 252

In [3]:
from __future__ import division  
Av=1*10**(5)
print "Av= %0.2f"%(Av) #Voltage gain
RF=100*10**(3)
print "RF= %0.2f"%(RF)," ohm"  #Feedback resistance
RM=10*10**(3)
print "RM= %0.2f"%(RM)," ohm"  # D.C Ammeter internal resistance
Is=10*10**(-6)
print "is = %0.2e"%(Is)," ampere" #  Source current
vo=Is*RF
print "vo=is*RF= %0.2f"%(vo)," volts" #  output voltage
S=vo/Is
print "S=vo/is= %0.2f"%(S)," V/A" # Sensitivity of Ammeter
Rif=RF/(1+Av)
print "Rif=RF/(1+Av)= %0.2f"%(Rif)," ohm"  #Input resistance of OP-AMP
im=100*10**(-6)
print "im = %0.2f"%(im)," ampere" # Meter Full-Scale deflection current   
RF=(im*RM)/Is
print "RF=(im*RM)/is= %0.2f"%(RF)," ohm"  # New required Feedback resistance for im=100 micro ampere
Av= 100000.00
RF= 100000.00  ohm
RM= 10000.00  ohm
is = 1.00e-05  ampere
vo=is*RF= 1.00  volts
S=vo/is= 100000.00  V/A
Rif=RF/(1+Av)= 1.00  ohm
im = 0.00  ampere
RF=(im*RM)/is= 100000.00  ohm

Example 8_6 Page No. 255

In [10]:
from __future__ import division  
Av=36
print "Av= %0.2f"%(Av)," dB" #Voltage gain
R1=1*10**(3)# Choosing value of R1
print "R1= %0.2f"%(R1)," ohm"  # Resistor at input side of OP-AMP
RF=R1*(10**(Av/20)-1) # Using formulae Av=20*log(1+RF/R1)
print "RF=R1*[10**(Av/20)-1]= %0.2f"%(RF)," ohm"  # Calculated Feedback resistance
#NOTE: Correct value of RF=62095.734 ohm or 62.095 kilo ohm but in book given as 62.24 kilo ohm 
 
Av= 36.00  dB
R1= 1000.00  ohm
RF=R1*[10**(Av/20)-1]= 62095.73  ohm

Example 8_7 Page No. 256

In [4]:
from __future__ import division  
If=100*10**(-6)
print "if = %0.2e"%(If)," ampere" #Full-Scale deflection current
Av=1*10**(5)
print "Av= %0.2f"%(Av) #Voltage gain    
vs=10*10**(-3)    
print "vs= %0.2f"%(vs)," volts" #  Input voltage 
RM=100
print "RM= %0.2f"%(RM)," ohm"  # Moving coil Ammeter internal resistance
Ri=10*10**(3)
print "Ri= %0.2f"%(Ri)," ohm"  #Input resistance of OP-AMP
R1=vs/If
print "R1=vs/if= %0.2f"%(R1)," ohm"  # Resistor at input side of OP-AMP in Voltage-to-Current converter 
Avf=1+(RM/R1) # formulae using Avf=1+(RF/R1)=1+(RM/R1)# since RF=RM
print "Avf=1+(RM/R1)=%0.2f"%(Avf) # Overall Voltage gain
Rif=Ri*(Av/Avf)
print "Rif=Ri*(Av/Avf)=%0.2e"%(Rif)," ohm"  # Equivalent input side resistance of OP-AMP with feedback
if = 1.00e-04  ampere
Av= 100000.00
vs= 0.01  volts
RM= 100.00  ohm
Ri= 10000.00  ohm
R1=vs/if= 100.00  ohm
Avf=1+(RM/R1)=2.00
Rif=Ri*(Av/Avf)=5.00e+08  ohm

Example 8_8 Page No. 258

In [5]:
from __future__ import division  
Ro=0.001
print "Ro= %0.2e"%(Ro)," ohm"  #Output resistance
Sv=0.01
print "Sv= %0.2f"%(Sv),"%" # Input Regulation for IC regulator
delta_VI=12-9
print "change in regulator voltage= %0.2f"%(delta_VI)," volts" # Regulator input voltage variation
delta_IL=1.25-1
print "change in regulator Current= %0.2f"%(delta_IL)," A" # Regulator Current variation
delta_Vo=(delta_VI*(Sv/100)+delta_IL*Ro)
print "change in regulator output voltage= %0.2f"%(delta_Vo)," volts" # Regulator output voltage variation
Ro= 1.00e-03  ohm
Sv= 0.01 %
change in regulator voltage= 3.00  volts
change in regulator Current= 0.25  A
change in regulator output voltage= 0.00  volts

Example 8_9 Page No. 260

In [6]:
from math import pi
from __future__ import division  
alpha=1.414# Damping coefficient for Butterworth LP filter
print "alpha=%0.2f"%(alpha)
AM=3-alpha
print "AM=%0.2f"%(AM) # Midband gain of filter 
fOH=1*10**(3)
print "fOH= %0.2f"%(fOH)," Hz"#Cut off frequency
R1=10*10**(3)# Choosing value of R1 same as in book
print "R1= %0.2f"%(R1)," ohm"  # Resistor at input side of (OP-AMP)filter 
RF=R1*(AM-1)
print "RF=R1*(AM-1)=%0.2f"%(RF)," ohm"  #Feedback resistance 
C=0.1*10**(-6) # Choosing value of capacitor same a in book
print "C=%0.2e"%(C),"farad"
R=1/(2*pi*fOH*C)# Using formulae wOH=1/C*R and wOH=(2*pi*fOH)
print "R=1/(omega_OH*C)=1/(2*pi*fOH*C)=%0.2f"%(R)," ohm"  # resistance value for filter design
alpha=1.41
AM=1.59
fOH= 1000.00  Hz
R1= 10000.00  ohm
RF=R1*(AM-1)=5860.00  ohm
C=1.00e-07 farad
R=1/(omega_OH*C)=1/(2*pi*fOH*C)=1591.55  ohm

Example 8_10 Page No. 261

In [7]:
from math import sqrt,pi
from __future__ import division  
fo=150
print "fo= %0.2f"%(fo)," Hz"#Central frequency of band pass filter
BW=15
print "BW= %0.2f"%(BW)," Hz"# Upper cut-off frequency or 3-dB bandwidth
Q=fo/BW # Quality factor
print "Q= %0.2f"%(Q)
C=0.05*10**(-6) # Choosing value of capacitor same as in book
print "C=%0.2e"%(C),"farad"
R=sqrt(2)/(2*pi*fo*C)
print "R=sqrt(2)/(2*pi*fo*C)=%0.2f"%(R)," ohm"  # resistance value for filter design
Am=5-(sqrt(2)/Q) # formulae
print "Am=5-(sqrt(2)/Q)=%0.2f"%(Am) # Midband gain 
Abp=Am/(5-Am)
print "Abp=Am/(5-Am)=%0.2f"%(Abp) # Central frequency  gain 
fo= 150.00  Hz
BW= 15.00  Hz
Q= 10.00
C=5.00e-08 farad
R=sqrt(2)/(2*pi*fo*C)=30010.54  ohm
Am=5-(sqrt(2)/Q)=4.86
Abp=Am/(5-Am)=34.36

Example 8_11 Page No. 263

In [1]:
from __future__ import division  
R=10*10**(3)
print "R= %0.2f"%(R)," ohm"  # resistance
R1=10*10**(3)
print "R1= %0.2f"%(R1)," ohm"  # resistance
C=0.01*10**(-6) #  value of capacitor
print "C=%0.2e"%(C)," farad"
R1_ratio_K=2.5*10**(3)
print "R1_ratio_K= %0.2f"%(R1_ratio_K)," ohm"  # resistance
R2=5*10**(3)
print "R= %0.2f"%(R)," ohm"  # resistance
alpha_R2=250
print "alpha_R2= %0.2f"%(alpha_R2)," ohm"  # resistance
alpha=alpha_R2/R2
print "alpha=alpha_R2/R2= %0.2f"%(alpha)  # Damping factor
Q=1/alpha
print "Q= 1/alpha=%0.2f"%(Q) # Quality factor
omega_o=1/(R*C)
print "omega_o=1/(R*C)= %0.2f"%(omega_o)," radian"# centre angular frequency
BW=omega_o/Q
print "Bandwidth=omega_o/Q= %0.2f"%(BW)," radian"# Upper cut-off frequency or 3-dB bandwidth
K=R1/(R1_ratio_K)# Pass band gain for lPF and HPF of state variable filter
print "K=R1/(R1_ratio_K)= %0.2f"%(K)
Gm=K/alpha# Pass band gain of state variable filter
print "center frequency gain for BPF, K/alpha=K*Q= %0.2f"%(Gm) # Centre frequency gain for BP filter
R= 10000.00  ohm
R1= 10000.00  ohm
C=1.00e-08  farad
R1_ratio_K= 2500.00  ohm
R= 10000.00  ohm
alpha_R2= 250.00  ohm
alpha=alpha_R2/R2= 0.05
Q= 1/alpha=20.00
omega_o=1/(R*C)= 10000.00  radian
Bandwidth=omega_o/Q= 500.00  radian
K=R1/(R1_ratio_K)= 4.00
center frequency gain for BPF, K/alpha=K*Q= 80.00

Example 8_12 Page No. 264

In [2]:
from __future__ import division  
IB=0.5*10**(-6)
print "IB = %0.2e"%(IB)," ampere" #Input bias current 
Iio=0.05*10**(-6)
print "Iio = %0.2e"%(Iio)," ampere" #Input offset current  
Vio=1*10**(-3)
print "Vio= %0.2e"%(Vio)," volts" #Input offset voltage
R1=10*10**(3)
print "R1= %0.2f"%(R1)," ohm"  # resistance
RF=500*10**(3)
print "RF= %0.2f"%(RF)," ohm"  #Feedback resistance
Vos1=Vio*(1+RF/R1)
print "Vos1=Vio*(1+RF/R1)=%0.2f"%(Vos1)," volts" #output offset voltage due to input offset voltage
Vos2=IB*RF
print "Vos2=IB*RF=%0.2f"%(Vos2)," volts" #output offset voltage due to Input bias current 
Vos=Vos1+Vos2
print "Vos=Vos1+Vos2=%0.2f"%(Vos)," volts" #total output offset voltage 
R2=(R1*RF)/(R1+RF)
print "R2=(R1*RF)/(R1+RF)= %0.2f"%(R2)," ohm"  # resistance to balance IB effect 
Vos2=Iio*RF
print "Vos2=Iio*RF=%0.2f"%(Vos2)," volts" # Reduced output offset voltage due to Input offset current  
Vos=Vos1+Vos2
print "Vos=Vos1+Vos2=%0.2f"%(Vos)," volts" # output offset voltage with compensation 
  
IB = 5.00e-07  ampere
Iio = 5.00e-08  ampere
Vio= 1.00e-03  volts
R1= 10000.00  ohm
RF= 500000.00  ohm
Vos1=Vio*(1+RF/R1)=0.05  volts
Vos2=IB*RF=0.25  volts
Vos=Vos1+Vos2=0.30  volts
R2=(R1*RF)/(R1+RF)= 9803.92  ohm
Vos2=Iio*RF=0.02  volts
Vos=Vos1+Vos2=0.08  volts

Example 8_13 Page No. 265

In [3]:
from __future__ import division  
Iio=0.1*10**(-9)
print "Iio = %0.2e"%(Iio)," ampere/degree _celsius" #Input offset current  
Vio=10*10**(-6)
print "Vio= %0.2e"%(Vio)," volt/degree _celsius" #Input offset voltage
Vs=10*10**(-3)
print "Vs= %0.2f"%(Vs)," volts" #Input voltage
R1=10*10**(3)
print "R1= %0.2f"%(R1)," ohm"  # resistance
RF=100*10**(3)
print "RF= %0.2f"%(RF)," ohm"  #Feedback resistance
print "part(i)"
R2=(R1*RF)/(R1+RF)# R1 in parallel with RF
print "R2=(R1*RF)/(R1+RF)= %0.2f"%(R2)," ohm"  # resistance to balance IB i.e offset effect 
print "part(ii)"
delta_T=75-25
print "delta_T=75-25 = %0.2f"%(delta_T)," degree_celsius" #Temperature change
delta_Vo=((Vio*delta_T)*(1+RF/R1))+(Iio*delta_T*RF)
print "delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)= %0.2f"%(delta_Vo)," volts" #Output voltage drift
print "part(iii)"
Vo=(-RF/R1)*Vs
print "Vo=(-RF/R1)*Vs= %0.2f"%(Vo)," volts" #Inverting OP-AMP output voltage
e=(delta_Vo/Vo)*100
print "Percentage error=(delta_Vo/Vo)*100 =(-)%0.2f"%(abs(e)),", (+)%0.2f"%(abs(e)),"  percent"#percentage error
Iio = 1.00e-10  ampere/degree _celsius
Vio= 1.00e-05  volt/degree _celsius
Vs= 0.01  volts
R1= 10000.00  ohm
RF= 100000.00  ohm
part(i)
R2=(R1*RF)/(R1+RF)= 9090.91  ohm
part(ii)
delta_T=75-25 = 50.00  degree_celsius
delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)= 0.01  volts
part(iii)
Vo=(-RF/R1)*Vs= -0.10  volts
Percentage error=(delta_Vo/Vo)*100 =(-)6.00 , (+)6.00   percent

Example 8_14 Page No. 266

In [4]:
from __future__ import division  
Iio=0.1*10**(-9)
print "Iio = %0.2e"%(Iio)," ampere" #Input offset current
VCC=15
print "VCC= %0.2f"%(VCC)," volts" #  voltage supply  
PSRR=150*10**(-6)
print "PSRR= %0.2e"%(PSRR),"  volts/V"# Power supply rejection ratio
Vio=10*10**(-6)
print "Vio= %0.2e"%(Vio)," volts" #Input offset voltage
R1=10*10**(3)
print "R1= %0.2f"%(R1)," ohm"  # resistance
RF=100*10**(3)
print "RF= %0.2f"%(RF)," ohm"  #Feedback resistance
delta_T=75-25
print "delta_T=75-25 = %0.2f"%(delta_T)," celsius" #Temperature change
delta_Vo=((Vio*delta_T)*(1+RF/R1))+(Iio*delta_T*RF)
print "delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)= %0.2f"%(delta_Vo)," volts" #Output voltage drift
delta_Vio1=(delta_Vo)*(R1/RF)
print "delta_Vio1=(delta_Vo)*(R1/RF)= %0.2f"%(delta_Vio1)," volts" # voltage change at Input for voltage drift found
delta_Vio2=(delta_Vio1)*(1/10)
print "delta_Vio2=(delta_Vio1)*(1/10)= %0.2f"%(delta_Vio2)," volts" #  change in Vio due to PSRR
p=((delta_Vio2)/(VCC*PSRR))*100
print "power supply regulation=[(delta_Vio2)/(VCC*PSRR)]*100 =%0.2f"%(p)," percent"# power supply regulation requirement

#delta_Vio1 corresponds to voltage change at Input for voltage drift found 
#delta_Vio2 corresponds voltage change at input due to PSRR
Iio = 1.00e-10  ampere
VCC= 15.00  volts
PSRR= 1.50e-04   volts/V
Vio= 1.00e-05  volts
R1= 10000.00  ohm
RF= 100000.00  ohm
delta_T=75-25 = 50.00  celsius
delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)= 0.01  volts
delta_Vio1=(delta_Vo)*(R1/RF)= 0.00  volts
delta_Vio2=(delta_Vio1)*(1/10)= 0.00  volts
power supply regulation=[(delta_Vio2)/(VCC*PSRR)]*100 =2.67  percent

Example 8_15 Page No. 271

In [7]:
from math import pi
from __future__ import division  
SR=0.65
print "SR= %0.2f"%(SR),"  volts/microsecond"# Slew rate of OP-AMP
print "part(i)"
Vm=5
print "Vm= %0.2f"%(Vm)," volts" #  Output peak voltage1
fsm=SR/(10**(-6)*(2*pi*Vm)) # using formulae  SR=2*pi*fsm*Vm
print "fsm=SR/[10**(-6)*(2*pi*Vm)] = %0.2f"%(fsm)," Hz"# # Full power bandwidth  for Output peak voltage Vm=5V
print "part(ii)"
Vm=1
print "Vm= %0.2f"%(Vm)," volts" #  Output peak voltage2
fsm=SR/(10**(-6)*(2*pi*Vm))  # using formulae  SR=2*pi*fsm*Vm
print "fsm=SR/[10**(-6)*(2*pi*Vm)] = %0.2f"%(fsm)," Hz"# # Full power bandwidth  for Output peak voltage Vm=1V
SR= 0.65   volts/microsecond
part(i)
Vm= 5.00  volts
fsm=SR/[10**(-6)*(2*pi*Vm)] = 20690.14  Hz
part(ii)
Vm= 1.00  volts
fsm=SR/[10**(-6)*(2*pi*Vm)] = 103450.71  Hz