Homebrew
Read this article in MAKE:
12: Upload, Page 192.
To get MAKE, subscribe or purchase single volumes.
My Lego UAV.
From the column Homebrew
Photos by Anne Anderson
My Lego UAV: the Full Story
I didn't have my children to justify playing with Legos, but it certainly didn't hurt. Yet after a while, simply building Lego creations with my kids wasn't enough. We (okay, mostly I) wanted to do something with Lego that had never been done before. But what?
The answer came to me while out on a run, and it combined three geeky things that were on my mind. We'd recently got some radio-controlled (RC) airplanes in the office for review and the kids and I had taken them out, crashed most of them, but eventually learned how to fly. Fun, but hardly groundbreaking. Then, I happened to read that HiTechnic, a company that makes third-party sensors for Lego's Mindstorms robotics set, was going to release a gyro sensor. Suddenly it came to me. Gyros are what you use for autopilots. An RC plane with an autopilot? That's an Unmanned Aerial Vehicle (UAV), or drone. Bingo. We were going to build the world's first Lego UAV.
When I got back from the run, I built a prototype on the dining room table. I blogged it as one does, and got Slashdotted, so then I had to actually make it work. HiTechnic sent me an early version of their sensor, and I got my first dose of reality. The HiTechnic sensors use the tiny MEMS-based gyros that are so ubiquitous today, from the Nintendo WII controller to the iPhone. The sensors use tiny rate gyros", which don't measure absolute position. They've got no idea where down" really is. To get them to actually keep a plane flying straight and level, you'd have to combine them with acceleration sensors (the force of gravity down" is measured as an acceleration) and do a ton of gnarly math to get around inertial forces, drift, and other complications. Unfortunately, our beloved Mindstorms doesn't even support floating-point math, to say nothing of real-time integration of gyro data, so a Lego inertial measurement unit wasn't going to happen.
Then came the second flash of insight. I realized that an autopilot actually has two jobs: 1) keep the plane flying level; and 2) navigate to geographic waypoints. Keeping a plane flying straight and true is a solved problem companies such as FMA Direct sell co-pilots" for around $100 that look at the infrared gradient from earth and sky in four directions and move the plane's control surfaces to keep those IR signals balanced. They can keep a plane level in any conditions. By handing the flight stabilization job to the FMA co-pilot, I'd turned a 3D problem into a 2D problem. So that just left navigation for the Lego: while the FMA co-pilot controlled the ailerons and elevator, the Lego could control the rudder, steering right or left to get to the next waypoint.
I found a plane (a Hobbico ElectriStar) that was big enough to hold the Lego Mindstorms controller, gears, sensors and other elements necessary to have two control systems. The RC system used the usual servos, while the Mindstorms motor was geared to move the entire rudder servo back and forth. This meant that we had a total disconnect between the two systems, which is a good thing from a safety perspective; if the autopilot failed we'd still be able to move the servo arms manually. The right way to do navigation is with GPS, but at the moment I started, there was no good way to read GPS data with Mindstorms via its built-in Bluetooth. So I started with a proof of concept that used HiTechnic's compass sensor, and helped my then-9-year-old to write a program that would just tell the plane to fly a square pattern when it was turned on by a RC servo pushing a Mindstorms touch sensor. (While we were at it, we mounted a wireless video camera on the bottom of the plane with a Lego pan-tilt assembly, which is another story!) So far, so good. Everything worked as hoped and the plane flew autonomously, providing a Lego-driven eye in the sky, albeit one that just flew in a square.
Fortunately there here were several groups working on the Bluetooth GPS problem on Mindstorms. The team behind the RobotC programming language were the first to really crack it. So we ported all the code from Mindstorms NXT-G to RobotC, which turned out to be pretty easy. Today we have a fully-functional Lego UAV. You give it GPS waypoints, take it off manually, flick a switch on the RC transmitter, and it flies to whatever coordinates you've entered (you can watch the real-time aerial video from the ground). When it's done, you switch off the autopilot and land it manually. That's pretty awesome, but we want more. So the next job will be to integrate an onboard cellphone that communicates with the Mindstorms via Bluetooth. Then the plane will have a phone number, which means we will be able to send it text messages. Goto Lat XX, Lon XX". Cool, huh?
MAKE: Noise — Discuss this article
You must be logged in to post a talkback.[ Display main threads only] [ Oldest First]
Showing messages 1 through 7 of 7.
- UAV lego Plane
You must be logged in to reply.
Chris,
I am an instructor in the Arts and Sciences department at Dunwoody College of Technology. We are one of the oldest technical schools in the country. I am interested in ideas and that is why I love Make. Our CITP department teaches C++ and uses Lego Mindstorms. Bob Nell, my colleague is the Department head. We would like to work with your plane as an educational tool for our students to learn programming and in addition feel that the plane would be a unique opportunity.
Bob had some questions for you.
First: Do you have a detailed description of the modifications you made for the plane?
Second: What parts from Lego Mindstorms need to be installed in the plane?
Third: What is needed for the V Servo?
Fourth: We can purchase the software from Carnegie-Mellon, but what is the code that was used for the plane?
Fifth: Do you have pictures of the mods within the plane, or a cad drawing of the layout?
Finally: We need more information about the gyro and sensors?
Any help that you can give us would be greatly appreciated?
DavePosted by shaman512 on December 21, 2007 at 06:36:35 Pacific Time
- UAV lego Plane
You must be logged in to reply.
Sure, it's all at DIY Drones:
http://diydrones.com/profiles/blog/show?id=705844%3ABlogPost%3A728Posted by zlite on December 21, 2007 at 07:14:18 Pacific Time
- UAV lego Plane
You must be logged in to reply.
Sure. It's all at DIY Drones:
http://diydrones.com/profiles/blog/show?id=705844%3ABlogPost%3A728Posted by zlite on December 21, 2007 at 07:13:16 Pacific Time
- UAV lego Plane
You must be logged in to reply.
Sure. It's all at DIY Drones:
http://diydrones.com/profiles/blog/show?id=705844%3ABlogPost%3A728Posted by zlite on December 21, 2007 at 07:13:02 Pacific Time
- Most excellent
You must be logged in to reply.
This is really great.
>>we will be able to send it text
>>messages. Goto Lat XX, Lon XX"
You probably will have best results if you tell it to fly a continuous circle AROUND Lat XX, Lon XX. Then it can stay in the area for as long as it's power holds out, giving you time to send it new coordinates or to bring it in for a landing.
Any chance of ever making it land autonomously? If you knew the exact altitude of the landing strip, and the GPS coordinates of it's two ends, it seems like it shouldn't be too tough. I guess it would all depend on the robustness of the onboard sensors and computational power.Posted by WayneZ on November 30, 2007 at 10:35:14 Pacific Time
You must be logged in to reply.
That's one of the coolest things I've heard of in a long time. What about adding a gps data logger (for fun) to track it with google earth.Posted by strex on November 28, 2007 at 09:47:26 Pacific Time
You must be logged in to reply.
Yes, the GPS receiver we use is also a logger, and we do a lot of work in stitching together continuous aerial imagery with GPS coodinates and superimposing the resulting high-res (3 cm) mosaics on Google Maps.
Reciever/logger: http://www.amazon.com/i-Blue-Bluetooth-Data-Logger-Receiver/dp/B000NK3G2Q
What we do with the GPS-tagged imagery:
http://diydrones.com/profiles/blog/show?id=705844%3ABlogPost%3A3667
-ChrisPosted by zlite on November 28, 2007 at 22:26:04 Pacific Time
|
Showing messages 1 through 7 of 7. |
Join the conversation -- every MAKE article has an online page that includes a place for discussion. We've made these RSS and Atom feeds to help you watch the discussions: subscribe.

Why advertise on MAKE?
Read what folks are saying about us!
Click here to advertise on MAKE!
Explore More in Make Magazine
Search the pages of MAKE
Raves for MAKE!
“Now we've got geek DIY (do it yourself) porn. Just as would-be Emerils pore over lushly illustrated cookbooks with recipes involving hard-to-find morels and complicated instructions for roux, Tom Swift wanna-bes are devouring MAKE.”
— Steven Levy, Newsweek
“...O'Reilly Media recently launched what has already become the bible of this new movement, a magazine called MAKE.”
— Daniel Roth, FORTUNE
“If you're the type who views the warnings not to pry open your computer as more a challenge than admonition, MAKE is for you.”
— Rolling Stone
“One of the most innovative magazines I've seen in a long time.”
— Steve Riggio, CEO Barnes & Noble
“The kind of magazine that would impress MacGyver”
— Marcus Chan, San Francisco Chronicle
|
|







