Xtrinsic sensor fusion library for Kinetis MCUs

Xtrinsic sensor fusion library for Kinetis MCUs

In my December post, New sensor expansion boards for Freedom development platform, I introduced you to the FRDM-FXS sensor shields for the platform. From the “Downloads” tab on the FRDM-FXS-MULTI-B web page, you can now download demo executables for the FRDM-KL25Z and FRDM-K20D50M boards that are compatible with Xtrinsic Sensor Fusion Toolbox for Android. (You can read more about this app here: Free Android App Teaches Sensor Fusion Basics.) The links for the two executable are labeled FRDM-K20D50M_MQXL (compiled for ARM® Cortex-M4) and FRDM-KL25Z-MQXL (compiled for ARM Cortex-M0+). You will need to log into our community and accept a click-through license/disclaimer to gain access to the files.

One of the things I like most about the Freedom development platform is its ease of use. It can be programmed with a bootloader that allows you to plug the board into your PC via USB, and install software (such as these files) with a simple drag and drop. If you haven’t done this before, let me recommend a couple of resources for you:

Last June, I posted a number of videos to our website which show you how to run the Sensor Fusion Toolbox. Although we’ve added a number of features to the toolbox since then, the basic principles described in the videos still apply. Using the combination of hardware (shown at left), embedded code from the links above, and the Sensor Fusion Toolbox, you can experiment with different combinations of MCUs, sensors and algorithms, in real time, on your own phone or tablet.

Now here is the really cool part, the embedded fusion library at the heart of this functionality is now available in via the “Xtrinsic Sensor Fusion Library for Kinetis MCUs – Evaluation Version and documentation” link, available from the same Downloads tablisted above. The download package includes a datasheet describing Xtrinsic Sensor Fusion capabilities, a user’s guide that will show you how to get up and running, and a zip file containing a CodeWarrior project. The evaluation version runs only on the KL25Z board. Everything in the project, with the exception of one .c file, is precompiled. Filename user_tasks.c is reserved for your use, and allows you to insert code at 5 specific entry points in the project. You have visibility to all fusion outputs, and can modify the Bluetooth output stream to suite your own needs. This is the same project used to create the executables mentioned earlier. The evaluation version is fully compatible with the Xtrinsic Sensor Fusion Toolbox.

The evaluation version of the kit is intended to give developers everything they need to evaluate the quality and scope of sensor fusion libraries. Once a decision is made to incorporate the library into a product, you will want to upgrade to the “product development” version of the library. This version, which will soon be available from the same download page, provides many more bells and whistles with regard to fusion options and underlying project structure. Differences in the three versions of the library are summarized below:

Feature Demo Version Evaluation Version Development Version
License Free click-through Free click-through Contact us for Pricing
CPU selection MKL25Z128VLK4




others upon request

Board customizable No — FRDM_KL25Z & FRDM_K20D50M only No – FRDM_KL25Z only Yes
Sensor sample rate Fixed Fixed Programmable
Fusion rate Fixed Fixed Programmable
Frame of Reference Android Android Programmable
Algorithms Executing accel only, accel + gyro, accel + mag, accel + mag + gyro Programmable
Sleep mode enabled between samples/calculations No No Programmable
Code flexibility NONE — Executable only customer code limited to 5 specific entry points only Kalman and MagCal libraries are precompiled. Everything else is supplied in source form, and can be modified.
Access to Processor Expert™ configuration No No Yes
Collateral Materials datasheet

zip file containing the appropriate CodeWarrior project

user manual

The next table shows sensor fusion features versus sensor complement used for the application. See the sensor fusion datasheet for additional restrictions/details.

Feature Accel only Accel + gyro Accel + mag Accel + mag + gyro
Filter Type Butterworth Indirect Kalman Butterworth Indirect Kalman
Roll / Pitch / Tilt in degrees Yes Yes Yes Yes
Yaw in degrees No No Yes Yes
Angular Rate in degrees/second virtual 2 axis Yes virtual 3 axis Yes
Compass heading (magnetic north) in degrees No Yes Yes Yes
quaternion and rotation vector Yes Yes Yes Yes
rotation matrix Yes Yes Yes Yes
linear acceleration separate from gravity No Yes No Yes
NED (North-East-Down Frame of Reference Yes Yes Yes Yes
ENU (Windows 8 variant) Frame of Reference Yes Yes Yes Yes
ENU (Android variant) Frame of Reference Yes Yes Yes Yes
Magnetic calibration included No No Yes Yes
Gyro offset calibration included N/A Yes N/A Yes
FRDM-KL25Z_MQXL board support Yes Yes Yes Yes
FRDM-K20D50M_MQXL board support Yes Yes Yes Yes


Michael Stanley
Michael Stanley
Mike Stanley develops advanced algorithms and applications for MCUs and sensors, including sensor fusion and sensor data analytics. He is a founding member of the MEMS Industry Group’s Accelerated Innovation Community and a contributor to the IEEE Standard for Sensor Performance Parameter Definitions (IEEE 2700-2014). He is co-author of a chapter on intelligent sensors in “Measurement, Instrumentation, and Sensors Handbook” (volume two), and speaks on sensor topics. When the Arizona temperature drops below 100 degrees, you'll find Mike flying his F450 quadcopter . Follow him @SensorFusion.

Comments are closed.

Buy now