I’ve built catapults with garage door springs, locks with tiny wooden parts, taken panoramas of cities from mountains, captured the nose of Lincoln on the penny, and photographed the curvature of the Earth. Time for another small project! Quadcopters, are extremely stable versions of the classic helicopter. Sporting four blades instead of a main rotor and tail stabilizer and just four moving parts, they are an excellent platform for autonomous drones and cameras.
The four rotors are arranged in a “+” configuration, opposite motors rotate in the same direction and adjacent ones in opposite direction. This cancels out the gyroscopic forces tail rotors compensate for in traditional copters. Turning is only a matter of increasing the speed of a given set of blades so the rotational forces are unbalanced, inducing rotation. Translating is made possible by increasing the speed of the rotor that is opposite the desired direction and decreasing the forward motor so the thrust imbalance translates the helicopter. However, the total gyroscopic forces remain the same in each direction. This Wikipedia article has a great explanation if you want to know more.
I was inspired by the CrazyFly (great work guys!) for this project and decided to look into making a cheap, highly functional,expandable, palm-sized drone for my own enjoyment. From doing a little research, my initial requirements were:
- Fit in the palm of your hand
- Expandable to a full UAV with barometric, GPS, data logging, temperature sensors, FPV camera system. The do-anything pocket autonomous drone is the goal here.
- Give me an excuse opportunity to dive into surface-mount soldering and PCB design, update and meld it with my Balloon Control Board from the LENSE project. In this way the board pretty much allows me to use this board for a second launch. I also wanted to use all the same sensors from that project again (cheap!).
- Explore 9-axis attitude/heading/orientation computing.
- Give me an opportunity to get into RC and start programming my own toys (<- great word).
- Run on a single cell lithium polymer battery (easy to charge, no balancing, light)
- Be as light as possible (less mass = cheaper, less crash damage, portable)
- Be as cheap as possible.
Starting from scratch, there were several parts I wanted to include from the get-go. The MPU-6050 evaluation board from InvenSense I have left over from LENSE sports a 3 axis magnetometer, 3 axis gyro, and 3 axis accelerometer that can be accessed through a simple I2C bus and a few other pins. This board is a scant 4.3 grams! For further expansion, I wanted to integrate the new Copernicus II GPS from Trimble, the BMP085 from Bosch, Sparkfun’s OpenLog, and two temperature sensors, DS18B20s from Maxim. Combined with 4 PWM ports, I should have an extremely expandable and versatile system!
For the microcontroller, my criteria were very strict. It had to run from 3.3v (I'm a fan of low-power), be widely available, have a fast clock speed >32Mhz, and capable of many different peripherals. From the parts list above, I need I2C, two serial ports, at least 4 PWM channels, and several I/O lines for each device’s specific needs. The fast clock speed is important to update the motors with stabilization data as often as possible to increase responsiveness, an update frequency of 450hz is desired. Enter the PIC32MX795 series. Capable of 80mhz, 1.5-6v operation, lots of I/O and peripherals for your every need, this is the perfect chip. Plus it supports USB hosting! This is important because I can significantly reduce the weight and cost of a radio receiver by using a tiny USB-bluetooth dongle for communications! These weigh almost nothing, are tiny in size, and can go far enough for my purposes. I also decided to break out 5 PWM channels, the optional fifth for a FPV tilt servo. FPVHobby makes an incredible sub-1 gram camera and transmitter system that boasts a 1km range, for a great price!
With these parts picked out, I put a careful schematic together using all SMD parts in Eagle. I included a MIC5205 voltage regulator from Micrel as well as a SP6641A boost ic that lets the entire circuit take in 1.5-15v and run at a constant 3.3v. Thank-you SparkFun Electronics for having such a great library! Because of the tight component density, I learned to route manually for a change. Just after I finished, my computer crashed - three weeks of routing and revision down the drain! GAHH!! I admit it was probably for the best; I was able to switch to a more efficient layout and better routing technique that reduced the board size to 2” square.
BatchPCB is a service from those Sparkfun guys down in Boulder that offers to panelize your PCB designs for cheap prices and have them made in China in 2-4 weeks. Only a fellow nerd hobbyist would understand the agony of waiting for PCBs and parts to ship from China. Speaking of parts, I ordered the rest of the flight components from HobbyKing. Their site has incredible prices and a huge selection. The downside: based in China. 3-4 weeks to ship. Nonetheless, I picked out the following based on help from those great guys over at RCGroups.
- The battery is a Zippy 1S 400mah 20C Lipo, an optimistic 8-10 minutes of flying time. With no luck finding good single-cell LiPo chargers, I designed my own with the MCP73833 charge controller. The recommended 1A charging circuit should give me a 20-25 minute charge. I ordered four of these, so I can charge three while flying one, then set the dead one to charge and load a fresh battery to keep flying.
Once the parts arrived (no PCBs yet though) I got started on tallying up some weights and building a simple frame. I went cheap and easy, something that will make it through prototyping in the very least. Two 5 1/2" x 3/16" x 3/8" balsa spars went under the knife and were slotted together at the center, coated in superglue for rigidity and strength. The resulting structure could withstand 500 grams of pressure in any direction with some minor flex. Looks pretty crash resistant. For now at least.
The stationary shaft of the motors are just over 1/8", so I hand-drilled holes 3/16" in from the end of each arm and filed it just large enough for a press fit. Superglue kept the ends from splitting, though binding with cotton thread it is probably necessary like many have done on this great thread over at RCGroups. Even taking the time to read all 1000 posts only lasted me 6 hours, then I was back to waiting for my PCBs.
The final measurements were 5.5" arms and the motors form a 3.5" square. The frame weighs 1.8 grams.
Between props the clearance is just 1/4", and there is 1/2" under the blades for the control board. The CA glue made the balsa very rigid, it resisted almost ten times the weight as a non-treated piece.
Dec. 1st update
Today I received the main controller and battery chargers from BatchPCB, after 17 days. The date stamp on the package says they were shipped to the US on Nov. 23rd, so assuming 2-3 days shipping from China that's a one week processing time, not bad for $35. But the kicker is that they doubled my order free of charge! That makes 8 battery chargers and a backup controller if my soldering isn't up to par.
The controller is fully assembled, as are the LiPo chargers i made. SMT soldering is pretty easy once you get the hang of it, the hardest part is holding on to those teensy 0603 packages with tweezers! I tested the chargers, they work great and get a 400mah cell to a full charge in less than thirty minutes.
The batteries also now have connectors installed and are pretty rugged. I had a brief scare with a smoking wire, but no harm was done. A weight tally brings me up to 39.9 grams, ready to fly. This is still a bit heavier than I want it, but I could lighten the battery if needed, possibly switch to a 240mah.
The LiPo charger assembled and operating. The right meter monitors the output voltage. This value ended at 4.212 volts. The left meter monitors the current output. It gradually decreases as the charge progresses from 1000 to 80ma.
The MCP73833 gets quite toasty, I used a fan just in case, though it was probably unnecessary.
End of charge. The yellow "Dead" light is off, the green "Charged" one is lit.
December 6th Update
I spent the weekend and tonight assembling everything, looking good at just under 42 grams! For some meager shock-mounting I put some small foam pieces at the corners of the main PCB. The secondary MPU-6050 Evaluation board rides on a set of small electrical tape tubes (so I can remove it for troubleshooting), will be replaced with shrink tubing if necessary. I just attached the ESCs with small dabs of hot glue, FETs out for cooling. Though the wires look tiny, I have put 2 amps through them with no problems. In the corner you can see the Bluetooth radio. It just fits under the blades, I'll either need some smaller props or to relocate it underneath the copter. As for the battery, I'm thinking a small piece of Velcro. The 4 LiPo chargers are in the testing phase, nothing's gone wrong so far.
1s Chargers with connectors and ready for testing.
4 1s 400mah 20c Zippy batteries with JST connectors.
The MPU-6050 is oriented so the arms correspond to the axes.
The PCBs used rolled tape and foam pads for vibration isolation.
The stripped USB bluetooth radio can be used as an ultralight transceiver, if it doesn't get shattered by the prop above it.
The underside wiring for the ESCs and battery plug.