Part Number:TMS320F28379D
我在IDDKV2.2.1评估板上可以读到电机的编码器的位置信息,但是发现经常发生校验错误,这个有什么好的处理办法,谢谢?
I can read the position information of the motor encoder on the IDDKV2.2.1 evaluation board, but I find that check errors often occur. Is there any good way to deal with this ?
Thanks!
Green Deng:
你好,校验错误有具体的错误内容或者错误代码吗?
,
David Lew:
这个在判断位置在readTformatEncPosition程序内:
inline void readTformatEncPosition(void){
if(tFormat_dataId == PM_TFORMAT_DATAID3) { retVal1 = PM_tformat_receiveData(PM_TFORMAT_DATAID3);
crcResult = PM_tformat_getCRC(0, 80, 8, (uint16_t *)(&tformatData.rxPkts), tformatCRCtable, 10); crcResult = crcResult ^ (0xFF);
if(!tformat_checkCRC(crcResult, tformatData.crc)) {//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!正常时不会进入这段代码
tFormat_crcError = 1;runMotor = MOTOR_STOP;
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!这个代表收到的数据包(不含CRC字节)CRC校验后和数据包尾的CRC校验码不一致
//不知道你们遇到这种概率有多大 ?这个一定是保持很低概率才行!
}
// //Invert the received bit sequence for position and //turns for actual data // position = ((__flip32((uint32_t) tformatData.dataField0) >> 24 ) & 0xFF) | ((__flip32((uint32_t) tformatData.dataField1) >> 16 ) & 0xFF00) | ((__flip32((uint32_t) tformatData.dataField2) >> 8 ) & 0xFF0000);
turns = ((__flip32((uint32_t) tformatData.dataField4) >> 24 ) & 0xFF) | ((__flip32((uint32_t) tformatData.dataField5) >> 16 ) & 0xFF00) | ((__flip32((uint32_t) tformatData.dataField6) >> 8 ) & 0xFF0000);
tFormat_encCmdStatus = ENC_CLOSE; tFormat_dataId = 0; // reset the ID log
,
Green Deng:
你好,我咨询了一下其他工程师,对方认为这个错误是由系统中的某种噪音导致的。 建议仔细检查所有连接器并确保所有连接的探头/示波器探头正确接地。