旋转磁场的旋转方向与三相交流电的相序一致;
另外收藏过有段咱看不懂的算法,或许你能看懂。电机转角信号到电机位置信号的转换可通过S函数编程实现,程序如下
位置计算 S 函数(is.m)
function [sys,x0,str,ts] =is(t,x,u,flag)
switch flag
case 0,
[sys,x0,str,ts]=mdlInitializeSizes;
case 3,
sys = mdlOutputs(t,x,u);
case 2,
sys = [];
case 9,
sys = [];
otherwise
error(['unhandled flag = ',num2str(flag)]);
end
function [sys,x0,str,ts]=mdlInitializeSizes()
sizes = simsizes;
sizes.NumContStates = 0;
sizes.NumDiscStates = 0;
sizes.NumOutputs = 3;
sizes.NumInputs = 2;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1;
sys = simsizes(sizes);
x0 = [];
str = [];
ts = [-1 0];
function sys=mdlOutputs(t,x,u)
global Is;
global Pos;
Is=u(1); %电流
Pos=u(2);%位置
if Pos>=0& Pos<=pi/3
sys=[Is,-Is,0];
elseif Pos>=pi/3& Pos<=2*pi/3
sys=[Is,0,-Is];
elseif Pos>=2*pi/3& Pos<=pi
sys=[0,Is,-Is];
elseif Pos>=pi& Pos<=4*pi/3
sys=[-Is,Is,0];
elseif Pos>=4*pi/3& Pos<=5*pi/3
sys=[-Is,0,Is];
else Pos>=5*pi/3& Pos<=2*pi
sys=[0,-Is,Is];
end