In my instructions on how to build a Lego Autopilot, I've neglected to show how you turn the thing on and off remotely. The answer is a servo strapped to a Mindstorms touch sensor inside the front of the plane. This video is pretty self-explanatory.
Here's a semi-scale Predator. Pretty cool, but it's an ARF so I can't do too much bragging. I just modded an inexpensive ($80) Nitro Models kit with a AXI 2208 brushless motor and added some proper landing gear and an airscoop to cool the motor in the back. (BTW, Nitro sells two Predators. Get this one, not the similar camo version with a slightly smaller wingspan. That one's wings don't come off! I have no idea how you're supposed to transport it, short of a van).
But there's more to this Predator than meets the eye. It's not just a model of an Autonomous Aerial Vehicle--it is a UAV! How can you tell? Look closer.
This is a Pentax W30 camera, which is one of the smallest cameras to have a proper programmable time-lapse photography setting. Why would I want to strap a camera with a time-lapse function to the bottom of a R/C plane? Because it's not just a R/C plane!
Here's what's under the canopy, or at least the first layer of it. It shows the installation of a UNAV Picopilot GPS-guided autopilot. This makes the Predator totally autonomous. You can enter up to 20 GPS waypoints, and the Predator will fly to them and then return home afterwards. That, in turn, explains the time-lapse camera. It snaps a 7 megapixel picture every ten seconds while the UAV is following its programmed course. Which means that you can stitch those pictures together and create a super high-quality aerial view of any area you choose. They're WAY better than Google Maps resolution, and you can update the aerial views anytime you want to.
But how can you take off and land the Predator? The Picopilot can't do that. Fortunately, there's another layer in the Predator's electronics bay.
Underneath the autopilot floor, there's space for all the standard R/C stuff: A Futaba 2.4 GHz receiver, a 1,500 mAh Li-Po battery and an electronic speed control. When the transmitter's gear switch is down, this lower layer controls the plane manually. When you switch the gear lever up, it transfers control to the Picopilot and the Predator goes into autonomous mode. Just like the real thing!
WASHINGTON — The use of unmanned aircraft in Iraq has surged by nearly one-third since the buildup of U.S. forces began early this year, and drones are now racking up more than 14,000 hours a month in the battlefield skies.
The increase in unmanned aircraft — from high-altitude Global Hawks to short-range reconnaissance Ravens [shown] that soldiers fling into the air — has fueled a struggle among the military services over who will control their use and the more than $12 billion that will be spent on the programs over the next five years.
The Air Force wants to take over development and purchasing of unmanned aerial vehicles, arguing that it would save money and improve technology and communications.
It also wants more centralized command of the drones, saying better coordination could eliminate airspace conflicts that can endanger U.S. troops.
The other military services see a power grab, and they’re fighting it.
A little more than a year ago, about 700 unmanned aircraft were operating in Iraq. By last December, according to Army data, that number had grown to about 950, and it’s soon expected to hit 1,250.
At least 500 are the smaller Ravens that are used by the Army. The rest include Hunters and Shadows — the Army’s medium-altitude aircraft that can carry weapons — as well as the Air Force Predators, which are also armed. Larger Global Hawks are used for high-tech surveillance
Continue reading here.
There's nothing like a big project for a crash course in a new technology. After choosing the Basic Stamp platform for the embedded processor version of the autopilot, I've now learned the hard way about the complexities and limitations of embedded processors. They're not insurmountable, but they're important to know, since that knowledge will help me choose the right embedded processor platform for a more advanced autopilot at some point in the future.
First, why use an embedded processor in the first place? The answer is total systems integration. The only way to properly connect a R/C receiver, servos, GPS and a stand-alone navigation processor so you have full control over the whole melange of devices is to integrate them at the hardware level. That means speaking the language that R/C receivers use to drive servos, which is pulse width modulation signals. The receivers send the servos a square wave, and the "width" (time length) of that square pulse determines how far the servo moves.
The way a UAV autopilot works (at least in our definition) is that there is always a choice between manual (human pilot) control and autonomous control. We take off and land the UAVs manually, and switch them into autonomous mode for the self-guided portion of their mission, either to test their robotic functionality in a closed course within visual range, so we can take over manual operation is something isn't working right, or eventually to go to and return from waypoints beyond visual range when all is working properly.
For a computer to take over control of some of those servos when it's acting as an autopilot, it needs the ability to intercept and pass through the regular R/C commands during manual mode, and then create and send out its own command in autonomous mode. That means the ability to read and generate square waves and that, in turn, means the ability to read voltages on specific pins of the chip.
This ability to have full pin-level control of the chip, along with internal processing routines that can make sense of square waves, is what makes embedded processors so well suited for driving hardware such as servos and sensors. But the trade-off is that you are forced to deal with a lot of primitive computing issues that are usually abstracted away behind the operating system in a more advanced processor such as those used in PCs. One such example in the Basic Stamp series is that you can't work with real numbers with digits to the right of the decimal. Instead, everything is limited to integer arithmetic (3/2 = 1, not 1.5), which means tiresome conversions and approximations when you're trying to do any sort of proper math.
Another limitation of embedded processors is that they're typically limited to onboard memory, which is usually just a few kilobytes of program memory in non-volatile EPROM storage, and a few dozen bytes of volatile RAM for real-time variable storage. This is going to require some real discipline and means that the first version, at least, won't be using accelerometers. Instead, I'll once again use an external stabilization system and just use the Basic Stamp for GPS-guided navigation.
So to end this post, here's the current state of play: The Basic Stamp will have two programs loaded. The first one, based on this code, just passes through R/C receiver commands when the plane is under manual control. When it detects that the landing gear switch has been thrown, which is the sign that the pilot has switched on autopilot mode, it switches command to the second program (based on this code), which reads GPS coordinates from the GPS module (shown) and sends commands to the rudder servo to steer to the next pre-loaded waypoint. When it detects that the landing gear switch returns to its off position, it switches command back to the first program and manual control. Sounds simple, but this will take a few more weeks to perfect. Stay tuned....
Great news on the Lego UAV front. Ralph Hempel, who has been helping me on adding GPS waypoints and navigation to my Mindstorms Autopilot, has cracked the tricky bluetooth integration code problem. Just the review the challenge, it appeared that the easiest way to connect the Mindstorms NXT CPU with a GPS receiver is via its bluetooth interface. But the native NXT bluetooth stack and API is very limited, and we couldn't find a good way to do it in the native NXT-G language.
Ralph cracked the problem by using pbLua, a more powerful language that has been ported to the NXT. He's got a great post to show how it works here. He's also included a GPS parser, so the only remaining challenge is the port the rest of the autopilot code to pbLua and write the navigation routines that turn the GPS location information and directional vectors into rudder commands to reach the next waypoint. That will probably take another month or so, during which we'll continue to fine-tune the basic platform stability using the current compass-based autopilot that's already working.
From the MAKE blog:
Here is a link to pictures of an attempt by a group of Calpoly engineers to have a UAV glider bring back pictures from 100,000 feet. After some sleepless nights and an overwhelming amount of work on hardware and software we launched a glider in California Valley. The balloon reach about 31,000 before something caused it to cut away, possibly a strong downdraft caused the code to cut the glider from the balloon thinking the balloon prematurely popped. We latter found the fuselage and one wing of the aircraft near Bakersfield, thanks to a friend with a Christian Husky and GPS tracking on the APRS network.
From Wired's Danger Room blog:
"The number of flying robots in the American armed forces' arsenal has gone up by nearly 1400% in four years, military documents show. A relatively-modest unmanned fleet of 217 machines has grown into a 3211-drone armada.
Most of the change has come in small, handheld unmanned aerial vehicles (UAVs) -- ones weighing 10 pounds, or less. In 2002, there were only 90 of the machines, used to peek around a corner or over a hill for enemy activity. By late last year, there were over 2800. The most popular of these UAVs in the Army's three-foot-long Raven. It weighs about four-and-a-half pounds, and good, hard toss will get it airborne, where it can loiter for a little over an hour, at nearly 1000 feet."
Read more here
Description: The main aim of this project is to both make the world's cheapest full-featured UAV and the first one designed to be within the reach of high school and below kids, as a platform for an aerial robotics contest. Like the Lego FIRST league, but in the air.
(There is another aim of this project, which is more about policy. At the moment the FAA regulations on UAVs are ambiguous (we believe that by staying below 400 feet and within line-of-sight we're within them). But there is a good deal of concern that as small and cheap UAVs become more common, the FAA will toughen the rules, making activities such as ours illegal without explicit approval. I hope this project will illustrate why that approach won't work.
By creating a UAV with Lego parts and built in part by kids, we haven't just created a "minimum UAV", we've created a reductio ad absurdum one. If children can make UAVs out of toys, the genie is out of the bottle. Clear use guidelines (such as staying below 400 feet and away from tall buildings) would be welcome, but blanket bans or requirements for explicit FAA approval for each launch will be too hard to enforce. The day when there was a limited "UAV industry" that could be regulated are gone.)
Here's a video of it in flight:Features: In GPS mode, unlimited pre-programmed waypoints, with programmable options such as circle and hold. Ability to integrate other sensors, such as ultrasonic, compass, gyros, accelerometers, or barometric pressure (altitude). With optional bluetooth cellphone integration, control via text message, including dynamical-changed GPS waypoints, "come home" and "circle" commands, etc.
This is the most complete UAV, so I'll start the instructions here from the beginning:
Notes:
Many people have asked why the Lego autopilot moves the whole servo back and forth, rather than just controlling the servo arm the way a R/C receiver would. There are two answers to this: 1) we always want to have a manual override, so in this case you can manually control the rudder servo arm even as the autopilot is moving the whole assembly back and forth to control the rudder another way. 2) there is no good commercially available way to communicate directly from the NXT brick to a R/C servo. That said, there are some products in development that will make this possible. Stay tuned....
Description: This platform was inspired by the realization that almost all the hardware you need for a functioning UAV is contained in the high-end cellphone in your pocket: GPS, camera, two-way long-distance wireless data communications, onboard computing and storage. Why do the tricky hardware integration when some cellphone maker has done it better themselves? By using a Windows Mobile phone, a UAV becomes a software, not a hardware, project. (You can see the phone strapped to the bottom of the plane in the image above; the sensor to the rear of it is for the FMA co-pilot.)
Features: Control the UAV (dynamic waypoints, camera commands, "come home", etc) by text message! Plane can return GPS-tagged imagery in real time by MMS (also stores it onboard for later downloading). Phone steers the rudder along GPS waypoint path, circling on command, and controls the throttle to maintain altitude. Separate FMA co-pilot stabilizer on the ailerons and elevator keeps the plane flying level.
Description: This UAV is intended mostly as an education platform to teach you the basics of microprocessors, embedded system programming and autopilot design. It will fly, but it's not designed to be a real production UAV. That said, it demonstrates the advantages of creating your own microprocessor-based autopilot: maximum flexibility and expandability by fully integrating the autopilot and the R/C control system.
Hardware level integration means that the onboard computer can control as many or as few aircraft and camera functions as we want. The downside is that the particular embedded processor we chose, the BASIC Stamp (which is the easiest to program), is also very limited in processing power and memory. But the same concept, extended to more powerful processors such as the Parallax Propeller or a Linux-based Gumstix, could be quite capable indeed, potentially allowing the autopilot to handle both navigation and stabilization functions, rather than using an off-the-shelf commercial unit for stabilization as we do in this UAV. Or, if you want something like Basic Stamp but more appropriate for a production UAV, follow along as we develop ArduPilot, the open source Arduino-based autopilot, here on this site
Features: Unlimited pre-set GPS waypoints, with programmable options such as circle and hold. GPS-controlled altitude hold. With Pentax A30 setup, autopilot can control camera to take pictures at waypoints or at a set interval along paths.
My kids and I actually had the first successful test flight of the sub-$1,000 UAV two weekends ago, but I haven't had time to edit the video properly until now. The good news is that a) it didn't crash, and b) it works. We tested stabilization, autonomous navigation (only using compass headings this time, although GPS is in the works), and the real-time video downlink. Everything worked well enough that we're able to see what we have to improve, which is the definition of a successful test.
Just as a reminder, this is a R/C plane that's been modded into a proper drone. It's got a Lego Mindstorms NXT autopilot, a Lego pan-tilt camera, and an infrared autostalization system.
Here are some video clips from that flight (we're still getting the hang of filming a small plane in flight, so please forgive the distance and shakiness, too): The only thing you can kind of make out about the flight characteristics in the brief part where the you can see the plane in the air is the distinctive "crabbing" behavior as the autostabilized ailerons fight the autopilot-steered rudder. This is normal and is just an artifact of the way I designed it, with stabilization and navigation as two separate systems that don't communicate with each other. It still turns as intended, it's just a little graceless about it.
Finally, a word on why we're doing this.
The main aim of this project is to both make the world's cheapest full-featured UAV and the first one designed to be within the reach of high school and below kids, as a platform for an aerial robotics contest. Like the Lego FIRST league, but in the air.
But there is another aim, which I ended being asked about a lot at Maker Faire. At the moment the FAA regulations on UAVs are ambiguous (we believe that by staying below 400 feet and within line-of-sight we're within them). But there is a good deal of concern that as small and cheap UAVs become more common, the FAA will toughen the rules, making activities such as ours illegal. I hope this project will illustrate why that approach won't work.
By creating a UAV with Lego parts and built in part by kids, we haven't just created a minimum UAV, we've created a reductio ad absurdum one. If children can make UAVs out of toys, the genie is out of the bottle. Clear use guidelines (such as staying below 400 feet and away from tall buildings) would be welcome, but blanket bans or requirements for explicit FAA approval for each launch will be too hard to enforce. The day when there was a limited "UAV industry" that could be regulated are gone.
May 13th, first test flight of both the Lego UAV and the stealth "minimum" UAV at Alameda Naval Air Station. Video coming soon.
Description: This UAV, which uses an off-the-shelf autopilot, is the reference platform against which we benchmark the more innovative (and cheaper) custom UAVs that are our main focus at DIY Drones.
The video system listed below, which streams realtime video via a 2.4 GhZ wireless link, provides a real-time eye-in-the sky overhead view of the path, although a FlyCamOne2 is a cheaper and lighter video solution if you don't mind waiting till you land to download the video. Alternately, this is a reasonable platform for Geomapping (very high resolution aerial photography that you can use with Google Earth) with a commercial digital point-and-shoot camera shooting in continuous mode, accompanied by a GPS logger.
The Mini Telemaster is relatively small and has a pretty high wing-loading, so the onboard camera equipment it can carry is limited, both in size and weight (it's ideally suited for the tiny FlyCamOne). The advantage is that you can hand launch it almost anywhere, so no runway is required. But a more serious imaging system requires the shift to a larger plane, such as the full-size Electro Telemaster.
Features: Up to 32 pre-set GPS waypoints. Integrated inertial stabilization. Tried and true system, which offers reliability in exchange for limited flexibility.