# Complementary filter in MPU_6050 is giving me the wrong answer when the system is accelerating

So I am using a complementary filter to find the attitude in my quadcopter, doing the following

$$\text{angle} = 0.98\cdot (\text{angle}+\text{dt}\cdot \text{angle_rate})+0.02\cdot \text{accelerometer_angle}$$

Now the problem is that the angle is wrong when my system(quadcopter) is accelerating, do you know how to solve the problem, or it is normal not to get accurate values when accelerating even if one is using the complementary filter?

• try 0.02 as weight for the accelerometer_angle. the sum currently seems to add up to 1.18 instead of 1. – Petrus1904 Dec 6 '20 at 18:01
• @Petrus1904 sorry I wrote wrong, I meant 0.02, I also tried other values like 0.01 and 0.99, but there is the same problem – Bananamaths Dec 7 '20 at 10:31