Angelic Angles Algorithm

Currently, Phoebe can only run short flights safely; flights more than a few seconds lead to inaccurate angle of tilt calculations due to drift over time in the integration of the gyro angular speed.  The net result of a longer flight would be Phoebe thinking she’s hovering horizontally, when in fact she has a slight angle of tilt accelerating her towards a brick wall..

I’ve mentioned in the past that angular information is also available from the accelerometer by using the Euler calculation, but short term it’s prone to the noise I spent months trying to reduce.

I’ve also mentioned previously that by applying a mathematical filter to these two sources of angular data, you can extract the best of both worlds both short and long term.

But I’ve held off doing so through lack of understanding how they work.  I hate the idea of copying someone else’s code without understanding it, since then I can’t recognise / fix bugs in that code, or tailor it to be a perfect fit for my code.

The best of the filters commonly used is by Kalman (again previously mentioned) – this still remains too complicated for my aging and damaged brain to comprehend.

However, I’ve just found this article which means I now fully understand how a complementary filter works, and so I’m happy to deploy the filter in my code.

I strongly recommend reading this article – it’s great.

P.S. The previous set of Chapters and Appendices aren’t yet complete, but with winter upon us and the nights drawing in, testing time is in even more short supply.  I hope for one final Appendix, but until then, life (both mine and Phoebe’s) moves on.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.