Showing posts with label Flying things. Show all posts
Showing posts with label Flying things. Show all posts

Saturday, December 8, 2012

The Quadrotor Itch Strikes Again!

I was inspired by Shane zipping his small quadrotor across the office, and decided I wanted to make another, smaller quadrotor that I could fly indoors (unlike my other giant one). I wasn't too eager to cough up the relatively large sum of money that I threw down on Derpcopter (if I remember right it totaled something in the neighborhood of $800), so I designed one with cheap hobby parts that I could get for a lot less.

I decided that I wanted to 3D print the main body components so that they'd be relatively lightweight, and it would also let me do non-2D geometries (as much as I love laser cutters and waterjets, I think I eventually get sick of being stuck in 2D). I based the design on 6mm carbon fiber squaretube, since it's very lightweight but still plenty strong enough for a small quadrotor. I also wanted to try out the relatively new KK2 flight control board, so I designed my body specifically to accommodate it (3mm holes spaced on a 45mm square).


I added slots for a velcro strap on the bottom side, to hold the battery. The holes for the control board also retain the squaretube arms, which fit into the square slots on the corners. I also split the model in half across the horizontal mid plane, in order to make it much easier to 3D print.

I wanted to get a head start on picking out components to I order them from China, because shipping takes forever. Here are some links to the major components:

I decided to use the same radio transmitter that I already had for Derpcopter, there wasn't really any reason for me to buy another one. I also picked out substantially bigger ESCs than I needed, really the motors could run on ESCs half that size, but I was considering that I might want to bump up the motor size later, which I can with large ESCs.

I went ahead and ordered two sets of parts (one for me, one for a friend), then worked on the design (and my scooter!) for a few weeks while I waited for them to come. Now that I knew which motors I'd be getting, I went ahead and designed mounts for them which also serve as feet for the copter.



I also wanted a sort of dome structure on the top of the body, which would serve both to protect the control board and mount the radio receiver (mostly just make the quadrotor look more legit, though). I didn't have a very concrete idea of what I wanted the design to look like, though, so I just sketched out a few different designs until I came up with one that I liked.




I ended up going with the third design (the one on the bottom) because it looked the simplest/sturdiest, as well as the easiest of the three to print. Again notice the velcro strap slots for the radio receiver.

I went ahead and printed out the frame parts while I waited on my electronics to arrive.

Yay printers!
There wasn't much else I could do on the copter front, so I spent a couple weeks focusing on school and other projects. I was pretty excited when the giant shipping package of Hobbyking parts came in, so I laid everything out and took a picture:


I included my old radio transmitter for completeness, the orange and black one you see is the one my friend got for his quadrotor. Also, notice the extra props: I've learned a bit of a lesson there. New quadrotor = broken props, so buy extra.

I began by cutting my 75cm carbon fiber tube into 4 17cm sections. I also took rather meticulous photos of this whole build, because I'm planning on writing a quadrotor Instructable. Oh, and there happened to be a lightbox sitting at MITERS, the owners of which kindly decided to let me use it to take some pictures of quadrotor parts.

I think you're supposed to wear a mask when you do this? Not much dust came up though. I think I held my breath.
Cut arms:

Ooh, fancy.
The bandsaw didn't make perfect cuts on the CF, but it really doesn't matter for how they're being used (the faces don't need to be perfectly rectangular). Plus, I didn't really feel like sanding it down and throwing dust everywhere.

I arranged the arms and base together so that I could drill out the holes in the arms.

Sorry it's a little hard to distinguish the white base from the white background, this is why I'm an engineer and not a photographer
This was just faster than measuring out and drilling holes for the arms separately, and it works just as well.


I then did essentially the same thing with the motor mounts, except I taped around them a bit to help hold them in place on the arm.


That done, my basic frame was complete!

This one didn't quite fit in the lightbox :(
With the frame ready, it was time to work on electronics. Primarily I just had to solder lots of bullet connectors so that I could hook everything together. Oh, and I also got my battery started charging so I'd have it ready by the time I finished everything else. I took a whole lot of pictures of the process for soldering bullet connectors, because I remember they were very confusing to me the first time I had to use them (on Derpcopter). I'll be putting a full detailed guide to doing this on the Instructable, but for now I'll save you having to scroll through 20 pictures and just show you the result:

So pretty!
There are all four motors and ESCs, all soldered up and ready to go (only 32 bullet connectors between them).

Next, I discovered my first major mistake: I'd assumed that the motors used the same 3mm screw size as the control board, but actually the holes are for 2mm screws. Oh well, I didn't have the patience to do this the 'right' way and buy some screws from Amazon, so I just removed the motor mounts and drilled the holes out to 3mm.

These are annoying to fixture properly and the alloy is so soft that I just decided to beast it with vice grips.
I screwed on the control board and the power distribution board, and then started mounting the motors.

It's starting to look pretty quadrotor-y!
ESCs all wired up:


And a final picture of the finished copter, with battery, radio, and propellers attached:


I zip-tied the ESCs to the arms to clean up the wiring and prevent them from just swinging around in flight. You'll notice that the dome I designed isn't attached in this picture, this is due to the fact that I underestimated the thickness of the power distribution board when I was buying screws. The body screws I got are too short to go through everything and mount the dome, so currently I'm waiting on new screws ordered through Amazon in order to complete the body. Regardless, it's fully capable of flying without the dome, the purpose is mostly aesthetic. I did fly it for a minute or so around when I took that last picture, but it was 5am at that point and the copter was very difficult to control (due to the default PI gains of the flight control being set way too high, causing it to oscillate around whatever desired position I gave it), so I decided to call it a night.

The next day I worked out the PI (if you're not sure what this means, I recommend reading up on PID control on Wikipedia. Copters typically don't have need for the D component because it's highly affected by noise in the sensors, and it slows the system response which isn't very desirable) settings to get a much more stable copter, and came up with a name: I dubbed it the Blitzcopter, owing to how I'd completed the entire construction over the course of one manic night.

Okay, I'm not going to leave you waiting for the video any longer than that, so here it is:


Yay! The reason it's flying so loud is that I haven't yet gotten a chance to balance the propellers, which entails adding little bits of mass (i.e. tape) to the blades in order to move the center of mass of the propeller onto the rotational axis, greatly reducing the vibration of the motors.

I've also taken a couple of hard landings and snapped some of the printed motor mounts due to the impact, for now I've super-glued them back together but I'm going to be designing new sturdier mounts won't break as easily.

Wednesday, August 8, 2012

New blog and old projects!

Alright, so while I'm over in Washington jumping out of planes and with very limited shop access, I decided my downtime would present the perfect opportunity with which to categorize some old projects, as well as things I'm currently working on. Hence the start of yet another generic Mechanical Engineering blog!

I figured I'd start with an old project of mine which I recently got working again: Derpcopter! This is one of the few of my projects lying in the "Actually Finished" category of stuff I built/am building.

Derpcopter was initially conceived as both a good way to make my first foray into CAD, and to satisfy my high school graduation requirement of a senior project.

So, the first Real Thing I ever CADed:


Yes, that's right. AutoCAD for a 3D assembly. It was all I knew at the time, and it got the job done. Notice how this design is currently lacking any motor mounts whatsoever, if I recall correctly I actually just made those in Visio (the only drawing software available on the computer hooked up to the laser cutter). I was initially intending for the lasercut parts to be acrylic, but ended up settling on polycarbonate because it's much stronger/less brittle. (Note: don't ever ever lasercut polycarb, unless you want all manner of delightful brain damage which I probably have by now).

The platform was based on the Arducopter build of the beginning of 2011, when the project was still very much in beta. Knowing approximately squat about electronics at the time (not that I can really say much has changed on that front), I just went with their default Ardupilot Mega hardware and Arducopter firmware, some 30A ESCs, APC 10x4.7 props, and these actually pretty decent motors.

I specced out 5/16" aluminum squaretube for the arms, 1/4" polycarb for the frame and 1/8" polycarb for the electronics mounts. It turns out 5/16" squaretube with 1/16" wall is commonly used in upscale railings (who knew?) so I picked up a few lengths for free from a contractor who no longer had use for them (not to mention they came pre-painted a sexy matte black). As for the polycarb, TAP Plastics has this great scrap bin in their stores where you can pick up excess sheets for practically free.

After making three or four passes on the 1/4" polycarb at max laser power with low speed and succeeding at nothing other than charring lines all over the place (and throwing around all manner of nasty fumes), I opted to swap all the structural components to 1/8" as well.

From that point, machining/assembly went pretty smoothly, and I was able to finish the wiring/electronics assembly with much digging through old forum posts to find any and all relevant info. If you're looking to build an Arducopter now you'll have a much more pleasant time of it, considering documentation by this point is far more substantial.

Finished build, weighing in at a whopping ~2.6 lbs with battery:


I uploaded the firmware, calibrated ESCs, mounted props and decided to see if Derpcopter would lift itself a bit. I applied what I thought was just a little bit of throttle, and immediately WHRRR-CRACK!
Derpcopter flung itself sideways straight into a wall, instantly shattering three of the props. Not only did I grossly underestimate the amount of thrust the over-specced motors I used could produce, I'd also failed to double check directionality of the props and one of them was backwards. Well, crap. I'd only bought one extra of each direction of propeller, so I was stuck waiting over a week for new props to ship (and yes, this time I bought like 10 spares).

Unfortunately I had to present the project before the new props actually came in, so I just spun it up a bit without props mounted to show my teachers that yes, it actually seemed to do what it was supposed to, which evidently was enough for me to pass with the project.

New props came, I put them on in the correct direction, flew around my neighborhood a bit, and then I must have given it a few too many hard landings because eventually Derpcopter became pretty much uncontrollable. I monitored direct sensor outputs from the Ardupilot on my PC and noticed that one of the accelerometers was spitting values completely all over the place. Derpcopter thought it was shaking like crazy, so the reason it was impossible to fly was that it was actually just trying to stabilize itself (even though it was already stable) and thus jerking all over the place. At this point I was nearing the end of senior year, and shelved the project in the "I'll fix it eventually" basement shelf.

Come the end of freshman year at MIT, I started spending some time over with these guys, who inspired me to dust off Derpcopter and bring it back to life. I noticed an inadvertent but quite convenient feature in my design:

It folds!
It turns out that converting Derpcopter into travel mode only requires taking out a total of 6 screws, yay! Anyway, I brought Derpcopter into my lab to work on, where a perceptive friend noticed that a smoothing cap on the APM board was toast. Whoa, that would explain bad accelerometer readings! Here's a picture with the rather hilarious looking not-at-all-surface-mount replacement cap:



Looks good! Now to upload the new firmware, and.... crap. It turns out that APM has upgraded their boards and are now based on ATmega2560s instead of 1280s. This means my old board doesn't have enough memory to support the modern Arducopter firmware. The solution? Upload firmware manually using Arduino, after having commented out parts that are irrelevant to my uses (there is a lot of bloat on the main Arducopter code, there are ridiculous amounts of features).

Somehow in the process of screwing with firmware I managed to get the plane edition of the code. My quadcopter spent several hours fully convinced that it was a plane before I finally got correct code to compile and upload. Planes like to go at mid throttle when the throttle stick of their controller is all the way down. See why a quadcopter that thinks it's a plane is a very bad thing? Fortunately I didn't have props mounted on it, so Derpcopter just spent a while happily spinning all motors when given no throttle input as I tried to figure out what it could possibly be doing.

I finally got Derpcopter running, fixed orientation issues, and adjusted PID values to get something flyable.


Yay! No one is dying! It still flies backwards (the taped arm should be the front, at the moment it's treated as the back), but I can live with that for now. When I get back to Boston I'll take some footage if it doing crazier stuff over Briggs Field, but for now you'll have to be satisfied with the first working test flight.