element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sensors
  • Technologies
  • More
Sensors
Documents [Freescale Sensors] New version of the Xtrinsic eCompass software released
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: MAb
  • Date Created: 10 May 2013 9:46 AM Date Created
  • Last Updated Last Updated: 8 Oct 2021 5:28 AM
  • Views 1079 views
  • Likes 1 like
  • Comments 1 comment
Related
Recommended

[Freescale Sensors] New version of the Xtrinsic eCompass software released

Article first published by Michael E Stanley in The Embedded Beat (Freescale blog) on 29 Apr. 2013


ELECTRONIC_AWARD_2012.jpgA few weeks ago, my coworkers and I had the pleasure of participating in an awards ceremony in which Electronic Products Magazine presented Freescale with a Product of the Year award for our Xtrinsic eCompass software. This software processes the outputs of two sensors (an accelerometer and a magnetometer) to implement a tilt-compensated electronic compass. The software is available in source code format supported by an easy-to-use click through license.

We were at revision 2.0 of that library when Electronic Products announced the award. Since then, revision 3.0 has been uploaded to our web site. To download, click on the ECOMPASS_SW link on the Xtrinsic eCompass software page, read and approve the license agreement that pops up (you can freely use this software in products which include Freescale magnetometers and accelerometers), and save the offered .zip file onto your hard drive.

When you expand the zip file, you will have a folder called "eCompass", with sub-folders: "Documents" and "Software".  This is a major new release. I'm going to claim it to be the best-documented e-compass solution anywhere, thanks to the Herculean efforts of my good friend Mark Pedley, who also supplied much of the content for this post. Here's what you're going to find in the "Documents" folder:

 

  1. Software for Tilt-Compensated eCompass with Magnetic Calibration (v3 Release) User Guide
  2. AN4676 - Euler Angle, Rotation Matrix and Quaternion Representations of Orientation in Aerospace, AndroidRegistered and Windows 8Registered Coordinates
  3. AN4684 - Magnetic Calibration of Hard and Soft Iron Interference
  4. AN4685 - Tilt-Compensated eCompass in Aerospace, Android and Windows 8 Coordinate Systems
  5. AN4696 - Accelerometer and Magnetometer Sensor Simulatoin for Tilt-Compensated eCompass
  6. AN4697 - Low Pass Filtering of Orientation Estimates
  7. AN4698 - CPU, Flash and RAM Benchmarks : Xtrinsic eCompass and Magnetic Calibration Algorithms
  8. AN4699 - Data Structures for Matrix and Vector Algebra
  9. AN4700 - Control Loop, Data Structures and Compile Time Constants
  10. AN4706 - Accelerometer and Magnetometer Selection and Configuration

The software itself has been expanded and improved.Flow chart.jpgThe "Software" directory contains half a dozen C source and header files that contain everything you need to implement your own e-compass. It also includes a pre-compiled command line tool that lets you simulate performance of the e-compass. The ANSI C source code is processor agnostic allowing Freescale customers to retain their existing MCU architecture. The software is highly optimized to minimize use of program memory, RAM and floating point calculations. Software features include:

  • The code compiles into 10KB of ARM Thumb2 object code and uses less than 4KB of RAM.
  • A dedicated floating point unit (FPU) is not required and the software can run on typical 32 bit integer processors with software floating point emulation.
  • Orientation is provided in Euler angle (roll, pitch, yaw and compass heading), rotation matrix and quaternion formats.
  • Supports Aerospace, Android and Windows 8 coordinate systems
  • Tilt-compensated
  • Programmable low pass filter
  • Quality of fit metric indicates expected compass heading error
  • Resilient to magnetic jamming corrupting calibration
  • Three levels of hard and soft iron magnetic calibration are provided at increasing levels of performance and computational complexity.
    1. The simplest 4 element calibration solver computes the hard iron correction vector and geomagnetic field strength and removes the largest component of the magnetic interference caused by ferromagnetic components on the circuit board. It consumes 3300 floating point operations per call.
    2. The seven element calibration solver corrects for differing magnetic permeability along the three Cartesian axes and is suitable for the more complex calibration environments found in the dense circuit board layouts of smartphones and tablets. It consumes 20,000 floating point operations per call.
    3. The 10 element calibration solver computes a best-fit solution to the 10 dimensional magnetic optimization problem including off-diagonal elements of the soft iron matrix. It consumes 62,000 floating point operations per call.

The web-release includes source for options 1 and 2 above. Option 3, the highest performing 10 element calibration solver, is not available in source form, but is available under license in object code format for ARM Thumb2 processors. If you have used previous generations of our e-compass software, you will see major improvements in the feature set above. I like the fact that it now supports any of three different orientation representations right out of the box. The math behind an electronic compass isn't easy, but Mark has done an excellent job of breaking it down into manageable chunks that are easily digested. So please, download the new release, give it a go and let us have your feedback.
References:

  • Magnetic sensor makes electronic compass design easy
  • Hard and soft iron magnetic compensation explained
  • Orientation Representations - Part 1
  • Orientation Representations - Part 2
  • freescaledocs
  • sensors
  • freescale
  • xtrinsic
  • software
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply
Parents
  • DAB
    DAB over 12 years ago

    I read a couple of articles on this software on other sites.

    It looks like Freescale did an excellent job with the software.

     

    Is there any test data on the device as to bearing stability during movement?

     

    I wonder how well the system can maintain correct bearing during high dynamic situations.

     

    Just a thought,

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 12 years ago

    I read a couple of articles on this software on other sites.

    It looks like Freescale did an excellent job with the software.

     

    Is there any test data on the device as to bearing stability during movement?

     

    I wonder how well the system can maintain correct bearing during high dynamic situations.

     

    Just a thought,

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube