在ST的PMSM的电机库里,在 SVPWM_3ShuntCalcDutyCycles
这个子程序里,是计算PWM的占空比的,有这么一段:
switch(bSector)
{
case SECTOR_1:
hTimePhA = (T/8) + ((((T + wX) - wZ)/2)/131072);
hTimePhB = hTimePhA + wZ/131072;
hTimePhC = hTimePhB - wX/131072;
// ADC Syncronization setting value
if ((u16)(PWM_PERIOD-hTimePhA) > TW_AFTER)
{
hTimePhD = PWM_PERIOD - 1;
}
else
{
hDeltaDuty = (u16)(hTimePhA - hTimePhB);
// Definition of crossing point
if (hDeltaDuty > (u16)(PWM_PERIOD-hTimePhA)*2)
{
hTimePhD = hTimePhA - TW_BEFORE; // Ts before Phase A
}
else
{
hTimePhD = hTimePhA + TW_AFTER; // DT + Tn after Phase A
if (hTimePhD >= PWM_PERIOD)
{
// Trigger of ADC at Falling Edge PWM4
// OCR update
//Set Polarity of CC4 Low
PWM4Direction=PWM1_MODE;
hTimePhD = (2 * PWM_PERIOD) - hTimePhD-1;
}
}
请问这里的131017是哪里来的数据,是干什么用的?
} |