Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Kinetis Drone: Sensor Fusion Toolbox

DZone's Guide to

Kinetis Drone: Sensor Fusion Toolbox

The drone building project continues by adding sensors and a microcontroller

· IoT Zone ·
Free Resource

Flying a quadrocopter without some sensor and microcontroller intelligence will be a challenge. Definitely I will need some intelligent sensor data to help me out :-). Luckily, there is a Freescale ‘Sensor Fusion Toolbox’ and Library which gives me a nice start and visibility into the sensors I plan to use:

Sensor Fusion Data

Sensor Fusion Data

The Freescale FRDM-K22F board already has the Freescale FXOS8700CQ on it which is a combined magnetometer+accelerometer. There is the FRDM-STBC-AGM01 which has the same FXOS8700CQ on it, plus the FXAS21002 gyroscope:

FRDM-K22F with FRDM-STBC-AGM01

FRDM-K22F with FRDM-STBC-AGM01

There is as well a smaller board available, just what is inside the ‘white’ box of the FRDM-STBC-AGM01 board. Basically the same board, smaller, and without the Arduino headers.

Freescale has that really cool ‘Sensor Toolbox’ to explore these sensors:

  1. Go to the Sensor Fusion Webpage (www.freescale.com/sensorfusion) and download the Sensor Fusion Fusion Toolbox.
  2. Install the Sensor Fusion Toolbox.
  3. Have the ‘mbed’ OpenSDA v2.1 (not P&E or Segger) firmware running on the FRDM-K22F board, so the board shows up as MBED disk drive and shows up with an ‘mbed Serial Port’: mbed Serial Port mbed Serial Port
  4. Run the Sensor Fusion software
  5. Select the file I want to load to the board: Flash to Board Flash to Board
  6. Browse to the MBED disk drive and save the file there: Saving to MBED disk drive Saving to MBED disk drive
  7. It should confirm that everything was going well. Follow the steps to unplug and re-plug the board: Success programming the board Success programming the board
  8. Select the mbed serial port or use ‘Auto Detect’ button: Sensor Fusion Toolbox Port Detection Sensor Fusion Toolbox Port Detection
  9. The Board RGB LED should be blinking in Green, and the COM port detected/set, with showing the board: COM Port Detected COM Port Detected
  10. Rotate the sensor/board to calibrate the magnetometer: Calibrated Magnetometer Calibrated Magnetometer
  11. Now I can move the board, and it will follow/show this on the screen: Board Moving Board Moving

Really cool!

Sometimes I had a problem that the wrong board was shown or it was stuck. Unplugging the board and restarting the toolbox helped.

Same thing works in combination with the FRDM-STBC-AGM01 board:

Sensor Fusion with FRDM-STBC-AGM01

Sensor Fusion with FRDM-STBC-AGM01


The toolbox shows Sensors, Dynamics, Magnetics and Kalman information:

Sensors

Sensors

Dynamics

Dynamics

Magnetics

Magnetics

Sensor Fusion Data

Sensor Fusion Data

Kalman

Kalman

Example Projects

The web page on www.freescale.com/sensorfusion hosts a library with Kinetis Design Studio projects (Sensor Fusion Library for Kinetis MCUs). I was able to use the V5 or the library with the Kinetis Design Studio V3.0.0. The projects emit over the UART-2-USB OpenSDA bridge data to the sensor toolbox. So that way I can build and debug the demo applications which come as binary files with the Sensor Toolbox, and can use the projects as a starting or inspiration point for my sensor data processing.

Some of the demos in the Library have an issue described in “Eclipse Project ‘Refresh Policy’: Broken Incremental Build with External Make?“. Additionally, I have found that some debug/launch configurations are either missing or incorrect, so it is necessary to fix this before the projects can be used.

What makes the demos and application outstanding is that they are using Processor Expert: that way they are easy to use, configure and build.

Sensor Fusion Project for KL25Z

Sensor Fusion Project for KL25Z

Summary

The Freescale Sensor Toolbox gives me a great start and feeling for the sensors. Now the challenge will be to have the quadrocopter using it. The Sensor Fusion library has some out-of-the box challenges, but for anyone familiar with Eclipse ;-) that’s not a blocking point. So in my next steps I plan to join the drivers in to my application.

Happy Sensing :-)

Links

Topics:
iot ,drone ,kinetis

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}