Wiki

This application wants to provide an easy way to calibrate the compass of android devices.

Calibration workflow (idea)

  • User is outside and wants to get a reliable compass direction
  • User is instructed to waive an 8 --> find out what this really does!
  • If GPS in not available, the workflow is abborted
  • The User is instructed to point to a target which is at least ??? meters away.
    • The compass value is saved
    • How many meters may be calculated using the accuracy of the compass or some constant value
  • The User is instructed to walk towards the point he points at until the phone issues a signal or he has reached the point.
    • The signal is issued when the worst-case-error based on the GPS data allows a definitive answer for the direction the user has walked.
  • The difference between the initial compass value and the angle determined by the GPS-Signals is the calibration Offset.
  • The user may want to redo this procedure, this can be requested by shaking the phone or pressing a button.

The following image describes how the procedure works.

the red point is where the user is questioned to point towards the green point. Value a(red) is saved. When marching towards the green point, angle b(green) can be determined after some time. when this angle is known, then offset value c(blue) can be calculated, by subtracting b from a. this offset is added to the raw compass data, every time the compass reports new measurement values.

Issues with this Procedure

This only gives a constant offset which will be added to whathever value the compass yields.

Working Stack

  1. Measure accuracy of GPS signals to find out how much walking will be needed in a series of tests with different Android-Devices Done --> Results Accuracy REsults
  2. Implement the workflow described above and write an app which displays two compasses, one with the calibrated values and one with the raw compass values. Implementation Details
    1. Maybe a third compass could be implemented, which does some smoothing of the last values.
  3. Integrate the workflow into mixare(https://github.com/mixare/mixare) No time for that

Findings

Algorithm with NMEA

The testsscenario was the following:

two Points, which were far away were marked on a map and their direction was determined, using a real map. these points served as reference.

given this data was available, the workflow was performed several times, using different Objects as reference Objects(in Pointing and Walking Step)

When the workflow is done, the angle for both reference points was determined, using the red arrow. this led to the following results:

Nr Schloss calibrated Difference Schloss Raw Difference Kirche calibrated Difference Kirche Raw Difference Offset Corrected Schritte
actual angles 2 104 -
1 47 45 40.1 38.1 159 55 152.1 48.1 6.9 6.9
2 7 5 -1 3 111 7 103 1 8 8
3 8 6 -0.9 2.9 108 4 99.1 4.9 8.9 8.9
4 10 8 -1.1 3.1 110 6 98.9 5.1 11.1 11.1
5 14 12 10.1 8.1 116 12 112.1 8.1 3.9 3.9
6 16 14 13.2 11.2 104 0 101.2 2.8 2.8 2.8
7 -15 17 -11.5 13.5 95 9 98.5 5.5 -3.5 -3.5
8 27 25 -1.3 3.3 124 20 95.7 8.3 28.3 28.3 16
9 31 29 6 4 124 20 99 5 25 25 18
10 -5 7 9.2 7.2 86 18 100.2 3.8 -14.2 -14.2 31
11 -50 52 -96 98 43 61 -3 107 314 46 16
12 -62 64 -75 77 70 34 57 47 347 13 30
13 -23 25 -23 25 91 13 91 13 42
Average 0.384615385 23.76923077 -10.09230769 22.64615385 103.1538462 19.92307692 92.67692308 19.96923077 11.35 25.5
Difference to actual 1.615384615 12.09230769 0.846153846 11.32307692
Difference max - min 109 59 136.1 95.1 116 61 155.1 106

measuring.png (8.37 KB) Anonymous, 02/22/2011 03:35 PM

Resultate_CompassCalibration.xlsx (12 KB) Anonymous, 03/30/2011 04:38 PM