Beruflich Dokumente
Kultur Dokumente
Application Note
One Technology Way P.O. Box 9106 Norwood, MA 02062-9106, U.S.A. Tel: 781.329.4700 Fax: 781.461.3113 www.analog.com
INTRODUCTION
One common method for determining the tilt or inclination of
a system is to integrate the output of a gyroscope. Although this
method is straightforward, error associated with null bias stability
can quickly compound as the integration period is increased,
causing an apparent rotation even when the device is stationary.
In some applications, where the net acceleration or force on
a system over time is gravity, an accelerometer can be used to
measure the static angle of tilt or inclination. Such applications
include gaming, horizon detection in digital cameras, and detecting
the heading of a device in industrial and medical applications.
The underlying assumption in inclination sensing with an
accelerometer is that the only acceleration stimulus is that
associated with gravity. In practice, signal processing can be
performed on the signal output to remove high frequency
content from the output signal, so some ac acceleration can
be tolerated.
Rev. 0 | Page 1 of 8
AN-1057
Application Note
TABLE OF CONTENTS
Introduction ...................................................................................... 1
Rev. 0 | Page 2 of 8
Application Note
AN-1057
TILT/INCLINATION CALCULATION
Single-Axis Tilt Calculation
In applications where inclination sensing is needed only over a
limited angle and with a somewhat coarse resolution, a single-axis
device (or a single axis of a multiple-axis device) can be used.
For example, in Figure 1 a single axis (the x-axis in this example)
is rotated through gravity. Because this approach uses only a
single axis and requires the gravity vector, the calculated angle
of inclination is accurate only when the device is oriented such
that the x-axis is always in the plane of gravity. Any rotation about
the other axes reduces the magnitude of the acceleration on the
x-axis and results in error in the calculated angle of inclination.
+X
S [ g ] = 1 g (sin(N + P ) sin(N ))
18
(1)
16
X: 24
Y: 16.01
14
12
10
8
X: 63
Y: 8.059
6
X: 77
Y: 4.074
4
2
0
100
80
60 40 20
0
20
40
60
ANGLE OF INCLINATION, (Degrees)
80
100
08767-003
1g
4.5
1.0
0.8
0.6
0.4
0.2
4.0
X: 23.5
Y: 4.005
3.5
3.0
2.5
2.0
X: 62.75
Y: 2.006
1.5
X: 76.75
Y: 1.009
1.0
0.5
0
100
0.2
0.4
80
60 40 20
0
20
40
60
ANGLE OF INCLINATION, (Degrees)
80
100
08767-004
0.6
0.8
1.0
100
80
60 40 20
0
20
40
60
ANGLE OF INCLINATION, (Degrees)
80
100
08767-002
(2)
where:
N is the current angle.
P is the step size.
08767-001
1g
+X
AN-1057
Application Note
(3)
(4)
k X,OUT
1g
(5)
k = 1.00
k = 1.04
0.4
0.3
0.2
0.1
0
0.1
0.2
0.3
0.4
0.5
50
40
30 20 10
0
10
20
30
ANGLE OF INCLINATION, (Degrees)
40
50
50
INVERSE SINE
LINEAR APPROXIMATION
40
0.5
30
20
10
0
10
20
30
+Y
+Y
40
40
30 20 10
0
10
20
30
ANGLE OF INCLINATION, (Degrees)
40
50
08767-005
+X
50
50
08767-006
A
[g]
= sin 1 X,OUT
1g
+X
1g
1g
08767-007
Rev. 0 | Page 4 of 8
Application Note
AN-1057
Constant Sensitivity
The first major benefit of using a second axis is due to the orthogonality of the axes. As in the single-axis solution, the acceleration
detected by the x-axis is proportional to the sine of the angle of
inclination. The y-axis acceleration, due to the orthogonality, is
proportional to the cosine of the angle of inclination (see Figure 8).
As the incremental sensitivity of one axis is reduced, such as
when the acceleration on that axis approaches +1 g or 1 g, the
incremental sensitivity of the other axis increases.
X-AXIS
Y-AXIS
AOUT [ g ] 1 g sin(P )
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
100
1.0
90
100
50
0
50
100
ANGLE OF INCLINATION, (Degrees)
150
200
80
One method to convert the measured acceleration to an inclination angle is to compute the inverse sine of the x-axis and the
inverse cosine of the y-axis, similar to the single-axis solution.
However, an easier and more efficient approach is to use the ratio
of the two values, which results in the following:
A X,OUT
AY,OUT
1 g sin( )
1 g cos( )
A X ,OUT
= tan
A
Y ,OUT
1
= tan( )
60
50
X: 2
Y: 34.9
40
30
X: 1
Y: 17.45
20
10
0
X: 0.1
Y: 1.745
10
1
(6)
(7)
70
X: 0.25
Y: 4.363
0
1
2
3
4
5
ANGLE OF INCLINATION STEP SIZE, P (Degrees)
08767-009
150
MINIMUM ACCELEROMETER
RESOLUTION, AOUT (mg)
200
(8)
Figure 9 can be used to determine the minimum necessary accelerometer resolutionor maximum accelerometer scale factorfor a
desired inclination step size. Note that increased accelerometer
resolution corresponds with a reduction in accelerometer scale
factor and with the ability to detect a smaller change in output
acceleration. Therefore, when selecting an accelerometer with
the appropriate resolution, the scale factor should be less than
the limit shown in Figure 9 for the intended inclination step size.
0.8
08767-008
1.0
Rev. 0 | Page 5 of 8
AN-1057
Application Note
If the system is tilted enough, such that very little acceleration due
to gravity is present in the xy-plane, the inclination angle step
size will be too coarse to be useful; therefore, it is recommended
that tilt in the xz- or yz-plane be limited.
A Z ,OUT
= cos 1
2
A X ,OUT + A 2 Y ,OUT + A 2 Z ,OUT
(10)
+90
(a)
II
+Z
+Z
(b)
+Y
+X
+X
+Y
+Y
+X
+Y
1g
1g
1g
+X
1g
X-AXIS +
Y-AXIS
+Y
X-AXIS +
Y-AXIS +
+X
180
+Z
0
X-AXIS
Y-AXIS
X-AXIS
Y-AXIS +
+Z
(c)
+X
1g
1g
(d)
08767-011
+Y
+Y
+X
III
08767-010
1g
IV
90
(9)
Rev. 0 | Page 6 of 8
Application Note
AN-1057
+Y
+Y
1g
+X
1g
+Z
+Z
+Y
+X
+Y
1g
+X
1g
(c)
(d)
08767-012
+X
Basic trigonometry can be used to show that the angles of inclination can be calculated using Equation 11, Equation 12, and
Equation 13.
A X,OUT
= tan 1
2
A Y ,OUT + A 2 Z ,OUT
(11)
AY,OUT
= tan 1
2
A X ,OUT + A 2 Z ,OUT
(12)
A 2 X ,OUT + A 2 Y ,OUT
= tan 1
A Z ,OUT
(13)
3
200
150
100
50
0
50
100
ANGLE OF INCLINATION, (Degrees)
150
200
08767-013
+Z
+Z
The analysis in this application note was done under the assumption that an ideal accelerometer was used. This corresponds to a
device with no 0 g offset and with perfect sensitivity (expressed as
mV/g for an analog sensor or LSB/g for a digital sensor). Although
sensors come trimmed, the devices are mechanical in nature,
which means that any static stress on the part after assembly of
the system may affect the offset and sensitivity. This, combined
with the limits of factory calibration, can result in error beyond
the allowable limits for the application.
(a)
AN-1057
Application Note
2.0
1.5
1.0
0.5
(15)
(16)
0.5
1.0
1.5
2.0
200
150
100
50
0
50
100
ANGLE OF INCLINATION, (Degrees)
150
200
08767-014
(17)
A+1g A1g
Gain = 0.5
1g
(18)
(14)
where:
AOFF is the offset error, in g.
Gain is the gain of the accelerometer, ideally a value of 1.
AACTUAL is the real acceleration acting on the accelerometer and
the desired value, in g.
A ACTUAL [ g ] =
AOUT AOFF
Gain
(19)
Rev. 0 | Page 8 of 8