Anda di halaman 1dari 4

APENDIX

MATLAB simulation

The initial step of this project was to develop a simulation model that could
approximate the results of the lab experiments. During the development of
this simulation various aspects of the wireless power transfer intrinsics were
explored which ultimately aided my effort into getting acquainted with the
current circuit characteristics and basic values.
The proposed simulation can be easily modified to represent any series-
series or parallel wireless power transfer system (enabling variable load and
power levels). All basic system values can be imported in order to
approximate the systems behavior. The validity of the simulation is
confirmed by the experimental results. However, a 11% deviation is
observed in the resonant frequency and efficiency but this is expected
because of the parasitic elements that effect the actual WPT circuit as well
as other factors that werent analyzed at this stage of the project like the
rectifier capacitance. Some results of the simulation are presented below
MATLAB code of main script:
(All the simulation components are attached to the simulation .zip file)

syms w; % Omega, frequency variable


global p; % Structure containing all parameters, and meta info of
parameters.
global eq;

%1 %2 %4 %5 %6 %7
%Name %Value %Min %Max %Unit %Description
p.def = {'Lp', 195.7e-6, 1e-6, 1e-4, 'H', 'Primary inductance';
'Cp', 18.1e-9, 1e-9, 1e-7, 'F', 'Primary capacitance';
'Rp', 0.6, 0.1, 10, 'Ohm', 'Primary resistance';
'Ls', 197.48e-6, 1e-6, 1e-4, 'H', 'Secondary inductance';
'Cs', 17.75e-9, 1e-9, 1e-7, 'F', 'Secondary capacitance';
'Rs', 0.5, 0.1, 10, 'Ohm', 'Secondary resistance';
'k', 0.5, 0, 1, '', 'Coupling factor';
'Rl', 28.3, 1, 100, 'Ohm', 'Load resistance';
'Vin', 28, 1, 30, 'V', 'Input voltage';
'Rin', 0.1, 0, 100, 'Ohm', 'Source resistance';
'Lin', 1e-6, 1e-5, 1e-3, 'H', 'Source inductance';
};

%For all defined parameters...


for ii=1:size(p.def,1)
s.(p.def{ii,1}) = sym(p.def{ii,1}); % Generate a symbolic variable s.X
p.(p.def{ii,1}) = ii; % Generate a linearly increasing
number p.X for indexing purposes
end
s.vec = sym(p.def(:,1)).'; % Generate a vector containing all
symbolic variables
p.vec = cell2mat(p.def(:,2)).'; % Generate a vector containing all
parameter values

Lm = s.k*sqrt(s.Lp*s.Ls); % Mutual inductance

eqdef = {'name', 'n', 'description';


'ss', 2, 'Series-series';
'pp', 4, 'Parallel-parallel';
'sp', 3, 'Series-parallel';
'ps', 3, 'Parallel-series';
};

eq = cell2struct(eqdef(2:end,:), eqdef(1,:), 2);

% Compose different sets of impedances, for different circuit toplogies.


% s = series, p = parallel
eq(1).Z = [s.Rin-1i/(w*s.Cp)+s.Rp+(s.Lp-Lm)*w*1i;
Lm*w*1i;
(s.Ls-Lm)*w*1i+s.Rs-1i/(w*s.Cs);
s.Rl-1i/(w*s.Cs2)];
eq(2).Z = [s.Rin+s.Lin*w*1i;
-1i/(w*s.Cp);
s.Rp+(s.Lp-Lm)*w*1i;
Lm*w*1i;
(s.Ls-Lm)*w*1i+s.Rs;
-1i/(w*s.Cs);
1;
s.Rl];

eq(3).Z = [eq(1).Z(1:2);eq(2).Z(5:8)];
eq(4).Z = [eq(2).Z(1:4);eq(1).Z(3:4)];

for ii=1:size(eq,1)
% Get indices of symbolic variables used in each equation
[~,varsUsed] = ismember([symvar(eq(ii).Z) s.Vin], s.vec);
% Store vector with nonzero indices for each equation
eq(ii).vars = sort(varsUsed(varsUsed~=0));
% Solve equations
funcName = ['If',eq(ii).name];
I = symbolicEquations(eq(ii).n, eq(ii).Z, s.Vin);
matlabFunction(I, 'vars',{w,s.vec}, 'File',funcName);
eq(ii).fhandle = str2func(funcName);
end

p.state.eqNr = 1;

%% Make a figure, and define its structure (with empty plots)

% Generate frequency vector


wvecHz = logspace(4.5, 5.5, 500);
%wvecHz = linspace(4.5e5, 5.2e6, 500);
wvec = wvecHz*2*pi;

figure(1)
h1 = loglog(wvecHz, zeros(length(wvec),2));
ylabel('Current [A]')
xlabel('Frequency [Hz]')
grid on
legend('I_{in}','I_{out}')
figure(2)
h2 = semilogx(wvecHz, zeros(length(wvec),2));
xlabel('Frequency [Hz]')
ylabel('Phase [deg]')
ylim([-180 180]);
grid on
figure(3)
h3 = semilogx(wvecHz, zeros(length(wvec),2));
ylabel('Power [W]')
xlabel('Frequency [Hz]')
legend('P_{in}','P_{out}')
grid on
figure(4)
h4 = semilogx(wvecHz, zeros(length(wvec),1));
xlabel('Frequency [Hz]')
ylabel('Efficiency [-]')
grid on
ylim([0 1]);

h = {h1 h2 h3 h4};
% Update all plots (using the equations defined in p.state.Ifunc)
drawPlots(h, wvec);

%% Make a figure with which all relevant parameters can be easily changed

f = figure(5);
clf
hc = controlParameters(f, h, wvec);