MPU6050 subjected to vibration

Hey guys!

First of all, I hope to be posting this topic on the right category, and not to be posting a repeated issue. I searched all over but I couldn’t find something that would help me.

I am developing an application with a MPU6050 in which I use flapping wings, that beat at ~25Hz. Well, because of this, and all the structure that supports the sensors, these undergo a lot of vibration, which causes me some problems obtaining the roll and pitch angles.

So, trying to attack the problem, I tested mantaining my robot fixed and I started flapping the wings, exciting the structure and making it vibrate, although the robot mantains the same position. The angle in roll is displayed in attachment.

It is important to note that I’ve tried different materials to damp the vibration on the board, reducing the offset in angle (initially I had about 12 degrees offset) but never eliminating it.

My question here is if all the structure that supports the board suffers from a drift in angle, or if is there something else I can be missing. I’ve tried filtering the data, which helps reducing the noice but it doesn’t solve the offset.

Thank you in advance!

example drift.jpg

It does not surprise me. Only 5 degrees offset with vibrations is not that bad. It has not been designed for that.
What happens if you turn the accelerometer upside down ? Perhaps the vibrations with the earth gravity causes the offset.
The 25Hz vibrations might not be the biggest problems. The higher frequency vibrations (mechanical, or from the motors) of a few hundred Hz could be too much for the MPU-6050.

Could you try some very soft and sticky silicone/gel as damper and keep it very loose. Not foam, not rubber, not elastic band.

Maybe an analog accelerometer will be easier to dampen. For example the ADXL335 : ADXL335 - 5V ready triple-axis accelerometer (+-3g analog out) : ID 163 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits.
I think it is worth trying. It is also a MEMS sensor, so it could have the same problem, but the analog output makes it possible to use a RC filter.

Some MPU-6050 modules have the wrong capacitor. They used a 2n2 where a 100nF should be used. If you have such a board, you will get a lot more noise.

Hi Koepel,

I'll try to apply what you suggested, and as soon as I got some results, I'll post it here.

It is also possible that the vibration of the motor (higher frequency), which is attached to the structure that supports the board, originates the offset. What do you mean by "a few hundred Hz could be too much for the MPU-6050."?

Regarding the analog accelerometer, it is difficult to implement it since I am strictly limited by weight. My microcontroller (micro mwc) contains the sensors and weights 1.7g.

I will try to investigate which kind of capacitor is used in this board.

Thank you for all the help

To investigate the wrong capacitor, keep the MPU-6050 completely still, and compare the raw values with this : http://playground.arduino.cc/Main/MPU-6050#measurements If your values are three times more noisy, you could have the wrong capacitor.

The trouble with higher frequency vibrations is that the sensor can no longer 'follow' the motion. When the sensor and the software can 'follow' the motion, a filter in software would solve it. For example with a sample rate of 100Hz and a vibration that is maximum 25Hz, then it should be no problem to filter it in software.

Try to find a better mechanical damper.

As a last option, solve it in software. Accept the offset as something that happens and adjust it in software. You know when your are flapping, right ? Be sure to explain in the code why you do that.

I will investigate the raw values, thanks for the link.

My point here is that the sensor always follows the motion in terms of angle, but it adds this offset. It doesn't seem like a problem of noise though, this offset, either mechanical or from the sensor (after stopping flapping, in the figure I posted, the behaviour of the angle coming back to its initial value seems weird). If the problem is mechanical, looks like when I starts flapping the structure vibrates in a way that tilts my board continuously... In terms of angular velocity, and filtering the data, the values come with no problem.

The adjust in software was the last thing I want to try, after 'burning' all the hypothesis for solving the problem by its root.

Wikipedia has something about MEMS sensors : https://en.wikipedia.org/wiki/Microelectromechanical_systems That's why I wrote that I'm not surprised, because of the way it works. I think that is where the root of the problem is, it could be the way the sensor is build.

I think the angle of the sensor returning to its good offset value is normal, although 2.5 seconds to recover is very long. Is that with raw values, or is that with a software filter ?

If you don't want to try an analog sensor, then "fix" it in software. Maybe a better solution shows up later on.

This angle is obtained with the DMP algorithm which comes in the library of the MPU, which can be found here.

I will start trying your suggestions now and I'll keep you informed. Thanks!