Skip to content
+
+
+
+
Sensor Fusion//AUG 08, 2026//6 min read

IMU Sensor Fusion for Motion Tracking: What Actually Works

Complementary, Madgwick and Kalman filters compared for real motion tracking products, including drift, impacts and integration error.

IMU Sensor Fusion for Motion Tracking: What Actually Works

IMU Sensor Fusion for Motion Tracking: What Actually Works

IMU sensor fusion is straightforward in a lab and difficult in a product. The algorithms are well documented. The problems appear when real motion, real impacts and real sensor noise arrive together.

This article covers what works in shipping hardware.

The core problem

An accelerometer measures acceleration plus gravity plus noise. A gyroscope measures angular rate with a slowly varying bias.

Neither alone gives you orientation. Integrate gyro rate and the bias accumulates into unbounded drift. Use accelerometer alone and any real motion corrupts the gravity estimate.

Fusion exists to combine their complementary weaknesses. The gyro is trustworthy over short intervals, the accelerometer over long ones.

Filter options in practice

Complementary filter. A weighted blend of gyro integration and accelerometer estimate. Roughly ten lines of code, negligible compute cost. Good enough for a surprising number of applications.

Madgwick filter. A gradient descent approach that is computationally cheap and well suited to microcontrollers. It gives good orientation and its behaviour is easy to reason about.

Extended Kalman filter. Estimates state and error covariance together, and can estimate sensor biases as part of the state. More accurate when tuned well, and considerably harder to tune.

Start with Madgwick. Move to an EKF only when you can articulate specifically what Madgwick is failing to do. Many projects lose weeks tuning an EKF that a well configured complementary filter would have satisfied.

Position is much harder than orientation

Orientation fusion works because the accelerometer provides an absolute reference, gravity, that does not drift.

Position has no such reference. To get displacement you integrate acceleration twice, and any bias becomes a quadratic error term. A 10 milli-g offset produces roughly 5 cm of drift after one second and 20 cm after two.

There is no algorithmic fix for this. You need either an absolute reference such as a barometer, GNSS or an encoder, or a way to reset the integration regularly.

Zero velocity updates

The most effective technique available for cyclic motion.

If you can reliably detect moments when the device is stationary, you can reset velocity to zero at each of those moments. That bounds the drift to a single cycle rather than letting it accumulate.

Detecting the stationary moment is the hard part. Common approaches:

  • Acceleration magnitude near 1 g with low variance over a short window
  • Gyro magnitude below a threshold
  • Application specific cues, such as the turning point of a repetitive motion

Reliability of that detector determines the accuracy of the whole system.

Impacts corrupt everything

In many real applications the device experiences sharp impacts. The response is rarely a clean spike.

What you typically see is a decaying oscillation lasting a few hundred milliseconds, driven by mechanical resonance in the structure the sensor is mounted to. In the frequency domain it appears as strong content in a band well above the motion of interest.

Two observations that save time:

Mechanical isolation often does not work. Foam and elastomer mounts change the resonance rather than removing it, and can make matters worse by introducing a new low frequency mode.

Low pass filtering usually does. If your motion of interest is below a few hertz and the resonance is at ten or more, a well chosen low pass filter separates them cleanly. Characterize the actual spectrum with an FFT before choosing a cutoff, rather than guessing.

Combining inertial and absolute sensors

A common architecture pairs an IMU with a slower absolute sensor such as a barometric pressure sensor.

The principle is to trust the IMU over short intervals and the absolute sensor over long ones. That gives you responsiveness without unbounded drift.

The failure mode to watch for is the absolute sensor pulling the fused estimate away from a value that was actually correct. If your IMU integration is accurate over the duration of one motion cycle, and the barometer is noisy at that timescale, a naively tuned filter will degrade a good estimate.

Validate against a reference device. Do not assume the fused output is better than either input just because it is fused.

Calibration is not optional

Every IMU needs calibration and most products skip it.

Accelerometer. A six point calibration, holding each axis up and down, gives you scale and offset per axis. This is worth doing in production, not just in development.

Gyroscope. Bias varies with temperature and drifts over time. Estimate it during known stationary periods and update continuously.

Temperature. Both sensors shift with temperature. If your product operates across a wide range, characterize it. For battery powered wearable nodes, see our guide on low power circuit design.

Sampling rate matters too. If rep or event timing feeds your integration start point, a 10 ms timing error can dominate your total error budget.

Validating against ground truth

You cannot tune what you cannot measure.

Use a reference instrument with known accuracy, such as a tethered encoder for linear motion or an optical system for orientation. Log raw sensor data alongside reference data so you can replay algorithm changes offline against the same dataset.

Offline replay is the single biggest accelerator in this kind of work. Tuning on live hardware means every change requires a new recording session.

When machine learning helps

If a single analytic model cannot cover every case, a learned model on top of the fused output can help, particularly for event detection such as identifying the start and end of a motion.

The requirements are real though. You need a few hundred to a few thousand labelled examples with reference data, covering the edge cases you care about. Collect that dataset before committing to the approach.

Getting motion tracking to production accuracy

Most sensor fusion projects fail on the practical layer rather than the algorithmic one: unmodelled mechanical resonance, timing error, uncalibrated bias, and no ground truth to validate against.

SRQ Robotics builds inertial sensing products, including IMU and pressure sensor fusion, impact rejection filtering and validation against reference instrumentation. Learn more about our Sensor Fusion & DSP services or contact us if your motion tracking is not meeting its accuracy target.

+
+
+
+

Have a device to build?

Book a free 30-minute technical scoping call and talk straight to an engineer.