# Field current, firing angle and power factor
import math
# Variable delcaration
V= 230.0 # input supply voltage
f = 50.0 # supply frequency
alfa_f = 0 # firing angle for semi-converter for field
Rf = 200.0 # field resistance
Ra = 0.3 # Armature resistance
T = 50.0 # torque
r = 900.0 # rpm
vc = 0.8 # voltage constant
tc = 0.8 # torque constant
#Calculations
#(a)
sqrt_2 = math.floor(math.sqrt(2)*1000)/1000
Vm = V*sqrt_2
Vf = (2*Vm/math.pi)*math.cos(alfa_f)
If = Vf/Rf
If = math.floor(If*10**4)/10**4
#(b)
Ia = T/(tc*If)
Ia = math.ceil(Ia*1000)/1000
w = r*2*math.pi/60
w = math.ceil(w*1000)/1000
back_emf =vc*w*If
back_emf = math.floor(back_emf*100)/100
Va = back_emf+Ia*Ra
Va = math.floor(Va*1000)/1000
alfa = math.acos((Va*math.pi/(Vm))-1)
alfa_a = alfa*180/math.pi
alfa_a = math.floor(alfa_a*1000)/1000
#(c)
P = Va*Ia
Ii = Ia*math.sqrt((180-alfa_a)/180)
Ii = math.floor(Ii*100)/100
VA = V*Ii
pf = P/VA
#Result
print("(a) Field current = %.4f A\n(b) Alfa_a = %.3f°\n(c) Input power factor = %.3f lagging"%(If,alfa_a,pf))
# Torque developed and motor speed
import math
# Variable delcaration
V= 230.0 # input supply voltage
f = 50.0 # supply frequency
alfa_f = 0 # firing angle of converter in the field
Rf = 200.0 # field resistance
Ra = 0.25 # Armature resistance
Ia = 50 # Armature current
vc = 1.1 # voltage constant
tc = 1.1 # torque constant
alfa_a = 45 # firing angle of armature ciruit
#Calculations
alfa_a = alfa_a*math.pi/180
sqrt_2 = math.floor(math.sqrt(2)*1000)/1000
Vm = V*sqrt_2
Vf = 2*Vm*math.cos(alfa_f)/math.pi
Va = 2*Vm*math.cos(alfa_a)/math.pi
If = Vf/Rf
If = math.floor(If*10**4)/10**4
T = tc*Ia*If
bemf = Va- Ia*Ra - 2
w = bemf/(vc*If)
N = w*60/(2*math.pi)
#Result
print("Torque = %.3f N-m\n\nMotor Speed = %.1f rpm"%(T,N))
# firing angle of the converter in the armature circuit
import math
V = 400 # input 3-phase supply
alfa_f = 0 # firing angle of field converter
Ra = 0.3 # Armature resistance
Rf = 250 # field resistance
Ia = 50 # Armature current
vc = 1.3 # motor voltage constant
N = 1200 # speed in rpm
#Calculations
Vf = 3*math.sqrt(3)*V*math.sqrt(2)*math.cos(alfa_f)/(math.sqrt(3)*math.pi)
If = Vf/Rf
w = N*2*math.pi/60
Eb = vc*If*w
Va = Eb+Ia*Ra
alfa_a = math.acos(Va*math.sqrt(3)*math.pi/(3*V*math.sqrt(2)*math.sqrt(3)))
alfa_a = alfa_a*180/math.pi
alfa_a = math.ceil(alfa_a*100)/100
#Result
print("Alfa_a = %.2f°"%alfa_a)
# input power, speed and torque
import math
# Variable declaration
V = 500 # input supply voltage
Ra = 0.1 # Armature resistance
Ia = 200.0 # Armature current
vc = 1.4 # Volatage constant
tc = 1.4 # Torque constant
If = 2 # Field current
d = 0.5 # chopper duty cycle
# Calculations
#(a)
Pi = d*V*Ia
#(b)
Va = V*d
Eb = Va - Ia*Ra
w = Eb/(vc*If)
w = math.floor(w*100)/100
N = w*60/(2*math.pi)
#(c)
T = tc*Ia*If
#Result
print("(a) Power input = %.0f kW \n(b) Speed = %.2f rpm\n(c) Torque = %.0f N-m"%(Pi/1000,N,T))
# Braking DC motor using one quadrant chopper
import math
#Variable declaration
Ra = 0.1 # Armature resistance
Rb = 7.5 # Breaking resistance
vc = 1.4 # voltage constant
Ia = 120 # armature current
If = 1.6 # field current
d = 0.35 # chopper duty cycle
#calculations
#(a)
Vavg = Rb*Ia*(1-d)
#(b)
Pb = (Ia**2)*Rb*((1-d)**2)
#(c)
Eb = Vavg+Ra*Ia
w = Eb/(vc*If)
w = math.ceil(w*100)/100
N = w*60/(2*math.pi)
#Result
print("(a) Average voltage across chopper = %.0f V\n(b) Pb = %.0f W\n(c) Speed = %.4f rpm "%(Vavg,Pb,N))
#Answer for Pb and Speed is wrong in the book
# Speed -Torque characteristics
import math
#variable declaration
V = 220.0 # per phase input voltage
f = 50 # frequency
L = 0.012 # motor inductance
R = 0.72 # Resistance
a = 2 # Armature constant
alfa = 90 # firing angle
#Calculations
sqrt_2=math.floor(math.sqrt(2)*1000)/1000
sqrt_3=math.floor(math.sqrt(3)*1000)/1000
Va = 3*sqrt_3*V*sqrt_2*(1+math.cos(alfa*math.pi/180))/(2*math.pi)
Va = math.floor(Va*100)/100
Ia1 = 5 # Armature current for case 1
T1 = Ia1*a
Eb1 =Va-Ia1*R
Speed1 = Eb1*60/(a*2*math.pi)
Speed1 = math.floor(Speed1*100)/100
Ia2 = 10 # Armature current for case 2
T2 = Ia2*a
Eb2 =Va-Ia2*R
Speed2 = Eb2*60/(a*2*math.pi)
Speed2 = math.floor(Speed2*100)/100
Ia3 = 20 # Armature current for case 3
T3 = Ia3*a
Eb3 =Va-Ia3*R
Speed3 = Eb3*60/(a*2*math.pi)
Speed3 = math.floor(Speed3*100)/100
Ia4 = 30 # Armature current for case 4
T4 = Ia4*a
Eb4 =Va-Ia4*R
Speed4 = Eb4*60/(a*2*math.pi)
Speed4 = math.floor(Speed4*100)/100
#Result
print("Armature Voltage =%f V"%Va)
print("For Ia =0%d A, Torque = %d N-m and Speed = %.2f rpm"%(Ia1,T1,Speed1))
print("For Ia =%d A, Torque = %d N-m and Speed = %.2f rpm"%(Ia2,T2,Speed2))
print("For Ia =%d A, Torque = %d N-m and Speed = %.2f rpm"%(Ia3,T3,Speed3))
print("For Ia =%d A, Torque = %d N-m and Speed = %.2f rpm"%(Ia4,T4,Speed4))
#################-----PLOT-----#####################
%matplotlib inline
import matplotlib.pyplot as plt
t = [T1, T2, T3, T4]
S = [Speed1, Speed2, Speed3, Speed4 ]
plt.plot(t,S)
plt.plot(t,S,'ro')
plt.axis([0,70,0,1500])
plt.xlabel('Torque(N-m)')
plt.ylabel('Speed(RPM)')
plt.title('Speed torque characteristics')
plt.show()
# Firing angle and no load speed
import math
#Variable declaration
V = 400 # input 3-phase voltage
f = 50 # frequency
Ia = 50 # motor armature current
Ra = 0.1 # armature resistance
bec = 0.3 # back emf constant
alfa = 30.0 # firing angle
Inl = 5 # no load current
n = 1600 # speed in rpm
#Calculations
#(a)
sqrt_2=math.floor(math.sqrt(2)*1000)/1000
sqrt_3=math.floor(math.sqrt(3)*100)/100
Va = 3*sqrt_3*V*sqrt_2*(1+math.cos(alfa*math.pi/180))/(sqrt_3*2*math.pi)
Bemf = Va-Inl*Ra
Speed = Bemf/bec
#(b)
Bemf2 = n*bec
Vi = Bemf2+(Ra*Ia)
alfa2= math.acos((Vi/(3*sqrt_3*V*sqrt_2/(sqrt_3*2*math.pi)))-1)
alfa2 = alfa2*180/math.pi
#Result
print("(a)\nAverage output voltage of rectifier = %.1f V\nBack emf = %.1f V\nSpeed = %d rpm"%(math.floor(Va*10)/10,Bemf,Speed))
print("\n(b)\nBack emf = %.0f V\nInput voltage to motor = %.0f V\nfiring angle = %.2f°"%(Bemf2,Vi,alfa2))
#firing angle of converter and power fed back to source(refering ex.9.2)
import math
#Variable declaration
V= 230.0 # input supply voltage
f = 50.0 # supply frequency
alfa_f = 0 # firing angle of converter in the field
Rf = 200.0 # field resistance
Ra = 0.25 # Armature resistance
Ia = 50 # Armature current
vc = 1.1 # voltage constant
tc = 1.1 # torque constant
alfa_a = 45 # firing angle of armature ciruit
#Calculations
alfa_a = alfa_a*math.pi/180
sqrt_2 = math.floor(math.sqrt(2)*1000)/1000
Vm = V*sqrt_2
Vf = 2*Vm*math.cos(alfa_f)/math.pi
Va1 = 2*Vm*math.cos(alfa_a)/math.pi
bemf = Va1- Ia*Ra - 2
Eg = -bemf
Va = Eg + Ia*Ra +2
alfa = math.acos(Va*math.pi/(2*sqrt_2*V))
alfa = alfa*180/math.pi
P = -Va*Ia
#Result
print("When field current is reversed, the direction of back emf is reversed. The motor now acts as generator.\n\nEg = %f"%Eg)
print("\nAlfa = %.2f°\n\nPower fed back to source = %d W"%(alfa,P))
# Half controlled single phase bridge converter
import math
#variable declaration
V = 240 # input DC voltage
alfa = 100 # firing angle
Ra = 6 # armature Resistance
Ia = 1.8 # armature current
#Calculations
alfa = alfa*math.pi/180
sqrt_2=math.floor(math.sqrt(2)*1000)/1000
Vdc = sqrt_2*V*(1+math.cos(alfa))/math.pi
Vdc = math.floor(Vdc*100)/100
Bemf = Vdc-Ra*Ia
#Result
print("Back emf = %.2f V"%Bemf)
# Speed and Torue
import math
#Variable declaration
V = 230.0 # input voltage
N = 1500.0 # rpm
Ra = 1.0 # armature resistance
Ia = 10 # Armature current
T1 = 5 # Torque for case-1
alfa1 = 30 # Firing angle for case-1
N2 = 950.0 # rpm in case-2
alfa2 = 45 # Firing angle for case-2
#Calculations
w = N*2*math.pi/60
k = (V-Ia*Ra)/w
k = math.floor(k*10)/10
#(a)
Ia1 = T1/k
V1 = 2*V*math.sqrt(2)*math.cos(alfa1*math.pi/180)/math.pi
V1 = math.floor(V1*10)/10
w1 = (V1-Ia1*Ra)/k
w1 = w1*60/(2*math.pi)
#(b)
V2 = 2*V*math.sqrt(2)*math.cos(alfa2*math.pi/180)/math.pi
V2 = math.ceil(V2*100)/100
Ia2 = V2-(k*N2*2*math.pi/60)
#Ia2 = math.floor(Ia2*100)/100
T2 = k*Ia2
#Result
print("k - Torque constant = %.1f N-m/A"%k)
print("\n(a) Speed = %.1f rpm\n\n(b) Torque = %f N-m"%(w1,T2))
#Answer for torque is wrong in the book
# rms source, rms and average thyristor current and power factor
import math
#Variable declaration
V = 500.0 # Morot max. voltage rating
N = 1500.0 # motor max. speed in rpm
Ia = 100.0 # Motor max. current
Vi = 350.0 # 3-phase input supply voltage
Ra = 1.1 # armature resistance
alfa = 45 # firing angle
N1 = 1200.0 # actual speed
#Calculations
w = N*2*math.pi/60
w1 = N1*2*math.pi/60
k = (V-Ia*Ra)/w
k = math.floor(k*10**4)/10**4
sqrt_2=math.floor(math.sqrt(2)*1000)/1000
sqrt_3=math.floor(math.sqrt(3)*100)/100
Va = 3*sqrt_3*Vi*sqrt_2*(1+math.cos(alfa*math.pi/180))/(sqrt_3*2*3.142)#--math.pi = 3.142 to match the ans
Va = math.ceil(Va*100)/100
Ia = (Va -k*w1)/Ra
Ia = math.ceil(Ia*100)/100
Irms_i = Ia*math.sqrt(120.0/180.0)
Iavg = Ia/3
Irms = Ia/math.sqrt(3)
pf = (Ia*Va)/(sqrt_3*Vi*Irms_i)
#Result
print("Torque constant, k = %.2f V-s/rad\n\n(a)\nConverter output voltage = %.2f V\nIa = %.2f A "%(k,Va,Ia))
print("\n(b)\nRMS input current = %.2f A\nAverage thyristor current = %.2f A\nRMS thyristor current = %.2f A"%(Irms_i,Iavg,Irms))
print("Input power factor = %.3f lagging"%(math.floor(pf*1000)/1000))
# time taken by motor to reach 1000rpm speed
import math
#Variable declaration
T = 40 # Load torque
N = 500.0 # motor speed
i = 0.01 # inertia of the drive
T1 = 100.0 # increased value of torque
N1 = 1000.0 # speed value
#Calculations
w = N*2*math.pi/60
w1 = N1*2*math.pi/60
A = -w/((T1-T)/i)
t = (w1/((T1-T)/i))+A
t = math.floor(t*10**6)/10**6
#Result
print("Time taken by motor to reach 1000 rpm speed = %f seconds"%t)
# motor parameters:motor driven by DC chopper
import math
#Variavble declaration
f = 400.0 # chopper operating frequency
V = 200.0 # input voltage
T = 30.0 # load torque
N = 1000.0 # speed in rpm
Ra = 0.2 # motor resistance
L = 2*10**-3 # motor inductance
emf = 1.5 # emf
k = 1.5 # torque constant
#calculations
w = N*math.pi*2/60
Ia = T/k
Be = emf*w
Be = math.ceil(Be*100)/100
alfa = (Be+Ia*Ra)/V
t = 1/f
Ton = alfa*t
Toff = t-Ton
x = t*Ra/L
b1 = (1-(math.e**(-alfa*x)))
b1 = math.ceil(b1*10**4)/10**4
b2 = (1-(math.e**(-x)))
b2 = math.ceil(b2*10**4)/10**4
Imax = ((V/Ra)*(b1/b2))-(Be/Ra)
Imin= ((V/Ra)*(((math.e**(alfa*x))-1)/(((math.e**(x))-1))))-(Be/Ra)
x1 = (V-Be)/Ra
x2 = Ra/L
#Result
print("(a)\nImax = %.3f A\nImin = %d A\n\n(b) Excursion of armature current = %.3f A"%(Imax,Imin,Imax))
print("\n(c)\nVariation of cuurent during on period of chopper is \ni = %.1f*(1-e^(-%d*t'))"%(x1,x2))
print("\nVariation of cuurent during off period of chopper is \ni = %.3f*e^(-%d*t')-%.1f*(1-e^(-%d*t'))"%(Imax,x2,Be/Ra,x2))
# Average motor current and speed
import math
# Variable declaration
f = 50.0 # input frequency
V = 230 # input voltage
Ra = 1.5 # armature resistance
Rf = 1.5 # field resistance
K = 0.25 # torque constant
TL = 25 # load torque
emf = 0.25 # emf constant
#Calculations
Vo = 2*math.sqrt(2)*V/math.pi
Vo = math.floor(Vo)
Ia = math.sqrt(T/K)
Ia = math.floor(Ia)
w = (Vo-Ia*Ra)/(emf*Ia)
N =w*60/(2*math.pi)
N = math.floor(N*100)/100
#Result
print("Ia = %d A\nN = %.2f RPM"%(Ia,N))
# Armature current and firing angle of semi-converter
import math
#Variable declaration
Vo = 675.0 # transformer secondary voltage
alfa1 = 90.5 # case 1 firing angle
N1 = 350.0 # case 1 motor speed in rpm
Ia1 = 30.0 # case 1 armature current
N2 = 500.0 # expected speed
Ra = 0.22 # armature resistance
Rf = 0.22 # field resistance
#Calculations
Ia2 = Ia1*N2/N1
Ia2 = math.ceil(Ia2*100)/100
Va1 = Vo*math.sqrt(2)*(1+math.cos(alfa1*math.pi/180))/math.pi
Eb1 = Va1-(Ia1*(Ra+Rf))
Va2 = (Eb1/((Ia1*N1)/(Ia2*N2)))+Ia2*(Ra+Rf)
alfa2 = math.acos(((Va2*math.pi)/(math.sqrt(2)*Vo))-1)
alfa2 = alfa2*180/math.pi
#Result
print("Armature current = %.2f A\n\nFiring Angle = %.2f°"%(Ia2,alfa2))
# Torque and armature current
import math
# Variable declaration
P = 15.0 # motor power rating
V = 220.0 # motor voltage rating
N = 1500.0 # motor max. speed
Vi = 230.0 # input voltage
emf = 0.03 # emf constant
K = 0.03 # Torque constant
alfa =45 # firing angle
#Calculations
#(a)
sqrt_2 = math.floor(math.sqrt(2)*1000)/1000
alfa = alfa*math.pi/180
Vm = Vi*sqrt_2
N = N*2*math.pi/60
T = (4*emf*(Vm**2)*(math.cos(alfa)**2))/(((math.pi)**2)*(K*N)**2)
Ia = math.sqrt(T/K)
Ia = math.floor(Ia*100)/100
#(b)
Ia2 = Vm*(1+math.cos(alfa))/(math.pi*K*N)
Ia2 = math.floor(Ia2*10)/10
T2 = K*Ia2**2
#Result
print("(a)\n Torque = %.2f N-m\n Armature current = %.2f A"%(T,Ia))
print("\n(b)\n Armature current = %.1f A\n Torque = %.4f N-m"%(Ia2,T2))
# motor current and Torque
import math
# variable declaration
Pr = 15.0 # motor power rating
Vr = 220.0 # motor voltage rating
N = 1000.0 # motor max. speed
R = 0.2 # total armature and series resistance
Vi = 230.0 # input voltage
Ks = 0.03 # speed constant
K = 0.03 # Torque constant
alfa = 30 # Firing angle
#Calculation
sqrt_2 = math.floor(math.sqrt(2)*1000)/1000
alfa = alfa*math.pi/180
Vm = Vi*sqrt_2
N = N*2*math.pi/60
N = math.ceil(N*100)/100
V = Vm*(1+math.cos(alfa))/math.pi
V = math.floor(V*100)/100
Ia = V/((Ks*N)+R)
Ia = math.floor(Ia*1000)/1000
T = K*(Ia*Ia)
# Result
print("Armature current = %.3f A\n\nTorque = %.2f N-m"%(Ia,T))
# load torque, rotor current and stator voltage
import math
# Variable declaration
V = 400.0 # motor voltage rating
p = 4.0 # no of poles
f = 50.0 # frequency
r1 = 0.64 # Stator resistance
x1 = 1.1 # leakage resistance
r2 = 0.08 # rotor resistance
x2 = 0.12 # leakage resistance
T = 40.0 # Torque at given speed
N1 = 1440.0 # Speed value for given torque
N2 = 1300.0 # Speed value for which torque is asked to calculate
#Calculations
#(a)
ns = 60*2*f/p
Tl = T*(N2/N1)**2
Tl = math.floor(Tl*10)/10
#(b)
s = (ns -N2)/ns
r2_dash = r2*(2)**2
x2_dash = x2*(2)**2
pi = math.floor(math.pi*100)/100
I2_dash = math.sqrt((Tl*2*pi*s*(ns/60))/(3*r2_dash))
I2 = 2*I2_dash
#(c)
I1 = I2_dash
V1 = I1*math.sqrt(((r1+r2_dash+r2_dash*((1-s)/s))**2)+(x1+x2_dash)**2)
StV = V1*math.sqrt(3)
#Result
print("(a) At %d rpm , Load torque = %.1f N-m\n(b) Rotor current = %.2f A\n(c) Stator voltage = %.1f V"%(N2,Tl,I2,StV))
# slip for max torque, speed and corresponding max torque
import math
#Variable declaration
V = 400.0 # motor voltage rating
p = 4.0 # no of poles
f = 50.0 # frequency
r1 = 0.64 # Stator resistance
x1 = 1.1 # leakage resistance
r2 = 0.08 # rotor resistance
x2 = 0.12 # leakage resistance
T = 40.0 # Torque at given speed
N1 = 1440.0 # Speed value for given torque
N2 = 1300.0 # Speed value for which torque is asked to calculate
f1 = 50 # case 1 frequency
f2 = 25 # case 2 frequency
#Calculation
#(a)
ns = 2*f1/p
r2_dash = r2*(2)**2
x2_dash = x2*(2)**2
s = r2_dash/math.sqrt(r1**2+(x1+x2_dash)**2)
s = math.floor(s*10000)/10000
V1 = V/math.sqrt(3)
V1 = math.ceil(V1*100)/100
Tmax = (1.5*V1**2/(2*math.pi*ns))*(1/(r1+math.sqrt(r1**2+(x1+x2_dash)**2)))
Tmax = math.floor(Tmax*10)/10
n = ns*(1-s)
N = n*60
#(b)
x1_b = x1/2
x2_dash_b = x2_dash/2
s2 = r2_dash/math.sqrt(r1**2+(x1_b+x2_dash_b)**2)
s2 = math.floor(s2*10000)/10000
ns2 = 2*f2/p
V1_b = V1*0.5
Tmax2 = (1.5*V1_b**2/(2*math.pi*ns2))*(1/(r1+math.sqrt(r1**2+(x1_b+x2_dash_b)**2)))
n2 = ns2*(1-s2)
N2 = n2*60
#Result
print("(a) for f = %d Hz\n\nslip = %.4f\n\nTmax = %.1f N-m\n\nSpeed corresponds to max torque = %.2f rpm"%(f1,s,Tmax,N))
print("\n\n(b) for f = %d Hz\n\nslip = %.4f\n\nTmax = %.2f N-m\n\nSpeed corresponds to max torque = %.3f rpm"%(f2,s2,Tmax2,N2))
# Starting torque
import math
# Variable declaration
V = 400.0 # motor voltage rating
p = 4.0 # no of poles
f = 50.0 # frequency
r1 = 0.64 # Stator resistance
x1 = 1.1 # leakage resistance
r2 = 0.08 # rotor resistance
x2 = 0.12 # leakage resistance
T = 40.0 # Torque at given speed
N1 = 1440.0 # Speed value for given torque
N2 = 1300.0 # Speed value for which torque is asked to calculate
f1 = 50 # case 1 frequency
f2 = 25 # case 2 frequency
#Calculation
#(a)
ns = 2*f1/p
r2_dash = r2*(2)**2
x2_dash = x2*(2)**2
#s = r2_dash/math.sqrt(r1**2+(x1+x2_dash)**2)
#s = math.floor(s*10000)/10000
V1 = V/math.sqrt(3)
V1 = math.ceil(V1*100)/100
Tstarting = (3*(V1**2)*(r2_dash))/(2*math.pi*ns*((r1+r2_dash)**2+(x1+x2_dash)**2))
#(b)
x1_b = x1/2
x2_dash_b = x2_dash/2
#s2 = math.floor(s2*10000)/10000
ns2 = 2*f2/p
V1_b = V1*0.5
Tstarting_b = (3*(V1_b**2)*(r2_dash))/(2*math.pi*ns2*((r1+r2_dash)**2+(x1_b+x2_dash_b)**2))
#Result
print("(a) for %d Hz,\nT_starting = %.2f N-m"%(f1,Tstarting))
print("\n(b) for %d Hz,\nT_starting = %.2f N-m"%(f2,Tstarting_b))