offsetCalCounter=0;
*iL1MeasOffset=0;
*iL2MeasOffset=0;
*iL3MeasOffset=0;
*v1MeasOffset=0;
*v2MeasOffset=0;
*v3MeasOffset=0;
while(offsetCalCounter<25000)
{
if(EPwm1Regs.ETFLG.bit.INT==1)
{
if(offsetCalCounter>1000)
{
// offset of the inductor current sense
*iL1MeasOffset = k1*(*iL1MeasOffset) + k2*(IL1_ADC_READ1+IL1_ADC_READ2+IL1_ADC_READ3+IL1_ADC_READ4)*0.25*ADC_PU_SCALE_FACTOR;
*iL2MeasOffset = k1*(*iL2MeasOffset) + k2*(IL2_ADC_READ1+IL2_ADC_READ2+IL2_ADC_READ3+IL2_ADC_READ4)*0.25*ADC_PU_SCALE_FACTOR;
*iL3MeasOffset = k1*(*iL3MeasOffset) + k2*(IL3_ADC_READ1+IL3_ADC_READ2+IL3_ADC_READ3+IL3_ADC_READ4)*0.25*ADC_PU_SCALE_FACTOR;
// offset of the inductor current sense
*v1MeasOffset = k1*(*v1MeasOffset) + k2*(V1_ADC_READ1+V1_ADC_READ2+V1_ADC_READ3+V1_ADC_READ4)*0.25*ADC_PU_SCALE_FACTOR;
*v2MeasOffset = k1*(*v2MeasOffset) + k2*(V2_ADC_READ1+V2_ADC_READ2+V2_ADC_READ3+V2_ADC_READ4)*0.25*ADC_PU_SCALE_FACTOR;
*v3MeasOffset = k1*(*v3MeasOffset) + k2*(V3_ADC_READ1+V3_ADC_READ2+V3_ADC_READ3+V3_ADC_READ4)*0.25*ADC_PU_SCALE_FACTOR;
}
EPwm1Regs.ETCLR.bit.INT=1;
offsetCalCounter++;
}
}
第一个问题:K1,K2这个偏置滤波系数怎么来的依据是什么?Ti官方给的是 k1 = 0.998; K1: 0.05/(T+0.05);
第二个问题:*iL1MeasOffset = k1*(*iL1MeasOffset) + k2*(IL1_ADC_READ1+IL1_ADC_READ2+IL1_ADC_READ3+IL1_ADC_READ4)*0.25*ADC_PU_SCALE_FACTOR;该表达式第一项一直为零,放在这里有何意义。
第三个问题:为什么在1000-25000才开始计算?
Green Deng:
你好,为了更加有效地解决你的问题,我已将此问题升级至英文E2E论坛,你可以通过以下帖子链接查看FAE的回复:
e2e.ti.com/…/957839
如果需要追加提问,你也可以使用校园邮箱作为账号进行注册登录,并进行回复或者发布新的帖子。