Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Xtrinsic Sensor Fusion

Software for Tilt-Compensated


eCompass with Magnetic Calibration
Target Products
Smartphones
Tablet PCs
GPS Navigation Aids

Target Applications
eCompass
Map orientation

Software Features
eCompass with tilt-compensation
Roll, pitch and compass angles
7 element calibration
3 Hard iron offsets (T)
3 Soft iron gains
Geomagnetic field B (T)
4 element calibration
3 Hard iron offsets (T)
Geomagnetic field B (T)
ANSI C source code
20 KB compiled code size
6.5 KB RAM requirement
Sensor simulation module included for
immediate verification

Xtrinsic Magnetometer and Accelerometer


6-Axis Calibration and Compensation
Overview
The magnetic calibration algorithms automatically
compute 7 parameters in real time which
model and subtract the magnetic interference
environment on the PCB. These are the three
components of the hard iron offset vector, the
three components of the soft iron gain matrix and
the fit to the local geomagnetic field strength.

The Xtrinsic eCompass Software is compatible


with any Freescale three axis accelerometer
and three axis magnetometer for applications
requiring an electronic compass (eCompass).
It is written in ANSI C for maximum compatibility
across processors and operating systems.
The accelerometer provides the roll and pitch
orientation which is used to de-rotate the
magnetometer readings to the horizontal plane
for calculation of the yaw, or compass heading,
angle. The eCompass can therefore operate
accurately at any tilt angle.

The software also includes a compact 4


parameter calibration model for the hard iron
vector and geomagnetic field strength only. This
is targeted at customers with minimal soft iron
distortion or very tight constraints on code size.

Xtrinsic
eCompass
Software
Architecture
Xtrinsic
eCompass
and Calibration
Software
Architecture
Magnetometer

Accelerometer

Bp

Gp

Data Selection
Roll, Pitch Calculation
Calibration Algorithms
Hard Iron V
and Soft Iron
W-1 Calibration

Pitch , Roll
W-1, V

Hard and Soft Iron Correction


Pitch ,
Roll

Bc
Tilt Compensation
Compass , Bf
Low Pass Filters

W-1, V

Compass

Pitch

Roll

The software includes the ability to simulate


the accelerometer and magnetometer data at

Features and Benefits


Features

Benefiits

Free for use with Freescale Xtrinsic magnetometers

No licensing fees

Documented source code with user manual

Maximum flexibility

Extensive set of supporting application notes

Convenient source of mathematical background

software can accurately compute the magnetic

ANSI C language

Most common language for embedded systems

interference parameters and the eCompass

7 and 4 element calibration models

Flexibility to correct hard and soft iron, or hard iron only

orientation and compass heading information

Sensor simulation with console input and output

Allows immediate verification of algorithms on target


system before interfacing with actual sensors

Processor agnostic

Uses ANSI C libraries only for maximum flexibility

Exact least squares solution

Provides highest quality calibration and rapid fix from given


series of magnetometer measurements

Intelligent data buffering

Selects the most useful magnetometer measurements for


calibration purposes by value and by age to ensure stable
solution at all times

Quality of fit indicator

No need for guesswork about the quality of the computed


compass heading and automatic detection of jamming

Compatible with all Freescale magnetometers


and accelerometers

Maximum flexibility

Equivalent functionality to 7 and 4 element


calibration solvers on Freescale's Sensor Toolbox

Evaluate using the proven RD4247MAG3110


demonstration board

random angles for a user-defined magnetic


field vector and hard and soft iron magnetic
interference. The user can verify that the

on a processor board before interfacing an


actual accelerometer and magnetometer. Once
actual sensors are connected to the processor
over I2C, the sensor simulation driver is simply
replaced by the actual sensor driver.

Recommended Sensors
The combination of the magnetometer and
the accelerometer with eCompass software
provides a full tilt-compensated electronic
compass capability. With a GPS-enabled
device, direction-dependent location-based

Documentation
Document

Description

MAG3110

MAG3110 Magnetometer Data Sheet

MMA8451Q

MMA8451Q Accelerometer Data Sheet

MAG3110UG

RD4247MAG3110 Sensor Toolbox Tilt-Compensated eCompass Kit Users Guide

of 1000 T, a resolution of 0.1 T and noise

AN4246

Calibrating an eCompass in the Presence of Hard and Soft Iron Interference

as low as 0.25 T with sampling rates up to

AN4247

Layout Recommendations for PCBs using a Magnetometer Sensor

80Hz.

AN4248

Freescales Xtrinsic MMA845xQ family of

Implementing a Tilt-Compensated eCompass using Accelerometer and


Magnetometer Sensors

AN4249

Accuracy of Angle Estimation in eCompass and 3-D Pointer Applications

accelerometers are the ideal choice to

AN3461

Tilt Sensing Using Linear Accelerometers

services can be achieved.


Freescales Xtrinsic MAG3110 three-axis
magnetometer provides a measurement range

provide tilt-compensation for the MAG3110


magnetometer in eCompass applications. The
MMA8451Q provides industry-leading 14-bit
resolution, an extremely low noise level as low
as 99 g/Hz, data rates up to 800 Hz and a

Development Tools
Kit Number

Description

LFSTBEB3110

The LFSTBEB3110 contains two PCBs: MAG3110 magnetometer and MMA8451


accelerometer daughter card, and the sensor interface board. Customers can purchase
the LFSTBUSB communication board separately.

RD4247MAG3110

The RD4247MAG3110 is a complete kit containing three PCBs: MAG3110 magnetometer


and MMA8451 accelerometer daughter card, sensor interface board and LFSTBUSB
communication board for running Freescale's Sensor Toolbox PC software.

current consumption as low as 6 A.

Freescale: A Leader in Sensing Solutions


Expanding on its more than 30-year heritage of sensor innovation, Freescales Xtrinsic sensing solutions
are designed with the right combination of high-performance sensing capability, processing capacity
and customizable software to help deliver smart, differentiated sensing solutions. With Xtrinsic sensors,
our vision is to offer a diverse and differentiated product portfolio to meet the expanding needs of the
automotive, consumer and industrial segments. Xtrinsic solutions offer ideal blends of functionality and
intelligence designed to help our customers differentiate and win in highly competitive markets.

Combination plot showing uncalibrated and


calibrated magnetometer measurements

For more information, visit freescale.com/eCompass


Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off.
Xtrinsic is the trademark of Freescale Semiconductor, Inc. All other product or service names are the property
of their respective owners. 20102012 Freescale Semiconductor, Inc.
Document Number: ECOMPASSFS REV 0

You might also like