Dissatisfied with the DCM approach to coding orientation (in particular, I don't like the renormalization step), I switched the algorithm over to quaternions. And today I finally fixed a bug in the quaternion multiplication code that was causing coupled rotations to not work properly. Maybe I should have just done Euler angles for this first approach...
Also I switched to a pair of complementary filters instead of the extended Kalman filter. The problem with using Kalman is that it's not a simple matter of noise when combining the sensors. The gyro is probably well-described as having Gaussian noise, but the accelerometer and magnetometer see lower-frequency disturbances: translational acceleration and distortions of the earth's magnetic field caused by nearby magnets and high-μ materials. So when it comes down to it, I really do want to specify crossover frequencies.
The accelerometer is the only thing I trust at DC, because it has the least bias drift, but above 0.2 rad/s (arbitrarily chosen) I'll be picking up the maneuver acceleration in the tilt sensing. I trust the magnetometer at higher frequencies, up to the point where magnetometer noise is comparable to gyro drift. I chose 2 rad/s.
This is complicated by the fact that the accel and magneto can only read error in two axes, so I augmented the accel attitude error estimate using the magneto attitude error estimate, and I augmented the magneto attitude error estimate using the gyro signal (because I trust the gyro more than the accelerometer between 0.2-2.0 rad/s).
Anyways, it looks pretty good! Next up is some mounting hardware and porting the code to the AVR.
No comments:
Post a Comment