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.

关于F28377的EQEP模块



在看f28377配套的eqep测速的例程中,计算电机的速度中, 对低速进行测量(利用cap进行测量)时,若输入 引脚的速度比10Khz低,temp的值应该大于625,第三行的逻辑是否有误??

p->freq_pr = _IQdiv(p->freqScaler_pr,tmp);//625-10K 625/(t2-t1)
tmp=p->freq_fr;

if (tmp>_IQ(1))//这个语句的逻辑关系是否有误?
{
p->freq_pr = _IQ(1);
}
else
{
p->freq_pr = tmp;
}

//
// Q0 = Q0*GLOBAL_Q => _IQXmpy(), X = GLOBAL_Q
// p->freqhz_pr =( p->freq_pr)*10kHz = X/(t2-t1)
//
p->freqhz_pr = _IQmpy(p->BaseFreq,p->freq_pr);//10K*625/(t2-t1)

//
// Clear Unit position event flag
// Clear overflow error flag