|
|
新人Show
| 论坛注册会员名: |
xueshoudaoke |
| 研究方向/专业工种: |
自动控制 |
| 课题项目/专业特长: |
控制、检测、测试 |
| 兴趣爱好: |
篮球 |
| 居住地: |
郑州 |
马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!
您需要 登录 才可以下载或查看,没有账号?立即加入
×
最近在做电流预测控制算法,在本论坛找到了这个模型,想研究一下,有些问题需要大家给予解释一下,在此谢谢大家了!!!!!我把预测控制器的代码给贴在下面,谁能给我解释一下?
) R# {0 k4 v' e2 D" ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1 C& y' I3 {$ F% This function contains the algorithm for the predictive current control ' y! `4 \/ m% R, w+ t- p) R
% of a two-level voltage source inverter.! w% P$ G2 r- H- p( S! }7 n
% Inputs:1 L3 l$ G- @0 Z% J9 {2 v
% I_ref := Two-element vector containing the reference current in
# m% ?5 @, j+ B% alpha-beta coordinates.) R% K% p* A# p) G! u* i) o' m" u
% I_meas := Two-element vector containing the measured current in
8 F2 Y1 G+ W! v# Q+ h% alpha-beta coordinates.
$ ?+ I' u! C0 [6 L7 ^# m! W% Parameters (defined in the file parameters.m):9 I p3 j% B: |
% R := Load resistance
4 P6 A- Q' o/ a# E# J7 k- I) ^% L := Load inductance
; S/ Y& a6 Y5 I9 X8 R% p: |# r% Ts := Sampling time
. [+ S4 @+ } X' F2 `4 o/ l% v := Eight-element vector containing the voltage vectors that can
5 V9 o* Z! ^# {- w- ^% be generated by the inverter, in alpha-beta coordinates. + ~( R6 N' k0 Z: \, c' V( f4 O. R
% states := Eight-by-three array containing the switching states for
/ @: Q& F. L1 D# \: W1 b$ q% x2 |% each voltage vector.
; C S/ \+ O; H' Y8 N% Outputs: C7 z v+ a0 D# l; d
% [Sa, Sb, Sc] := switching state corresponding to the optimum vector to
: z8 i% @) w4 F- J% X0 m% be applied in the next sampling period.
: B/ d- t7 A( ~* C v( Q%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%! _8 H7 W/ s- {7 q+ d. h" T
; o' [, @4 \3 a- o) ?9 V
function [Sa,Sb,Sc] = control(I_ref,I_meas,R,L,Ts,v,states)% U, d0 B& U, |8 j7 k5 Y
% Optimum vector and measured current at instant k-1
2 { k- x3 h% W3 L* b7 ?# Cpersistent x_old i_old + m. F- k$ [9 w! v# A/ K
% Initialize values8 J) H, s+ F+ K: J3 C9 f2 Z* l! Y
if isempty(x_old), x_old = 1; end
* s, c5 r# F; uif isempty(i_old), i_old = 0+1j*0; end5 r0 L' M g; O. {8 W( m
g = zeros(1,8);5 n# R' e( u$ o" `: g2 k" t9 _. A9 r) v
% Read current reference inputs at sampling instant k9 O8 D/ h7 P, M/ A o
ik_ref = I_ref(1) + 1j*I_ref(2);
' G( S: B& r4 P. G, L- D$ k% Read current measurements at sampling instant k# t2 L3 _ w) U) r. F
ik = I_meas(1) + 1j*I_meas(2);
. n/ t1 G4 L0 |1 q' D# N% Back-EMF estimate' ? G' i. x8 l, [
e = v(x_old) - L/Ts*ik - (R - L/Ts)*i_old;
8 k6 z* h& @1 ]' f2 R% Store the measured current for the next iteration# \0 P$ n% ]1 X! A1 K
i_old = ik;) V8 H. C! m) n; o, P1 {( z
for i = 1:8
2 {" K( B3 h+ D: ^% H- L, K % i-th voltage vector for current prediction
7 f0 x* k% }: W& s& V v_o1 = v(i);, K; X' D r; |
% Current prediction at instant k+1" L# O# O- n; h7 c0 k- r) q
ik1 = (1 - R*Ts/L)*ik + Ts/L*(v_o1 - e);
& ~% r b/ _+ K % Cost function
: O; y& n; q+ @$ V; o' A g(i) = abs(real(ik_ref - ik1)) + abs(imag(ik_ref - ik1));# B. [/ o# I/ s' g# V( I* S. L
end$ t; y% W( @! |
% Optimization& W( w# H5 J7 B1 l! S9 R
[~,x_opt] = min(g);
' ]& N* b& Y, c0 X( O5 P9 K% Store the present value of x_opt2 `8 M: q! c z
x_old = x_opt;& x1 s T, y1 }
% Output switching states1 v: ?" i! b: h+ E0 ]
Sa = states(x_opt,1);
L( b9 v) Q# u o0 ~# T8 oSb = states(x_opt,2);3 N; |0 Y* t+ U7 _; s; }/ x
Sc = states(x_opt,3); |
|