My disappointment with the MPU6050

Hi all!

Again and again in the battle to get what I want from MPU6050 I created this ultimate post to try one last time to achieve what I want to do with this sensor.

My goal :

With the help of the accelerometers and the gyro calculate the lean angle of a motorcycle.

I use the Kalman filter to calculate the angle of inclination, and it works very well, I just use the LOW PASS FILTER to eliminate motor noise from my bike.
This filter allows me to have a stable angle even when I mount the engine speed.

My problem :

If when the motorcycle is stationary (engine running) the measures are good, as soon as I move, the measures do not correspond with the true inclination of my bike.
Instead of values ​​around the 30/40 ° in a sharp curve, the measures do not reflect reality and can display both 5 ° and 12 ° in the same curve, and sometimes display an opposite corner than expected .

It is as if once in motion, my sensor no longer had his bearings.

I plan to try my editing on a simple bike to remove the engine and the vibrations of the suspect list, but I have to make an attachment for the module and time fails me.

Nevertheless I think the problem lies elsewhere but I can not identify it.

Would you have an idea about the problem I encounter?

P.S Sorry for my (Google Translate) English...

The accelerometer will measure the g-forces, and the gyro will show the inclination. The gyro will drift a little, so you have to compensate that with the accelerometer. However, on a motorbike, the accelerometer should be averaged a lot before it has a stable reading for the earth gravity (to know what is up and down).

Suppose you are accelerating during one minute, then the accelerometer has to use the average over 5 minutes perhaps.
What if you are on a closed round track. The accelerometer would never know what up and down is.

I don't know how to adapt the Kalman filter or an other filter for this.
You can start by using only the gyro value (with a low-pass filter in software to make it more smooth), and somehow you have to compensate the small drift of the gyro with the accelerometer.

I would suggest to forget about the crap 6050 and take this one instead:

Would you have an idea about the problem I encounter?

It is simply not possible to separate the acceleration due to gravity from other accelerations, and unfortunately, gravity defines "down" for the purpose of measuring the tilt angle.

The best you can do is have an excellent motion processor/filter attempt to estimate the orientation of the vehicle at all times, but it won't be accurate in situations of high acceleration.

The Kalman filter you claim to have implemented may not be working correctly -- there are several available for download that don't. You might try this one, which seems to be state of the art.

Thanks for replies!

Use a 9DOF IMU would be the solution to know motorcycle's orientation ?

I agree with jremington, how would a sensor know 'down' at all times ?
This is a modern sensor from Adafruit with libraries : http://www.adafruit.com/products/2472

Use a 9DOF IMU would be the solution to know motorcycle’s orientation ?

Not a solution, only an approximation, and only when used with state of the art software.

Sorry but i don't understand "state of the art software", google translate don't help me anymore...

I found this about the Bosch IMU :

"The lean angle and pitch angle can also be calculated using a microcontroller. Information about the wheel speeds and other motorcycle-specific parameters (tire size, tire form and geometric installation location of the sensor) are required for this calculation.".

I did not think that the calculation of this angle would require so much information.

"state of the art software"

"As good as presently possible".
Software that is agrees with our present understanding of the problem, is correct and works well.

The problem you are trying to solve is far more difficult than you seem to realize.

why don't you look at the CMPS11 I already have linked to?
it has a 16bit MCU on-board which performs all the Kalman filtering and sensor fusioning and provides all the values you need for a convenient access.

ArthurD:
why don't you look at the CMPS11 I already have linked to?
it has a 16bit MCU on-board which performs all the Kalman filtering and sensor fusioning and provides all the values you need for a convenient access.

Will it calculate the angle of inclination even though the object is in motion? If yes then it is obviously the component that I must thank you!

One function of the CMPS11 is to estimate the device orientation, just like any other IMU/software combination, but there is certainly no guarantee that it will work in your situation.

Try it and let us know how it goes.