1-phase controlled rectifier

A single-phase controlled converter is connected to a constant current load as shown in the figure. The rectifier is operating at a firing angle of $45^{\circ}$. Determine the duration for which each thyristor conducts in a fundamental period of the input voltage.
In [1]:
from IPython.display import Image
Image(filename =r'controlled_rectifier_1ph_5_fig_1.png', width=400)
Out[1]:
No description has been provided for this image
In [2]:
# run this cell to view the circuit file.
%pycat controlled_rectifier_1ph_5_orig.in

We now replace the strings such as \$L with the values of our choice by running the python script given below. It takes an existing circuit file controlled_rectifier_1ph_5_orig.in and produces a new circuit file controlled_rectifier_1ph_5.in, after replacing \$L (etc) with values of our choice.

In [3]:
import gseim_calc as calc
import numpy as np

s_L = "20e-3"
s_alpha = "45"

l = [
  ('$L', s_L),
  ('$alpha', s_alpha),
]
calc.replace_strings_1("controlled_rectifier_1ph_5_orig.in", "controlled_rectifier_1ph_5.in", l)
print('controlled_rectifier_1ph_5.in is ready for execution')
controlled_rectifier_1ph_5.in is ready for execution
Execute the following cell to run GSEIM on controlled_rectifier_1ph_5.in.
In [4]:
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("controlled_rectifier_1ph_5.in")
os.system('run_gseim controlled_rectifier_1ph_5.in')
get_lib_elements: filename gseim_aux/xbe.aux
get_lib_elements: filename gseim_aux/ebe.aux
Circuit: filename = controlled_rectifier_1ph_5.in
Circuit: n_xbeu_vr = 2
Circuit: n_ebeu_nd = 5
main: i_solve = 0
ssw_allocate_1 (2): n_statevar=1
main: calling solve_trns
mat_ssw_1_ex: n_statevar: 1
mat_ssw_1_e0: cct.n_ebeu: 7
Transient simulation starts...
i=0
i=1000
i=2000
solve_ssw_ex: ssw_iter_newton=0, rhs_ssw_norm=1.0000e+01
Transient simulation starts...
i=0
i=1000
i=2000
solve_ssw_ex: ssw_iter_newton=1, rhs_ssw_norm=0.0000e+00
solve_ssw_ex: calling solve_ssw_1_ex for one more trns step
Transient simulation starts...
i=0
i=1000
i=2000
solve_ssw_1_ex over (after trns step for output)
solve_ssw_ex ends, slv.ssw_iter_newton=1
GSEIM: Program completed.
Out[4]:
0

The circuit file (controlled_rectifier_1ph_5.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on controlled_rectifier_1ph_5.in) creates a data file called controlled_rectifier_1ph_5.dat in the same directory. We can now use the python code below to compute/plot the various quantities of interest.

In [5]:
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_1ph_5_orig.in")

i_slv = 0
i_out = 0
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u = np.loadtxt(filename)
t = u[:, 0]

col_v_s  = slv.get_index(i_slv,i_out,"v_s")
col_g1   = slv.get_index(i_slv,i_out,"g1")
col_g2   = slv.get_index(i_slv,i_out,"g2")
col_IT1  = slv.get_index(i_slv,i_out,"IT1")
col_IT2  = slv.get_index(i_slv,i_out,"IT2")
col_IT3  = slv.get_index(i_slv,i_out,"IT3")
col_IT4  = slv.get_index(i_slv,i_out,"IT4")
col_IL   = slv.get_index(i_slv,i_out,"IL")

# compute durations of diode conduction:

ndiv = 5000

delt_IT1, IT1p = calc.interp_linear_1(t, u[:,col_IT1], ndiv)
delt_IT2, IT2p = calc.interp_linear_1(t, u[:,col_IT2], ndiv)
delt_IT3, IT3p = calc.interp_linear_1(t, u[:,col_IT3], ndiv)
delt_IT4, IT4p = calc.interp_linear_1(t, u[:,col_IT4], ndiv)

n_IT1 = 0
n_IT2 = 0
n_IT3 = 0
n_IT4 = 0

i_small = 0.001

for k in range(ndiv):
    if (IT1p[k] > i_small): n_IT1 += 1
    if (IT2p[k] > i_small): n_IT2 += 1
    if (IT3p[k] > i_small): n_IT3 += 1
    if (IT4p[k] > i_small): n_IT4 += 1

print('angle of conduction for T1:', "%6.2f"%(float(n_IT1)*delt_IT1*360.0/(2.0*T)), 'deg.')
print('angle of conduction for T2:', "%6.2f"%(float(n_IT2)*delt_IT2*360.0/(2.0*T)), 'deg.')
print('angle of conduction for T3:', "%6.2f"%(float(n_IT3)*delt_IT3*360.0/(2.0*T)), 'deg.')
print('angle of conduction for T4:', "%6.2f"%(float(n_IT4)*delt_IT4*360.0/(2.0*T)), 'deg.')

color1='blue'
color2='green'
color3='red'
color4='dodgerblue'

fig, ax = plt.subplots(6, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)

set_size(5.5, 11, ax[0])

for i in range(6):
    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'$v_s$'   , fontsize=12)
ax[1].set_ylabel(r'$g_1$'   , fontsize=12)
ax[2].set_ylabel(r'$g_2$'   , fontsize=12)
ax[3].set_ylabel(r'$I_{T1}$', fontsize=12)
ax[4].set_ylabel(r'$I_{T2}$', fontsize=12)
ax[5].set_ylabel(r'$I_L$'   , fontsize=12)

ax[1].set_yticks([0.0, 1.0])
ax[2].set_yticks([0.0, 1.0])

for k in range(5):
    ax[k].tick_params(labelbottom=False)

ax[0].plot(t*1e3, u[:,col_v_s], color=color1, linewidth=1.0, label="$v_s$")
ax[1].plot(t*1e3, u[:,col_g1 ], color=color2, linewidth=1.0, label="$g_1$")
ax[2].plot(t*1e3, u[:,col_g2 ], color=color2, linewidth=1.0, label="$g_2$")
ax[3].plot(t*1e3, u[:,col_IT1], color=color4, linewidth=1.0, label="$I_{T1}$")
ax[4].plot(t*1e3, u[:,col_IT2], color=color4, linewidth=1.0, label="$I_{T2}$")
ax[5].plot(t*1e3, u[:,col_IL ], color=color4, linewidth=1.0, label="$I_L$")

ax[5].set_xlabel('time (msec)', fontsize=12)

#plt.tight_layout()
plt.show()
filename: controlled_rectifier_1ph_5.dat
angle of conduction for T1: 207.65 deg.
angle of conduction for T2: 207.65 deg.
angle of conduction for T3: 207.65 deg.
angle of conduction for T4: 207.65 deg.
No description has been provided for this image

This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.

In [ ]: