Complementary Filter
Be sure to check out the presentation on this filter at the bottom of this page.
Used the following to convert gyro and accel ADC readings to engineering units
Accelerometer Output (G) = (N-512) / 1024 * (double)10.78;
Gyro Output (radians) = (N-512) / 1024 * (double)28.783;
Implemented the complementary filter using the following equations
If filter term = tau / (tau + dt), where tau = time constant, dt = loop update rate:
rollAngle = (0.9615 * (rollAngle + (rollADC / 1024.0 * 28.783 * dt))) + (0.0385 * (rollAccADC / 1024.0 * 10.78)) * 57.2957795;
pitchAngle = (0.9615 * (pitchAngle + (pitchADC / 1024.0 * 28.783 * dt))) + (0.0385 * (pitchAccADC / 1024.0 * 10.78)) * 57.2957795;
- filter term = 0.9615
- when at rest observe noise to be 0.3 degrees
- very responsive
- appears to show 0.1 deg resolution
- filter term 1 = 0.9804, filter term 2 = 0.0196
- when at rest observe noise to be 0.2 degrees
Topic revision: r1 - 2009-06-13 - 07:41:06 -
AeroQuad