% t1=flux_alfa, t2=flux_beta
% cal the angel of the stator flux linkage relative to the stator reference frame
function y=jiaodu(t1,t2)
if t1==0&t2==0
y=0;
end
if t1==0&t2>0
y=pi/2;
end
if t1==0&t2<0
y=3*pi/2;
end
if t1>0&t2==0
y=0;
end
if t1>0&t2>0
y=atan(t2/t1);
end
if t1>0&t2<0
y=2*pi-atan(abs(t2/t1));
end
if t1<0&t2==0
y=pi;
end
if t1<0&t2>0
y=pi-atan(abs(t2/t1));
end
if t1<0&t2<0
y=pi+atan(t2/t1);
end
评论1