Boost Converter: CCM

The boost converter given below is switched at $40\,$kHz and at a duty ratio of 0.3 with a load resistance of $1\,\Omega$. The input voltage to the boost converter is $15\,$V. The inductor is $10\,\mu$H with an ESR of $100\,$m$\Omega$ and the output capacitator is $1000\,\mu$F. The on-state resistance of the switch S is $25\,$m$\Omega$, and the on-state drop across the diode is $0.8\,$V.

Evaluate the following quantities:

  1. output voltage
  2. average input current
  3. output power
  4. efficiency
  5. average power dissipated in the switch, diode, and inductor
In [1]:
from IPython.display import Image
Image(filename =r'boost_ccm_3_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_3_orig.in

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

In [3]:
import gseim_calc as calc
s_Vin = '15'
s_L = '10u'
s_ESR = '100m'
s_R_sw = '25m'
s_V_D = '0.8'
s_R_load = '1'
s_f_hz = '40k'
s_D = '0.3'

l = [
  ('$Vin', s_Vin),
  ('$L', s_L),
  ('$ESR', s_ESR),
  ('$R_load', s_R_load),
  ('$V_D', s_V_D),
  ('$R_sw', s_R_sw),
  ('$f_hz', s_f_hz),
  ('$D', s_D)
]
calc.replace_strings_1("boost_ccm_3_orig.in", "boost_ccm_3.in", l)
print('boost_ccm_3.in is ready for execution')
boost_ccm_3.in is ready for execution
Execute the following cell to run GSEIM on boost_ccm_3.in.
In [4]:
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("boost_ccm_3.in")
os.system('run_gseim boost_ccm_3.in')
Circuit: filename = boost_ccm_3.in
main: calling solve_sss
solve_sss starting: sss_n_st: 2
solve_sss_ex: sss_iter_newton=0, rhs_sss_norm=3.8596e+01, sss_period_1_compute=5.0000e-05
solve_sss_ex: sss_iter_newton=1, rhs_sss_norm=1.1838e-08, sss_period_1_compute=5.0000e-05
solve_sss_ex: sss_iter_newton=2, rhs_sss_norm=1.1807e-13, sss_period_1_compute=5.0000e-05
solve_sss_ex: calling sss_solve_trns_ex for one more trns step
Transient simulation starts...
i=0
i=1000
i=2000
GSEIM: Program completed.
Out[4]:
0

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

In [5]:
calc.print_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=0,
   var_name="v_out", t_start=0.0, t_end=50.0e-6,
   s_format="%11.4E", s1="Vo_avg:", s2="V")

calc.print_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=0,
   var_name="IL", t_start=0.0, t_end=50.0e-6,
   s_format="%11.4E", s1="IL_avg:", s2="Amp")

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[0].legend_position = "upper right"

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

calc.plot_multi_time(
   infile='boost_ccm_3.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=50e-6,
   t_offset=0.0,
   plot_multi=plot_multi)
Vo_avg:  1.6885E+01 V
IL_avg:  2.4182E+01 Amp
filename: boost_ccm_3.dat
No description has been provided for this image
In [6]:
calc.print_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=1,
   var_name="P_VS", t_start=0.0, t_end=50.0e-6,
   s_format="%11.4E", s1="Average power (VS):", s2="W")

calc.print_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=1,
   var_name="P_ESR", t_start=0.0, t_end=50.0e-6,
   s_format="%11.4E", s1="Average power (ESR):", s2="W")

calc.print_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=1,
   var_name="P_S", t_start=0.0, t_end=50.0e-6,
   s_format="%11.4E", s1="Average power (switch):", s2="W")

calc.print_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=1,
   var_name="P_D", t_start=0.0, t_end=50.0e-6,
   s_format="%11.4E", s1="Average power (diode):", s2="W")

calc.print_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=1,
   var_name="P_R", t_start=0.0, t_end=50.0e-6,
   s_format="%11.4E", s1="Average power (load):", s2="W")

P_R_avg = calc.get_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=1,
   var_name="P_R", t_start=0.0, t_end=50.0e-6)

P_VS_avg = calc.get_avg(
   infile='boost_ccm_3.in', i_slv=0, i_out=1,
   var_name="P_VS", t_start=0.0, t_end=50.0e-6)

print('efficiency:', "%11.4E"%(P_R_avg/P_VS_avg))

plot_1 = calc.gseim_plot_single(2)

plot_1.l_plots[0].i_slv = 0
plot_1.l_plots[0].i_out = 1
plot_1.l_plots[0].var_name = "P_R"
plot_1.l_plots[0].plot_type = "X-time"
plot_1.l_plots[0].label = "$P_R$"
plot_1.l_plots[0].color = "dodgerblue"
plot_1.l_plots[0].linewidth = 1.0
plot_1.l_plots[0].linestyle = "solid"

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

plot_1.y_label = ""
plot_1.legend_flag = True
plot_1.legend_position = 'lower right'

calc.plot_single_time(
   infile='boost_ccm_3.in',
   t_mult=1e6,
   x_size=4.0,
   y_size=2.5,
   x_label='time (' + r'$\mu$' + 'sec)',
   label_font_size=11,
   legend_fontsize=10,
   t_start=0.0,
   t_end=50.0e-6,
   t_offset=0.0,
   plot_1=plot_1)
Average power (VS):  3.6273E+02 W
Average power (ESR):  5.9148E+01 W
Average power (switch):  4.4882E+00 W
Average power (diode):  1.3919E+01 W
Average power (load):  2.8511E+02 W
efficiency:  7.8602E-01
filename: boost_ccm_3_1.dat
No description has been provided for this image
In [7]:
import numpy as np
import matplotlib.pyplot as plt 

from setsize import set_size

Dmin = 0.001
Dmax = 0.999
D = np.linspace(Dmin, Dmax, num=100)
VD = 0.8 
Vin = 15
L_ESR = 100.0e-3
R_sw = 25.0e-3
R_load = 1.0 

M = (1.0/(1.0-D))*(1.0 - (1.0 - D)*VD/Vin)/(1.0 + ((L_ESR + D*R_sw)/((1.0-D)*(1.0-D)*R_load)))

M_ideal = 1.0/(1.0-D)

color1='green'
color2='crimson'

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

set_size(5, 3.0, ax) 

plt.grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)

ax.plot(D, M, color=color1, linewidth=1.0, label=r'$M$')
ax.plot(D, M_ideal, color=color2, linewidth=1.0, linestyle = '--', dashes=(4,3), label=r'$M_{ideal}$')

ax.set_xlim(left=0.0, right=1.0)
ax.set_ylim(bottom=0.0, top=5.0)
plt.xlabel(r'$D$', fontsize=11)
plt.ylabel(r'$M$', fontsize=11)

ax.legend(loc = 'upper left',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()
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 [ ]: