一、SVPWM 控制算法的仿真实现
(1)总结构图
(2)Subsystem 结构图
(3)其中模块 SVPWM 的程序为
function [CMPR,Fi,Nsec] = SVPWM(Va ,Vb ,Vc)
ts =0.0004;%开关周期
udc_ref =600;%直流母线电压为 600V
T1on=0;
T2on=0;
T3on=0;
t1=0;
t2=0;
sectorNO =0;Nsec =0;
ualfa =sqrt(2/3)*(Va -0.5*Vb -0.5*Vc);%三相旋转坐标变换为两相静止
坐标
ubeta =sqrt(2/3)*(sqrt(3)/2*Vb - sqrt(3)/2*Vc);
Fi =atan(ualfa/ubeta)*180/pi;
if ubeta>0 %判断 a b c 的大小为后续判断在哪个扇区做准备
a=1;
else a=0;
end
if (sqrt(3)/2*ualfa-0.5*ubeta)>0
b=1;
else b=0;
end
if (-sqrt(3)/2*ualfa-0.5*ubeta)>0
c=1;
else c=0;
end
sectorNO =a+2*b+4*c;
x=sqrt(3)*ubeta*ts/udc_ref;%计算在相应扇区每个已知电压矢量的分
别作用时间
y=(1.5*ualfa + sqrt(3)/2*ubeta)*ts/udc_ref;
z=(-1.5*ualfa + sqrt(3)/2*ubeta)*ts/udc_ref;
switch sectorNO %判断在合成电压矢量在哪个扇区
case 3
Nsec=1;
t1=-z;
t2=x;
case 1
Nsec=2;
t1=z;
t2=y;
case 5
Nsec=3;
t1=x;
t2=-y;
case 4
Nsec=4;
t1=-x;
t2=z;
case 6
Nsec=5;
t1=-y;
t2=-z;
case 2
Nsec=6;
t1=y;
t2=-x;
end
if ts-t1-t2<0 %零矢量作用时间及校正
t1=ts*t1/(t1+t2);
t2=ts-t1;
end
ta=(ts-t1-t2)/4;%矢量的切换点计算
tb=ta+t1/2;
tc=tb+t2/2;
switch sectorNO %各扇区的时间切换点
case 3
T1on=ta;
T2on=tb;
T3on=tc;
case 1
T1on=tb;
T2on=ta;
T3on=tc;
case 5
T1on=tc;
T2on=ta;
T3on=tb;
case 4
T1on=tc;
T2on=tb;
T3on=ta;
case 6
T1on=tb;
T2on=tc;
T3on=ta;
case 2
T1on=ta;
T2on=tc;
评论1