3-phase controlled rectifier
The three-phase thyristor-controlled converter given below is fed from a balanced three-phase AC source. If the rectifier is operated at a firing angle of $30^{\circ}$, determine- the peak-to-peak voltage ripple at the DC terminal voltage $v_o(t)$
- the average value of $v_o$
- RMS thyristor and line currents
- THD of line current
- input power factor
from IPython.display import Image
Image(filename =r'controlled_rectifier_3ph_8_fig_1.png', width=420)
# run this cell to view the circuit file.
%pycat controlled_rectifier_3ph_8_orig.in
We now replace the strings such as \$alpha with the values of our choice by running the python script given below. It takes an existing circuit file controlled_rectifier_3ph_8_orig.in and produces a new circuit file controlled_rectifier_3ph_8.in, after replacing \$alpha (etc) with values of our choice.
import gseim_calc as calc
import numpy as np
s_alpha = "30"
VL = 400.0
A_sin = VL*np.sqrt(2/3)
s_A_sin = ("%11.4E"%(A_sin)).strip()
l = [
('$alpha', s_alpha),
('$A_sin', s_A_sin),
]
calc.replace_strings_1("controlled_rectifier_3ph_8_orig.in", "controlled_rectifier_3ph_8.in", l)
print('controlled_rectifier_3ph_8.in is ready for execution')
controlled_rectifier_3ph_8.in is ready for execution
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("controlled_rectifier_3ph_8.in")
os.system('run_gseim controlled_rectifier_3ph_8.in')
Circuit: filename = controlled_rectifier_3ph_8.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=1000 i=2000 i=3000 GSEIM: Program completed.
0
The circuit file (controlled_rectifier_3ph_8.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on controlled_rectifier_3ph_8.in) creates data files called controlled_rectifier_3ph_8_1.dat, etc. in the same directory. We can now use the python code below to compute/plot the various quantities of interest.
import numpy as np
import matplotlib.pyplot as plt
import gseim_calc as calc
from setsize import set_size
f_hz = 50.0
T = 1.0/f_hz
slv = calc.slv("controlled_rectifier_3ph_8.in")
i_slv = 0
i_out = 0
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u1 = np.loadtxt(filename)
t1 = u1[:, 0]
v_o = slv.get_array_double(i_slv,i_out,"v_o",u1)
Vab = slv.get_array_double(i_slv,i_out,"Vab",u1)
Vbc = slv.get_array_double(i_slv,i_out,"Vbc",u1)
Vca = slv.get_array_double(i_slv,i_out,"Vca",u1)
i_out = 3
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u2 = np.loadtxt(filename)
t2 = u2[:, 0]
g1 = slv.get_array_double(i_slv,i_out,"g1",u2)
g2 = slv.get_array_double(i_slv,i_out,"g2",u2)
g3 = slv.get_array_double(i_slv,i_out,"g3",u2)
g4 = slv.get_array_double(i_slv,i_out,"g4",u2)
g5 = slv.get_array_double(i_slv,i_out,"g5",u2)
g6 = slv.get_array_double(i_slv,i_out,"g6",u2)
l_v_o = calc.avg_rms_2(t1, v_o, 0, 2.0*T, 1.0e-5*T)
t_v_o = np.array(l_v_o[0])
print('average value of v_o:', "%11.4E"%l_v_o[1][0])
l1 = calc.min_max_1(t1, v_o, 0.0, 2.0*T)
del_v_o = l1[1] - l1[0]
print('ripple in v_o:', "%11.4E"%del_v_o)
fig, ax = plt.subplots(2, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(6.5, 7, ax[0])
for i in range(2):
ax[i].set_xlim(left=0.0, right=2.0*T*1e3)
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax[0].set_ylabel(r'voltage', fontsize=12)
ax[1].set_ylabel(r'$g_x$' , fontsize=12)
ax[0].tick_params(labelbottom=False)
color1 = "tomato"
color2 = "dodgerblue"
color3 = "olive"
color4 = "blue"
color5 = "grey"
color6 = "green"
color7 = "darkcyan"
ax[0].plot(t1*1e3, Vab, color=color1, linewidth=1.0, label="$V_{ab}$")
ax[0].plot(t1*1e3, Vbc, color=color2, linewidth=1.0, label="$V_{bc}$")
ax[0].plot(t1*1e3, Vca, color=color3, linewidth=1.0, label="$V_{ca}$")
ax[0].plot(t1*1e3, v_o, color=color4, linewidth=1.0, label="$v_o$")
ax[0].plot(t_v_o*1e3, l_v_o[1], color=color4, linewidth=1.0, label="$v_o^{avg}$", linestyle='--', dashes=(5,3))
ax[1].plot(t2*1e3, (g1 ), color=color1, linewidth=1.0, label="$g_1$")
ax[1].plot(t2*1e3, (g2 - 1.2), color=color2, linewidth=1.0, label="$g_2$")
ax[1].plot(t2*1e3, (g3 - 2.4), color=color3, linewidth=1.0, label="$g_3$")
ax[1].plot(t2*1e3, (g4 - 3.6), color=color5, linewidth=1.0, label="$g_4$")
ax[1].plot(t2*1e3, (g5 - 4.8), color=color6, linewidth=1.0, label="$g_5$")
ax[1].plot(t2*1e3, (g6 - 6.0), color=color7, linewidth=1.0, label="$g_6$")
ax[1].set_xlabel('time (msec)', fontsize=12)
ax[1].tick_params(left = False)
ax[1].set_yticks([])
for i in range(2):
ax[i].legend(loc = 'lower right',frameon = True, fontsize = 10, title = None,
markerfirst = True, markerscale = 1.0, labelspacing = 0.5, columnspacing = 2.0,
prop = {'size' : 12})
#plt.tight_layout()
plt.show()
filename: controlled_rectifier_3ph_8_1.dat filename: controlled_rectifier_3ph_8_4.dat average value of v_o: 4.6781E+02 ripple in v_o: 2.8280E+02
import numpy as np
import matplotlib.pyplot as plt
import gseim_calc as calc
from setsize import set_size
f_hz = 50.0
T = 1.0/f_hz
slv = calc.slv("controlled_rectifier_3ph_8.in")
i_slv = 0
i_out = 1
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u1 = np.loadtxt(filename)
t1 = u1[:, 0]
IT1 = slv.get_array_double(i_slv,i_out,"IT1",u1)
IT2 = slv.get_array_double(i_slv,i_out,"IT2",u1)
IT3 = slv.get_array_double(i_slv,i_out,"IT3",u1)
IT4 = slv.get_array_double(i_slv,i_out,"IT4",u1)
IT5 = slv.get_array_double(i_slv,i_out,"IT5",u1)
IT6 = slv.get_array_double(i_slv,i_out,"IT6",u1)
i_out = 2
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u2 = np.loadtxt(filename)
t2 = u2[:, 0]
ISa = slv.get_array_double(i_slv,i_out,"ISa",u2)
ISb = slv.get_array_double(i_slv,i_out,"ISb",u2)
ISc = slv.get_array_double(i_slv,i_out,"ISc",u2)
l_IT1 = calc.avg_rms_2(t1, IT1, 0, 2.0*T, 1.0e-5*T)
t_IT1 = np.array(l_IT1[0])
print('rms value of thyristor current:', "%11.4E"%l_IT1[2][0])
l_ISa = calc.avg_rms_2(t2, ISa, 0, 2.0*T, 1.0e-5*T)
t_ISa = np.array(l_ISa[0])
print('rms value of line current:', "%11.4E"%l_ISa[2][0])
fig, ax = plt.subplots(7, sharex=False, gridspec_kw={'height_ratios': [1, 1, 1, 1, 1, 1, 2]})
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(6.5, 8, ax[0])
for i in range(7):
ax[i].set_xlim(left=0.0, right=2.0*T*1e3)
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
for i in range(6):
ax[i].set_yticks([0.0, 10.0])
ax[i].set_ylim(bottom=-2.0, top=12.0)
ax[6].set_ylim(bottom=-12.0, top=12.0)
ax[0].set_ylabel(r'$I_{T1}$', fontsize=12)
ax[1].set_ylabel(r'$I_{T2}$', fontsize=12)
ax[2].set_ylabel(r'$I_{T3}$', fontsize=12)
ax[3].set_ylabel(r'$I_{T4}$', fontsize=12)
ax[4].set_ylabel(r'$I_{T5}$', fontsize=12)
ax[5].set_ylabel(r'$I_{T6}$', fontsize=12)
for k in range(6):
ax[k].tick_params(labelbottom=False)
color1 = "blue"
color2 = "red"
ax[0].plot(t1*1e3, IT1, color=color1, linewidth=1.0, label="$I_{T1}$")
ax[1].plot(t1*1e3, IT2, color=color1, linewidth=1.0, label="$I_{T2}$")
ax[2].plot(t1*1e3, IT3, color=color1, linewidth=1.0, label="$I_{T3}$")
ax[3].plot(t1*1e3, IT4, color=color1, linewidth=1.0, label="$I_{T4}$")
ax[4].plot(t1*1e3, IT5, color=color1, linewidth=1.0, label="$I_{T5}$")
ax[5].plot(t1*1e3, IT6, color=color1, linewidth=1.0, label="$I_{T6}$")
ax[6].plot(t2*1e3, ISa, color=color2, linewidth=1.0, label="$I_{Sa}$")
ax[6].set_xlabel('time (msec)', fontsize=12)
#plt.tight_layout()
plt.show()
filename: controlled_rectifier_3ph_8_2.dat filename: controlled_rectifier_3ph_8_3.dat rms value of thyristor current: 5.7736E+00 rms value of line current: 8.1650E+00
import numpy as np
import matplotlib.pyplot as plt
import gseim_calc as calc
from setsize import set_size
f_hz = 50.0
T = 1.0/f_hz
slv = calc.slv("controlled_rectifier_3ph_8.in")
i_slv = 0
i_out = 2
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u1 = np.loadtxt(filename)
t1 = u1[:, 0]
ISa = slv.get_array_double(i_slv,i_out,"ISa",u1)
VSa = slv.get_array_double(i_slv,i_out,"VSa",u1)
P_Vsa = slv.get_array_double(i_slv,i_out,"P_Vsa",u1)
# compute Fourier coeffs:
t_start = T
t_end = 2.0*T
n_fourier = 20
coeff_ISa, thd_ISa = calc.fourier_coeff_1C(t1, ISa,
t_start, t_end, 1.0e-8, n_fourier)
print('THD in line current:', "%5.2f"%(thd_ISa*100.0), "%")
print("line current fundamental: RMS value:", "%11.4E"%(coeff_ISa[1]/np.sqrt(2.0)))
l_ISa = calc.avg_rms_2(t1, ISa , T, 2.0*T, 1.0e-5*T)
l_VSa = calc.avg_rms_2(t1, VSa , T, 2.0*T, 1.0e-5*T)
l_P_Vsa = calc.avg_rms_2(t1, P_Vsa, T, 2.0*T, 1.0e-5*T)
Irms = l_ISa[2][0]
Vrms = l_VSa[2][0]
pf = l_P_Vsa[1][0]/(Vrms*Irms)
print('input power factor:', "%6.3f"%pf)
print('THD in ac line current:', "%5.2f"%(thd_ISa*100.0), "%")
x = np.linspace(0, n_fourier, n_fourier+1)
y_ISa = np.array(coeff_ISa)
fig, ax = plt.subplots()
grid_color='#CCCCCC'
set_size(6, 2, ax)
delta = 5.0
x_major_ticks = np.arange(0.0, (float(n_fourier+1)), delta)
x_minor_ticks = np.arange(0.0, (float(n_fourier+1)), 1.0)
ax.set_xlim(left=-1.0, right=float(n_fourier))
ax.set_xticks(x_major_ticks)
ax.set_xticks(x_minor_ticks, minor=True)
ax.grid(visible=True, which='major', axis='x', color=grid_color, linestyle='-', zorder=0)
ax.set_xlabel('$N$',fontsize=14)
ax.set_ylabel('$I_{Sa}$',fontsize=14)
bars1 = ax.bar(x, y_ISa, width=0.3, color='red', label="$I_{Sa}$", zorder=3)
plt.tight_layout()
plt.show()
filename: controlled_rectifier_3ph_8_3.dat THD in line current: 31.08 % line current fundamental: RMS value: 7.7970E+00 input power factor: 0.827 THD in ac line current: 31.08 %
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.