kriswiner / MPU9250

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

Is it worth to use this MPU9250? #353

Open shomedas opened 5 years ago

shomedas commented 5 years ago

I need to know if the MPU9250 I am using will give me stable AHRS. I am new to IMUs and I ask your opinion about my MPU9250(I am using the blue board). Also I need to know what type of calibration is needed?(For accelerometer, gyro and magnetometer). i have gone through your calibration methods in your sketches(5637.ino) and I need to know whether I need any thing over them. How do I reduce the gitter in accelerometer, gyroscope & magentometer.

My connection: 0250---arduino uno Vcc--5V Gnd--0V FSYNC--0V NCS--3.3V SDA -- A4 SCL -- A5 INT -- Pin2 Pull up between SDA, SCL to 3.3 is 5k

I recorded the accelerometer, gyroscope and magnetometer while keeping the IMU stationary on a table. The IMU was fixed to a solid cube and placed in three different orientations in three consecutive experiments.

  1. YZ on table, X pointing down
  2. XY on table, Z pointing up
  3. XZ on table, Y pointing up

Below table shows the rms error & peak to peak of ax,ay,az, Gx, Gy,Gz, Mx,My,Mz for three orientations of the IMU. accel, gyro and mag readings are uncalibrated readings from the 5637.ino code. The units for acceleration, gyroscope and magneometer are g, dps & mGauss respectively. The magnetometer data is captured at 100Hz mode.

Orientation1 ax ay az gx gy gz mx my mz
peak to peak 0.01 0.01 0.02 0.39 0.45 0.39 68.33 61.33 64.36
RMS error 4.2e-5 0.0027 0.0032 0.0484 0.0516 0.0463 8.145 7.6624 7.5714
Orientation2 ax ay az gx gy gz mx my mz
peak to peak 0.01 0.01 0.02 0.79 1.07 0.46 73.7 70.35 71.32
RMS error 4.4e-4 4.6e-5 0.019 0.049 0.0512 0.046 7.9524 7.8141 7.4709
Orientation3 ax ay az gx gy gz mx my mz
peak to peak 0.02 0.01 0.01 0.44 0.48 0.51 70.12 80.2 72.3
RMS error 1.13e-4 7.53e-4 0.005 0.0487 0.0524 0.0514 7.7502 8.206 7.8266

Please find herewith attached the set of images for the case when z faces up and IMU is on table.

Ax_vs_time Ay_vs_time Az_vs_time Gx_vs_time Gy_vs_time Gz_vs_time Mx_vs_time My_vs_time Mz_vs_time

How does the IMU data look overall in its stationary state? Is it reliable enough for AHRS

kriswiner commented 5 years ago

I am confused by your data.

Shouldn't one of the accel axes be showing gravity at 1000 mg?

Shouldn't the mag magnitude be ~0.5 Gauss?

Shouldn;t the gyro read 0, 0, 0?

Why don't they?

On Tue, Mar 19, 2019 at 11:53 AM shomedas notifications@github.com wrote:

I need to know if the MPU9250 I am using will give me stable AHRS. I am new to IMUs and I ask your opinion about my MPU9250(I am using the blue board). Also I need to know what type of calibration is needed?(For accelerometer, gyro and magnetometer). i have gone through your calibration methods in your sketches(5637.ino) and I need to know whether I need any thing over them. How do I reduce the gitter in accelerometer, gyroscope & magentometer.

My connection: 0250---arduino uno Vcc--5V Gnd--0V FSYNC--0V NCS--3.3V SDA -- A4 SCL -- A5 INT -- Pin2 Pull up between SDA, SCL to 3.3 is 5k

I recorded the accelerometer, gyroscope and magnetometer while keeping the IMU stationary on a table. The IMU was fixed to a solid cube and placed in three different orientations in three consecutive experiments.

  1. YZ on table, X pointing down
  2. XY on table, Z pointing up
  3. XZ on table, Y pointing up

Below table shows the rms error & peak to peak of ax,ay,az, Gx, Gy,Gz, Mx,My,Mz for three orientations of the IMU. accel, gyro and mag readings are uncalibrated readings from the 5637.ino code. The units for acceleration, gyroscope and magneometer are g, dps & mGauss respectively. The magnetometer data is captured at 100Hz mode. Orientation1 ax ay az gx gy gz mx my mz peak to peak 0.01 0.01 0.02 0.39 0.45 0.39 68.33 61.33 64.36 RMS error 4.2e-5 0.0027 0.0032 0.0484 0.0516 0.0463 8.145 7.6624 7.5714 Orientation2 ax ay az gx gy gz mx my mz peak to peak 0.01 0.01 0.02 0.79 1.07 0.46 73.7 70.35 71.32 RMS error 4.4e-4 4.6e-5 0.019 0.049 0.0512 0.046 7.9524 7.8141 7.4709 Orientation3 ax ay az gx gy gz mx my mz peak to peak 0.02 0.01 0.01 0.44 0.48 0.51 70.12 80.2 72.3 RMS error 1.13e-4 7.53e-4 0.005 0.0487 0.0524 0.0514 7.7502 8.206 7.8266

Please find herewith attached the set of images for the case when z faces up and IMU is on table.

[image: Ax_vs_time] https://user-images.githubusercontent.com/14357750/54632893-0aa2a000-4aa5-11e9-953b-abb7bfeb5e47.jpg [image: Ay_vs_time] https://user-images.githubusercontent.com/14357750/54632902-0fffea80-4aa5-11e9-82b1-329c8d3bb50f.jpg [image: Az_vs_time] https://user-images.githubusercontent.com/14357750/54632906-12624480-4aa5-11e9-8bdf-0fa9f0f62f2e.jpg [image: Gx_vs_time] https://user-images.githubusercontent.com/14357750/54632917-18f0bc00-4aa5-11e9-92c7-5be665efc2e6.jpg [image: Gy_vs_time] https://user-images.githubusercontent.com/14357750/54632923-1c844300-4aa5-11e9-9f8e-98f09fc04b10.jpg [image: Gz_vs_time] https://user-images.githubusercontent.com/14357750/54632933-20b06080-4aa5-11e9-85f4-78cf45cd015e.jpg [image: Mx_vs_time] https://user-images.githubusercontent.com/14357750/54632943-25751480-4aa5-11e9-8a94-800e7ce4ae2a.jpg [image: My_vs_time] https://user-images.githubusercontent.com/14357750/54632953-29a13200-4aa5-11e9-9e28-7a74c08e878e.jpg [image: Mz_vs_time] https://user-images.githubusercontent.com/14357750/54632956-2c9c2280-4aa5-11e9-99ff-b199676a85ba.jpg

How does the IMU data look overall in its stationary state? Is it reliable enough for AHRS

— 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/353, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qom3Ba_ioPDJsBtLsDg9IIAVy4cnks5vYTI3gaJpZM4b83rR .

shomedas commented 5 years ago

This is uncalibrated data. I am showing the raw data here. I have done the calibrations. After calibration the yaw pitch roll values are not changing as expected. Also If I reverse the IMU direction about an axis(x axis to -x axis), the magnetometer value is not exactly the negative of the initial value.So I thought of checking the reliablity of the uncalibrated raw data to start with.

I have calculated the rms error value and peak to peak error values as shown in the table. The images show the raw data as it is without calibration.

kriswiner commented 5 years ago

The data is wrong.

On Tue, Mar 19, 2019 at 12:08 PM shomedas notifications@github.com wrote:

This is uncalibrated data. I am showing the raw data here. I have done the calibrations. After calibration the yaw pitch roll values are not changing as expected. So I thought of checking the reliablity of the uncalibrated raw data to start with.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/353#issuecomment-474530561, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qtug1dWcbO_p2L4CX2ZeypnJ4Ue3ks5vYTWZgaJpZM4b83rR .

shomedas commented 5 years ago

Its past midnight here. I am too sleepy and tired. I beg to be excused today. I will collect calibarted data and post again.

kriswiner commented 5 years ago

If the data is properly scaled, then:

one of the accel axes be showing gravity at 1000 mg

the mag magnitude be ~0.5 Gauss

the gyro read 0, 0, 0 dps

Do they? This is independent of calibration.

You are either not reading the registers properly or not converting register bytes to signed integers properly or not scaling the signed integers properly or all of the above.

So what you are calling the data is not.

On Tue, Mar 19, 2019 at 12:29 PM shomedas notifications@github.com wrote:

I am not able to understand how the raw data is wrong. I have not edited it. Can you kindly elaborate?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/353#issuecomment-474542115, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qvcAb-NKp_ZxBHIrnkzaBpp6cNhBks5vYTqvgaJpZM4b83rR .