|
Introduction An important application of inertial data is the orientation determination of the device during static conditions. This can be accomplished through the geometric analysis of the of the accelerometer and magnetometer data.
Determination of static orientation using accelerometer data The orientation of the device relative to the gravity vector can be determined according to the following method from accelerometer data. The device is assumed to be under static or quasi–static (very low frequency) conditions.
The planar projections of the gravity vector make some set of angles with respect to the primary device axes (Fig. 1.0).
As an example, the angle between the x-y component of gravity, thetax , and the positive axis is
thetax = Arctan(x,y) - tan-1[gy/gx] [equation 1.0]
Where the function Arctan(x,y) is the quadrant sensitive (two-input) form of the inverse tangent.
And likewise,
thetay = tan-1[gz/gy], thetaz = tan-1[gx/gz]

Figure 1: Local gravity vector read with respect to the device coordinate system
Determination of static orientation using magnetometer data The determination of orientation using the gravity vector lends itself immediately to orientation relative to earth, since angles calculated according to the above method can be used directly to describe the orientation relative to the horizontal plane or the inclination to this plane.
The earth magnetic field vector will most likely not be pointing radially towards the earth’s center or any other convenient direction. A coordinate transformation may be utilized to reorient the earth reference magnetic field. This is done only to conveniently interpret the magnetometer data when compared to accelerometer data.
Resolving the orientation of the device via magnetic data requires accurate values for the earth field components. These are determined either from actual measurements with a reference magnetometer or by using a current magnetic model of the earth field. While models can be quite accurate, it is preferred that the earth field is measured directly in the region where the device is intended to be used.
For example, the local earth field components (Fig. 2.0) have the following values at some location:
mx = 0.187 gauss my = 0.029 gauss mz= 0.524 gauss
The particular compensation angles are then:
thetax = 8.82° thetay = 86.83° thetaz = 19.64°
The quantities thetax and (90° - thetay) are known as the declination and inclination of the field respectively. The angles thetax and thetay may be subtracted from magnetometer output to produce a magnetic field vector in the same direction as gravity for design purposes as in Fig. 3.
These values will vary with location and time (Fig. 5 and Fig. 6), but fortunately the earth’s magnetic field drifts quite slowly, on the order of ±10-100nT per year for each component. Periodic calibration can be done to correct these changes.

Figure 2: Earth Magnetic field coordinate system

Figure 3: Simplification of magnetometer coordinate system through compensation
The orientation of the device to the local earth magnetic vector can be determined in a similar fashion as with the accelerometer data. The planar projections of the magnetic vector make another set of angles with respect to the primary device axes.
thetamx = tan-1[my/mx] thetamy = tan-1[mz/my] thetamz = tan-1[mx/mz]
Where the function is the quadrant sensitive form of the inverse tangent and mx, my and mz, are the IMU magnetometer outputs.

Figure 4: Earth magnetic field read by device

Figure 5: Earth Field Declination

Figure 6.0: Earth Field Inclination
Summary This MEMSense technical note has explained common methods used to determine the orientation of an inertial measurement unit utilized in static and quasi-static conditions. These methods are the most basic means for orientation determination. Much more sophisticated methods may be employed through higher level algorithms, such as the Kalman or complimentary filters. These filters however require a significant development effort, time to implement and must be tuned to each application. In many controlled applications use of the methods described here will suffice.
|