Bi-directional voltage source converter
A single-phase bi-directional voltage source converter is connected to an AC voltage source through an inductor $L = 5\,$mH as given below. All the switches are ideal and are operated using the sinusoidal pulse width modulation technique. The dc link voltage is $500\,$V. The AC source voltage is $230\,\angle{0}\,$V. The PWM carrier signal is a triangle wave between $-1$ and $1$ with a frequency of $10\,$kHz, and the modulating signal is $v_{ref}(t) = M\,\sin\,(\omega \,t + \theta)$. If $\phi$ is varied from $-180^{\circ}$ to $180^{\circ}$, show that the locus of the tip of the fundamental component of the inductor current is a circle. Find the origin and radius of the circle.In [1]:
from IPython.display import Image
Image(filename =r'VSC_bi_4_fig_1.png', width=300)
Out[1]:
In [2]:
# run this cell to view the circuit file.
%pycat VSC_bi_4_orig.in
In [3]:
import numpy as np
import gseim_calc as calc
import os
import dos_unix
# do not change the following line; later calculations depend on
# the arguments here.
phi_arr = np.linspace(-180.0, 180.0, 37)
real_IL = []
imag_IL = []
s_L = '5e-3'
s_Vdc = '500'
s_M = '0.8'
s_f_hz = '50'
A_sin = 230.0*np.sqrt(2.0)
s_A_sin = ("%11.4E"%A_sin).strip()
for phi in phi_arr:
s_phi = "%11.4E"%phi
l = [
('$L', s_L),
('$Vdc', s_Vdc),
('$M', s_M),
('$f_hz', s_f_hz),
('$A_sin', s_A_sin),
('$phi', s_phi),
]
print('phi:', s_phi)
calc.replace_strings_1("VSC_bi_4_orig.in", "VSC_bi_4.in", l)
# uncomment for windows:
#dos_unix.d2u("VSC_bi_4.in")
os.system('run_gseim VSC_bi_4.in')
slv = calc.slv("VSC_bi_4.in")
i_slv = 0
i_out = 0
filename = slv.l_filename_all[i_slv][i_out]
u = np.loadtxt(filename)
t = u[:, 0]
t0 = t[0]
t = t - t0
col_IL = slv.get_index(i_slv,i_out,"IL")
T = t[-1]
coeff, thd, coeff_a, coeff_b = calc.fourier_coeff_2A(t, u[:,col_IL], 0.0, T, 1.0e-8*T, 1)
k_fourier = 1
A, theta_rad, theta_deg = calc.get_mag_angle_1(k_fourier, coeff_a, coeff_b)
real_x, imag_x = calc.get_mag_angle_2(k_fourier, coeff_a, coeff_b)
real_IL.append(real_x)
imag_IL.append(imag_x)
print('phi_arr[18]:', phi_arr[18])
x1 = real_IL[0]
x2 = real_IL[18]
y1 = imag_IL[0]
y2 = imag_IL[18]
x_o = 0.5*(x1 + x2)
y_o = 0.5*(y1 + y2)
delx = x2 - x1
dely = y2 - y1
r = 0.5*np.sqrt(delx*delx + dely*dely)
print('x1:', "%11.4E"%x1, 'x2:', "%11.4E"%x2)
print('y1:', "%11.4E"%y1, 'y2:', "%11.4E"%y2)
print('delx:', "%11.4E"%delx)
print('dely:', "%11.4E"%dely)
print('from graph:')
print('origin: (', "%11.4E"%x_o, ",", "%11.4E"%y_o, ")")
print('radius:', "%11.4E"%r)
L = float(s_L)
Vdc = float(s_Vdc)
M = float(s_M)
f_hz = float(s_f_hz)
A_sin = float(s_A_sin)
omg = 2.0*np.pi*f_hz
XL = omg*L
y_o_theory = A_sin/XL
r_theory = M*Vdc/XL
print('from theory:')
print('origin: (0,', "%11.4E"%y_o_theory, ")")
print('radius:', "%11.4E"%r_theory)
phi: -1.8000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.7000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.6000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.5000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.4000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.3000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.2000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.1000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.0000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -9.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -8.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -7.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -6.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -5.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -4.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -3.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -2.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: -1.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 0.0000E+00 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 2.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 3.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 4.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 5.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 6.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 7.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 8.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 9.0000E+01 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.0000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.1000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.2000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.3000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.4000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.5000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.6000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.7000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi: 1.8000E+02 get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = VSC_bi_4.in main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 i=50000 i=100000 GSEIM: Program completed. phi_arr[18]: 0.0 x1: 2.5302E+02 x2: -2.5622E+02 y1: 2.0902E+02 y2: 2.0517E+02 delx: -5.0924E+02 dely: -3.8501E+00 from graph: origin: ( -1.5962E+00 , 2.0710E+02 ) radius: 2.5463E+02 from theory: origin: (0, 2.0707E+02 ) radius: 2.5465E+02
In [4]:
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator, AutoMinorLocator)
from setsize import set_size
fig, ax = plt.subplots()
ax.set_aspect('equal', adjustable='box')
plt.grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax.set_xlabel('$Re(i_L)$',fontsize=12)
ax.set_ylabel('$Im(i_L)$',fontsize=12)
ax.plot(real_IL, imag_IL, color="blue", linewidth=1.0)
plt.tight_layout()
plt.show()
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.
In [ ]: