资源简介
基于EKF的三相PMSM无传感器矢量控制,根据现代永磁同步电机控制原理及Matlab仿真搭建,仿真模型已通过调试,波形完美,可以作为参考资料
代码片段和文件信息
function [sysx0strts] =EKF(txuflag)
% The following outlines the general structure of an S-function.
switch flag
%%%%%%%%%%%%%%%%%%
% Initialization %
%%%%%%%%%%%%%%%%%%
case 0
[sysx0strts]=mdlInitializeSizes;
%%%%%%%%%%%%%%%
% Derivatives %
%%%%%%%%%%%%%%%
%%%%%%%%%%
% Update %
%%%%%%%%%%
case 2
sys=mdlUpdate(txu);
%%%%%%%%%%%
% Outputs %
%%%%%%%%%%%
case 3
sys=mdlOutputs(txu);
%%%%%%%%%%%%%%%%%%%%%%%
% GetTimeOfNextVarHit %
%%%%%%%%%%%%%%%%%%%%%%%
case {149}
sys=[];
%%%%%%%%%%%%%
% Terminate %
%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%
% Unexpected flags %
%%%%%%%%%%%%%%%%%%%%
otherwise
error([‘Unhandled flag = ‘num2str(flag)]);
end
% end sfuntmpl
%=============================================================================
% mdlInitializeSizes
% Return the sizes initial conditions and sample times for the S-function.
%=============================================================================
%
function [sysx0strts]=mdlInitializeSizes
global P0;
sizes = simsizes;
sizes.NumContStates = 0;
sizes.NumDiscStates = 4;
sizes.NumOutputs = 4;
sizes.NumInputs = 4;
sizes.DirFeedthrough = 0;
sizes.NumSampleTimes = 1;
sys = simsizes(sizes);
% initialize the initial conditions
x0 = [0 0 0 0];
P0 = diag([0.1 0.1 0 0]);%P估计初值
% str is always an empty matrix
str = [];
ts = 1e-6;
% end mdlInitializeSizes
%=======================================================================
% mdlDerivatives
% Return the derivatives for the continuous states.
%=======================================================================
function sys = mdlUpdate(txu)
global P0;
Rs = 2.875;%电阻
Ls = 0.0085;%电感
np = 2;%极对数
J = 0.008;%转动惯量
flux = 0.3;%磁链
B1 = 0;%阻尼系数
Q = diag([0.1 0.1 1 0.01]);
R = diag([0.2 0.2]);
T = 1e-6;
vs_ab = [u(1) u(2)]‘;
is_ab = [u(3) u(4)]‘;
H = [1 0 0 0; 0 1 0 0];
B = [1/Ls 0 0 0; 0 1/Ls 0 0]‘;
F = [-Rs/Ls 0 flux/Ls*sin(x(4)) flux/Ls*x(3)*cos(x(4));0 -Rs/Ls -...
flux/Ls*cos(x(4)) flux/Ls*x(3)*sin(x(4)); 0 0 0 0; 0 0 1 0];%雅克比矩阵
%非线性系统矩阵函数3/2*np^2*flux/J*(x(2)*cos(x(4))-x(1)*sin(x(4)))-B1*x(3)/J
f1 = [-Rs/Ls*x(1)+flux/Ls*x(3)*sin(x(4));-Rs/Ls*x(2)-flux/Ls*x(3)*cos(x(4)); 0; x(3)];
f2 = diag([1 1 1 1])+T*F;%系统转移矩阵
X_pred = x+T*(f1+B*vs_ab);%系统转移矩阵
Y_pred = H*X_pred;%测量预测值
Y = is_ab;
P_pred = f2*P0*f2‘+Q;%预测值
K = P_pred*H‘*inv(H*P_pred*H‘+R);%增益
sys = X_pred+K*(Y-Y_pred);
P0 = P_pred-K*H*P_pred;%估计值
%=============================================================================
% mdlOutputs
% Return the block outputs.
%=============================================================================
%
function sys=mdlOutputs(txu)
sys=x;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2970 2018-10-31 19:04 PMSM-EKF\EKF.m
文件 40210 2018-11-02 00:01 PMSM-EKF\PMSM_EKF.slx
目录 0 2018-11-02 00:04 PMSM-EKF
----------- --------- ---------- ----- ----
43180 3
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论