I'm working on a quadcopter. I'm reading the accelerometer and gyro data out from the MPU6050 and using complementary filter to calculate the roll and pitch values. When the quad is on the floor, and the motors are turned on the roll values are:
-4.88675227698
-5.07656137566
7.57363774442
-3.53006785613
4.44833961261
-2.64380479638
-3.70460025582
It is very messy. After minus five there is plus seven. I would like to filter out this too high/low values programmatically but I have no idea how to do it.
EDIT: At this moment I think the solution is the Low-pass filter. I'll let you know if it is successful or not.