# chopper parameters
import math
#Variable declaration
Vi = 200.0 # input voltage
Vo = 150.0 # output voltage
R = 10.0 # resistance
#Calculations
#(a)
alfa = Vo/Vi
#(b)
Iavg = Vo/R
Irms = math.sqrt(alfa)*Vi/R
#(c)
Irms_t = Irms
#(d)
Iavg_i = Iavg
#(e)
Reff = R/alfa
#Result
print("(a) Alfa = %.2f "%alfa)
print("(b) Average load current = %.0f A\n RMS load current = %.2f A"%(Iavg,Irms))
print("(c) RMS thyristor current = %.2f A"%Irms_t)
print("(d) Average input current = %.0f A"%Iavg_i)
print("(e) Effective input resistance = %.3f ohm"%Reff)
# periods of conduction and blocking in each cycle
import math
#Variable declaration
Vi = 230.0 # input voltage
Vav = 150.0 # output voltage
f = 1000.0 # frequency
# Calculation
T = 1/f
Ton = Vav*T/Vi
Toff = T -Ton
#Result
print("Conduction Period = %.3f*10^-3 s\nBlocking period = %.3f*10^-3 s"%(Ton*1000,Toff*1000))
# periods of conduction and blocking
import math
#Variable declaration
Ra = 0.06 # armature resistance
Rf = 0.03 # field resistance
I = 15.0 # Average circuit current
f = 500.0 # chopper frequency
Be = 100 # back emf of motor
Vi = 200 # input voltage
#Calculations
Vav = I*(Ra+Rf)+Be
T = 1/f
Ton = Vav*T/Vi
Toff = T -Ton
#Result
print("Conduction Period = %.4f*10^-3 s\nBlocking period = %.4f*10^-3 s"%(Ton*1000,Toff*1000))
# Duty Cycle
import math
#Variable declaration
N = 800.0 # rated speed in rpm
I = 20 # rated current
Ra = 0.5 # armature resistanc
V = 240.0 # supply voltage
N1 = 600.0 # motor speed
#Calculations
#(a)
Be_800 = V- I*Ra
Be_600 = Be_800*N1/N
Vav = Be_600 + I*Ra
D1 = Vav/V
#(b)
Ia = I/2.0
Vav2 = Be_600+Ia*Ra
D2 = Vav2/V
#Result
print("(a) Since torque is constant,Ia is also constant, i.e. %d A\n Duty cycle = %.4f "%(I,D1))
print("(b) Since torque is reduced to half and flux is constant,armature current is reduced to half, i.e. %d A\n Duty cycle = %.4f "%(Ia,D2))
# chopper parameters
import math
#Variable declaration
V = 200.0 # input voltage
R = 8.0 # load resistance
Vt = 2.0 # voltage drop across thyristor
f = 800.0 # chopper frequency
d = 0.4 # duty cycle
alfa = 0.5 # duty cycle for case 5
#Calculations
#(a)
Vav = d*(V-Vt)
#(b)
Vl = math.sqrt(d)*(V-Vt)
#(c)
Po = (Vl**2)/R
Pi = d*V*(V-Vt)/R
eff = Po/Pi
#(d)
Ri = R/d
#(e)
Vl2 = 2*(V-Vt)/math.pi
sqrt_2 = math.floor(math.sqrt(2)*1000)/1000
V1 = Vl2/sqrt_2
V1 = math.floor(V1*1000)/1000
#Result
print("(a) Vav = %.1f V\n(b) Vl = %.3f V\n(c) Chopper efficiency = %.0f%%\n(d) Input resistance = %.0f ohm"%(Vav,Vl,eff*100,Ri))
print("(e)\nThe fundamental component (n=1) is,\nVl = %.2fsin(%d*pi*t)\nThe rms value of fundamental component is, V1 = %.3f V"%(Vl2,2*f,V1))
# chopping frequency
import math
#Variable declartion
V = 400 # input voltage
R = 0 # resistance
L = 0.05 # inductance
alfa = 0.25 # duty cycle of chopper
I = 10 # load current
#Calculation
Vav = V*alfa
Ton = L*I/(V-Vav)
T = Ton/alfa
f = 1/T
#Result
print("Chopper frequency = %d pulses/s"%(f))
# chopper parameters
import math
#variable declaration
R = 4.0 # resistance
L = 6*10**-3 # inductance
V = 200.0 # voltage
alfa = 0.5 # duty cycle
f = 1000.0 # frequency
E = 0 # back emf
#calculations
T = 1/f
#(a)
x = R*T/L
Imax = ((V/R)*((1-math.e**(-alfa*x))/(1-math.e**(-x))))-(E/R)
Imax = math.ceil(Imax*100)/100
Imin = ((V/R)*(((math.e**(alfa*x))-1)/((math.e**(x))-1)))-(E/R)
Imin = math.floor(Imin*100)/100
#(b)
ripple = V/(f*R*L)
#(c)
Iavg = (Imax+Imin)/2
#(d)
Il = math.sqrt((Imin**2)+(((Imax-Imin)**2)/3)+(Imin*(Imax-Imin)))
Il = math.floor(Il*100)/100
#(e)
Iavg_i =0.5*Iavg
#(f)
Irms_i = Il*math.sqrt(0.5)
#Result
print("(a) Imax = %.2f A\tImin = %.2f A"%(Imax,Imin))
print("(b) Maximum Ripple = %.2f A\n(c) Average load current = %.0f A"%(ripple,Iavg))
print("(d) rms load current = %.2f A\n(e) Average input current = %.1f A\n(f) RMS input current = %.3f A"%(Il,Iavg_i,Irms_i))
# Load inductance
import math
#Variable declaration
V = 300 # input voltage
R = 5 # load resistance
f = 250.0 # chopping frequency
r = 0.20 # 20% ripple
I = 30 # Average load current
#Calculations
x = r*I
L = V/(4*f*x)
#Result
print("L = %.0f *10^-3 H"%(L*1000))
# Current at the instannce of turn off of thryster and 5 msec after turn off
import math
#Variable declaration
R = 0.5 # Armature resistance
L = 16*10**-3 # Arature inductance
V = 200.0 # DC input voltage
Be = 100.0 # Back emf
Imin = 10.0 # minimum load current
Toff = 2*10**-3 # thyristor turn off time
delay = 5*10**-3 # current at the to be calculated 5 msec after turn off
#Calculation
#(a)
x = R/L
i = (((V-Be)/R)*(1-math.e**(-x*Toff)))+Imin*(math.e**(-x*Toff))
i = math.floor(i*100)/100
#(b)
i2 = i*(math.e**(-x*delay))
#Result
print("(a) Current at the instance of turn off of thyristor = %.2f A"%i)
print("(b) After the turn off of thyristor,the current freewheels 5 ms.\n\ti = %.2f A"%i2)
# answers in the book are wrong:12.12+9.39=21.41
# Speed of the motor
import math
#Variable declaration
V = 220.0 # input voltage
Ra = 1.0 # armature resistance
N = 1000.0 # no load speed of the motor
alfa = 0.6 # duty cycle
I = 20 # motor current
E = 220.0 # back emf at no load
# Calculations
Vi = V*alfa
Be = Vi-Ra*I
N1 = Be*N/V
#Result
print("Speed of the motor = %.1f rpm"%N1)
# Average load voltage of the chopper
import math
#Variable declaration
Vi = 230.0 # input voltage
Ton = 25 # on time in ms
Toff = 10 # off time in ms
#Calculations
V = Vi*Ton/(Ton+Toff)
#Result
print("Average load voltage = %.3f V"%V)
# max, min and average load current and load voltage
import math
#Variable declaration
V = 100.0 # applied voltage
Be = 0 # back emf
L = 1.0*10**-3 # inductance
R = 0.5 # Resistance
T = 3*10**-3 # Ton + Toff
Ton = 1*10**-3 # Ton
#Calculations
alfa = Ton/T
x = T*R/L
#(a)
Imax = (V/R)*((1- math.e**(-alfa*x))/(1-math.e**(-x)))
#(b)
Imin = (V/R)*((math.e**(alfa*x)-1)/(math.e**(x)-1))
#(c)
Vavg = alfa*V
#Result
print(" Imax = %.2f A\n Imin = %.1f A\n Average load current = %.1f A\n Average output voltage = %.2f V"%(Imax,Imin,(Imax+Imin)/2,Vavg))
# In One quadrant chopper, output voltage and current
import math
#Variable declaration
V = 100.0 # applied voltage
Be = 12.0 # back emf
L = 0.8*10**-3 # inductance
R = 0.2 # Resistance
T = 2.4*10**-3 # Ton + Toff
Ton = 1*10**-3 # Ton
#Calculations
alfa = Ton/T
x = T*R/L
#(a)
Imax = (V/R)*((1- math.e**(-alfa*x))/(1-math.e**(-x)))
#(b)
Imin = (V/R)*((math.e**(alfa*x)-1)/(math.e**(x)-1))
#(c)
Vavg = alfa*V
#Result
print("(a) Imax = %.2f A\n(b) Imin = %.1f A\n(c) Average output voltage = %.2f V"%(Imax,Imin,Vavg))
# Series inductance
import math
#Variable declaration
f = 400.0 # chopping frequency
V = 500.0 # input voltage
I = 10 # maximum current swing
#calculations
L = V/(4*f*I)
#Result
print("Series Inductance, L = %.2f*10^-3 H "%(L*1000))
# Motor speed and current swing
import math
#Variable declaration
V = 800.0 # input voltage
P = 300.0 # motor power rating in HP
eff = 0.9 # motor efficiency
R = 0.1 # total armature and field resistance
L = 100*10**-3 # inductance
alfa = 0.2 # duty cycle
N = 900.0 # motor rated speed
f = 400.0 # chopping frequency
#Calculations
Po = P*735.5/1000
Pi = Po/eff
I = Pi*1000/V
Be = V-(I*R)
Be_duty = (alfa*V)-(I*R)
N2 = N*Be_duty/Be
di = (V- (alfa*V))*alfa/(L*f)
#Result
print("Motor speed = %.2f rpm\nCurrent swing = %.1f A"%(N2,di))
print("Theoretical example")
print("Theoretical example")
# step down chopper parameters
import math
#Variable declaration
V = 200.0 # input voltage
R = 2.0 # resistance
L = 10*10**-3 # inductance
E = 20.0 # back emf
T = 1000*10**-6 # chopping cycle
Ton =300*10**-6 # Ton time of thyrister
#Calculations
#(a)
f = 1/T
x = (R*T)/L
alfa_min =(math.log(1+((E/V)*(math.e**(x)-1))))/x
alfa = Ton/T
#(b)
Imax = ((V/R)*((1-math.e**(-alfa*x))/(1-math.e**(-x))))-(E/R)
Imax = math.floor(Imax*10)/10
Imin = ((V/R)*((math.e**(alfa*x)-1)/(math.e**(x)-1)))-(E/R)
Imin = math.floor(Imin*100)/100
#(c)
Il = (alfa*V-E)/R
#(d)
x1 = alfa*V
x2 = (V*math.sin(math.pi*2*alfa))/math.pi
x3 = (V/math.pi)*(1-math.cos(alfa*2*math.pi))
x4 = (V*math.sin(math.pi*2*2*alfa))/(math.pi*2)
x5 = (V/(2*math.pi))*(1-math.cos(alfa*2*2*math.pi))
x6 = (V*math.sin(math.pi*3*2*alfa))/(math.pi*3)
x7 = (V/(3*math.pi))*(1-math.cos(alfa*2*3*math.pi))
d = f*2*math.pi
#(e)
Iavg = (alfa*(V-E)/R)-(L*(Imax-Imin)/(R*T))
#Result
print("(a) Minimum required value of alfa = %.4f\n Actual value of alfa = %.1f"%(alfa_min,alfa))
print(" Since actual value is more than minimum required for continuous current,the load current is continuous.")
print("\n(b) Imax = %.1f A\tImin = %.2f A"%(Imax,Imin))
print("\n(c) Average load current = %.0f A"%Il)
print("\n(d) Vl = %d + %.2fcos(%.1ft) + %.2fsin(%.1ft)%.2fcos(%.1ft) + %.2fsin(%.1ft)%.2fcos(%.1ft) + %.2fsin(%.1ft)+...."%(x1,x2,d,x3,d,x4,2*d,x5,2*d,x6,3*d,x7,3*d))
print("\n(e) Average Input current = %.2f A"%Iavg)
# answer for Imin is slightly greater than the answer given in book and hence answer for avg input current
# load current values
import math
#variable declaration
V = 200.0 # input voltage
R = 4.0 # resistance
L = 10*10**-3 # inductance
T = 1000*10**-6 # chopping cycle
Ton =300*10**-6 # Ton time of thyrister
#Calculations
f = 1/T
alfa = Ton/T
x1 = alfa*V
x2 = (V*math.sin(math.pi*2*alfa))/math.pi
x2 = math.ceil(x2*100)/100
x3 = (V/math.pi)*(1-math.cos(alfa*2*math.pi))
x3 = math.floor(x3*100)/100
x4 = (V*math.sin(math.pi*2*2*alfa))/(math.pi*2)
x4 = math.floor(x4*100)/100
x5 = (V/(2*math.pi))*(1-math.cos(alfa*2*2*math.pi))
x5 = math.floor(x5*100)/100
x6 = (V*math.sin(math.pi*3*2*alfa))/(math.pi*3)
x6 = math.ceil(x6*100)/100
x7 = (V/(3*math.pi))*(1-math.cos(alfa*2*3*math.pi))
x7 = math.floor(x7*100)/100
sqrt_2 = math.floor(math.sqrt(2)*1000)/1000
V1 = math.sqrt((x2**2+x3**2))/sqrt_2
V2 = math.sqrt((x4**2+x5**2))/sqrt_2
V3 = math.sqrt((x6**2+x7**2))/sqrt_2
Z1_mag = math.sqrt(R**2+(2*math.pi*f*L)**2)
Z1_angle = math.tan((2*math.pi*f*L)/R)
I1 = V1/Z1_mag
Z2_mag = math.sqrt(R**2+(2*2*math.pi*f*L)**2)
Z2_angle = math.tan((2*2*math.pi*f*L)/R)
I2 = V2/Z2_mag
Z3_mag = math.sqrt(R**2+(3*2*math.pi*f*L)**2)
Z3_angle = math.tan((3*2*math.pi*f*L)/R)
I3 = V3/Z3_mag
Iavg = alfa*V/4
Irms = math.sqrt(Iavg**2+I1**2+I2**2+I3**2)
print("RMS value of first harmonic component of load current = %.3f A"%I1)
print("RMS value of second harmonic component of load current = %.4f A"%I2)
print("RMS value of third harmonic component of load current = %.4f A"%I3)
print("RMS value of load current = %.4f A"%Irms)
# L and C of the auxiliary commutation circuit
import math
#Variable declaration
V = 200 # input voltage
I = 50 # average current
Il = 60 # peak load current
Toff = 15*10**-6 # thyristor turn off current
l = 1.5 # max current limit of 150%
#calculation
C = Toff*Il/V # C should be greater than this value
C1 = 5 *10**-6 # assumed
Ic = Il*l-Il
L = (V**2*(C1))/(Ic**2)
#Result
print("C > %.1f*10^-6, Therefore assume C = %.1f*10^6 F"%(C*10**6,C1*10**6))
print("L = %.2f*10^-6 H"%(L*10**6))
# period of conduction
import math
#Variable declaration
V = 200.0 # input voltage
Vav = 250.0 # output voltage
Toff = 0.6*10**-3 # blocking period
#calculation
Ton = (Vav*Toff/V) - Toff
#Result
print("Ton = %.2f*10^-3 second"%(Ton*10**3))
# period of conduction
import math
#Variable declaration
V = 150.0 # input voltage
Vav = 250.0 # output voltage
Toff = 1*10**-3 # blocking period
#calculation
Ton = (Vav*Toff/V) - Toff
#Result
print("Ton = %.4f*10^-3 second"%(Ton*10**3))