Boost Converter: CCM

The boost converter given below has an input voltage of $V_i = 5\,V$. The average output voltage is $V_o = 10\,V$, and the load resistance is $5\,\Omega$. The switching frequency is $25\,$kHz. If $L = 200\,\mu$H and $C = 200\,\mu$F, evaluate the following quantities:
  1. duty ratio
  2. peak-to-peak ripple voltage across the capacitor
  3. peak-to-peak ripple in the inductor current
  4. rms current through switch, diode, inductor, and capacitor
In [1]:
from IPython.display import Image
Image(filename =r'boost_ccm_1_fig_1.png', width=320)
Out[1]:
No description has been provided for this image
In [2]:
# run this cell to view the circuit file.
%pycat boost_ccm_1_orig.in

We now replace the strings \$Vin, \$L, \$C, \$R, \$D, \$f_hz with the values of our choice by running the python script given below. It takes an existing circuit file boost_ccm_1_orig.in and produces a new circuit file boost_ccm_1.in, after replacing \$L, \$C, \$R, \$D, \$f_hz with the values of our choice.

In [3]:
import gseim_calc as calc
s_Vin = '5'
s_L = '200u'
s_C = '200u'
s_R = '5'
s_D = '0.3'# to be changed by user
s_f_hz = '25e3'
l = [
  ('$Vin', s_Vin),
  ('$L', s_L),
  ('$C', s_C),
  ('$R', s_R),
  ('$D', s_D),
  ('$f_hz', s_f_hz)
]
calc.replace_strings_1("boost_ccm_1_orig.in", "boost_ccm_1.in", l)
print('boost_ccm_1.in is ready for execution')
boost_ccm_1.in is ready for execution
Execute the following cell to run GSEIM on boost_ccm_1.in.
In [4]:
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("boost_ccm_1.in")
os.system('run_gseim boost_ccm_1.in')
Circuit: filename = boost_ccm_1.in
main: calling solve_sss
solve_sss starting: sss_n_st: 2
solve_sss_ex: sss_iter_newton=0, rhs_sss_norm=1.3909e+00, sss_period_1_compute=8.0000e-05
solve_sss_ex: sss_iter_newton=1, rhs_sss_norm=1.3013e-01, sss_period_1_compute=8.0000e-05
solve_sss_ex: sss_iter_newton=2, rhs_sss_norm=3.1323e-13, sss_period_1_compute=8.0000e-05
solve_sss_ex: calling sss_solve_trns_ex for one more trns step
Transient simulation starts...
i=0
GSEIM: Program completed.
Out[4]:
0

The circuit file (boost_ccm_1.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on boost_ccm_1.in) creates a data file boost_ccm_1.dat in the same directory. We can now use the python code below to view the inductor current as a function of time.

In [5]:
n_plots = 2
l_n_curves = [2, 2]
plot_multi = calc.gseim_plot_multi(n_plots, l_n_curves)

plot_multi.plot_all[0].l_plots[0].i_slv = 0
plot_multi.plot_all[0].l_plots[0].i_out = 0
plot_multi.plot_all[0].l_plots[0].var_name = "IL"
plot_multi.plot_all[0].l_plots[0].plot_type = "X-time"
plot_multi.plot_all[0].l_plots[0].label = "$I_L$"
plot_multi.plot_all[0].l_plots[0].color = "green"
plot_multi.plot_all[0].l_plots[0].linewidth = 1.0
plot_multi.plot_all[0].l_plots[0].linestyle = "solid"

plot_multi.plot_all[0].l_plots[1].i_slv = 0
plot_multi.plot_all[0].l_plots[1].i_out = 0
plot_multi.plot_all[0].l_plots[1].var_name = "IL"
plot_multi.plot_all[0].l_plots[1].plot_type = "AVG"
plot_multi.plot_all[0].l_plots[1].label = "$I_L^{avg}$"
plot_multi.plot_all[0].l_plots[1].color = "green"
plot_multi.plot_all[0].l_plots[1].linewidth = 1.0
plot_multi.plot_all[0].l_plots[1].linestyle = "dashed"
plot_multi.plot_all[0].l_plots[1].line_tuple = (3, 2)

plot_multi.plot_all[1].l_plots[0].i_slv = 0
plot_multi.plot_all[1].l_plots[0].i_out = 0
plot_multi.plot_all[1].l_plots[0].var_name = "v_out"
plot_multi.plot_all[1].l_plots[0].plot_type = "X-time"
plot_multi.plot_all[1].l_plots[0].label = "$V_{out}$"
plot_multi.plot_all[1].l_plots[0].color = "dodgerblue"
plot_multi.plot_all[1].l_plots[0].linewidth = 1.0
plot_multi.plot_all[1].l_plots[0].linestyle = "solid"

plot_multi.plot_all[1].l_plots[1].i_slv = 0
plot_multi.plot_all[1].l_plots[1].i_out = 0
plot_multi.plot_all[1].l_plots[1].var_name = "v_out"
plot_multi.plot_all[1].l_plots[1].plot_type = "AVG"
plot_multi.plot_all[1].l_plots[1].label = "$V_{out}^{avg}$"
plot_multi.plot_all[1].l_plots[1].color = "dodgerblue"
plot_multi.plot_all[1].l_plots[1].linewidth = 1.0
plot_multi.plot_all[1].l_plots[1].linestyle = "dashed"
plot_multi.plot_all[1].l_plots[1].line_tuple = (3, 2)

plot_multi.plot_all[0].y_label = ""
plot_multi.plot_all[0].legend_flag = True

plot_multi.plot_all[1].y_label = ""
plot_multi.plot_all[1].legend_flag = True

calc.plot_multi_time(
   infile='boost_ccm_1.in',
   t_mult=1e6,
   x_size=5.0,
   y_size=5.0,
   x_label='time (' + r'$\mu$' + 'sec)',
   label_font_size=11,
   legend_fontsize=10,
   t_start=0.0,
   t_end=80e-6,
   t_offset=0.0,
   plot_multi=plot_multi)
filename: boost_ccm_1.dat
No description has been provided for this image

On the output file produced by GSEIM (in this case, boost_ccm_1.dat), we can do some post-processing to obtain average and rms values, for example. For this purpose, a python module gseim_calc.py has been included in the directory from which you launched Jupyter. Run the following python script to obtain the quantities of interest listed in the question.

In [6]:
calc.print_ptop(
   infile='boost_ccm_1.in', i_slv=0, i_out=0,
   var_name="IL", t_start=0.0, t_end=80.0e-6,
   s_format="%11.4E", s1="IL_ptop:", s2="Amp")

calc.print_ptop(
   infile='boost_ccm_1.in', i_slv=0, i_out=0,
   var_name="v_out", t_start=0.0, t_end=80.0e-6,
   s_format="%11.4E", s1="Vo_ptop:", s2="V")

calc.print_rms(
   infile='boost_ccm_1.in', i_slv=0, i_out=0,
   var_name="IL", t_start=0.0, t_end=80.0e-6,
   s_format="%11.4E", s1="IL_rms:", s2="Amp")

calc.print_rms(
   infile='boost_ccm_1.in', i_slv=0, i_out=0,
   var_name="IS", t_start=0.0, t_end=80.0e-6,
   s_format="%11.4E", s1="IS_rms:", s2="Amp")

calc.print_rms(
   infile='boost_ccm_1.in', i_slv=0, i_out=0,
   var_name="ID", t_start=0.0, t_end=80.0e-6,
   s_format="%11.4E", s1="ID_rms:", s2="Amp")

calc.print_rms(
   infile='boost_ccm_1.in', i_slv=0, i_out=0,
   var_name="IC", t_start=0.0, t_end=80.0e-6,
   s_format="%11.4E", s1="IC_rms:", s2="Amp")

calc.print_avg(
   infile='boost_ccm_1.in', i_slv=0, i_out=0,
   var_name="v_out", t_start=0.0, t_end=80.0e-6,
   s_format="%11.4E", s1="Vo_avg:", s2="V")
IL_ptop:  2.9988E-01 Amp
Vo_ptop:  8.5621E-02 V
IL_rms:  2.0422E+00 Amp
IS_rms:  1.1183E+00 Amp
ID_rms:  1.7088E+00 Amp
IC_rms:  9.3793E-01 Amp
Vo_avg:  7.1385E+00 V

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

In [ ]: