kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.03k stars 472 forks source link

Euler Angles High Drift Rates #429

Open oozarslan15 opened 4 years ago

oozarslan15 commented 4 years ago

Hello Kris,

Thanks for the outsanding work. I am trying to obtain euler angles from quaternions with same sensor sampling rates. I am using 80Mhz esp8266 and updating madgwick ~10 times for 1 sensor reading. However, all euler angles are drifting at high rate. Sensor readings are taken at with 100ms interval. Those magnetometer plots are obtained with 8Hz magnetometer readings with 135 ms intervals. In order to calibrate, I took 200 samples with 8Hz sampling rate and 135 ms interval.

image image image

Below graph is the magnetometer measurements.

image

That graph is the Roll - Pitch - Yaw. I am not even sure that problem is drift it seems like nonsense readings. Can you tell me what I am missing? image

kriswiner commented 4 years ago

What is the problem exactly?

Your sensor sample rates are rather low for capturing types of motion from typical human activity. Why not use 200 - 400 Hz for gyro/accel and 100 Hz for mag?

The sensor data need to be fed into the Mamdgwick or Mahoney filter in NED order.

On Wed, Aug 26, 2020 at 12:16 PM oozarslan15 notifications@github.com wrote:

Hello Kris,

Thanks for the outsanding work. I am trying to obtain euler angles from quaternions with same sensor sampling rates. I am using 80Mhz esp8266 and updating madgwick ~10 times for 1 sensor reading. However, all euler angles are drifting at high rate. Sensor readings are taken at with 100ms interval. Those magnetometer plots are obtained with 8Hz magnetometer readings with 135 ms intervals. In order to calibrate, I took 200 samples with 8Hz sampling rate and 135 ms interval.

[image: image] https://user-images.githubusercontent.com/46425752/91335408-040b7280-e7d9-11ea-89c6-0e1a7a2da509.png [image: image] https://user-images.githubusercontent.com/46425752/91335473-200f1400-e7d9-11ea-9c2d-3bf585c31483.png [image: image] https://user-images.githubusercontent.com/46425752/91335534-34eba780-e7d9-11ea-93b2-5a5ba80f8d49.png

Below graph is the magnetometer measurements.

[image: image] https://user-images.githubusercontent.com/46425752/91335058-8c3d4800-e7d8-11ea-86e5-77bbedd6911c.png

That graph is the Roll - Pitch - Yaw. I am not even sure that problem is drift it seems like nonsense readings. Can you tell me what I am missing? [image: image] https://user-images.githubusercontent.com/46425752/91345623-4ee0b680-e7e8-11ea-8ed0-f6f795236018.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/429, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKQZSJO7YQ47BK6A7XTSCVNP7ANCNFSM4QMFKM3A .

oozarslan15 commented 4 years ago

that euler angles and mag measurements are obtained when sensor is at rest. Problem is the same when I am doing calculations with 100 hz magnetometer. I am using NED order as your https://github.com/kriswiner/MPU9250/blob/master/MPU9250_MS5637_AHRS_t3.ino script.

paulrossmanith commented 3 years ago

Be sure to calibrate your IMU beforehand. I had a similar issue where the filter would drift indefinitly opposed to converging properly. Also try increasing the filters gain, beta=0.5 worked fine for my MPU9250 + Madgwick-Filter