(image from http://www.ngdc.noaa.gov/geomag/WMM/image.shtml)
Hi folks!
I decided to implement an on-board declination calculator based on geographic location and I'd love to get some feedback. It takes up about 1400 flash bytes in total for a 3 degree declination error anywhere that people live (permanently - sorry Vostok!) and using a compass is reasonable. It's not going to be flight tested until it stops raining here, so use at your own risk! See the paper for more details :)
-John
Paper:
Lightweight%20Computation%20of%20the%20Earths%20Magnetic%20Field.pdf
APM Code - check under AP_GPS for AP_Declination_Lookup.*
LUT/IDW C# Calculator:
Footprint:
COMPASS_DECLINATION_LUT == DISABLED
113268 bytes, Free RAM: 1351, using 2061 bytes of memory
COMPASS_DECLINATION_LUT == ENABLED, COMPASS_DECLINATION_LUT_ACCURACY_LEVEL == 0
114692 bytes, Free RAM: 1351, using 2061 bytes of memory
Accuracy:
Scalable with table size
Table size: 89 entries (COMPASS_DECLINATION_LUT_ACCURACY_LEVEL == 0)
-------------------------------
Error 0 percentile: 0
Error 10 percentile: 0.1098926
Error 20 percentile: 0.2223369
Error 30 percentile: 0.3377705
Error 40 percentile: 0.4542923
Error 50 percentile: 0.5770731
Error 60 percentile: 0.7134132
Error 70 percentile: 0.8671622
Error 80 percentile: 1.072514
Error 90 percentile: 1.401104
Error 91 percentile: 1.447367
Error 92 percentile: 1.495352
Error 93 percentile: 1.551685
Error 94 percentile: 1.611044
Error 95 percentile: 1.676226
Error 96 percentile: 1.764013
Error 97 percentile: 1.864101
Error 98 percentile: 1.988347
Error 99 percentile: 2.208701
Error 100 percentile: 2.987068
Comment by John Erickson on March 15, 2011 at 2:16pm Great feedback, Doug! I am re-running the table creation with a 0.1 degree grid this time. Also, could you share the coordinates of such a disturbance? I'd be interested if either the IGRF11 or the WMM2010 take these into account. You can try out both models here: http://www.ngdc.noaa.gov/geomagmodels/IGRFWMM.jsp?defaultModel=WMM. Obviously, the accuracy of this method is limited by the accuracy of the model - GIGO as they say :) That said, I don't want anyone thinking that I am claiming the worst case error will scale linearly with the number of points. In other words, 100% < 1 degree error will take *lots* of points. And by the sound of these disturbances, it's likely infeasible with this model in general.
I also wanted to explain some more more caveats: 1) 1400 bytes is cheating a little bit (I briefly mention this in the write-up); I have the user-configurable declination code disabled when this is enabled, so I'd estimate it's closer to 2-3k, but I have not specifically calculated this. 2) By limiting the area of applicability, I'm making a difficult problem much more tractable 3) I'm not taking into account either elevation or time. In my area, declination is changing at 0.2 degrees/year. I don't know what worst cases are for this though.
Comment by bcr on March 15, 2011 at 8:42pm
Comment by Jack Crossfire on March 16, 2011 at 12:21am
Comment by John Erickson on March 18, 2011 at 10:23am Comment
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.24 members
58 members
1355 members
207 members
52 members
© 2013 Created by Chris Anderson.
Powered by

You need to be a member of DIY Drones to add comments!
Join DIY Drones