Close

Pre-Race Update

A project log for Polymorphic Hardware

Applying polymorphism to hardware enables users to do more with their devices while avoiding IoT pitfalls.

trey-germanTrey German 05/24/2016 at 01:022 Comments

In case you haven't heard, my secret plan for the "Anything Goes" part of the Hackaday Prize is to use the hardware I'm developing to instrument a Powered Paraglider. To the best of my knowledge this has never been done before! I've made a lot of progress, and I'm exited to share the results with you.

Flying my powered paraglider!

Software:

Over the past week or two, I've been working hard to add an attitude/heading reference system (AHRS) to the Polymorphic Dot. If you're not familiar an AHRS provides a pilot (or autopilot) with yaw (heading), pitch (attitude), and roll (bank) angles which effectively tells you how a body is oriented in reference to the earth. AHRS algorithms are very complex, so instead of writing my own, I'm relying on one of the more popular open source algorithms which was written by Sebastian Madgwick as part of his Ph.D thesis. You can find it here:

http://www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/

I started by finding a javascript implementation of this algorithm. This allowed me to easily test and make sure that the IMU data I was getting was solid. The code I borrowed for this can be found here:

https://github.com/ZiCog/madgwick.js/tree/master

After a bit of tweaking to feed the bluetooth IMU data into the algorithm, I had a 3D model of a box moving around on my phone in the same way that I moved a Polymorphic Dot.

This really blew my mind! It shouldn't have been that easy, but thanks to open source software, I was able to get this working in days instead of months!

My next step was to try to move the AHRS processing from the smart phone app to the Polymorphic Dot. Why would I do this when I already had a working solution? Well, a responsive AHRS needs a lot (>= 100 samples/second) of IMU data. By processing the IMU data locally on the Polymorphic Dot there is less processing for the app to do (so it runs faster) and less data for the Dot to transmit (so it uses less power). To this end I added a service to the Dot that reports AHRS data when enabled.

The current implementation of the AHRS service is (in the spirit of Hackaday!) very much a hack. In the future I plan to convert the algorithm from floating to fixed point as well as port it to run on the low power sensor CPU present on the CC2650.

After I had the AHRS working, it was time to begin work on the app for the race. Once again time was a major limitation, so I looked for open source flight instruments and happened to get lucky! Another Sebastian (Sébastien Matton), developed some javascript flight instruments as part of his thesis:

https://github.com/sebmatton/jQuery-Flight-Indicators

After dropping the code into my app, I had attitude and heading indicators as well as an altimeter.

The final piece I wanted to add to the app was a map. This would prevent me from constantly having to switch between my paragliding app and Google Maps. While I could use the standard javascript Maps API, I found a better solution for Cordova apps: the Cordova Google Maps Plugin! What makes this plugin special is that instead of opening google maps from the web, it instead loads the native Android/iOS Maps and embeds the view in your app. After adding the plugin to my project and adding a few lines of code to my index.js, I was able to display a map of the race area. A few more tweaks and I had the race course drawn out and icons added for gas stations.

I've committed and pushed both the updated firmware and this new paragliding app to the github repos listed on this project page.

Enclosures:

In one of my previous posts, you probably saw the magnetic mount cases I developed for the paraglider race this week. As you may have guessed, they won't work that great for this application because of the magnets!

In my rush to get everything done in time, I neglected to think about how the magnets would effect the magnetometer on the board. After I did some testing, I found that the pitch and bank angles weren't affected but the heading was. Because of this, I quickly designed a new mount for the Polymorphic Dot that would move the magnets away from the device.

I also tweaked the top of the case to make the snap together mechanism more robust.

I've placed an order for the parts and done everything I can to expedite it, but the parts may not arrive in time for the race. If this happens, I'll have to do without heading data from the Polymorphic Dot during the race.

Race:

The race is an event put on by an organization called the Adventurists. They specialize in putting on outlandish old school adventure races all over the world. This week's race is called the Icarus X race and is just a sample of what the full Icarus Trophy race holds for me in October. In both races, I'll fly my paramotor for extended distances carrying everything I need to survive with me. This means I'll have a tent, sleeping bag, food, water, 2 stroke oil, and much more. If I need gas, I have to land at a gas station or get a ride from a local to one.

Thursday morning (May 26th), I'll set off from a field West of Fort Smith Arkansas to start on a roughly 200 mile circular route through Oklahoma. As I type this, weather for the race looks marginal at best. A stationary front and a low are positioned just West of the course and storms are predicted all three days of the race. If nothing else, it should make for one hell of an adventure!

Stay tuned to my hackday.io project page and my twitter (@yertnamreg) for updates during and after the race as well as inflight demos of the app!

Discussions

Trey German wrote 05/24/2016 at 22:59 point

Thanks Pablo! ...I'll need it.  Friday looks to have strong thunderstorms all day. Yikes!

  Are you sure? yes | no

Pablo Lopez wrote 05/24/2016 at 03:45 point

Good luck Trey

  Are you sure? yes | no