Estimation of IMU and MARG orientation using a
gradient descent algorithm
Sebastian O.H. Madgwick, Andrew J.L. Harrison, Ravi Vaidyanathan
Abstract—This paper presents a novel orientation algorithm
designed to support a computationally efficient, wearable inertial
human motion tracking system for rehabilitation applications. It
is applicable to inertial measurement units (IMUs) consisting of
tri-axis gyroscopes and accelerometers, and magnetic angular
rate and gravity (MARG) sensor arrays that also include tri-axis
magnetometers. The MARG implementation incorporates mag-
netic distortion compensation. The algorithm uses a quaternion
representation, allowing accelerometer and magnetometer data to
be used in an analytically derived and optimised gradient descent
algorithm to compute the direction of the gyroscope measurement
error as a quaternion derivative. Performance has been evaluated
empirically using a commercially available orientation sensor
and reference measurements of orientation obtained using an
optical measurement system. Performance was also benchmarked
against the propriety Kalman-based algorithm of orientation
sensor. Results indicate the algorithm achieves levels of accuracy
matching that of the Kalman based algorithm; < 0.8
◦
static
RMS error, < 1.7
◦
dynamic RMS error. The implications of the
low computational load and ability to operate at small sampling
rates significantly reduces the hardware and power necessary
for wearable inertial movement tracking, enabling the creation
of lightweight, inexpensive systems capable of functioning for
extended periods of time.
I. INTRODUCTION
The accurate measurement of orientation plays a critical
role in a range of fields including: aerospace [1], robotics [2],
[3], navigation [4], [5] and human motion analysis [6], [7]
and machine interaction [8]. In rehabilitation, motion tracking
is vital enabling technology, in particular for monitoring
outside clinical environs; ideally, a patient’s activities could
be continuously monitored, and subsequently corrected. While
extensive work has been performed for motion tracking for
rehabilitation, an unobtrusive, wearable system capable of
logging data for extended periods of time has yet to be
realized. Existing systems often require a laptop or handheld
PC to be carried by the subject due to the processing, data
storage, and power requirements of the sensory equipment.
This is not practical outside of a laboratory environment, thus
detailed data may only be obtained for short periods of time
for a limited range of subject’s motion. More precise data
representative of a subject’s natural behaviour over extended
periods of time (e.g. an entire day or even a week) would be
Sebastian Madgwick is with the Department of Mechanical Engineering,
University of Bristol, e-mail: s.madgwick@bristol.ac.uk.
Ravi Vaidyanathan is with the Department of Mechanical Engineering, Uni-
versity of Bristol, Queens Building, BS8 1TR and the Department of Sys-
tems Engineering at the US Naval Postgraduate School, Monterey, CA, USA,
93940. e-mail: r.vaidyanathan@bristol.ac.uk.
Andrew Harrison is with the Department of Mechanical Engineering, Uni-
versity of Bristol, e-mail: andrew.j.l.harrison@bristol.ac.uk.
of significant utility in this realm. In a recent survey, Zhoua
[7], cited real time operation, wireless properties, correctness
of data, and portability as major deficiencies that must be
addressed to realize a clinically viable system.
A. Inertial Motion Tracking Systems
Whilst a variety of technologies enable the measurement of
orientation, inertial based sensory systems have the advantage
of being completely self contained such that the measurement
entity is constrained neither in motion nor to any specific
environment or location. An IMU (Inertial Measurement Unit)
consists of gyroscopes and accelerometers enabling the track-
ing of rotational and translational movements. In order to
measure in three dimensions, tri-axis sensors consisting of 3
mutually orthogonal sensitive axes are required. A MARG
(Magnetic, Angular Rate, and Gravity) sensor is a hybrid
IMU which incorporates a tri-axis magnetometer. An IMU
alone can only measure an attitude relative to the direction of
gravity which is sufficient for many applications [2], [1], [6].
MARG systems, also known as AHRS (Attitude and Heading
Reference Systems) are able to provide a complete measure-
ment of orientation relative to the direction of gravity and the
earth’s magnetic field. An orientation estimation algorithm is
a fundamental component of any IMU or MARG system. It is
required to fuse together the separate sensor data into a single,
optimal estimate of orientation.
The Kalman filter [9] has become the accepted basis for
the majority of orientation algorithms [2], [10], [11], [12]
and commercial inertial orientation sensors; xsens [13], micro-
strain [14], VectorNav [15], Intersense [16], PNI [17] and
Crossbow [18] all produce systems founded on its use. The
widespread use of Kalman-based solutions are a testament
to their accuracy and effectiveness, however, they have a
number of disadvantages. They can be complicated to im-
plement which is reflected by the numerous solutions seen
in the subject literature [2], [10], [11], [12], [19], [20], [21],
[22], [23]. The linear regression iterations, fundamental to the
Kalman process, demand sampling rates which can far exceed
the subject bandwidth (e.g. a sampling rate between 512 Hz
[13] and 30 kHz [14] may be necessary for human motion
capture applications where system portability is critical). The
state relationships describing rotational kinematics in three-
dimensions typically require large state vectors and an ex-
tended Kalman filter implementation [2], [12], [19] to linearise
the problem.
These challenges demand a large computational load for
implementation of Kalman-based solutions and provide a clear
2011 IEEE International Conference on Rehabilitation Robotics
Rehab Week Zurich, ETH Zurich Science Cit
, Switzerland, June 29 - Jul
1, 2011
978-1-4244-9862-8/11/$26.00 ©2011 IEEE