Buck-boost Converter: CCM
The periodic current through the capacitor of a buck-boost converter is shown below. If $I_1 = 2\,$A, $I_2 = 1.5\,$A, $I_3 = -1.75\,$A, find the duty ratio $d$.In [1]:
from IPython.display import Image
Image(filename =r'buck_boost_ccm_2_fig_1.png', width=650)
Out[1]:
In [2]:
import numpy as np
import matplotlib.pyplot as plt
import gseim_calc as calc
from setsize import set_size
T = 1.0e-3
D = 0.3 # to be changed by user
I1 = 2.0
I2 = 1.5
I3 = -1.75
n_div = 5000
t = np.linspace(0.0, 2*T, (n_div+1))
slope = (I1-I2)/((1.0-D)*T)
DT = D*T
l1 = []
for i, u in enumerate(t):
t1 = u % T
if t1 < DT:
I = I3
else:
I = I1 - slope*(t1-DT)
l1.append(I)
x = np.array(l1)
l_x = calc.avg_rms_2(t, x, 0.0, 2.0*T, 1.0e-5*T)
x1 = np.array(l_x[0])
if abs(l_x[1][0]) > 1.0e-3*I1:
print('average value:', "%11.4E"%l_x[1][0])
print('D =', D, 'is not correct')
else:
print('D =', D, 'is correct')
color1='blue'
fig, ax = plt.subplots()
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(5, 2.5, ax)
plt.grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax.plot(t*1e3, x, color=color1, linewidth=1.0, label="$i_C$")
ax.plot(x1*1e3, l_x[1], color=color1, linewidth=1.0, label="$i_C^{avg}$", linestyle='--', dashes=(5,3))
ax.set_xlim(0.0, 2.0)
plt.xlabel('time (msec)', fontsize=11)
ax.legend(loc = 'upper 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()
average value: 6.9935E-01 D = 0.3 is not correct
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.
In [ ]: