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.

[参考译文] TMS320F28379D:如何使用 eQEP 计算实际机械角度

Guru**** 2609285 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/686026/tms320f28379d-how-to-calculate-actual-mechanical-degrees-using-the-eqep

器件型号:TMS320F28379D

你好  

在示例项目 eQEP_ex2_pos_speed/eQEP_ex2_calculation.c 中、您计算出机械 θ。 我希望该数字以度为单位。 它采用定点 Q15格式。 当我从 Q15转换为浮点时、它会为我提供非常小的数字。   

您能解释一下我如何从0到360度获得角度。  

//
//下面的行计算
//
// p->thetaMech ~= QPOSCNT / mechscaler [当前 cnt/(总 cnt 为1 rev)]
//
//其中 mechscal=4000 cnts/rocal
//
temp =(int32_t) p->thetaRaw *(int32_t) p->mechscalp;// Q0 * Q26 = Q26
temp &= 0x03FFF000;

p->thetaMech =(int16_t)(temp >> 11);// Q26 -> Q15
p->thetaMech &= 0x7FFF;

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我认为您应该能够将这个小浮点数乘以360、以使其达到度数。 这种情况是否看起来不是这样?

    惠特尼