Lego GPS autopilot code now in beta!

Chris Anderson
DIY Drones

November 26, 2007

Big news: we've finally got a version of the Lego UAV [ http://diydrones.com/profiles/blog/show?id=705844%3ABlogPost%3A728 ] that's based on GPS! The previous versions used a compass sensor as a proof of concept, but we've now upgraded it to use a third-party GPS receiver [ http://www.amazon.com/i-Blue-Bluetooth-Data-Logger-Receiver/dp/B000NK3G2Q ], connecting to the Mindstorms NXT brick by Bluetooth. This allows us to employ proper waypoints and to navigate to specific geographic locations, including returning home. Right now the code is in an early beta, but the key bits work. You can download the RobotC code here [ http://www.longtail.com/UAV2.c ].

Special thanks go to a number of people. Dick Swan, the creator of RobotC [ http://www.robotc.net/ ], was the first to create a Bluetooth interface to a GPS device. Steve Hassenplug created an excellent GPS parser for his Green Monster [ http://www.teamhassenplug.org/robots/GreenMonster/ ] outdoor wheeled Lego robot and was kind enough to share the code. And Ralph Hempel, the creator of pbLua [ http://www.hempeldesigngroup.com/lego/pbLua/ ], helped a lot in the early stages of solving the Bluetooth interface problem. Although we ended up going with RobotC, not Lua, in the end, he showed the way.

Coming up next: I've got to tweak the code to work properly in the air, and film a demonstration using real-time telemetry and aerial video to show how well it follows its waypoints when under autopilot control. And after that? Well, we've got some prototype hardware the promises to remove the mechanical complexity of the Lego-to-control-surfaces problem entirely. It would also allow us to bring the elevator under autopilot control, allowing us to do a proper altitude hold. Finally, there's a possibility that we may be able to also do aircraft stabilization with Mindstorms using inertial sensors, which would allow us to eliminate the FMA Co-Pilot that we're currently using. I can't say more about this yet, because it's using unreleased hardware, but stay tuned.

We've only just begun!

7:31am

Copyright 2007 http://diydrones.com/profiles/blog/show?id=705844:BlogPost:12607