Full-bridge converter

The full-bridge converter shown in the figure is operated at a switching frequency of $50\,$kHz. The input voltage of $50\,$V, the output voltage is $500\,$V, $L=1\,$mH, $C=10\,\mu$F, $R=50\,\Omega$, and $N_1:N_2$ is $1:12$. The magnetizing inductance as seen from the primary is $100\,\mu$H. The switches are operated in a phase-modulated manner as shown in the figure, with each switch operating at $50\,\%$ duty cycle.
  1. What is the phase shift ratio $D$?
  2. Find the inductor current ripple and ripple frequency.
  3. Plot the transformer primary voltage and current waveforms.
In [1]:
from IPython.display import Image
Image(filename =r'bridge_dcdc_1_fig_1.png', width=800)
Out[1]:
No description has been provided for this image
In [2]:
# run this cell to view the circuit file.
%pycat bridge_dcdc_1_orig.in

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

In [3]:
import gseim_calc as calc
s_D = "0.65" # to be changed by user
s_Vdc = "50"
s_Lm = "100e-6"
s_L = "1e-3"
s_R = "50"
s_C = "10e-6"
s_N1 = "1"
s_N2 = "12"

f_hz = 50.0e3
T = 1/f_hz
s_Tend = "20e-3"
Tend = float(s_Tend)
T1 = Tend - 2.0*T
s_T1 = ("%11.4E"%(T1)).strip()

D = float(s_D)
t0 = D*T
s_t0 = ("%11.4E"%(t0)).strip()

l = [
  ('$D', s_D),
  ('$Vdc', s_Vdc),
  ('$Lm', s_Lm),
  ('$L', s_L),
  ('$R', s_R),
  ('$C', s_C),
  ('$N1', s_N1),
  ('$N2', s_N2),
  ('$Tend', s_Tend),
  ('$T1', s_T1),
  ('$t0', s_t0),
]
calc.replace_strings_1("bridge_dcdc_1_orig.in", "bridge_dcdc_1.in", l)
print('bridge_dcdc_1.in is ready for execution')
bridge_dcdc_1.in is ready for execution
Execute the following cell to run GSEIM on bridge_dcdc_1.in.
In [4]:
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("bridge_dcdc_1.in")
os.system('run_gseim bridge_dcdc_1.in')
get_lib_elements: filename gseim_aux/xbe.aux
get_lib_elements: filename gseim_aux/ebe.aux
Circuit: filename = bridge_dcdc_1.in
main: i_solve = 0
main: calling solve_trns
Transient simulation starts...
i=0
i=10000
i=20000
i=30000
i=40000
i=50000
i=60000
i=70000
i=80000
i=90000
i=100000
GSEIM: Program completed.
Out[4]:
0

The circuit file (bridge_dcdc_1.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on bridge_dcdc_1.in) creates a data file called bridge_dcdc_1.dat 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.0e3
T = 1.0/f_hz

slv = calc.slv("bridge_dcdc_1.in")

i_slv = 0
i_out = 0
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u1 = np.loadtxt(filename)
t1a = u1[:, 0]
t1 = t1a - t1a[0]

col_v_out = slv.get_index(i_slv,i_out,"v_out")
col_IL    = slv.get_index(i_slv,i_out,"IL")
col_ILm   = slv.get_index(i_slv,i_out,"ILm")
col_ip    = slv.get_index(i_slv,i_out,"ip")
col_vp    = slv.get_index(i_slv,i_out,"vp")

ip_net = u1[:,col_ILm] + u1[:,col_ip]

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

col_IS1 = slv.get_index(i_slv,i_out,"IS1")
col_IS2 = slv.get_index(i_slv,i_out,"IS2")

l_IL_1 = calc.min_max_1(t1, u1[:,col_IL], 0.0, 2.0*T)
IL_ptop = l_IL_1[1] - l_IL_1[0]
print('peak-to-peak ripple in IL:', "%11.4E"%IL_ptop)

color1='red'
color2='goldenrod'
color3='blue'
color4='green'
color5='crimson'
color6='cornflowerblue'

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

set_size(5.5, 8, ax[0])

for i in range(6):
    ax[i].set_xlim(left=0.0, right=2.0*T*1e6)
    ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)

ax[0].set_ylabel(r'$I_L$'      , fontsize=14)
ax[1].set_ylabel(r'$V_{out}$'  , fontsize=14)
ax[2].set_ylabel(r'$V_p$'      , fontsize=14)
ax[3].set_ylabel(r'$I_p^{net}$', fontsize=14)
ax[4].set_ylabel(r'$I_{S1}$'   , fontsize=14)
ax[5].set_ylabel(r'$I_{S2}$'   , fontsize=14)

for i in range(5):
    ax[i].tick_params(labelbottom=False)

ax[0].plot(t1*1e6, u1[:,col_IL]   , color=color1, linewidth=1.0, label="$I_L$")
ax[1].plot(t1*1e6, u1[:,col_v_out], color=color2, linewidth=1.0, label="$V_{out}$")
ax[2].plot(t1*1e6, u1[:,col_vp]   , color=color3, linewidth=1.0, label="$V_p$")
ax[3].plot(t1*1e6, ip_net         , color=color4, linewidth=1.0, label="$i_p^{net}$")
ax[4].plot(t2*1e6, u2[:,col_IS1]  , color=color5, linewidth=1.0, label="$I_{S1}$")
ax[5].plot(t2*1e6, u2[:,col_IS2]  , color=color6, linewidth=1.0, label="$I_{S2}$")

ax[5].set_xlabel('time (' + r'$\mu$' + 'sec)', fontsize=14)

#plt.tight_layout()
plt.show()
filename: bridge_dcdc_1_1.dat
filename: bridge_dcdc_1_2.dat
peak-to-peak ripple in IL:  1.2571E+00
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 [ ]: