3-phase VSI

The phase voltage and phase current of a three-phase inverter operating in 180 degree conduction mode are shown in the figure. The circuit parameters are $V_{dc} = 600\,$V, $f = 50\,$Hz, $I_{sa} = 2\,\sin(\omega \,t-\pi/3)\,$A (and $I_{sb}$, $I_{sc}$ shifted by $2\,\pi/3$ and $4\,\pi/3$ from $I_{sa}$, respectively). What is the total duration for which the diode in switch $S_1$ conducts in one fundamental cycle of the input voltage?
In [1]:
from IPython.display import Image
Image(filename =r'VSI_3ph_8_fig_1.png', width=750)
Out[1]:
No description has been provided for this image
In [2]:
# run this cell to view the circuit file.
%pycat VSI_3ph_8_orig.in

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

In [3]:
import gseim_calc as calc
s_Vdc = "600"
s_f_clock = "50"

l = [
  ('$Vdc', s_Vdc),
  ('$f_clock', s_f_clock),
]
calc.replace_strings_1("VSI_3ph_8_orig.in", "VSI_3ph_8.in", l)
print('VSI_3ph_8.in is ready for execution')
VSI_3ph_8.in is ready for execution
Execute the following cell to run GSEIM on VSI_3ph_8.in.
In [4]:
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("VSI_3ph_8.in")
os.system('run_gseim VSI_3ph_8.in')
get_lib_elements: filename gseim_aux/xbe.aux
get_lib_elements: filename gseim_aux/ebe.aux
Circuit: filename = VSI_3ph_8.in
main: i_solve = 0
main: calling solve_trns
Transient simulation starts...
i=0
i=1000
i=2000
GSEIM: Program completed.
Out[4]:
0

The circuit file (VSI_3ph_8.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on VSI_3ph_8.in) creates data files called VSI_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.

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("VSI_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]

col_v_an = slv.get_index(i_slv,i_out,"v_an")

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

col_g1 = slv.get_index(i_slv,i_out,"g1")
col_g2 = slv.get_index(i_slv,i_out,"g2")
col_g3 = slv.get_index(i_slv,i_out,"g3")
col_g4 = slv.get_index(i_slv,i_out,"g4")
col_g5 = slv.get_index(i_slv,i_out,"g5")
col_g6 = slv.get_index(i_slv,i_out,"g6")

fig, ax = plt.subplots(2, sharex=False, gridspec_kw={'height_ratios': [1, 2]})
plt.subplots_adjust(wspace=0, hspace=0.0)

set_size(6.5, 6, 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'$V_{an}$', 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 = "crimson"

ax[0].plot(t1*1e3, u1[:,col_v_an], color=color7, linewidth=1.0, label="$V_{an}$")

dy = 1.5

ax[1].plot(t2*1e3, (u2[:,col_g1]       ), color=color1, linewidth=1.0, label="$g_1$")
ax[1].plot(t2*1e3, (u2[:,col_g2] -   dy), color=color2, linewidth=1.0, label="$g_2$")
ax[1].plot(t2*1e3, (u2[:,col_g3] - 2*dy), color=color3, linewidth=1.0, label="$g_3$")
ax[1].plot(t2*1e3, (u2[:,col_g4] - 3*dy), color=color4, linewidth=1.0, label="$g_4$")
ax[1].plot(t2*1e3, (u2[:,col_g5] - 4*dy), color=color5, linewidth=1.0, label="$g_5$")
ax[1].plot(t2*1e3, (u2[:,col_g6] - 5*dy), color=color6, linewidth=1.0, label="$g_6$")

ax[1].set_xlabel('time (msec)', fontsize=12)
ax[1].tick_params(left = False)
ax[1].set_yticks([])

ax[1].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: VSI_3ph_8_2.dat
filename: VSI_3ph_8_1.dat
No description has been provided for this image
In [6]:
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("VSI_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]

col_IS1 = slv.get_index(i_slv,i_out,"IS1")
col_ID1 = slv.get_index(i_slv,i_out,"ID1")
col_i_a = slv.get_index(i_slv,i_out,"i_a")

ndiv = 5000

delt_ID1, ID1p = calc.interp_linear_1(t1, u1[:,col_ID1], ndiv)
n_ID1 = 0

i_small = 0.0
for k in range(ndiv):
    if (ID1p[k] > i_small): n_ID1 += 1

print('angle of conduction for D1:', "%7.2f"%(float(n_ID1)*delt_ID1*360.0/(2.0*T)), 'deg.')

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

set_size(6.5, 4, ax[0])

for i in range(3):
    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'$i_a$'   , fontsize=12)
ax[1].set_ylabel(r'$i_{S1}$', fontsize=12)
ax[2].set_ylabel(r'$i_{D1}$', fontsize=12)

ax[0].tick_params(labelbottom=False)
ax[1].tick_params(labelbottom=False)

color1 = "blue"
color2 = "green"
color3 = "crimson"

ax[0].plot(t1*1e3, u1[:,col_i_a], color=color1, linewidth=1.0, label="$i_a$")
ax[1].plot(t1*1e3, u1[:,col_IS1], color=color2, linewidth=1.0, label="$i_{S1}$")
ax[2].plot(t1*1e3, u1[:,col_ID1], color=color3, linewidth=1.0, label="$i_{D1}$")

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

#plt.tight_layout()
plt.show()
filename: VSI_3ph_8_3.dat
angle of conduction for D1:   60.05 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 [ ]: