|
新人Show
论坛注册会员名: |
xueshoudaoke |
研究方向/专业工种: |
自动控制 |
课题项目/专业特长: |
控制、检测、测试 |
兴趣爱好: |
篮球 |
居住地: |
郑州 |
马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!
您需要 登录 才可以下载或查看,没有账号?立即加入
×
最近在做电流预测控制算法,在本论坛找到了这个模型,想研究一下,有些问题需要大家给予解释一下,在此谢谢大家了!!!!!我把预测控制器的代码给贴在下面,谁能给我解释一下?" G* ^0 _6 v+ N1 r
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 b2 M0 S' D k @/ O% This function contains the algorithm for the predictive current control * Y2 X2 S- v& p
% of a two-level voltage source inverter.- z/ B4 ~* y2 ?( A# O
% Inputs:
# G: A$ [' q1 {% I_ref := Two-element vector containing the reference current in
, B; J$ a0 B* o( U% alpha-beta coordinates.$ W( \! J+ k2 O, e& R6 n& y1 L6 w
% I_meas := Two-element vector containing the measured current in
4 p% k i& d5 A% }* \4 c% alpha-beta coordinates., v$ r D$ g0 J, \0 U2 A9 @
% Parameters (defined in the file parameters.m):3 E, n8 x6 E; E
% R := Load resistance; ^9 m O! C! w1 m$ h) r
% L := Load inductance' _" S9 X% U. Q0 P0 q
% Ts := Sampling time- o, d1 n: H+ {' g
% v := Eight-element vector containing the voltage vectors that can
- F F1 e4 V1 E: x3 F1 O+ s! i% be generated by the inverter, in alpha-beta coordinates.
/ f8 G: }# M# t' w# N5 m- A" F% states := Eight-by-three array containing the switching states for ; k# p6 | q! |6 O) b
% each voltage vector." I* f1 }! r- E# R' a4 r5 T
% Outputs:
4 O8 e- p" k0 c1 I; r. t% [Sa, Sb, Sc] := switching state corresponding to the optimum vector to , ] g( `" j# d; L! |
% be applied in the next sampling period.
9 I- |' `- D/ K8 j2 t' }* j%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%' X8 k8 V } h: [
) M! f4 I4 z# Z3 }: `! S
function [Sa,Sb,Sc] = control(I_ref,I_meas,R,L,Ts,v,states)
# O) t. r, F9 d7 y7 g% Optimum vector and measured current at instant k-1
6 a, _0 x- c( `) d( t9 {8 B* opersistent x_old i_old & U( W1 f4 [- b z) L0 @2 E; S6 V
% Initialize values p4 @+ @3 w9 @8 \$ [( _
if isempty(x_old), x_old = 1; end
) L# V$ s) ^+ ^% @& u* {& K6 eif isempty(i_old), i_old = 0+1j*0; end- p+ i7 ?+ y. G# D4 k! L
g = zeros(1,8);2 {/ U/ T1 Y2 ~; \8 r% s5 O; r
% Read current reference inputs at sampling instant k1 V# E `$ `; x8 z
ik_ref = I_ref(1) + 1j*I_ref(2);/ l) n0 t! D3 g$ u& X4 k
% Read current measurements at sampling instant k
$ [: j! l& h. R8 {* Gik = I_meas(1) + 1j*I_meas(2);0 d% n6 C) F/ x4 A* {. ^, f
% Back-EMF estimate
5 Y! g3 _! Q. e" e0 p7 I8 oe = v(x_old) - L/Ts*ik - (R - L/Ts)*i_old;
e6 Q: a4 S" Y r% Store the measured current for the next iteration
9 E& R( m- w9 x6 B5 \# @i_old = ik;+ t6 k& a+ d' t
for i = 1:8
- u6 e# C0 \' w; ?8 {/ e8 J % i-th voltage vector for current prediction
4 Y. `# L5 r' |* i) _ v_o1 = v(i);
/ R: I- b- G& t8 @; M % Current prediction at instant k+1# {' W7 ?2 t4 u& a
ik1 = (1 - R*Ts/L)*ik + Ts/L*(v_o1 - e);, n6 c& K% W6 L
% Cost function! g& |, w1 L$ E& g$ R# x
g(i) = abs(real(ik_ref - ik1)) + abs(imag(ik_ref - ik1));
. n0 T# W8 G" N% v9 z& B4 Lend2 J! h& j1 {- T6 [5 O" h& Z! L/ J
% Optimization' X0 a! m+ @" S# ]
[~,x_opt] = min(g);+ n3 u3 j$ M# n# l# l8 y6 K
% Store the present value of x_opt, T# I2 J7 Z; R$ d4 Y/ B
x_old = x_opt;' j4 w: C7 O% k3 u9 g" @4 `( o
% Output switching states c+ }2 Z) V2 g7 O2 q7 j
Sa = states(x_opt,1);6 v, o4 M8 x' G2 S
Sb = states(x_opt,2);
' ^* I' X- D @/ iSc = states(x_opt,3); |
|