Electronic – MPU-6050 angle readings under mechanical vibrations

accelerometergyroquad-copter

I'm in process of making a quadcopter. At this point I encountered a problem with MPU-6050 angle calculation.
When quadcopter is stationary with motors in off state and I'm tilting it, angle readings in all 3 axis is good, but when motors are in on state, readings starts to jump all over the place and can even differ from real value by 20 degrees.
I assume this effect is due to mechanical vibrations caused by motors. I include images of MPU-6050 board mounting enter image description here and a graphs of angle readings of MPU-6050 in X axis using Kalman filter, complementary filter and MPU-6050 DMP (Kalman and complementary filter implementations as well as processing code for graphs is from Kristian Lauszus GitHub, DMP used with Jeff Rowberg I2Cdev library).enter image description here

UPDATE

I connected second MPU to different microcontroller, so it would not be connected electrically with a quadcopter and mounted MPU on board with two sponges from both sides of MPU. Results were pretty much the same. So now I really know that noise (at least majority of noise) isn't related with electrical switching noise from motors.

Best Answer

Make sure that the high power circuit driving your ESC's shares a common ground with the low power signal circuit from from the microcontroller. I found this to be very important when building my quad, as it also caused some errors with the other systems such as the Rx/Tx.