increase of data rate of Razor IMU M0 SEN-14001

Hello,

I am trying to increase the data rate of the Razor IMU M0.

I retrieve the pitch angle only at a frequency of 150 Hz on the serial hardware port.

I removed some unuseful code (for me) to optimize the speed ( computation of roll and yaw, parsing of serial input data, logging on the SD card).

The problem is that sometime, the returned pitch angle is corrupted.

I normally keep the IMU with a pitch angle varying between [-10 ; 10] degrees. Most of the measurements are correct in this range. However, every few seconds, i get erroneous pitch values, for instance such as 40° or 160°.

I modified only the data rate at 150 Hz:

#define DMP_SAMPLE_RATE 150//100 // Logging/DMP sample rate(4-200 Hz)

#define IMU_COMPASS_SAMPLE_RATE 100 // Compass sample rate (4-100 Hz)

#define IMU_AG_SAMPLE_RATE 150//100 // Accel/gyro sample rate Must be between 4Hz and 1kHz

and kept the factory parameters such as the Accel/Gyro LPF corner frequency and full scale range:

#define IMU_GYRO_FSR 2000 // Gyro full-scale range (250, 500, 1000, or 2000)

#define IMU_ACCEL_FSR 2 // Accel full-scale range (2, 4, 8, or 16)

#define IMU_AG_LPF 5 // Accel/Gyro LPF corner frequency (5, 10, 20, 42, 98, or 188 Hz)

When the IMU runs at 100 Hz, i do not observe the erroneous pitch angle values.

Do you have an idea why the IMU sometime returns erroneous values?

How could i correct this?

Kind regards,

Taiga

Hello,

would it be possible to have any suggestion or idea from the experts on this forum ?

kind regards

Taiga

Is it possible that you are reading the values before they become valid? Maybe (I am not very familiar with the Razor IMU M0) if the sensor registers have not yet been set from a reading they may return an invalid number. That number may then propagate through whatever sensor fusion algorithms are present on the razor, and result in your observed strange readings.

I would ensure that the operating specs of the onboard sensor (I think it is an MPU-9250?) are being respected by the program.

Hello liquid.soulder,

thank you for your answer.

In the razor M0, the onboard sensor is indeed an MPU-9250.

In my case, i only read the values from the serial port generated by the razor IMU M0 software, so do not access by myself to the registers. There might be a reading of the registers before that the values are valid, but i did not dig in this part of the code yet to check that.

Today, i investigated things, and i noticed two things:

  • the erroneous values appear even if the IMU is perfectly standstill

  • In the case of the single erroneous pitch value, the accelerations also present some large variation. I can show you two examples of accely, accelz, pitch, recorded at 150 Hz while the IMU was not moving at all. Curioulsy, the acceleration is well continuous, except at the two samples where the pitch is abnormally large:

accely, accelz, pitch

-0,07 -1,00 -4,32

-0,08 -1,00 -4,32

-0,08 -1,00 -4,32

-0,08 -1,00 -4,33

-0,07 -1,01 -4,33

-0,07 -1,00 -4,32

-0,07 -1,00 -4,32

-0,07 -1,01 -4,32

-0,08 -1,01 -4,32

-0,99 0,02 -73,71

-0,07 -0,99 -4,32

-0,08 -1,02 -4,32

-0,07 -1,00 -4,32

-0,08 -1,00 -4,32

-0,08 -1,01 -4,32

-0,07 -1,00 -4,32

-0,08 -1,01 -4,32

-0,07 -1,00 -4,32

-0,07 -1,01 -4,32

-0,07 -1,00 -4,32

accely, accelz, pitch

-0,08 -1,01 -4,33

-0,08 -1,00 -4,33

-0,07 -0,99 -4,33

-0,08 -1,00 -4,33

-0,07 -0,99 -4,33

-0,08 -1,00 -4,32

-0,07 -0,98 -4,32

-0,07 -1,00 -4,32

-0,08 -1,00 -4,32

-0,08 -0,99 -4,32

-0,08 -1,00 -4,32

-1,33 0,02 -70,46

-0,07 -1,02 -4,32

-0,07 -0,99 -4,32

-0,08 -0,99 -4,32

-0,08 -1,00 -4,32

-0,08 -1,01 -4,32

-0,08 -1,01 -4,32

-0,07 -1,01 -4,32

-0,08 -1,00 -4,32

-0,07 -1,02 -4,32

-0,07 -0,99 -4,32

If the IMU is standstill, the acceleration should not vary so much i think.

Do you maybe have an idea about this?

Hello,

i spent many hours this week end again to try to solve the problem, but no success.

Would it be possible to have more support on this issue ?

Regarding the specifications, in the default settings of the “config.h” file , it is well written that the DMP sample rate is (4-200Hz):

#define DMP_SAMPLE_RATE    100 // Logging/DMP sample rate(4-200 Hz)

So, it should be possible to get the “low power quaternions” from the MPU9250 and to compute the pitch angle at 150 Hz.

Any suggestion and help is very welcome !

kind regards,

Hello,

i keep investigating and i noticed a very interesting thing.

Since the pitch angle is computed from the low power quaternions outputed from the MPU9250, i displayed at 150 Hz the values of time, quaternions, and pitch angle. In the following, i put some samples of the recordings, where the pitch value is erroneous, while the IMU does not move at all:

time qw qx qy qz pitch

28527 0,02 -0,8 0,59 -0,03 -3,9

28535 0,02 -0,8 0,59 -0,03 -3,9

28543 0,02 0,02 -0,8 0,59 -72,78

28551 0,02 -0,8 0,59 -0,03 -3,9

28559 0,02 -0,8 0,59 -0,03 -3,9

28625 0,02 -0,8 0,59 -0,03 -3,91

45615 0,02 -0,8 0,59 -0,03 -3,93

45623 0,02 -0,8 0,59 -0,03 -3,93

45631 0,02 -0,8 0,59 -0,03 -3,93

45639 0,02 0,02 -0,8 0,59 -72,81

45647 0,02 -0,8 0,59 -0,03 -3,93

45655 0,02 -0,8 0,59 -0,03 -3,93

45721 0,02 -0,8 0,59 -0,03 -3,93

51247 0,02 -0,8 0,59 -0,03 -3,95

51255 0,02 -0,8 0,59 -0,03 -3,95

51263 0,02 -0,8 0,59 -0,03 -3,95

51271 0,02 0,02 -0,8 0,59 -72,85

51279 0,02 -0,8 0,59 -0,03 -3,94

51287 0,02 -0,8 0,59 -0,03 -3,94

51353 0,02 -0,8 0,59 -0,03 -3,94

60789 0,02 -0,8 0,59 -0,03 -3,91

60797 0,02 -0,8 0,59 -0,03 -3,91

60805 0,02 -0,8 0,59 -0,03 -3,91

60813 0,02 0,02 -0,8 0,59 -72,84

60821 0,02 -0,8 0,59 -0,03 -3,91

60829 0,02 -0,8 0,59 -0,03 -3,91

60895 0,02 -0,8 0,59 -0,03 -3,92

78474 0,02 -0,8 0,59 -0,03 -3,93

78482 0,02 -0,8 0,59 -0,03 -3,93

78490 0,02 -0,8 0,59 -0,03 -3,93

78498 0,02 0,02 -0,8 0,59 -72,88

78506 0,02 -0,8 0,59 -0,03 -3,93

78514 0,02 -0,8 0,59 -0,03 -3,93

78580 0,02 -0,8 0,59 -0,03 -3,92

89371 0,02 -0,8 0,59 -0,03 -3,91

89379 0,02 -0,8 0,59 -0,03 -3,91

89387 0,02 0,02 -0,8 0,59 -72,94

89396 0,02 -0,8 0,59 -0,03 -3,91

89404 0,02 -0,8 0,59 -0,03 -3,91

103383 0,02 -0,8 0,59 -0,03 -3,9

103391 0,02 -0,8 0,59 -0,03 -3,9

103399 0,02 -0,8 0,59 -0,03 -3,9

103407 0,02 0,02 -0,8 0,59 -73,02

103415 0,02 -0,8 0,59 -0,03 -3,9

103479 0,02 -0,8 0,59 -0,03 -3,9

103487 0,02 -0,8 0,59 -0,03 -3,9

In the case of the erroneous lines, we can notice a shift of the quaternions values. For instance, in the case of the last sample:

time qw qx qy qz pitch

103399 0,02 -0,8 0,59 -0,03 -3,9

103407 0,02 0,02 -0,8 0,59 -73,02

qw seems duplicated.

qw is shifted in qx

qx is shifted in qy

qy is shifted in qz

How do you expplain that? Is it a bug in the FIFO management? How to correct this?

Please help with some suggestions !