The Frame

The frame for a quadcopter has a number of requirements. It must be strong enough to handle the power of the motors, while also being light. For a 3D-printed frame, lightness directly corresponds to the amount of plastic used, and affects the print time as well.

It doesn’t have to be particularly aerodynamic. Since quadcopters tend to move slowly, aerodynamics is a secondary concern. All else being equal, having better aerodynamics is obviously good, but we don’t have to spend a lot of time chasing that goal.

A number of projects have shown up on Thingiverse, which can be used as a source of inspiration for the WumpusUAV. Many are under a CC-BY-NC license, which won’t work for the WumpusUAV because (per the Open Source Definition and the Free Software philosophy) commercial use must be allowed.

The PL1Q Vampire makes a good starting point. The author claims a complete frame being 230 grams. It’s a bit small–I’m not sure it’ll hold an Arduino, Raspberry Pi, and a battery. It looks like a solid starting point for comparison; there’s nothing particularly noteworthy about it, but it does seem to work just fine.

The Flone is meant to be controlled by an on-board smartphone. The motor mounts aren’t on long arms, as they are on the Vampire and the Parrot AR.Drone. They’re almost on top of the frame. The author’s pictures indicate a CNC (laser?) cut wood platform rather than a 3D printer, but from a casual look, everything looks 3D-printable.

One I think is really clever is the Micro H-Quadcopter. The reason it’s clever is because the frame is built out of symmetric pieces, which means a smaller 3D printers can build it in sections. It’s only bilateral symmetry, so there’s two distinct pieces to print. Full four-way symmetry would be more amenable to mass production, though not a big deal for 3D printers.

The WumpusUAV Prototype Frame

I didn’t start this project with the intention of innovating anything. I merely saw a number of ideas already out there and wanted to work them together into a cheap kit. Then I had one of those flashes of insight: nobody seems to be using honeycomb structures in model aircraft.

They’re used extensively in full-sized aircraft, but until 3D printers, there probably wasn’t a good way to make them in model kits. Most model RC aircraft kits were done by hand with balsa wood, and honeycombs are tricky to do that way. With 3D printers becoming more popular and accessible, we can change this.

The honeycomb structure promises to be both light and strong. The reduction in materials from a solid frame may also reduce printing time (though I’ll have to see if that works out in practice).

As a prototype frame, we don’t need anything fancy. A single honeycomb “block” will do. Here’s an OpenSCAD drawing of one:

Honeycomb frame prototype

The nice thing about OpenSCAD is that the details can be programmed in without much fuss. We can change the size, spacing between cells, and number of cells just by tweaking a few parameters.

From this, we can attach all the electronics we need to test out. Once we have that, we can use this prototype as the starting point for something more aesthetically pleasing. Electronics will probably need to be fully encased, but with a 3D printer, we can have the bottom layer of the honeycomb filled in.

Arduino — Brushless Motor Control

Brushless ESCs are more efficient than the regular DC motors of old. However, they need to be controlled more carefully, so they need a dedicated controller for each motor. I’m using the Turningy Plush 18A. Some of the details might change for other motor controllers, but should be broadly correct.

Hardware Setup

The common pinout on the ESC has three wires. The black is ground, red is +5V, and then some other color is signal.

The Arduino Servo library docs say that servos tend to take a lot of power, so you shouldn’t run more than one or two directly off of the Arduino board’s own +5V line. However, a typical servo doesn’t have any other power connector. Brushless ESCs do, in the form of an extra +5V and GND wire. The Arduino board may be able to power 4 ESCs just fine. I haven’t done any measurements to confirm that. The PCB designed for the WumpusUAV has a seperate 7805 voltage converter for the ESCs.

Software Setup

The motor controller takes a signal like the ones that were previously used to control RC servos. This is sometimes called PWM, but it isn’t at all like the PWM typically used to dim LEDs and such. Thus, it is controlled using the Arduino Servo libary.

The Servo library can controll any servo on any digital output pin. The usual servos (used for things like stearing on an RC car, or the ailerons on an RC plane) take a value between 0 and 179 degrees. For Brushless ESCs, this translates directly into throttle settings.

The ESC takes a few seconds to startup, during which we need to send a zero value. The Turningy has an audiable beep that gives diagnostic information during this time.

The code below will attach to an ESC on pin 8, send a zero throttle for 10 seconds (which is probalby more than necessary), and then start sending a throttle of 10 (179 being top throttle). Brushless motors can be surpirisingly powerful, so you don’t want to run them to hard during testing.

And So It Begins — WumpusUAV Indiegogo Project Launched

Today, we announce the start of the WumpusUAV Indiegogo project.

We started this project because we looked around at the state of UAV platforms out there, and found that there are many that are cheap, and there many that are hackable, but there aren’t many that are cheap and hackable. We can fix that.

The blog here already details many of the technical building blocks for the quadcopter platform, and there will be more of that to come. In the mean time, look around our wiki, signup on our forum, like us on Facebook, and follow us on Twitter.

Arduino Standalone

To keep size and weight down, the WumpusUAV will need a customized Arduino PCB with some of the sensors and connectors onboard. It’s therefore useful to know how to work the Arduino in a standalone circuit, rather than relying on the retail boards.

The Arduino circuit is a simple one, needing a +5V voltage regulator, a crystal, an ATMega328, and a few capacitors. A schematic can be found at:

http://arduino.cc/en/Main/StandaloneAssembly

The LED and reset switch are not strictly necessary. Connecting the RESET pin to +5V will work fine.

I hit some snafus with transferring the Arduino bootloader on Linux. I will document the solutions in a later post.

Arduino/RaspberryPi–UART (Serial) Communication

UART/Serial is an old way of doing things, but also handy because you can do it without complicated wiring. Any USB port will do.

We do need to deal with a bunch of esoteric stuff like “parity bits” and “stop bits”. But it’s a simple matter of ensuring these things are set the same on each side.

Hardware Setup

If you don’t want to use USB, a voltage level converter is required, or else the Raspberry Pi’s 3.3V won’t meet the threshold for the Arduino’s 5V. Here’s an article with the details:

http://blog.oscarliang.net/raspberry-pi-and-arduino-connected-serial-gpio/

Otherwise, just plug the two in.

Arduino

In the sketch, we set the baud rate to 115,200. That’s bits-per-second. That might not sound very fast, but if you’re talking plaintext documents, it’s much, much faster than you can read. For UAV purposes, you wouldn’t transfer camera images over that line for processing, but for sending movement commands of a binary protocol, it’s more than enough.

The loop will then check if there’s anything waiting for us to read, and if so, sends it back.

Raspberry Pi

We’ll use the Device::SerialPort module. This sets all the stopbits and such for us for clean communication with Arduino. The loop will wait for us to type something with a newline at the end, send it over the serial port, and then read back the response. There tends to be a slight delay before the string comes back, so we sleep a bit after sending.

Run it with serial_example.pl /dev/ttyUSB0. You probably don’t have anything else plugged in to a Raspberry Pi as a USB serial device, so the Arduino is almost certainly on /dev/ttyUSB0. In case it isn’t, check the output of dmesg.

Arduino/Raspberry Pi — TWI

Two Wire Interface (TWI) is a simple means of communication between two systems. “I2C” is another name for basically the same thing. On the Arduino side, it is implemented by the Wire library. On Raspberry Pi under Perl, we will use HiPi::BCM2835::I2C.

Hardware Setup

Take a look at the Raspberry Pi version 2 header pinout. With the header on the top-left, the I2C pins are the second and third pins on the bottom row. The Arduino pins depend on the board; see the link above to the Wire library for details.

The SDA pin (Serial Data Line) and SCL pin (Serial Clock Line) between the two boards must be connected. We also need to connect the Raspberry Pi’s GND and +5V wires to the Arduino’s GND and Vin pins, respectively.

(If the Arduino is powered externally, then only the GND wire needs to be connected to the Raspbery Pi.)

When using Raspbian on the Raspberry Pi, you need to load the kernel modules i2c_dev and i2c_bcm2708. The second one is blacklisted by default in /etc/modprobe.d/raspi-blacklist.conf, so remove it from there. It’s also handy to add these modules to /etc/modules so that they get loaded on startup.

Add your user to the i2c group if you want to be able to connect without being root.

Raspberry Pi Programming

On Raspberry Pi revision 2, the I2C pins on the main header are actually the second I2C device. The first sits on a secondary ribbon header, which is currently used for the Raspberry Pi camera accessory. Thus, we use the device /dev/i2c-1.

Each slave (which will be the Arduino board) needs an address starting at 4 and up to 127. The currently connected devices can be scanned with i2cdetect -y 1.

Example Perl program:

Arduino

We intitilize the Wire library with the slave address. It then takes functions as arguments to onReceive and onRequest.

The loop() function will simply delay.

A complete example:

References

http://neophob.com/2013/04/i2c-communication-between-a-rpi-and-a-arduino/