Determining Magnetic Declination Using Polstar PMB-648 GPS Receiver
geometrix
Posts: 27
All,
I am currently working with a Honeywell HMC5883L Compass Module and a Polstar PMB-648 GPS Receiver. I am using 2 GPS receivers: one in a base unit and the other in a remote unit. The remote unit is wirelessly connected to the base unit using XBee.
I want to calculate the distance and bearing between the 2 devices. In order to calculate an accurate bearing, I need to figure out what the magnetic declination is based upon my geographical location. I then need to add/subtract the magnetic declination from magnetic north to calculate geographic north. Since the GPS coordinates are geographic, I need to do all of my calculations in the same frame of reference.
I know that $GPRMC has a MAGNETIC VARIATION field, but when I read the data stream from the PMB-648, the magnetic declination field is empty. I have e-mailed Polstar and they told me that this field is not supported.
So I have looked at a physical magnetic declination map of the US (Google "magnetic declination map") and have taken the average magnetic declination for each state. When I start my device, I prompt the user to push a button when his/her state appears in a scrolling list of states. I basically have an array set up that equates each state with its respective magnetic decliination.
Is there a more elegant way of doing this? Can I used GPS coordinates to determine the magnetic declination without having to create a huge lookup table? Am I missing something? Is there another GPS sentence that might provide this information?
TIA
--Neal
I am currently working with a Honeywell HMC5883L Compass Module and a Polstar PMB-648 GPS Receiver. I am using 2 GPS receivers: one in a base unit and the other in a remote unit. The remote unit is wirelessly connected to the base unit using XBee.
I want to calculate the distance and bearing between the 2 devices. In order to calculate an accurate bearing, I need to figure out what the magnetic declination is based upon my geographical location. I then need to add/subtract the magnetic declination from magnetic north to calculate geographic north. Since the GPS coordinates are geographic, I need to do all of my calculations in the same frame of reference.
I know that $GPRMC has a MAGNETIC VARIATION field, but when I read the data stream from the PMB-648, the magnetic declination field is empty. I have e-mailed Polstar and they told me that this field is not supported.
So I have looked at a physical magnetic declination map of the US (Google "magnetic declination map") and have taken the average magnetic declination for each state. When I start my device, I prompt the user to push a button when his/her state appears in a scrolling list of states. I basically have an array set up that equates each state with its respective magnetic decliination.
Is there a more elegant way of doing this? Can I used GPS coordinates to determine the magnetic declination without having to create a huge lookup table? Am I missing something? Is there another GPS sentence that might provide this information?
TIA
--Neal
Comments
Your project sounds very interesting. How is it coming along?
Is this just for North America? or the World?, Cuz that would be a huge lookup table.
-Tommy
1) separate the two GPS units.
2) have the user holding the unit with the magnetometer point it at the base unit.
3) calculate the true heading based on the GPS units, and the declination based on the true heading and the measured heading
You could figure out a rough equation that takes latitude and longitude (within some specified bounds) and produces the declination
You could improve on your current scheme by using the latitude and longitude to estimate the current state, and then use the lookup table (remove the Q&A).
Edit: Hmmm... I see now that it's a dead thread. Oh well.