This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280037: motorcontrolSDK套件中universal_motorcontrol_lab_f28003x例程中hall传感器问题

Part Number: TMS320F280037


1.初始化函数中capScaler为什么是时钟频率乘以3

pwmScaler 为什么是控制频率除以2

thetaDelta_rad 为什么是2pi/36

void HALL_setParams(HALL_Handle handle, const USER_Params *pUserParams)
{
HALL_Obj *obj = (HALL_Obj *)handle;

obj->capScaler = 3.0f * 1000000.0f * pUserParams->systemFreq_MHz;
obj->pwmScaler = pUserParams->ctrlFreq_Hz / 2.0f;
obj->thetaDelta_rad = MATH_TWO_PI / 36.0f;
obj->timeCountMax = pUserParams->ctrlFreq_Hz / 1.5f; // 0.25Hz
obj->speedSwitch_Hz = 50.0f;

obj->hallPrev[0] = 4;
obj->hallPrev[1] = 3;
obj->hallPrev[2] = 6;
obj->hallPrev[3] = 2;
obj->hallPrev[4] = 5;
obj->hallPrev[5] = 1;
obj->hallPrev[6] = 4;

#ifdef HALL_CAL
obj->hallIndexFlag = 0; //
#endif //HALL_CAL

return;
}