libdriver / mpu6050

MPU6050 full function driver library for general MCU and Linux.
https://www.libdriver.com
MIT License
386 stars 156 forks source link

mpu6050_self_test自检失败 #19

Open MagicPrince666 opened 1 year ago

MagicPrince666 commented 1 year ago

Description of the issues

代码移植到ros2 c++发现在mpu6050_dmp_init() 函数里面报了 gyro self test failed.,这个问题怎么排查

Additional context

No response

libdriver commented 1 year ago

Thank you very much for using the LibDriver MPU6050. The error 'gyro self test failed' indicates that the MPU6050 gyroscope self test has failed. Generally, there are several reasons for this error:

1.During self inspection, move MPU6050. Due to the self inspection requirements of MPU6050 itself, it is not allowed to move significantly during the self inspection period, otherwise the self inspection calculation will fail. Please do not move MPU6050 during the self inspection.

  1. The delay function error is too large. The MPU6050 self check requires the use of a delay to wait for the self check to generate data. The drive delay has great conservatism. Generally speaking, there is a certain error that is not a problem, but a large delay error can seriously interfere with the verification process. Please ensure the accuracy of the delay.
  2. IIC communication is unstable and requires at least running the /test/register_test to test the stability of IIC communication.
  3. If there are issues with the chip itself, including refurbishment, false chips, or chip defects, a replacement MPU6050 can be used for retesting.

非常感谢您使用LibDriver驱动,出现“gyro self test failed”的错误表示MPU6050陀螺仪自检失败,出现这种错误一般而言有以下几个原因: 1.自检的时候移动MPU6050。因为MPU6050本身自检的要求,MPU6050在自检期间不允许较大移动,否则自检计算会校验失败,自检时请不要移动MPU6050。 2.延时函数误差太大,MPU6050自检需要使用延时等待自检产生数据,驱动延时有很大的保守性一般而言存在一定误差没有问题,但是延时误差太大也会严重干扰校验过程,请确保延时的准确性。 3.IIC通信不稳定,需要至少运行/test中的register_test检测IIC通信的稳定性。 4.芯片本身问题,包括翻新、虚假芯片或者芯片自身缺陷等问题,可以更换一个MPU6050再次测试。

SimonFishhh commented 3 weeks ago

请问最后排查到问题了吗,我运行了register_test检测IIC通信的稳定性,自检过程中保持静止,依然出现自检失败的问题

libdriver commented 2 weeks ago

您好,昨天我们用jetson nano测试了一下ROS,自检是通过的,树莓派纯C的程序也是可以,以下是我们认为的几个原因:

1.自检的时候移动MPU6050。因为MPU6050本身自检的要求,MPU6050在自检期间不允许较大移动,否则自检计算会校验失败,自检时请不要移动MPU6050。 2.延时函数误差太大,MPU6050自检需要使用延时等待自检产生数据,驱动延时有很大的保守性一般而言存在一定误差没有问题,但是延时误差太大也会严重干扰校验过程,请确保延时的准确性。 3.IIC通信不稳定,需要至少运行/test中的register_test检测IIC通信的稳定性。 4.芯片本身问题,包括翻新、虚假芯片或者芯片自身缺陷等问题,可以更换一个MPU6050再次测试。

首先请您这边主要确认下原因1(正面向上),开发中我们遇到过翻新芯片的问题,导致无法通信或者自检失败的情况,5 - 10元(人民币)以内的大概率翻新芯片,因为一枚原装芯片大概20多元(人民币),我们推测原装芯片的MPU6050评估板可能要到30元(人民币)以上,不知道您那边知否也遇到类似的情况。