loading

Autonomous, Cardboard, Rasberry Pi Controlled QuadCopter

Featured
Picture of Autonomous, Cardboard, Rasberry Pi Controlled QuadCopter
This is an autonomous cardboard quadcopter driven by a Raspberry Pi. It is capable of wireless communication as well as well as real time image processing via camera.

This quadcopter was built by 4 sophomores at Olin College of engineering for a class called Principles of Engineering.
For more information see http://poe.olin.edu/poe2013/s_engr2210-quadcopter/ .

Initial RC controlled flight testing:
 
Remove these adsRemove these ads by Signing Up

Step 1: Materials

Cardboard from the recycling bin,

The sheet we we used was 32"x20" with a thickness off around 4.1mm. A large clean box should do.

Motors from Hobby King, 4x + Propeller clamps,

We used Turnigy D3530/14 1100KV Brushless Outrunner Motor at $14.56 each. Our motors also came with propeller clamps which allowed us to easily connect our propellers to the motors.

Electronic Speed Controllers (ESC) from Hobby King, 4x,

We used TURNIGY Plush 18 amp Speed Controller at $11.90 each.

Propellers from GWS props, 2x counterclockwise rotating, 2x clockwise

We used 3 bladed 8x4x3 GWS props at $2.00 each.

Flight Controller from Hobby King, 1x

We used HobbyKing Multi-Rotor Control Board V2.1 at $12.99

Flight Controller Mounting Pads from Hobby King,

We got a pack of Gyro / Flight Controller Mounting Pad at $1.99 but one can also use double sided tape.

RC Receiver from amazon.com, 1x,

We got a CSRC-RX3000 Spektrum DSM2 Compatible 2.4Ghz 6-Ch Receiver on sale for $9.99. Any 5 or more channel receiver will do though.

Foam block, cut into 4  2 inch by 4 inch chunks,

Used for a more durable landing.

Cyanoacrylate based glue,

Anything will work, the thicker the glue, the easier it is to work with. We used something along the lines of this.

Tape,

We used duct tape for mounting the foam landing pads as well as for low force attachment of electronics.

Nuts and bolts, 16x sets of 1 nut and 1 bolt,

Washers can be used when directly bolting to cardboard, but we found that you did not really need them. We used 4-40 x 5/8 inch nuts and matching bolts.

0.1mF capacitor, 1x

Used in the low pass filter before the Schmitt trigger.

7.87kΩ resistor, 1x

Used in the voltage divider.

8.2kΩ resistor, 1x

Used in the low pass filter.

453Ω resistor, 1x

Used in the voltage divider.

Operational Amplifier (LMC6484) , 1x

Used to create the Schmitt trigger.

Quad 2-Input Mux (74HC157N) from Digikey, 1x

Used to switch between the RC receiver and Raspberry Pi signal.

Section of perf-board

Used to solder the entire switch circuit in a condensed form for the quadcopter.

Battery from Hobby King, 1x

We used Turnigy nano-tech 3300mah 3S 25~50C Lipo Pack at $26.72.

Battery indicator, 1x

This device changes color and beeps if the batter is at low voltage. This is a must have if you don't want to keep breaking batteries. We used a 3 Cell Hobby King Battery Monitor at $3.99.

BEC from Hobby King, 1x,

This is used to power the Raspberry Pi. We used HobbyKing Micro UBEC 3A / 5v at $3.77.

Servo Connectors, female to female from Hobby King, 4x,

We got a pack of 5 female female from hobby king at $1.65 that we cut in half.

Power Wire, 2x 6 inches high current pieces,

We used 10 AWG red and black that can be bought from hobby king at for $2.99 a meter.

4mm Bullet Connectors, at least 1 male and 1 female.

Casing is nice, so we would suggest HXT 4mm Gold Connector w/ Protector at $3.64.

3.5mm Bullet Connectors, at least 12x

Available in packs of 10 from hobby king for $1.59.

Raspberry Pi, 1x,

We used one of the older model B with 256mb of ram for $35.00. A model A would work and probably better for $25. They are currently hard to buy, you could place an order from a vendor on their site and wait a few months, or just get one from Amazon.

Web Camera from amazon.com, 1x,

Really any usb webcam with linux support will work. We used Microsoft-LifeCam-VX-5000 for $12.74.

Wifi Card from amazon.com, 1x,

Any linux supported wifi card should work. We used this card at $13.06.

SD Card, 1x,

We used a 16gb card from amazon at $11.52.

Micro usb cable, 1x,

It does not need to be long, we used a six inch cable at $3.09.

Off-Board

AVR Programming device one from Hobby King, 1x

We first got USBasp AVR Programming Device for ATMEL processors at $4.95. Our board was defective, so we ended up using a Atmel AVRISP mkII In-System Programmer at $34

RC Transmitter, 1x

We used the highly overkill DX8 8CH Transmitter at $429.99. All you really need is 5 or more channels.

3 cell Lipo Battery Charger + Power supply, 1x,

Some way to charge your battery.

Step 2: Cut and Assemble Frame

Picture of Cut and Assemble Frame

The entire frame is assembled from laser cut cardboard. Our team was able to fit all of the required parts onto one sheet that could fit in the laser cutter. When designing this sheet, great care was taken to align the parts to match the correlations in the cardboard. If you would like to make your own sheet, you can use our cad located here.
Otherwise you can use our cutsheet attached.
We used a thick Cyanoacrylate based glue to do all of our connections. This gave us both strength and quick dry times.

Be careful when assembling the arms and read through the directions before you start.

Step 3: Frame

Picture of Frame
Starting to assemble arms.

Step 4:

Picture of
Bolt motors to cardboard motor mount.

Step 5:

Picture of
Put some super glue on the threads to lock the nuts in place.

Step 6:

Picture of
Assemble the other side of arm.

Step 7:

Picture of
Place other arm plate onto the assembly.

Step 8:

Picture of
Make the second arm assembly. Be very careful to orient the side plates correctly!

Step 9:

Picture of
Slide arms together

Step 10:

Picture of
Base assembled. (upside down)

Step 11:

Picture of
Side view of base (upside down)

Step 12:

Picture of
Add on battery holder.

Step 13:

Picture of
Cardboard squares are then glued onto remaining struts for support.

Step 14: Add on Propeller guards

Picture of Add on Propeller guards
glue2.jpg
We first bent thick wire into a U shape and inserted into the quadcopter frame. We chose to use hot glue for this due to its thickness. If you choose to bend the ends up like we did, ensure that the ends have plenty of clearance so they don't collide with the props.

Step 15:

Picture of
Use double sided tape/ anti vibration tape to mount the control board to the top of the frame.

Step 16: Make the power distributor

Picture of Make the power distributor
Take each section of thick, high amperage wire and use a razor blade to carefully strip five sections of about an 2 cm that are about 2.5 cm apart down the wire.

Strip the end of each wire about 1 cm and tin them both.

Make a jig by drilling holes to match the sizes of the battery connectors, so that the battery connectors plug into it nicely and don't move around. This video shows the process well. http://www.youtube.com/watch?v=MnldHRtjre8

Tin the cups of the connectors by melting solder into them until they are almost full or solder.

Let the battery connectors cool for a little while after they have been tinned.

Melt the solder in the battery connectors a second time and insert the end of the battery wire into the molten solder.

Remove the soldering iron and hold the wire motionless for about a minute or until the solder is completely re-hardened.

Heat shrink over these joints so that you won't be able to short the battery.

Tin the other exposed sections of wire carefully with your soldering iron set on high heat.

Step 17:

Picture of
Tin the ends of the motor speed controller and BEC wires that you will be connecting to the main power wire.

Wrap the ends of the motor speed controller wires around the stripped and tined sections of the high amperage wire using pliers.

Solder the two wires together ensuring that a good connection is made.

Place heat shrink over this new joint and shrink it so that the new joint is insulated and protected.

Solder the next motor speed controller to the power distribution wire and heat shrink it. Repeat this until all of the motor speed controllers and the BEC are soldered to both the power and ground wires and heat shrinked.

Heat Shrink over the ends of both wires that do not contain the connectors so that these ends do not short.

Step 18: Integrate Electronics

Picture of Integrate Electronics
Thread the electronic speed controllers through the holes.

Step 19:

Picture of
Secure the power distributor to the bottom of the copter. This can be as simple as a piece of tape.

Step 20:

Picture of
Thread the output from the ESCs through the wire routing holes and connect to motors.

Step 21:

Picture of
Label the propellers according to their spin direction.

Step 22: Electrical System

Picture of Electrical System
SchmittTriggerSchematic.jpg
Solder the electrical components onto a perf board according to the schematic for the Schmitt trigger.

Step 23: Test the Switch

We used an oscilloscope to test the switch. We sent up an output signal from the raspberry pi to something like 1.7ms pulse and then use the RC controller to toggle back and forth. You should see the signal instantly change.

Step 24:

Picture of
Use the servo connector female female cables to connect the switch, the RC receiver, and the flight controller.

Step 25: Setting Up the Pi

We decided to use Rasbian, a distribution that is relatively easy to set up and meant for the pi. We decided to not install X for performance reasons, but got up a basic c++ tool chain, wifi connections using wicd, and ssh. We then installed many libraries, including OpenCV, and servoblaster. Due to the speed of the raspberry pi, this process is quite slow and takes many hours.

Step 26: Tips for Writing Autonomous Code

Always write code on a computer. Due to the number of libraries we are using and the speed of the Raspberry Pi compile times are quite painful to debug with. In general, all code can be written on the computer, tested on the computer, and then uploaded to the Pi. Another more extreme option to minimize recompiles is to place all of the configuration values in an external file that can be changed at runtime.

As with all programming, start small and test. At least in our experience, the code can get quite complex very quickly and it helped a lot to make small tests.

Test your code! When writing image based autonomous code, its generally a good idea to run automated tests on your code. These tests take your code, and would run them in various virtual environments on a simulated quadcopter that behaves like the actual one. For our project we where not doing very complicated autonomy so we opted not to create this simulated environment. If your plan is to add more, we would strongly recommend creating a testing environment such as this.

If you want a starting point, see our code: Our codebase is located at https://github.com/lukemetz/PiQuopter-Vision.

Step 27: Program the Flight Controller

The first thing we did when we got out flight controller was to reprogram it to use the kapteinkuk xcopter kk firmware. To do this, we used the kkMulticopter Flashtool. We went with the xwing configuration because we have a camera on board. The camera look forward if it is placed between two arms and not have to look through propeller blades.

To finish setting up the flight controller, follow the kk Quad x setup guide located at RCExplorer. This guide walks you through testing and configuring the ESC and the flight controller.

Step 28: Attach the Top Layer of Electronics and Camera

Picture of Attach the Top Layer of Electronics and Camera
We used the anti-vibration mounting tape to secure the remaining electronics, but anything will do. Finally secure the camera to the forward side of the quadcopter.

Step 29: Bind the Transmitter to The RC Receiver

Because there are many different kinds of receivers and transmitters, reference the manual to learn how to do this.

Step 30: Tunning and Stabilization

Picture of Tunning and Stabilization
Tunning our quad copter was quite difficult for us. To begin with, we neutral the potentiometers. Move the first and third pot to 50% and the second pot to 0%. In the firmware we are using the second pot is unused. To begin with, we tied down our quadcopter such that it could not fly away. We then used the RC controllers trim values to trim it level. This step takes a lot of time and tinkering with controls.

Once the copter is more or less level, use the first pot to adjust roll and pitch gains and then tune the 3rd pot until the copter flies straight.

Once you have configured your quadcopter, you are going to want to scope the output of the RC receiver such that you can emulate the tunning in the autonomous code.

While doing this step, we strongly recommend you tie down your quadcopter to prevent it from getting out of control. Never turn off the controller while the battery is plugged in, as the default mode for the control board is all motors full on.

Awesome! I'd love to see this taken into a different route with reusing/recycling/repurposing cardboard from whatever's available. Such as the cardboard cup holders from fast food restaurants, standard shipping boxes, packing materials, and who knows what else. I've got some plans started :)

ENGN291 month ago

Hello,

First, I want to say that this is an awesome project, and I appreciate you sharing your handwork.

I am also a noob when it come to building a quadcopter. I ordered most of the parts to get started, but I have a few entry level questions before I start.

1. Where do I find the programming libraries that you mentioned in your tutorial?

2. Can I switch it from autonomous to manual control with the remote?

Thanks in advance,

Excitedtostartbuildingaquadcopter

ncunha4 months ago

Okay, I am a newb at all this so please pardon my ignorance. I am sure my middle school students will ask the same question. If you have a transmitter and motors and such, what is the purpose of the pi on the machine?

CameronC4 ncunha3 months ago

It's designed to be an autonomous quadcopter. Therefore, the Pi can be used to calculate flight paths etc. and fly the quad itself, rather than manually controlling altitude, speed etc. I imaging the Pi's software will allow the user to simply pick a location for the quad to fly to with the controller, and the Pi will do the rest! :)

jackowens8 months ago

You guys are awesome! What a project!

keion961 year ago

what is the usb thumb drive for

How is the UBEC used to power the pi..

Where to connect the pin from the UBEC in the Pi

how much payload could it carry?
Glany21601 year ago

Couldn't be used to explore rivers, the card board would get soggy! Combining a waterproof quadcopter with http://www.instructables.com/id/Making-an-autonomous-boat-with-a-Raspberry-Pi-a-/ would allow for an obstacle avoiding, fully autonomous river explorer.

Macflame1 year ago
Excellent job. I would never have thought of a cardboard frame for a quadcopter. Now all I need is a laser cutter!
Just from the thumbnail, I thought this thing was MASSIVE for some reason...
Gave me the same impression.
turtledrake2 years ago
WhiteTigerTails: I wanted to reply to your comment but I've never been able to comment on peoples' comments for some reason. It says "Type the words in the box" but doesn't give me a box or words to type! Weird.
Anyway, just wanted to say that I agree and I think it's the perspective with the chairs.
mathman472 years ago
Nicely done, gentlemen.
iApple guy2 years ago
How much did it cost?
The minimum needed parts assuming you have an AVR programmer and an RC transmitter and battery charger is: $253.15 not counting shipping. When adding in shipping ($50 from Hobby King) and small electrical components, one should be able to assemble one of these for under $310.
By looking at the materials list, around $750 :/
WhiteTech2 years ago
Very sweet. Although have you though about using a KK2 board from hobby king? The built in accelerometer allows the board to have Auto-level. It's the one I use on my camera rig quadcopter. KK himself updated the firmwhere, it's scary stable. Boarder-line looking like GPS hold. In fact if there's no were to take off I simply toss it in the air at what ever angle and it catches itself. The auto-level would also allow you to focus less on programming just to keep in the air, and more on actual moving autonomously.
kayak0806 (author)  WhiteTech2 years ago
That is really amazing! It would make the programming end of things much much easier.
Thanks!
Heh no problem. There's also a massive selection of different open source controllers. AduCopter is a type of board that uses an Ardino pro-mini (or any other ardino), has many programs by users, and can add any addition sensors you wish liek GPS, barometer, Magnetometer, MultiWii copter also uses Ardino combined with Wii remote sensors. Open-pilot is another, TONS of options for open-source, custom or ready-to-fly!
lebowski2 years ago
Nice job!
rc jedi2 years ago
i just started flying quads. Your cardboard construction has me rethinking my 3rd build....
Good Work!
SilverJimny2 years ago
wow, I am very impressed :)
bigme2 years ago
Wow!
Kiteman2 years ago
Oh, we REALLY need to see a video of this in flight!
kayak0806 (author)  Kiteman2 years ago
Video added for RC flight! Autonomy hopefully coming soon.
Cool!
cube0002 years ago
Definitely video must appear here asap.
What is total weight of ready to fly model?
kayak0806 (author)  cube0002 years ago
Done (for RC at least).
The current model weighs 1151 grams.
kayak0806 (author) 2 years ago
Video of initial RC flight added. None of the team has any real experience flying quadcopters, so our first flights are brief.