I'm working on an a filter to combine accelerometer and gyro data to approximate tilt angle for a balancing robot.
My problem is that if i "zero" the gyro's rate output, it will need rezeroing after a few minutes as it appears to slowly and randomly drift (even if I just let the gyro just sit on the table). For a balancing robot, there is no chance to stop and "rezero" occasionally. I'm looking for a way (in the code) to dynamically rezero the rate somehow.
Again, the rate, not the integrated angle (which I expect can be fixed with the accelerometer's absolute angle measurement), is drifting. I didn't expect this to happen.
I'm using the sparkfun 5-DoF IMU with an 8-bit ADC.