click here for frames page

Calibrating a Compass and Calculating TAS using GPS

I had an e-mail from a pilot asking if he could use GPS to calibrate a compass.  I though that it was an interesting problem.  Before I embarked on trying to figure it out, I thought that I would see if anybody else had already found a technique.  It turns out that there is a technique.

I should disclaim that I have not tried any of the techniques.  I just thought that it sounded like an interesting problem and thought that I would play with it for a bit.  So please keep this disclaimer in mind.  However, feel free to contact me about this at handheldgps@hotmail.com.

Finding Wind and TAS

The idea is that you fly an airplane at a fixed power setting on three different legs and record the track and speed from the GPS.  The assumption is that the TAS (true airspeed) and the wind are constant.  By comparing the TRACK and SPEED from the GPS for each of the three legs the TAS, wind direction, and wind speed can be calculated. 

The further apart the tracks are from each other, the better the measurements will be.  Ideally, the three tracks would be 120˚ apart.  Obviously, the steadier the wind, the better the results will be.

Finding Headings and Calibrating a compass

Once you calculate the wind and TAS, you can calculate the heading for each leg since you already know the track and groundspeed from the GPS.  If you have set up the GPS to give magnetic rather than true values and record the compass heading for each leg you can compare the GPS derived value to the actual compass reading to calibrate the compass.

There are some problems that I see.  The idea of swinging a compass is to correct for deviation caused by the aircraft.  The compass aligns itself with the earth's magnetic field.  The earth's magnetic variation is irregular.  I see the ability for the GPS to accurately calculate magnetic variation to be a possible factor.  The GPS "thinks" in true values and a magnetic variation must be internally calculated to display magnetic values of TRACK, BEARING, COURSE, etc.  A compass rose painted on an airport is probably measured rather than calculated.  Thus, by swinging a compass to a compass rose painted on the pavement, the variable that is eliminated is the deviation caused by the aircraft.  For most areas of the world and considering the accuracy of the compass, this probably isn't a big factor.

The problem is that it is difficult to swing the compass on a tail dragger operating at cruise power.  Thus, the GPS solution might be a useful tool.

Sources

Doug Gray's Paper

The first place that I found this information is in a paper Doug Gray. 
 

TAS_FNL4.pdf
This is the paper itself.

GPS_SPEED.txt
Doug Gray's paper has a spreadsheet to make the calculations.  This is the text file extracted from the .pdf file.  The only change that I made was to join a couple of words with an underscore.  For example, "Heading 1" becomes "Heading_1".  The reason for this is so that you can import this into a spreadsheet as a space delimited file.

GPS SPEED_as_in_paper.xls
This is the same spreadsheet as above saved in Microsoft Excel format.  I suggest that you right click on the link and select "save as."  You might get a request for a network password--select "cancel" and you should still be able to download the file.

Ed William's Aviation Formulary, http://williams.best.vwh.net/avform.html

Ed Williams has the formulas for calculating the wind and TAS from the GPS TRACK and SPEED from three legs on his site.

Refinements

My Refinement

I must repeat my disclaimer that I have not had the chance to test this spreadsheet and it is very much a use at your own risk type of proposition.  The reason that I worked on it was that I thought that the problem was interesting, if not particularly useful for my own purposes.

The limitation of the Doug Gray's technique is that it is limited to three legs.  This is just the mathematical nature of the problem.  I wondered if there was not a way to use more data points and average a solution.  I would be surprised if there were not a better way than the one that I came up with.  However, I think that my solution might work.

I created an Excel spreadsheet which allows you to calculate a best value of wind speed, wind direction, and TAS with more than three legs.  The spreadsheet uses a trial and error technique for averaging.

Here is the file:  other_articles/GPS_TAS/GPS SPEED_multiple_points.xls.  You should right click and select "save as."

There are two sets of legs.  The first set is a subset of the second.  Take the GPS SPEED and TRACK from three of the more spread out legs and use them in the first set to calculate the wind speed, wind direction, and TAS.  Units don't matter as long as they are consistent.  This provides an initial guess for the values in the second step.  This first step is nothing more than the technique in Doug Gray's paper.

The legs in the second step should include the legs used in the first step in addition to more legs.  I have twelve possible legs, but the spreadsheet can be modified to add more legs in between.  I have protection turned on and certain fields are locked to avoid accidentally changing formulas.  I also have some of the rows hidden to make the sheet more readable.  However, the sheet is not password protected and if you are reasonably proficient with Microsoft Excel, you should be able to easily make changes.

Start with the values from the first step and then change the values of wind speed, wind direction, and TAS to get a minimum error value.  For example, if the TAS from step 1 is 130, try this first.  Next try a TAS of 131.  If the error increases, then try 129.  Keep on incrementing or decrementing until you reach a minimum error.  After finding a minimum error value in one variable, you should go back to the others to make sure they are still at a minimum error producing value.

Three legs should produce no error.  In the example data in the sheet, there is a slight error because the values input in the first step are rounded to whole numbers.  This slight error is a reflection of this rounding.

I have not taken the time to rigorously prove the mathematics of this technique.  What I do in step two is to calculate a groundspeed using the values of wind speed, wind direction, and TAS and then compare it to the measured groundspeed.  I think that this is a reasonable although not rigorously proven way to average the data within my capabilities and level of interest.  Certainly, if you find that it doesn't work or have a better way, let me know (handheldgps@hotmail.com).

National Test Pilot school refinement:

The National Test Pilot school has a refinement of the above method that uses four legs instead of three for error checking at http://www.ntps.com/downloads.htm

Another Link:

While looking for this information, my web search led me to Kevin Horton's site at http://go.phpwebhosting.com/~khorton/rv8/phplinks/index.php?&PID=49.