Hello
I use mpu6050 and I want to use a 'Complementary Filter' to get the angle of the X, Y, and Z axes.
Applying this filter to the value of mpu6050 seems to reduce noise at first and produce good results. However, after some time, the value of the Z-axis continues to grow.
It keeps getting bigger and bigger, and after a while, the value is printed out too strangely.
This is the output when the sensor is placed on the floor. The X and Y axes seem to come out normally, but the Z axis has a strange value.
This is the code I wrote about filtering. I wrote it while referring to the example of Arduino, is there anything strange?
Or is it possible that this is a sensor problem?
Thank you.
//==================================================
I think I found a problem.
The value of dt in void calcDT() comes out as a fixed value as shown below, and suddenly becomes very large.
Can you tell me the cause of this problem??