Shop OBEX P1 Docs P2 Docs Learn Events
Determining Magnetic Declination Using Polstar PMB-648 GPS Receiver — Parallax Forums

Determining Magnetic Declination Using Polstar PMB-648 GPS Receiver

geometrixgeometrix Posts: 27
edited 2013-01-13 21:55 in Accessories
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

Comments

  • TtailspinTtailspin Posts: 1,326
    edited 2013-01-13 20:30
    Yes, I believe there is a GPS sentence for that and more, but your going to need a clearance, and probably a live scan...
    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. :smile:


    -Tommy
  • SRLMSRLM Posts: 5,045
    edited 2013-01-13 21:55
    You could have the user calibrate the device for their location by the following:
    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.
Sign In or Register to comment.