Kinetis Drone: Sensor Fusion Toolbox

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

 

Advertisements

4 thoughts on “Kinetis Drone: Sensor Fusion Toolbox

  1. Erich I don’t know how many of your followers are familiar with this Ted Talk demo. It is certainly and inspiration:

    Good luck with the project!

    – Charles

    Like

    • Hi Charles,
      yes, Raffaello makes really cool demos! Many are not aware that in his demos most of the computing is done outside the drones in servers who do all the calculations. He mentions briefly the camera system which in fact an infrared camera system which is typically in the US$ 10k range. We do have one too at the university, but at least initially I’m not planning to use it: I want first have the quadrocopter using its own brain for stabilization. We will see how far I can go. As for ‘luck’: had bad luck yesterday: one of my ESC’s overheated and now is dead 😦

      Like

  2. Pingback: Kinetis Drone: Remote Controller with SUMD | MCU on Eclipse

  3. Pingback: Kinetis Drone: First Test Flights | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.