我正在做一个单相变频器,该单相变频器采用TI 的TMS320LF2407A DSP来控制,其输出为脉宽调制方波.调制方式为SPWM,四个桥臂1,3为10kHz SPWM波,2,4为对应长度的低频方波(单极性调制)如下图.但是经过LC滤波后正弦波效果不理想,THD值较大.
500) {this.resized=true; this.width=500; this.alt='这是一张缩略图,点击可放大。\n按住CTRL,滚动鼠标滚轮可自由缩放';this.style.cursor='hand'}" onclick="if(!this.resized) {return true;} else {window.open('http://u.dianyuan.com/bbs/u/77/3166841242444963.jpg?x-oss-process=image/watermark,g_center,image_YXJ0aWNsZS9wdWJsaWMvd2F0ZXJtYXJrLnBuZz94LW9zcy1wcm9jZXNzPWltYWdlL3Jlc2l6ZSxQXzQwCg,t_20');}" onmousewheel="return imgzoom(this);">
有人说应该用双极性调制或单极性倍频调制,即四路均为高频SPWM波,这样滤波后才能达到较好的正弦波效果.不知道是否如此?或者是提高载波频率?那位高人能指点一下,不胜感激!欢迎高手和我联系:shroad@163.com.
附主要源程序如下:
init_spwm()
{
EVAIFRA=0xffff; //clear the PDPINT interrupt flag
EVAIMRA=0x0081; //enable t1 period interrupt
CMPR1=1400;CMPR2=1400;
CMPR3=1400;CMPR4=1400;
/* DBTCONA=0xffe4; //dead time =3.96us */
DBTCONA=0xff00;
COMCONA=0xa600;//enable pwm output
GPTCONA=0x40; //enable gp timer output
T1CMPR=1000;
ACTRA=0x0;
T1PR=1515;
T1CNT=0x0;
T1CON=0x0806;
T1CON=0x0846;
/*
IFR=0xffff;
IMR|=0x02;
asm( " clrc intm " );
delta_data=50;
*/
}
/* pwm sin***** */
en_wave()
{
if((flag2.bit.enable==1) && (delta_data>40))
{flag2.bit.enable=0;flag2.bit.change1=1;flag2.bit.disable=1;
step=0; flag_spwm=1;
IMR|=0x07;
T1CNT=0;
EVAIFRA=0xffff;
asm( " clrc intm " );
}
if((flag2.bit.disable==1) && (delta_data<15))
{
flag2.bit.disable=0;flag2.bit.enable=1;flag_spwm=0;ACTRA=0xff;
lcv[0]=lcv[1]=lcv[2]=lcv1[0]=lcv1[1]=lcv1[2]=0;
lci[0]=lci[1]=lci[2]=lci1[0]=lci1[1]=lci1[2]=0;
lcv_value=lcv_data=0;
lci_value=lci_data=0;
IMR&=0x05;
EVAIFRA=0xffff;
asm( " clrc intm " );
}
}
cal_wave()
{ unsigned int i;
if((flag2.bit.change1==1)&&(flag_spwm==1))
{
/* i=(((long)freq_data*6)/25);*/
i=(((long)freq_data*256)/125);
step1=i;
flag2.bit.change1=0;
}
}