hideakitai / MPU9250

Arduino library for MPU9250 Nine-Axis (Gyro + Accelerometer + Compass) MEMS MotionTracking™ Device
MIT License
276 stars 90 forks source link

Help with a modified version of this lib (yaw axis issue) #66

Closed paulosincos closed 2 years ago

paulosincos commented 2 years ago

Hi,

First of all, thanks @hideakitai for your great work on this library.

I submitted a issue a week ago and you help me to discover I have only an MPU6500 instead of a traditional mpu9250 (here #65 and here #52)

After some a little code review, lots os google searchs, looking for alternative libraries, I managed to change your library to work with only mpu6500.

In fact, I don't changed the code, I only completly removed the magnetometer code, then I revised the register map with the documentation of manufacturer of 6500 and when finishing, I added a new quarternion filter of Madwick that don't need magnetometer to calculate (https://www.enib.fr/~kerhoas/RESEAU_CAPTEURS_/code.txt/MadgwickAHRS.cpp, looks similar to yours).

All worked fine... except for the yaw axis:

image

Even after calibrating, and I tryied lots of calibrations, my Yaw always keeps "moving", like the sensor is slowing rotating.

I have no ideia if it is as know issue, that I can resolve with some parameter, or if it is a issue with my hardware.

Roll and pitch works correctly.

If anyone has any tip for me, I'll extremelly grateful

Thanks

(sorry my potato english)

paulosincos commented 2 years ago

The fake/ghost yaw movement is not a constant, and its change when I change the sensor orientation. It goes up, or down, in greater or lesser intensity.

I even placed the sensor in another location, thinking it might be an interference. But the problem persists.

hideakitai commented 2 years ago

@paulosincos Hi, It is a known and common problem. To solve it, we put in a geomagnetic sensor and make it 9DOF. For example, please refer https://community.nxp.com/t5/Sensors/6DOF-GY-KALMAN-Yaw-drift/m-p/457552

paulosincos commented 2 years ago

@paulosincos Hi, It is a known and common problem. To solve it, we put in a geomagnetic sensor and make it 9DOF. For example, please refer https://community.nxp.com/t5/Sensors/6DOF-GY-KALMAN-Yaw-drift/m-p/457552

Thank you very much!