Motion sensors de-mystified
Yet, the talents of these tiny sensors are still widely underutilized, for two simple reasons. First, coaxing out their data and fusing it into precise and reliable pointing and tracking information is a much more challenging algorithmic exercise than most would estimate and often becomes a major manpower time sink. Secondly, there is a widespread (and incorrect) presumption among hardware and application engineers that most sensors provide similar levels of performance, and therefore that the data generally available from sensors does not meet their application needs.
The motion-sensing sensors typically incorporated into consumer products include a 3-axis gyroscope, a 3-axis accelerometer, and a 3-axis geomagnetic sensor. Each of these sensors exhibits inherent strengths and weaknesses with respect to motion-tracking and absolute orientation. Recently, sensor “fusion” has found its way into consumer products as a method of overcoming the weaknesses of individual sensors. Sensor fusion is a sophisticated type of software that combines inputs from various sensors to yield a more accurate motion sensing result, typically involving complex algorithms that can take into account well over several hundred variables if implemented properly.
The 3-Axis Accelerometer SensorAccelerometers detect linear acceleration and the gravity vector by measuring the force on a spring in a given linear axis. Accelerometers were the first MEMS sensors to appear in high-volume applications, enabling air bag deployment in automobiles, image stabilization on cameras, and free-fall detection on laptops. The Nintendo Wii game console was the first major consumer product to introduce the accelerometer as a user input device for gesture recognition, rudimentary motion tracking, and orientation of the controller. And now, accelerometers are ubiquitous on smart phones and tablets for many reasons, including the ability to detect the orientation of the device and adjust the screen from portrait to landscape mode and back again.
Accelerometers have two primary weaknesses in terms of motion-tracking as discussed below:
- Accelerometers cannot establish either absolute or relative heading. When installed in a stationary device, a 3-axis accelerometer measures the acceleration on the individual accelerometer axes. As depicted in Figure 1, when stationary, both roll and pitch angles can be calculated based on the vertical gravity acceleration vector. However, heading is derived around the Z axis and the heading measurement cannot be calculated from the gravity vector. Consequently, accelerometers cannot derive heading.
- Accelerometers tend to be overly sensitive to motion, leading to hand jitter. This can be annoying in the short-term, as it means the cursor or screen-rendered object also will jitter. Over several minutes jitter can lead to significant accumulated orientation or position error, especially if the accelerometer’s noise is on the same order of magnitude as the jitter. And the low-cost, consumer-grade accelerometers that are now widely in use have considerably more noise than more expensive, larger, and more power-hungry industrial-grade accelerometers, as shown in Figure 2.
The 3-Axis Gyroscope Sensor
A gyroscope (also referred to as a gyro or an angular-rate sensor) measures the angular rate of rotation around an axis and, by derivation, the angle of rotation around the axis. In existence since the early 19th century, gyroscopes have shrunk from huge, brass desktop models to today’s small, low-cost, and low-power MEMS chip that can fit under your thumbnail. Consumer grade gyros were first built into Gyration’s Air Mouse in the mid-90s, and later MEMS gyros were used in Logitech’s MX Air pointing device and LG’s Smart TV remote control, among others. The Nintendo Wii further enhanced the gaming experience by adding gyroscopes to their Motion Plus controller. Gyros were also added to the iPhone 3GS to expand the gaming potential and improve the usability of location-based service (LBS) features.
As with the accelerometer, gyroscopes also have deficiencies:
- Gyroscopes do not provide absolute references. For this reason, they normally are used in conjunction with an accelerometer, which provides an absolute reference to “down”, and thus can provide absolute references for pitch and roll readings. Often a geomagnetic sensor is also used in conjunction with a gyroscope to provide an absolute reference for heading, as well.
- A gyroscope’s bias, or zero offset, will drift over time. If left uncorrected, this provides a major source of system error. For example, the output of a gyro may report the system is moving even though it is actually at rest. As a point of reference, an incorrect bias reading of 0.07°, which is the resolution limit for a consumer-grade gyroscope, results in 2.1° of error after 30 seconds. Figure 3, below, shows typical uncorrected bias change over an 8 minute period, while Figure 4 shows how this translates into heading error.