|
新人Show
论坛注册会员名: |
xueshoudaoke |
研究方向/专业工种: |
自动控制 |
课题项目/专业特长: |
控制、检测、测试 |
兴趣爱好: |
篮球 |
居住地: |
郑州 |
马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!
您需要 登录 才可以下载或查看,没有账号?立即加入
×
最近在做电流预测控制算法,在本论坛找到了这个模型,想研究一下,有些问题需要大家给予解释一下,在此谢谢大家了!!!!!我把预测控制器的代码给贴在下面,谁能给我解释一下?4 ]- ]8 T. m4 e" L) R+ ]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- t X$ M7 h) k. O- z% This function contains the algorithm for the predictive current control 5 u2 p' Q/ x. m9 V. D
% of a two-level voltage source inverter.6 |4 M: j1 }: o/ J% ?
% Inputs:, |$ r' L0 X. h- m. _' {/ z+ ~
% I_ref := Two-element vector containing the reference current in
, j* Z3 L- K! y- }" t+ l5 d% alpha-beta coordinates.# D; x+ H$ N a8 E! D/ ]- S
% I_meas := Two-element vector containing the measured current in - H/ n- g% P3 U5 y/ V f2 M
% alpha-beta coordinates.* p% B1 [, f) w
% Parameters (defined in the file parameters.m):% t2 v$ o" o* y
% R := Load resistance) h) u( D) q! l' W3 k& G" d
% L := Load inductance
2 R( Y. H3 `! \- ~: K% Ts := Sampling time9 s/ H6 H6 ^% h G+ I
% v := Eight-element vector containing the voltage vectors that can
+ T& ^3 P7 E6 E( `& V% be generated by the inverter, in alpha-beta coordinates.
$ f9 m1 ^; P6 D% states := Eight-by-three array containing the switching states for 2 C* h7 r# R; [# F3 w6 @$ l- I
% each voltage vector.
2 K: Z& ]% L9 `2 v9 H! ~) L% Outputs:
) }9 o3 F$ O8 a! O7 |% [Sa, Sb, Sc] := switching state corresponding to the optimum vector to . b( P4 Z% r! `. J! V! d
% be applied in the next sampling period.- |! O& z* N+ \6 X1 ~
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8 {/ i$ m* w+ p( q6 T! l2 m% r3 [# b" K9 O$ e* w
function [Sa,Sb,Sc] = control(I_ref,I_meas,R,L,Ts,v,states)
6 G- T1 o0 _0 X1 V, w% Optimum vector and measured current at instant k-1
: w; t3 `! E3 Upersistent x_old i_old
: T4 V2 W. J4 r# E6 A8 m! G% Initialize values
% Q/ S9 K* r6 ?, F$ R( z8 Fif isempty(x_old), x_old = 1; end: y7 h2 ?; V* R: k {, T
if isempty(i_old), i_old = 0+1j*0; end
' N6 i! |9 B! qg = zeros(1,8);
D5 ~# W0 y* v# y3 q3 q4 U5 F% Read current reference inputs at sampling instant k
1 q/ j8 v! m/ a7 t+ C4 bik_ref = I_ref(1) + 1j*I_ref(2); ]) f( A# v) R/ ?% Y! b3 Y
% Read current measurements at sampling instant k7 S( ?) y% m! y- T9 I
ik = I_meas(1) + 1j*I_meas(2);# Q, f k% e) G+ k. X
% Back-EMF estimate
& Y/ n! [4 u4 m& t% ]* }, I1 s2 \1 be = v(x_old) - L/Ts*ik - (R - L/Ts)*i_old;
' Q# t7 q* y& o; J, j+ B: f; D% Store the measured current for the next iteration
8 i0 J4 d5 U% U) L8 ei_old = ik;6 y$ a* k1 O% y, b) g4 a7 K3 Z2 v
for i = 1:8
$ r* s/ |) j2 h0 A! }. z % i-th voltage vector for current prediction$ @5 T3 }$ Z3 T: N: w: m
v_o1 = v(i);
K# m: L V6 _2 |) X* h5 k % Current prediction at instant k+1
- V+ Z/ v1 T! t! V ik1 = (1 - R*Ts/L)*ik + Ts/L*(v_o1 - e);
# p$ k% p* F! e9 {, Y! V9 C % Cost function- t4 U; L* T% }/ M1 |0 a5 y9 \
g(i) = abs(real(ik_ref - ik1)) + abs(imag(ik_ref - ik1));! s/ H7 ^. |! x& o( e2 x9 X
end. x5 e$ @ u+ H- C8 G5 _
% Optimization2 F5 Y5 V- Y: M8 G# C& @
[~,x_opt] = min(g);
X* A4 D! S2 i+ T p% Store the present value of x_opt
8 B. a" _2 L( y1 Vx_old = x_opt;
/ f. J5 t9 [* a7 \6 T% Output switching states
0 K1 Q9 X) C; v: z( D5 b. ZSa = states(x_opt,1);
. w, g6 }9 t" F' x1 xSb = states(x_opt,2);6 x6 Q9 p/ x* m: `* P
Sc = states(x_opt,3); |
|