voidSVPWM_Generator(floatsalfa,floatsbeta,float*sa,float*sb,float*sc) { A=sbeta; B=1.7320508*salfa-sbeta; C=-1.7320508*salfa-sbeta; N=i_sign(A)+2*i_sign(B)+4*i_sign(C); N=N-1; if(N>=0&&N<=5) i_section=section[N]; else i_section=0; switch(i_section) { case1: T1=salfa-sbeta/1.7320508; T2=2.0/1.7320508*sbeta; T1=1.5*T1; T2=1.5*T2; T0=1-T1-T2; if((T1+T2)>1) { T1=T1/(T1+T2); T2=T2/(T1+T2); T0=0; } uu=T0/4+T1/2+T2/2; uv=T0/4+T2/2; uw=T0/4;//uu、uv、uw已在定义中申明,是三相电流信号 break; case2: T1=salfa+sbeta/1.7320508; T2=-salfa+sbeta/1.7320508; T1=1.5*T1; T2=1.5*T2; T0=1-T1-T2; if((T1+T2)>1) { T1=T1/(T1+T2); T2=T2/(T1+T2); T0=0; } uu=T0/4.0+T1/2.0; uv=T0/4.0+T1/2.0+T2/2.0; uw=T0/4.0; break;
|