cal_sector3.m

来自「关于永磁同步电机DTC系统的无速度传感器」· M 代码 · 共 69 行

M
69
字号
function put=cal_sector3(u)
flux=u(1);
torque=u(2);
N=u(3);

v1=[1  1  0 
    0  1  0 
    0  1  1 
    0  0  1 
    1  0  1 
    1  0  0 ];
v2=[1  0  1 
    1  0  0 
    1  1  0 
    0  1  0 
    0  1  1 
    0  0  1 ];
v3=[0  1  0 
    0  1  1 
    0  0  1 
    1  0  1 
    1  0  0 
    1  1  0 ];
 v4=[0  0  1  
     1  0  1 
     1  0  0 
     1  1  0 
     0  1  0 
     0  1  1 ];
 
if (flux==1),
   if(torque==1)
      for i=1:6
         if(N==i),
            V=v1(i,:);
         end
      end
   end
   if(torque==0)
      for i=1:6
         if(N==i),
            V=v2(i,:);
         end
      end
   end
end
if (flux==0),
   if(torque==1)
      for i=1:6
         if(N==i),
            V=v3(i,:);
         end
      end
   end
   if(torque==0)
      for i=1:6
         if(N==i),
            V=v4(i,:);
         end
      end
   end
end
put=[V(:,1) V(:,2) V(:,3)];




   

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?