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) ;
|