Magnetic Declination simplified (hopefully)

Post Reply
IslandBill
Posts: 4
Joined: Mon Jan 05, 2015 10:41 pm

Magnetic Declination simplified (hopefully)

Post by IslandBill »

First of all, if I am wrong in my explanation here please someone let me know. However this method worked out just fine for the example in config.h of Budapest, Hungary (I came up with 4degrees, 34 minutes so the writer of config.h must live a bit west of downtown Budapest).

I've done some searching on this and finally figured out where things were overly complicated (or where I was overly simple?).

Go to http://magnetic-declination.com/. You will be able to look up the magnetic declination for your locaton. Here is the data for Houston, Texas:

Houston Texas
Latitude: 29° 45' 47.8" N
Longitude: 95° 21' 47.8" W
Magnetic declination: +2° 49' EAST
Declination is POSITIVE
Inclination: 58° 54'
Magnetic field strength: 47321.4 nT

Of this data I am concerned with only ONE value: Magnetic declination. Unfortunately for multiwii, and for you, this value is expressed in degrees and MINUTES. You need degrees and a DECIMAL VALUE SUBSTITUTION FOR MINUTES. What does that mean? It simply means, what percentage of an hour is 49 MINUTES? That's where that *(1/60) comes in. You are going to convert 49 minutes into a decimal (or percentage) of an hour. A MINUTE is 1/60th of an hour, or expressed as a decimal, .01666666666666666666(into infinity). You can round it to .01666666 and come out plenty close enough. So a MINUTE is .0166666 of an hour. In this example, meaning for Houston Texas, my magnetic declination is 2.81f because 49 minutes is 81% of an hour.

NOTE: Do not be confused by the notation "2.81" -- this is not a percentage or a decimal number. It is just a string of characters. The multiwii firmware knows that when it sees the "." it is done with whole degrees and the rest of the string represents the percentage of an hour to tack on to the offset. I think this is what throws most people off.

So let's do an example for Honolulu, Hawaii:

+9° 35' East
is the magnetic declination found online. Let's convert that to "multiwii-speak":

Since we know the degrees already, (9) all we have to do is find what 35 MINUTES means. We multiply 35 X .0166666 to get 0.58331, which we round to .58. This makes sense, our brain tells us, because 35 minutes does in fact seem like 58% of an hour.
Now all that's left is to write it out in multiwii-speak: 9.58f (the firmware needs the 'f' tacked on at the end for whatever reason). Because the value is 'East' (magnetic-declination website informed us of that) the value is POSITIVE. West is NEGATIVE. Therefore, our entry in config.h for Honolulu, HI is:
#define MAG_DECLINATION 9.58f
Since the value is East, or positive, it was written without a minus sign in front of it. For West, or negative, values simply put a negative sign in front of the number.
Easy enough?

FengShuiDrone
Posts: 234
Joined: Wed Dec 24, 2014 1:20 am
Location: ......

Re: Magnetic Declination simplified (hopefully)

Post by FengShuiDrone »

.
Last edited by FengShuiDrone on Sat Aug 08, 2015 12:15 am, edited 1 time in total.

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: Magnetic Declination simplified (hopefully)

Post by EOSBandi »

Seriusly????
How it could be explained simpler ?
"Convert the degree minutes into decimal degree by ==> degree+minutes*(1/60)
Note the sign on declination it could be negative or positive (WEST or EAST)"
Isn't it 6th grade math in the States ?

Btw,
The 4.0 in config.h is a one two years old value, the declination changed that much since then.
2.81f is not a string but a floating point number.
.2, .3 differences are not a big deal, it is masked by the inaccuracies of the GPS.

Post Reply