Go Down

Topic: IMU Pitch and Roll change with velocity (or acceleration) (Read 559 times) previous topic - next topic


My project is to determine the slopes of a paved path with the IMU attached to a wheeled cart. 

I have a BNO055 IMU running some of the example scripts and am able to read the angles fine.  However, when the IMU/Adurino is laid flat on my desk and is moved horizontally, the pitch or roll values (depending on the direction the IMU is moved) will increase while the IMU is in motion.  I'm not sure if this is dependent on velocity or acceleration.  When the IMU is stationary, the values go back to normal.  Is this standard behavior for an IMU?  If not, how can I mitigate this so that I can get accurate roll and pitch values while the device is in motion?

Thank you


Angles can be measured a couple of ways, right? One with accelerometer data ..... the other way with gyroscope data. Or a combination of both.

You mentioned example scripts were used. But you didn't mention anything about calibration. If you have various accelerometer sensors doing measurements in various directions --- then you'll want to have reference directions to begin with. And calibration must be done.

And once you start rolling your table horizontally ---- it should then be possible to see changes in particular accelerometer measurents - in specific directions. This is provided you do some data-logging when you test your sensors.


Is this standard behavior for an IMU?  If not, how can I mitigate this so that I can get accurate roll and pitch values while the device is in motion?
The "down" direction is defined by gravity, which is detected by the accelerometer when the sensor is stationary. Any change in horizontal motion has to include acceleration, which will introduces errors.

The gyro should help to compensate for those errors, but how well depends on the firmware built in to the device, and the BNO055 firmware is not very good.

There are several other options than the BNO055 (all of them involve more work on your part), but first, define what you mean by "accurate roll and pitch values".

My project is to determine the slopes of a paved path with the IMU attached to a wheeled cart.
This will involve LOTS of averaging, no matter what option you take. Because of acceleration bumps as the cart moves, all consumer grade sensors will return very noisy measurements. I doubt you will ever do better than +/-3 degrees accuracy in tilt and roll, if the sensor is moving.


The example script had a calibration step, which I've done every time, but still encountered the same issue when the device moves more than at a very slow walk.

the BNO055 firmware is not very good.
I also have a Adafruit 9-DOF IMU Breakout - L3GD20H + LSM303:

and a BerryIMU:

Would either of those be any less problematic?
If not, what is considered a good consumer grade IMU?

Regardless, would implementing a "filter" of some sort be possible to reduce the pitch values as the velocity/acceleration increases?


The L3GD20H + LSM303 are state of the art sensors. Have you tried the Adafruit software provided for their 9-DOF? Looks very primitive to me.

Much better: RTIMUlib for Arduino or the Madwick/Mahoney sensor fusion software. You would probably have to adapt the latter to your sensors.


I replaced my previous IMU with the L3GD20H + LSM303 and used the Adafruit_AHRD library with the Madgwick filter.  I also calibrated the IMU using the MotionCal software (Accelerometer and Gyroscope values were all 0??).

However, the new IMU still gives me incorrect pitch readings when the cart experiences acceleration in that axis.  Does this mean the accelerometer is still not properly calibrated?


You gave no useful details, but I suspect that the error introduced by the horizontal acceleration is too large for the fusion filter to correct.

The gyro and magnetometer aren't useful to correct errors introduced by jerky motion.  You could try averaging roll and pitch values, perhaps using a median filter (which rejects large outliers).

Thanks for drawing my attention to MotionCal, I will test it to see if it performs as well or better than the code I use.

Edit: MotionCal seems to be misnamed. It calibrates the magnetometer, but does not calibrate either the gyro or the accelerometer.


After reading up on my issue, it seems that determining the angle parallel to the direction of travel can be problematic with an IMU.  Is this true, or is the issue with my hardware/software?  I'm now considering switching my IMU for an inclinometer, although I cant seem to locate any specifically for an Arduino or Pi.

Does anyone know if switching from an IMU to an Inclinometer, such as the one below, help me determine the roll and pitch while the device is in motion:

Go Up