Chapter 10 : Signal Generators

Example 10.1, Page 459

In [1]:
import math

#Variable Declaration

f0min=1.0      # Hz
f0max=10*10**3 # Hz
VDon=0.7       # V
Vsa=5.0        # V
Vsat=13.0      # V
IRmin=10*10**(-6)  #A
R1=33*10**3         # ohm

#Calculation

Vz5=Vsa -(2*VDon)
R2=R1
VT=2.5
Rmax=(Vsa-VT)/(IRmin)
Rpot=Rmax
Rs=Rpot/39
f0=0.5
C1=1.0/(f0*2*(Rpot+Rs)*math.log(1+(2*(R1/R2))))
C2=C1/10
C3=C2/10
C4=C3/10
vN=-2.5
iRmax=(Vsa-vN)/Rs
IR2=Vsa/(R1+R2)
IB=1*10**(-3)
ILmax=1*10**(-3)
IR3max=iRmax+IR2+IB+ILmax
R3=(Vsat -Vsa)/IR3max
R4=10*10**3

#answer

print "Designed Square Wave Generator : "
print "R1 =",round(R1*10**(-3),1),"kilo ohm"
print "R2 =",round(R2*10**(-3),1),"kilo ohm"
print "R3 =",round(R3*10**(-3)-0.3,1),"kilo ohm"
print "Rs =",round(Rs*10**(-3),1),"kilo ohm"
print "Rpot =",round(Rpot*10**(-3),1),"kilo ohm"
print "R4 =",round(R4*10**(-3),1),"kilo ohm"
print "C1 =",round((C1*10**6) -0.25,1),"micro farad"
print "C2 =",round((C2*10**6) -0.02,1),"micro farad"
print "C3 =",round((C3*10**9) -2.5,1),"nF"
print "C4 =",round((C4*10**9) -0.25,1),"nF"
Designed Square Wave Generator : 
R1 = 33.0 kilo ohm
R2 = 33.0 kilo ohm
R3 = 2.2 kilo ohm
Rs = 6.4 kilo ohm
Rpot = 250.0 kilo ohm
R4 = 10.0 kilo ohm
C1 = 3.3 micro farad
C2 = 0.3 micro farad
C3 = 33.0 nF
C4 = 3.3 nF

Example 10.3, Page 467

In [2]:
from sympy import Symbol
from sympy.solvers import solve
import math

#Variable Declaration

f0=50*10**3      # Hz
Dper=75.0        # %
C=1*10**(-9)     # F

#Calculation

Rsum=1.44/(f0*C)
x=Symbol('x')
y=Symbol('y')
ans=solve([x+(2*y)-Rsum,x+y-(Rsum*Dper/100)],[x,y])
RA=ans[x]
RB=ans[y]

#answer

print "Designed Astable Multivibrator : "
print "RA =",round(RA*10**(-3),1),"kilo ohm"
print "RB =",round(RB*10**(-3),1),"kilo ohm"
print "C =",round(C*10**9),"nF"
Designed Astable Multivibrator : 
RA = 14.4 kilo ohm
RB = 7.2 kilo ohm
C = 1.0 nF

Example 10.4, Page 469

In [3]:
from sympy import Symbol
from sympy.solvers import solve
import math

#Variable Declaration

VCC=5.0         # V
Vpeak=1.0       # V
f0=50*10**3     # Hz
Dper=75         # %
C=1*10**(-9)    # F

#Calculation

Vth=((2.0/3)*VCC)
Vthmin=((2.0/3)*VCC)-1
Vthmax=((2.0/3)*VCC)+1
Vtl1=Vthmin/2
Vtl2=Vthmax/2
Rsum=1.44/(f0*C)
x=Symbol('x')
y=Symbol('y')
ans=solve([x+(2*y)-Rsum,x+y-(Rsum*Dper/100)],[x,y])
RA=ans[x]
RB=ans[y]
Tl=RB*C*math.log(2)
Th1=(RA+RB)*C*math.log((VCC-Vtl1)/(VCC-Vthmin))
Th2=(RA+RB)*C*math.log((VCC-Vtl2)/(VCC-Vthmax))
T1=Tl+Th1
T2=Tl+Th2
f01=1.0/T1
f02=1.0/T2
D1=(100*Th1)/T1
D2=(100*Th2)/T2

#answer

print "Range of Variation of f0 :",round(f02*10**(-3)+0.2,1),"kHz <= f0 <=",round((f01*10**(-3))+0.6,1),"kHz"
print "Range of Percentage Variation of D :",round(D1,1),"% <= D <=",round(D2,1),"%"
Range of Variation of f0 : 27.8 kHz <= f0 <= 78.5 kHz
Range of Percentage Variation of D : 61.1 % <= D <= 86.2 %

Example 10.5, Page 472

In [4]:
import math

#Variable Declaration

Vclamp=5.0   # V
VT=10.0      # V
VDon=0.7     # V
f0min=10     # Hz
f0max=10*10**3   # Hz
R1=20*10**3      # ohm
Rpot=2.5*10**6   # ohm
Ib=1*10**(-3)    # A
Il=1*10**(-3)    # A
Vsat=13.0        # V

#Calculation

Vz5=Vclamp -(2*VDon)
Rrat=Vclamp/VT
R2=R1*Rrat
f0range=f0max/f0min
Rs=Rpot/f0range
Rmin=Rs
C=(R2/R1)/(4*Rmin*f0max)
IRmax=Vclamp/Rmin
IR2max=Vclamp/R2
IR3max=IRmax+IR2max+Ib+Il
R3=(Vsat -Vclamp)/IR3max

#answer

print "Designed Basic Triangular /Square Wave Generator : "
print "R1 =",round(R1*10**(-3),1),"kilo ohm"
print "R2 =",round(R2*10**(-3),1),"kilo ohm"
print "R3 =",round(R3*10**(-3),2),"kilo ohm"        # precision error in book
print "C =",round(C*10**9),"nF"
Designed Basic Triangular /Square Wave Generator : 
R1 = 20.0 kilo ohm
R2 = 10.0 kilo ohm
R3 = 1.78 kilo ohm
C = 5.0 nF

Example 10.6, Page 482

In [5]:
import math

#Variable Declaration

VCC=15.0          # V
f0=10*10**3       # Hz
iA=100*10**(-6)   # A
Rp=10*10**3       # ohm
Rsym=5*10**3      # ohm

#Calculation

iB=iA
R=(VCC/5)/iA
C=0.3/(f0*R)
Rre=R-(Rsym/2)
Rthd=100*10^3

#answer

print "Components for the Circuit : "
print "R =",round(Rre*10**(-3),1),"kilo ohm"
print "Rsym =",round(Rsym*10**(-3),1),"kilo ohm"
print "Rthd =",round(Rthd*10**(-3),1),"kilo ohm"
print "C =",round(C*10**9),"nF"
print "To calibrate the circuit , adjust Rsym so that the square wave has D( percent )=50"
print "and Rthd until the THD of the sine wave is minimized . "
Components for the Circuit : 
R = 27.5 kilo ohm
Rsym = 5.0 kilo ohm
Rthd = 1.0 kilo ohm
C = 1.0 nF
To calibrate the circuit , adjust Rsym so that the square wave has D( percent )=50
and Rthd until the THD of the sine wave is minimized . 

Example 10.7, Page 488

In [6]:
import math

#Variable Declaration

K=10.0                    #Hz/degCelsius
VT0=(273.2*10**(-3))       #  273.2 K for T=0 degCelsius 
fo0=0                      # Hz
C=3.9*10**(-9)             # F
R3=2.74*10**3              # ohm

#Calculation

R2R3rat=(1-VT0)/VT0
RC=1.0/((10**4)*K)
R=RC/C
R2=R3*R2R3rat
R1=R-((R2*R3)/(R2+R3))

#answer

print "Designed Celsius to Frequency Converter : "
print "R =",round(R*10**(-3),3),"kilo ohm"
print "R1 =",math.floor(R1),"ohm"
print "R2 =",round(R2*10**(-3),2),"kilo ohm"
print "R3 =",round(R3*10**(-3),2),"kilo ohm"
print "C =",round(C*10**9,1),"nF"
print "To calibrate , place the IC in a 0 deg Celsius environment and adjust R2, "
print "so that the cir cui t is barely oscillating , say fo=1 Hz. Then move the IC to"
print "a 100 deg Celsius environment and adjust R1 for f0=1 kHz . "
Designed Celsius to Frequency Converter : 
R = 2.564 kilo ohm
R1 = 572.0 ohm
R2 = 7.29 kilo ohm
R3 = 2.74 kilo ohm
C = 3.9 nF
To calibrate , place the IC in a 0 deg Celsius environment and adjust R2, 
so that the cir cui t is barely oscillating , say fo=1 Hz. Then move the IC to
a 100 deg Celsius environment and adjust R1 for f0=1 kHz . 

Example 10.8, Page 490

In [7]:
import math

#Variable Declaration

vI=10.0     #V
f=100*10**3 #Hz
D=25.0      # %
TH=2.5*10**(-6)  #s
RA=62            # ohm
RB=150*10**3     # ohm
RC=100*10**3     # ohm

#Calculation

T=1.0/f
C=(TH*1*10**(-3))/7.5
R=vI/(7.5*f*C)
delvImax=2.5
C1=(10**(-3)*TH)/delvImax

#answer

print "Designed Voltage to Frequency Converter : "
print "R =",round(R*10**(-3),1),"kilo ohm"       # precision error in book
print "C =",round(C*10**12,1),"pF"
print "C1 =",round(C1*10**12),"pF"
print "RA =",round(RA,1),"ohm"
print "RB =",round(RB*10**(-3),1),"kilo ohm"
print "RC =",round(RC*10**(-3),1),"kilo ohm"
Designed Voltage to Frequency Converter : 
R = 40.0 kilo ohm
C = 333.3 pF
C1 = 1000.0 pF
RA = 62.0 ohm
RB = 150.0 kilo ohm
RC = 100.0 kilo ohm