Home

Madgwick

Madgwick refers to a real-time orientation estimation algorithm commonly known as the Madgwick filter or Madgwick’s AHRS filter. It is used to fuse data from inertial measurement units, combining gyroscope, accelerometer, and magnetometer measurements to estimate three-dimensional orientation in quaternion form. The algorithm was developed by Sebastian O. Madgwick in the early 2010s and has since become widely used in both research and hobbyist projects due to its computational efficiency and suitability for embedded systems.

The Madgwick filter operates by integrating gyroscope data to update orientation and then applying a gradient-descent

Open-source implementations are readily available in multiple programming languages and platforms, including C, C++, MATLAB, Python,

Limitations include sensitivity to magnetometer disturbances and the need for proper calibration of both accelerometer and

See also: Attitude estimation, quaternion, IMU, Kalman filter.

based
correction
term
to
align
the
estimated
gravity
and
magnetic
field
directions
with
the
sensor
measurements.
This
approach
yields
a
lightweight
alternative
to
more
resource-intensive
filters
such
as
extended
Kalman
filters,
while
maintaining
reasonable
accuracy
for
many
practical
applications.
The
method
supports
both
nine-axis
fusion
(gyroscope,
accelerometer,
and
magnetometer)
and
reduced
configurations
(e.g.,
six-axis
using
gyro
and
accelerometer).
and
hardware
targets
like
Arduino
and
ESP32.
As
a
result,
the
Madgwick
filter
is
commonly
used
in
robotics,
drone
flight
controllers,
virtual
reality
and
augmented
reality
tracking,
motion
capture,
and
other
applications
requiring
real-time
attitude
estimation
from
inexpensive
MEMS
sensors.
magnetometer.
Dynamic
accelerations
can
also
affect
accuracy,
since
the
algorithm
relies
on
gravity
and
magnetic
field
references
for
correction.