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:
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:
💡 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:
- Go to the Sensor Fusion Webpage (www.freescale.com/sensorfusion) and download the Sensor Fusion Fusion Toolbox.
- Install the Sensor Fusion Toolbox.
- 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’:
- Run the Sensor Fusion software
- Select the file I want to load to the board:
- Browse to the MBED disk drive and save the file there:
- It should confirm that everything was going well. Follow the steps to unplug and re-plug the board:
- Select the mbed serial port or use ‘Auto Detect’ button:
- The Board RGB LED should be blinking in Green, and the COM port detected/set, with showing the board:
- Rotate the sensor/board to calibrate the magnetometer:
- Now I can move the board, and it will follow/show this on the screen:
💡 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:
The toolbox shows Sensors, Dynamics, Magnetics and Kalman information:
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.
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 🙂
- Freescale Sensor Fusion: www.freescale.com/sensorfusion
- Sensor Fusion Library: Sensor Fusion Library for Kinetis MCUs
- Freescale FRDM-K22F Board: http://www.freescale.com/products/arm-processors/kinetis-cortex-m/k-series/k2x-usb-mcus/freescale-freedom-development-platform-for-kinetis-k22-mcus:FRDM-K22F
- Freescale FRDM-STBC-AGM01 Board: http://www.freescale.com/tools/embedded-software-and-tools/hardware-development-tools/freedom-development-boards/frdm-stbc-agm01-9-axis-inertial-measurement-sensor-board:FRDM-STBC-AGM01
- Link to the project on GitHub: https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/KDS/FRDM-K22F/FRDM-K22F_Drone
- mbed for FRDM-K22F: https://developer.mbed.org/platforms/FRDM-K22F/