Hello guys, after a while i managed to fuse and filter smoothly the data from a mpu6050 sensor(accel & gyro). However recently i realize that my whole project had one last major problem,due to the nature of the sensors it is confused by the linear motion and as a result produces small angle measurments which actually dont exist.
For instance if i have the sensor on a table and move it linearly back and forth it results in small angles,which is wrong cause i didnt rotate it at all.
Do you know any conditions of algorithms that can help me tackle this issue, using the data or something else?
I thought to put a condition like if( gyro_measurent > Threshold) it rotates
but this approach dont work as it produces constant drifts due to the filter of small changes.
Another technique i thought is that accel data follow a specific path ,when rotating one is incremented while the other decremented however they have too much noise even after a moving average
Gyros drift, so you need measure the average offset during startup, keeping the sensor motionless. Subtract that offset from subsequent measurements. Repeat for each axis.
euri:
Hello guys, after a while i managed to fuse and filter smoothly the data from a mpu6050 sensor(accel & gyro). However recently i realize that my whole project had one last major problem,due to the nature of the sensors it is confused by the linear motion and as a result produces small angle measurments which actually dont exist.
You have picked up on a weakness of the "complementary filter" used to detect tilt. If it experiences any lateral motion it is useless. Actually, it is useless under any conditions. There are genuine complementary filters but none have ever been discussed on this forum.
The attached pdf describes measurements I made on a balancing two wheeled robot. Lateral acceleration dominates accelerometer readings. That the accelerometer readings somehow enhances tilt measurement is nonsense.
That the accelerometer readings somehow enhances tilt measurement is nonsense.
Misguided comment, but no matter.
The accelerometer measures the tilt, using the acceleration of gravity to define the vertical. As the OP clearly understands, the gyro can help correct errors that accrue when gravity is not the only acceleration that the sensor is undergoing. A rate gyro alone cannot be used to measure tilt.
The best sensor fusion filter available is the Kalman and its derivatives, covered quite well in Dan Simon's excellent textbook Optimal State Estimation.
jremington:
The best sensor fusion filter available is the Kalman and its derivatives, covered quite well in Dan Simon's excellent textbook Optimal State Estimation.
I am sure the book is excellent and I am sure you have misread it.
Interesting how you conflate the complementary filter with the Kalman filter when they have nothing to do with each other.
charliesixpack:
The attached pdf describes measurements I made on a balancing two wheeled robot. Lateral acceleration dominates accelerometer readings. That the accelerometer readings somehow enhances tilt measurement is nonsense.
The document says "For dt = .010, you can rewrite this is as...
angle = .98angle + (.98gyro + 2*acc)*dt"
However, if 'dt = 0.01', then the main question is ... why is 'dt' still seen in the above equation?