Apply Sensor Fusion to Accelerometers and Gyroscopes
Contributed By DigiKey's North American Editors
2018-01-30
Accelerometers and gyroscopes are the sensors of choice for acquiring acceleration and rotational information in drones, cellphones, automobiles, airplanes, and mobile IoT devices. However, both accelerometers and gyroscopes are prone to errors, including noise and drift, respectively, requiring designers to employ novel approaches to achieve optimal accuracy.
One of these approaches includes sensor fusion. This article will evaluate the accelerometer and gyroscope independently to see how these noise and drift errors occur. It will then introduce examples of each type of sensor and show how to use sensor fusion techniques to combine the results of these two sensors and reduce the impact of these errors.
Selecting the right sensors
An accelerometer measures all linear forces that are working on an object with units of millivolts/g (mV/g). A moving object can exhibit dynamic motion such as acceleration, along with gravity as a continuous static force. By attaching an accelerometer to an object, its acceleration and the gravitational pull acting on the object can be measured. However, accelerometers have a tendency to exhibit position errors over time.
Figure 1: A drone with three-dimensional (3D) accelerometer and 3D gyroscope sensors successfully provides position feedback to the ground control unit. (Image source: Wikipedia and STMicroelectronics)
The gyroscope gives the rate of change of angular velocity over time that is working on an object with units of mV per degree per second (mV/deg/sec). By attaching the gyroscope to an object, the sensor smoothly measures that object’s angular changes, but gyroscopes exhibit a steadily growing angular error, which like accelerometers, increases over time.
Many accelerometers and gyroscopes are fabricated using micro-electromechanical systems (MEMS). The production process for the MEMS sensor combines silicon and mechanical functions on the same micrometer silicon substrate. The major components in these devices are the mechanical elements, the sensing mechanism and the application specific integrated circuit (ASIC).
MEMS as accelerometers
The construction of a single MEMS accelerometer uses stationary silicon plates and mechanical springs that respond to external forces (Figure 2).
Figure 2: MEMS accelerometer model uses silicon and mechanical elements to generate a change in capacitance corresponding to changes in acceleration. (Image source: HowToMechatronics.com)
A common MEMS sensing technique is to use on-chip variable capacitors. In motion, the green fixed plates remain static while the orange mass flexes along the acceleration axis. With this movement, the capacitance values C1 and C2 change with the changing distance between the fixed plate and mass.
Figure 3: Close-up view of the construction of one of the MEMS accelerometer capacitors. (Image source: DigiKey)
Quantitively, the change of the C1 and C2 values depends on the distance between the capacitor plates, d (Figure 3).
Where:
𝜀0 = dielectric constant of air = 8.85 x 10-12 Farad/meter
𝜀r = dielectric constant of substrate relative to air
L = length of adjoining fixed plate and mass
W = thickness of fixed plate and mass
d = separation between fixed plates and mass
The key variable in Equation 1 is d. This change in distance stays constant with constant acceleration and gravitational pull. When the sensor is still, or reaches a state of constant velocity, the structure relaxes. However, the gravitational pull still exists.
As a single unit, the value of these capacitors can be in the sub-picofarad (pF) range. Placing multiple plates in parallel increases the values to a usable range.
An example of the measurement circuit for these capacitors places C1 and C2 as a voltage divider between opposing power supplies (Figure 4). The signal passes through a low-pass filter and then is digitized with a delta-sigma analog-to-digital converter (ADC).
Figure 4: In a sample implementation, C1 and C2 form a voltage divider between two opposing power supplies and the output is digitized. (Image source: Maxim Integrated)
3D accelerometers
In a 3D accelerometer, there are three accelerometer sensors mounted orthogonally (Figure 5).
Figure 5: A 3D accelerometer provides output data for the x, y and z axis’ positional accelerations. (Image source: STMicroelectronics)
The sensing mechanism for all three accelerometers is again capacitive. An appropriate accelerometer for motion activated functions is the LIS2DW12TR digital output 3-axis accelerometer from STMicroelectronics. The LIS2DW12TR is a MEMS 3D accelerometer with a digital output and four different operating modes: high resolution, normal, low power and power down.
The high-resolution mode provides a 14-bit data output code to increase the accuracy of the measurement. With the full-scale bit set to ±2 g, the high-resolution mode typical sensitivity is 0.244 millig/digit (mg/digit). Alternatively, with a full-scale bit set to ±16 g, the high-resolution mode’s typical sensitivity is 1.952 mg/digit. This device has a typical zero-g factory trimmed offset accuracy level of ±20 mg.
A 3D accelerometer measures linear acceleration along the x, y, and z axis. Under rotation, such as a roll, the distances between the internal fixed plate and mass remain unchanged. Subsequently, the accelerometer will not respond to angular velocity.
With this attribute, the 3D accelerometer is appropriate in applications such as motion detection, gesture recognition, display orientation and free-fall detection. However, it can meet only part of a drone’s sensing requirements.
Three-dimensional gyroscopes
A MEMS gyroscope also relies on the varying capacitance between silicon and mechanical elements, but with this configuration, the sensor generates capacitive changes with angular velocity changes.
A 3D gyroscope has three gyroscopic sensors mounted orthogonally (Figure 6). A measurement of g-force is expressed in feet/second/second (ft./s/s), where 1 g is equal to the earth’s gravitational force. The sensing mechanism for all three gyroscopes is again capacitive.
Figure 6: Three-dimensional gyroscope provides output data for the angular acceleration rotation around the x, y, and z axis. (Image source: STMicroelectronics)
An appropriate gyroscope for navigation systems is the I3G4250D three-axis digital output gyroscope from STMicroelectronics. It provides a 16-bit data output code.
With the full-scale bit set to 245 degrees per second (dps), the typical sensitivity is 8.75 millidegrees per second per digit (mdps/digit). Alternatively, with a full-scale bit set to 2000 dps, the high-resolution mode’s typical sensitivity is 70 mdps/digit. This device’s typical digital zero-rate level is ±10 dps. This zero-rate level and sensitivity performance allows the designer to avoid further compensation and calibration during production.
A 3D gyroscope measures angular acceleration around the x, y, and z axis. If linear acceleration is imposed on a gyroscope, the distances between the internal fixed plate and mass remain unchanged. Subsequently, the gyroscope will not respond to linear velocity.
With this attribute, the 3D gyroscope is appropriate in applications such as motion control, appliances and robotics. However, the combination of a gyroscope and an accelerometer can start to fulfill the sensing requirements of a drone.
Combining 3D accelerometers and gyroscopes
The accelerometer and gyroscope individually bring strong advantages to a navigation system; however, both have areas of data uncertainty. With both of these sensors collecting data on the same phenomena, which is the movement of an object, merging the output data to get the best of both sensors is a good option. This can be accomplished with a sensor fusion strategy.
Sensor fusion techniques combine sensory data from disparate sources and generate information that has less uncertainty, or more accuracy. In the case of gyroscopes and accelerometers, they each serve to offset the other’s noise and drift errors to provide more complete and accurate movement tracking.
This action of combining these sensors’ outputs is realized through the implementation of the Kalman or complementary filter. The Kalman filter is a powerful tool that combines information in the presence of uncertainty. In a dynamic system, this filter is ideal for systems that are continuously changing.
When combining the 3D accelerometer and 3D gyroscope data, it is most effective to have both functions coexist in the same device. An example of such a device is the STMicroelectronics LSM6DS3HTR 3D accelerometer and 3D gyroscope. Appropriate applications for this device include a pedometer, motion tracking, gesture detection, and tilt functions.
The LSM6DS3HTR has a dynamic user selectable full-scale acceleration range of ±2/±4/±8/±16 g, and an angular rate range of ±125/±245/±500/±1000/±2000 dps that is comparable to its stand-alone sister and brother.
When combining 3D accelerometers and 3D gyroscopes, the complementary (or Kalman) filter initially uses the gyroscope for precision as it is not vulnerable to external forces. Long term the accelerometer data is used because it does not drift.
In the filter’s simplest form, the software equation is:
These values are integrated over time.
Additionally, STMicroelectronics offers extensive software to support sensing with its STM32 microcontrollers.
Conclusion
As designers work to extract more accurate information on moving objects, 3D MEMS accelerometers and gyroscopes, used in conjunction with a sensor fusion strategy, can provide a reliable solution to motion and navigation challenges.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of DigiKey or official policies of DigiKey.