1、SVPWM时间计算函数,是从matlab的SVPWM3L_TimingCalculation.p文件中反汇编出来的函数:
function [TgABC_On ,TgABC_Off ,Sn ]=SVPWM3L_TimingCalculation_frompfile (Vref ,DeltaVdc ,Fsw )
%#codegen
%coder .allowpcode ('plain' );
TgABC_On =[0 ,0 ,0 ];
TgABC_Off =[0 ,0 ,0 ];
DV =DeltaVdc ;
Tsamp =1/Fsw/2 ;if(Vref(1)*Vref(2)*Vref(3)>=0 )if Vref(1)>=0Sn =1;a =2;b =-1;elseif(Vref(2)>=0 )Sn =3;a =-1;b =2;elseSn =5;a =-1;b =-1;end
elseif(Vref(1)<0 )Sn =4;a =-2;b =1;
elseif(Vref(2)<0 )Sn =6;a =1;b =-2;
elseSn =2;a =1;b =1;
endVas =Vref (1)/sqrt(3)-a *1 /6;
Vbs =Vref (2)/sqrt(3)-b *1 /6;
Vcs =-Vas -Vbs;Tas =2 *Vas *Tsamp;
Tbs =2 *Vbs *Tsamp;
Tcs =2 *Vcs *Tsamp;if((Tas >Tbs )&&(Tas >Tcs ))Tmax =Tas;
elseif((Tbs >Tas )&&(Tbs >Tcs ))Tmax =Tbs;
elseTmax =Tcs;
end
if((Tas <Tbs )&&(Tas <Tcs ))Tmin =Tas;
elseif((Tbs <Tas )&&(Tbs <Tcs ))Tmin =Tbs;
elseTmin =Tcs;
end
Teff =Tmax -Tmin;
T0 =Tsamp -Teff;
Toffset =T0/2*(1 -DV )-Tmin;Tga =Tas+Toffset;
Tgb =Tbs+Toffset;
Tgc =Tcs+Toffset;TgABC_On(1)=Tsamp-Tga;
TgABC_On(2)=Tsamp-Tgb;
TgABC_On(3)=Tsamp-Tgc;TgABC_Off(1)=Tsamp+Tga;
TgABC_Off(2)=Tsamp+Tgb;
TgABC_Off(3)=Tsamp+Tgc;
2、主要模型:
3、运行波形:
4、模型获取可联系229425962@qq.com;