电流预测控制simulink仿真,帮忙解释一下!!!!
最近在做电流预测控制算法,在本论坛找到了这个模型,想研究一下,有些问题需要大家给予解释一下,在此谢谢大家了!!!!!我把预测控制器的代码给贴在下面,谁能给我解释一下?%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This function contains the algorithm for the predictive current control
% of a two-level voltage source inverter.
% Inputs:
% I_ref := Two-element vector containing the reference current in
% alpha-beta coordinates.
% I_meas:= Two-element vector containing the measured current in
% alpha-beta coordinates.
% Parameters (defined in the file parameters.m):
% R := Load resistance
% L := Load inductance
% Ts := Sampling time
% v := Eight-element vector containing the voltage vectors that can
% be generated by the inverter, in alpha-beta coordinates.
% states:= Eight-by-three array containing the switching states for
% each voltage vector.
% Outputs:
% := switching state corresponding to the optimum vector to
% be applied in the next sampling period.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function = control(I_ref,I_meas,R,L,Ts,v,states)
% Optimum vector and measured current at instant k-1
persistent x_old i_old
% Initialize values
if isempty(x_old), x_old = 1; end
if isempty(i_old), i_old = 0+1j*0; end
g = zeros(1,8);
% Read current reference inputs at sampling instant k
ik_ref = I_ref(1) + 1j*I_ref(2);
% Read current measurements at sampling instant k
ik = I_meas(1) + 1j*I_meas(2);
% Back-EMF estimate
e = v(x_old) - L/Ts*ik - (R - L/Ts)*i_old;
% Store the measured current for the next iteration
i_old = ik;
for i = 1:8
% i-th voltage vector for current prediction
v_o1 = v(i);
% Current prediction at instant k+1
ik1 = (1 - R*Ts/L)*ik + Ts/L*(v_o1 - e);
% Cost function
g(i) = abs(real(ik_ref - ik1)) + abs(imag(ik_ref - ik1));
end
% Optimization
[~,x_opt] = min(g);
% Store the present value of x_opt
x_old = x_opt;
% Output switching states
Sa = states(x_opt,1);
Sb = states(x_opt,2);
Sc = states(x_opt,3);
页:
[1]
