Dual active bridge DC-DC converter
The dual active bridge DC-DC converter shown in the figure is operated in phase shift modulation with a switching frequency of $50\,$kHz. The other parameters of the converter are $V_s = 50\,$V, $N_1:N_2 = 1:10$, $V_o = 400\,$V, $L_{LK} = 20\,\mu$H, $C_{out} = 22\,\mu$F, $R = 640\,\Omega$.- Determine the phase shift $\phi$.
- Plot the current through the inductor $L_{LK}$ and mark its salient features.
In [1]:
from IPython.display import Image
Image(filename =r'bridge_dcdc_3_fig_1.png', width=900)
Out[1]:
In [2]:
# run this cell to view the circuit file.
%pycat bridge_dcdc_3_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_3_orig.in and produces a new circuit file bridge_dcdc_3.in, after replacing \$Vdc, \$L, etc. with values of our choice.
In [3]:
import gseim_calc as calc
s_phi = "0.16" # to be entered by user
s_Vdc = "50"
s_LLK = "20e-6"
s_R = "640"
s_C = "22e-6"
s_N1 = "1"
s_N2 = "10"
f_hz = 50.0e3
T = 1/f_hz
s_Tend = "120e-3"
Tend = float(s_Tend)
T1 = Tend - 2.0*T
s_T1 = ("%12.5E"%(T1)).strip()
phi = float(s_phi)
t0 = phi*T
s_t0 = ("%11.4E"%(t0)).strip()
l = [
('$Vdc', s_Vdc),
('$LLK', s_LLK),
('$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_3_orig.in", "bridge_dcdc_3.in", l)
print('bridge_dcdc_3.in is ready for execution')
bridge_dcdc_3.in is ready for execution
Execute the following cell to run GSEIM on bridge_dcdc_3.in.
In [4]:
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("bridge_dcdc_3.in")
os.system('run_gseim bridge_dcdc_3.in')
get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = bridge_dcdc_3.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 i=110000 i=120000 i=130000 i=140000 i=150000 i=160000 i=170000 i=180000 i=190000 i=200000 i=210000 i=220000 i=230000 i=240000 i=250000 i=260000 i=270000 i=280000 i=290000 i=300000 GSEIM: Program completed.
Out[4]:
0
The circuit file (bridge_dcdc_3.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on bridge_dcdc_3.in) creates a data file called bridge_dcdc_3.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_3.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_ILLK = slv.get_index(i_slv,i_out,"ILLK")
col_VLLK = slv.get_index(i_slv,i_out,"VLLK")
VLLK = u1[:,col_VLLK]
n = np.size(VLLK)
l_index = []
for i in range(0,(n-1)):
if (abs(VLLK[i+1]-VLLK[i])) > 1.0:
l_index.append(i)
print('time points where slope of ILLK changes:')
for k in l_index:
t0 = t1[k]
print(' ', "%5.1F"%(t0*1e6), 'micro-sec')
color1='red'
color2='goldenrod'
color3='blue'
color4='green'
color5='crimson'
color6='cornflowerblue'
fig, ax = plt.subplots(2, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(5.5, 4, ax[0])
for i in range(2):
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_{LLK}$', fontsize=14)
ax[1].set_ylabel(r'$V_{out}$', fontsize=14)
ax[0].tick_params(labelbottom=False)
ax[0].plot(t1*1e6, u1[:,col_ILLK] , color=color1, linewidth=1.0, label="$I_{LLK}$")
ax[1].plot(t1*1e6, u1[:,col_v_out], color=color2, linewidth=1.0, label="$V_{out}$")
ax[1].set_xlabel('time (' + r'$\mu$' + 'sec)', fontsize=14)
#plt.tight_layout()
plt.show()
filename: bridge_dcdc_3_1.dat time points where slope of ILLK changes: 3.1 micro-sec 9.9 micro-sec 13.1 micro-sec 19.9 micro-sec 23.1 micro-sec 29.9 micro-sec 33.1 micro-sec
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.
In [ ]: