Compass Module Application Note PDF
Compass Module Application Note PDF
BACKGROUND
The local horizontal plane is defined as the plane normal
to the earth's gravity vector (see Figure 2). If a compass
was sitting in the local horizontal plane, then the roll and
pitch angles would be zero and the heading would be
calculated as:
(1)
TILT DETERMINATION
One method to determine the roll and pitch angles is to use
a tilt sensor that senses the direction of gravity. Common
tilt measuring devices include accelerometers, electrolytic
(fluid) based tilt sensors, and gimbaled mechanical
structures. Another method to determine the local
horizontal plane is to use a gyroscope to maintain a known
inertial reference orientation at all times.
tilt sensor
Roll
Tilt Sensor
pitch
-roll
3 - Axis
Magnetic
Sensor
Yh
local horizontal plane
Pitch
Xh
gravity
vector
X
Y
Analog to
Digital
Converter
Processor
interface and
algorithm
Tilt compensated
azimuth or heading
COMPASS SYSTEM
If a strapdown compass is required to output heading for
any orientation then, as a minimum, a compass system
must have a three-axis magnetic sensor and a two-axis tilt
(see Figure 3). The heading calculation relies on all three
magnetic components (X,Y,Z) so the compass orientation
can be mathematically rotated to the horizontal plane.
Then, the Xh and Yh components can be calculated to
determine the heading value from equation (1).
Low cost tilt sensors like the two-axis electrolytic and dual
axis accelerometer measure the roll and pitch angle
directly. Liquid filled electrolytic tilt sensors, resembling a
glass thimble, use electrodes to monitor the fluid
movement as the sensor changes angles. Solid state
accelerometer tilt sensors measure the Earths
gravitational field by means of an electromechanical
circuit [2]. These sensors are similar in that they have two
single axis components that measure the angle deviations
from the local horizontal plane. Signal conditioning
circuits are used to create an output signal proportional to
the angle of tilt. These sensors are considered strapdown
devices since they have no moving or pendulous parts and
are desirable for vehicle applications [3].
= 180 - arcTan(Yh/Xh)
= - arcTan(Yh/Xh)
= 360 - arcTan(Yh/Xh)
= 90
= 270
(3)
10
pitch (degree)
-10
5
-5
-2
0
2
5
-5
10
-10
0
90
180
270
360
Heading (degree)
if:
then:
Spec
Limit (1)
Field
Error
Heading
Error
Noise
(BW=10Hz)
85 ugauss
85 ugauss
<0.01
Linearity
0.05 %FS
0.2 mgauss
0.06
Hysteresis
0.08 %FS
0.32 mgauss
0.09
Repeatabilit
y
0.08 %FS
0.32 mgauss
0.09
0.49 mgauss
0.14
Parameter
Total rms
error
(4)
15
10
5
0
Reset
-5
Set
-10
-15
-20
-2
-1
0
1
Applied Field (gauss)
(5)
(6)
(7)
40
30
20
25 C
10
75 C
125 C
175 C
200 C
-10
-2.0
-1.5
-1.0
-0.5
0.0
0.5
1.0
1.5
2.0
Vout
200
Vset
Happlied
Vos
time
Happlied
Vreset
Set
Set
Set/Reset
Pulse
Rst
100
0
-200
-100
100
200
-100
-200
20
150
50
-200
-100
-50 0
100
200
-150
-250
X-axis Sensor (mgauss)
10
0
0
90
180
270
360
-10
-20
Heading (degree)
200
Yh Output (mgauss)
0
-200
-100
100
200
-100
100
-200
Xh Output (mgauss)
0
0
90
180
270
360
-2
-4
-6
-8
Heading (degree)
0.6
.3P / 0R
0.4
.2P / 0R
0P / .1R
0.2
.1P / 0R
0.0
0
90
180
270
360
-0.2
.2P / .2R
-0.4
-0.6
Heading (degrees)
COMPASS INSTALLATION
The performance of a compass will greatly depend on its
installation location. A compass depends on the earths
magnetic field to provide heading. Any distortions of this
magnetic field by other sources should be compensated
for in order to determine an accurate heading. Sources of
magnetic fields include permanent magnets, motors,
electric currentseither dc or ac, and magnetic metals
such as steel or iron. The influence of these sources on
compass accuracy can be greatly reduced by placing the
compass far from them. Some of the field effects can be
compensated by calibration. However, it is not possible to
compensate for time varying magnetic fields; for
example, disturbances generated by the motion of
magnetic metals, or unpredictable electrical current in a
nearby wire. Magnetic shielding can be used for large
field disturbances from motors or speakers. The best way
to reduce disturbances is distance. Also, never enclose the
compass in a magnetically shielded metallic housing.
ACCELERATION EFFECTS
CONCLUSION
0.14
0.29
0.05
0.50
0.98
REFERENCES