brtaylor
Well-known member
brtaylor is right. If your platform has any significant motion, you can't rely on the accelerometer to give you a second attitude reference (the first I assume is your magnetometer). Even with GPS aiding, and if you have a great dynamics model of your system, it's unlikely that you'll be able to retrieve an estimated gravity vector with enough accuracy or precision to use as a second reference using COTS MEMs sensors (that most of us can afford at least) - at least not good enough for a control system to use. I've tried this on many platforms with various levels of success. When I've gotten it to work, it was through artificially increasing terms in the covariance matrix to ignore the error buildup - but then I end up with a lot of drift in the attitude estimate. This is why it wasn't suitable for a control system without additional attitude measurements. It also depends on the system you are trying to control, its required bandwith and dynamics - smaller systems will need more sensitivity and bandwidth to control. I've ended up at this wall for hobbyist type hardware a few times. Make sure your control system, state estimator and overall system are matched to each other.
Attitude measurements, which are needed to correct the gyro stabilized dynamics model, are a tough topic - especially in the MEMS hobby world (read: us cheap bastards!). A properly calibrated magnetometer is usually the first attitude reference we all use since it's cheap and works on earth and in near-earth as long as you have a good magnetic model to use (see WMM). But additional attitude measurements to use if you are not motionless are a real challenge. Note, if you didn't know already, you'll need at least two (2) attitude references to estimate a 3-D attitude - but the more the better! RTK GPS can be used to provide an attitude reference (with 2+ receivers), and that equipment is getting more available and cheaper by the bay. But I'm not sure if it'll have the bandwidth for a pedestal balance type problem. Other options include camera object tracking (lot of CPU horsepower needed), time-of-flight type sensors, etc. Lots of ideas out there, but as usual implementation and bandwidth are a challenge.
This problem has certainly been solved in the past, but it'll use very expensive sensors, precision calibration of those sensors, and a system built to be controllable by the available hardware.
Good luck!
I've had plenty of luck estimating attitude, inertial velocity, and inertial position of manned and unmanned aircraft with MEMS sensors and GNSS aiding. To be clear, the EKF is only using the GNSS data as the measurement source, the gyro and accel are used in the time update. I typically don't use mags except to initialize the EKF and you get good heading accuracy if the inertial speed is above approximately 5 to 10 m/s. Where GNSS yaw comes in handy is if you spend lots of time slower than that, such as hover. Last year I did a comparison of our 15 state EKF, the VectorNav VN-300 (a high-end GNSS aided MEMS INS with GNSS yaw), and three GNSS receivers, which were used to measure attitude directly for their differential positions at a rate of 10 Hz. The results are attached, a little bias is present, but in general all 3 solutions match very well.

I'm currently developing an INS around what is probably the most expensive MEMS IMU on the market, the Honeywell HG4930CA51 (https://www.digikey.com/en/products...B2BTAngdxQG2wAgAkBxAFgE4BmABgGEBBAVgEYQBdAXyA), should be interesting to compare with our EKF!