[学习资料] PFC_SampleCorrection这段采样校正的原理是什么?

[复制链接]
 楼主| dongtianfu 发表于 2021-11-14 23:51 | 显示全部楼层 |阅读模式
AN1208_dsPIC33CK256MP508_EXT_INT_OPAMP_MCHV3.zip对应的程序

PFC_SampleCorrection(int16_t idealDuty,int16_t actualDuty,int16_t current)
{
    int16_t output = Q15(0.9999);
   
    /** Check if Ideal Duty is positive value */
    if(idealDuty > 0)
    {
        /** Calculate ratio of actual Duty and ideal Duty */
        output = __builtin_divf(actualDuty, idealDuty) ;
    }
    /** Check if ratio previous result is greater than 0 */
    if(output > 0)
    {
        output = (int16_t)((__builtin_mulss(current,output)) >> 15);
    }
    else
    {
        output = current;
    }
   
    return(output);
}
这段采样校正的原理是什么?希望大佬解答下。
其中/** Calculate ratio of actual Duty and ideal Duty */
        output = __builtin_divf(actualDuty, idealDuty) ;
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

7

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部