Thursday, October 20, 2011

Quadcopter-Change of Plans

Yesterday, I went to Charlotte Hackerspace, which was doing a workshop-type thing on building quadcopters. I talked to the guy in charge of it, and he told me a bunch of helpful things, and I saw things that have influenced the way I'll build the quad. The first thing that changed was the code I'm using. I'll now use the beta code and configurator instead of the 2.7.1 code and configurator. Also, I found out what the configurator does. It programs the escs and calibrates the transmitter. Simply put, it does the hard stuff that I was worried about. I found out how I'm going to build my frame and mount my motors. I'm going to build a wooden frame, and attach the motors in a way I'll describe some other time. He also told me to use a different type of wire. The kind you can't find at radio shack. This is the kind of wire used on the battery, escs, and motors. It's silicon-covered, and has a more rubbery feel than normal wire. It's also more flexible and better for soldering because it doesn't shrink or anything. He gave me a cool piece of metal with copper on both sides separated by silicon. That way, I can send the positive current through the top and the negative through the bottom for simplicity instead of splitting a wire in a complex way. He told me I only needed three of these, which I was amazed by. I thought I needed six, and I would have if I didn't know what certain slots in the receiver were for. I'll go over that in the documentation. I'm also going to get shrink wrap to make connecting the motors and escs better. I was pretty stupid not to think of that before. I don't have a heat gun, but I think you can use a lighter. That's all. I hope to have the quad done in less than two weeks. Honestly, it's a weekend's worth of work if you know what you're doing, but I procrastinate, and now it's been about six months. That's all I have to say right now. Expect another documentation on Monday or something.

Sunday, October 16, 2011

Quadcopter Documentation/Tutorial 4: Charging the Battery

I've realized that since there are so many tutorials out there, I'm doing a documentation of my experience rather than trying to help others, which this can still be used for, by the way. That's why I'm calling it a documentation/tutorial because the primary purpose is to record my experience while a secondary purpose is to help beginners such as me.

Today I soldered some bullet connectors (which I need to get more of and charged my battery for the first time. I'll explain everything in the order I did them:

Soldering the Bullet Connectors:

This took a pretty long time because I couldn't get the red protector on the bullet connectors. I ended up using electrical tape instead. I'm ordering more bullet connectors so I can use the red covering since I completely destroyed mine.
The first thing I did was cut the lengths of wire I needed. I used a wire cutter/stripper, but I think there are other options (although I'm not sure trying to cut with scissors would be a good idea. Since I was only going to use these lengths for charging, I cut them relatively short.
I cut two of these. If I were professional, I would have cut one red wire and one black wire for positive and negative, but I only have this roll of 16 gauge wire and I don't feel like going out and buying more. I then stripped each end with the same tool. If you don't have a wire stripper, use a knife. You can cut the end off, but it's usually not as neat.
At first, I stripped too much off. There was still wire showing after placing the ends in the bullet connectors. The ends should end up looking more like this (about half as long:
After cutting and stripping the wires, I went outside and got my solder and soldering iron ready. I used the 30 watt setting of my soldering iron and I used .062" diameter solder.
The first thing I did was cover one of the ends of one of the wires in solder. That way, It fills up empty space in the bullet connector.
I then put the bullet connector pointing up on an alligator clamp. It's important to have something like this because it gets hot and is hard to hold in this position otherwise. I filled it mostly with solder, then I put the soldered end of the wire into it. If it dries before you can put the wire in, heat it up with the soldering iron as you place it in. Solder melts easily, but dries fast.
I did this with both bullet connectors: one on each wire. I couldn't get the red protector on right, but know how now, but too late. I'll demonstrate when my new ones come in. Instead, I put electrical tape around the sections that would be exposed. It works, but isn't as elegant.
Plugged into the battery, they look like this:

Charging the Battery:

Now to the primary part: charging the battery. To start, I needed to plug in all the cords to connect the battery to the charger. There are two separate spaces for male bullet connectors on the charger; one for positive and one for negative. There are alligator clips that come with the charger that go here. On the right side are several slots with pins. This is to keep track of the separate cells in the battery when balancing. I'm using the one with four pins since it's decided by number of cells + 1 (for ground I think).
I started by using the alligator clips. I clipped them to the exposed ends of each one of the soldered wires. Make sure the red alligator clip is on the male bullet connector and the black one is on the female one. Also make sure they're plugged into the right slots in the charger.
Afterwards, I plugged the bullet connectors into the battery and plugged the battery's balance plug into the charger.
I actually did the next step first because I wasn't thinking properly. All it is is plugging the charger into the wall. It doesn't make much difference when you plug it in, but it's a tiny bit safer if you wait.
I then had to go through the charger's menu to charge my battery properly. First, I had to choose LiPo battery, so I just pressed "Type" and cycled through with the left and right arrows until I found it. Then I pressed "Start".
I then had to get all the values I needed from my battery, which were cells, voltage, and amps. The cells and voltage were already right because of the balancing plug. It automatically assumes 3.7 volts per cell, which I guess is standard. This is a picture of the battery, showing how I found everything:
This is the screen on the charger. 0.4 should be 4.0. I didn't know at the time.
Here's the whole arrangement before I began charging (minus the alligator clips which got cut off). The yellow boxes show where the connections should be. I held down start for three seconds, then pressed it again to confirm to show the charging screen which you see last.

That's all. My next step will probably be messing around with the transmitter and speed controllers, but I'm not sure how to go about any of it yet.

Friday, October 14, 2011

Quadcopter Tutorial 3: Messing around with code and the Arduino

EDIT: Someone is helping me out with the quadcopter, and recommended the beta code and configurator (AeroQuad_v2.5_Beta1.zip and AeroQuadConfiguratorFull_v3Beta2.zip in the AeroQuad downloads section). The code is edited the same way as in this documentation, but I'm also changing my style from plus configuration to x configuration.

So I've finally decided to be productive and post another tutorial. This one will be better because it's more of a documentation, not just a tutorial. I'm writing and taking pictures of what I'm doing as I'm doing it and not afterwards. The reason I didn't do that before is because I had already done those before deciding to make a tutorial. Also, the Aeroquad tutorial on their wiki might be easier, so go there if I don't explain it clearly enough or if I'm more boring-er than them.

1. Installing the Arduino Software:

First, I'm going to download the software for the Arduino, which can be found here. I chose my operating system, which is Windows. You need to download a zip file. If you don't have a program that can unzip these, I found a good one here. Be careful when installing it and look carefully at every page. Don't let them trick you with sneaky text into installing some crappy useless Bing toolbar. I unzipped the file into a folder called "quadcopter".

2. Downloading the AeroQuad Code:

I went here and downloaded the configurator as well as the code and put them in the same folder as the Arduino software. The links should be the two at the bottom: "AeroQuad_v2.4.2.zip" and "AeroQuadConfigurator_v2.7.1.zip". Simply put, the code tells the quadcopter what to do and the configurator troubleshoots if something doesn't work. My folder now looks like this:

3. Testing the Arduino:

To connect the Arduino, I needed the USB A to B cable, which looks like this:
By the way, I definitely took that picture, and my desk definitely is that blindingly perfect and white. I just opened the Arduino.exe in the folder I unzipped. AeroQuad recommends that I test the Arduino out with the "blink" code first, so I will. Basically, this just blinks an LED on the Arduino every second.
It opens another window with code on it. It looks like Java, but somewhat simpler. I went to the tools tab, then to board, and chose "Uno", because I have the Arduino Uno. The program can't find my Arduino because it can't find the com port. This told me to go to Control Panel>System and Security>System, so I did. I opened the device manager, found the Uno, and browsed for the driver, which was in the folder arduino-0022>drivers. I chose the folder and the drivers were installed. Now on the device manager, this is what I see:
I can finally get back to testing. I chose the now-available com port:
As you can see, uploading now works and I see the LED blinking on for one second, then blinking off for one. Now to the real code.

4. Editing and Uploading the Code:

I needed to open the AeroQuad code to start with, so in the Arduino program, I went to File>Open>...>AeroQuad>AeroQuad.pde:
This is extremely simple. Just uncomment whatever you're using (take away the "//"), so I uncommented "#define AeroQuad_v18" since I'm using an Arduino with the AeroQuad 1.9 shield (which is essentially the same as the 1.8).
The flight configuration is how the propellers are arranged relative to the front of the quad. The basic ones are X and +. X is meant for fpv quads, or quads with cameras on them so the propellers aren't blocking its view, but it seems more complex for me, and I'm not using a camera, so I chose the + configuration:
There are three optional sensors: the barometer, magnetometer, and battery monitor. I don't have either of the first two, and I'm not using the battery monitor until I'm already finished, so I uncommented only the last choice:
The next section has to do with flight angle calculations. Basically, you uncomment the ARG line if you don't have a magnetometer and otherwise leave it. I don't have a magnetometer, so I uncommented it:
The remainder of the user-definition section is about camera stabilization and stuff that I don't care about (currently), so I'm done!
I uploaded the code to the Arduino with no problems. If you need any help, comment.

Saturday, October 1, 2011

[Insert post name here]

So as always when I can't find anything to do, I'm writing here. Actually, I have plenty of things to do. In fact, the total time these things would take could quite possibly be the entire day. I just really don't feel like doing any of them. So, as usual this year, not last, school has been fun, at least compared to usual. I'm half a week to a week ahead in all my classes except Spanish II and Art. I've done all the work I can in Spanish, and I haven't done any of next week's work in Art yet. That's what I need to do, but in order to do that, I need to leave my room, unplug this laptop, take it all the way downstairs, plug it into the printer, print out some stuff, bring the laptop back upstairs, move the things that magically grew while I was gone, and plug my laptop back in. That's probably been the hardest part of my online classes so far. I hate moving my laptop.

I also don't really feel like making another quadcopter tutorial yet because I really don't feel like it right now for some reason. The next tutorial, though will be how to modify the code for the specific quad and how to get that code onto the Arduino.

Finally, the new Humble Bundle is out. This is a collection of indie games for the pc (any OS). It's pay what you want, so you could pay anywhere between a penny and thousands of dollars, and there are people on both ends of that. If you are going to get it, don't pay a penny, because only jerks do that. This Humble Bundle is the Humble Frozen Synapse Bundle. Frozen Synapse is a really awesome strategy game. It's hard to describe how to play, so you'd need to either buy it, or download the demo and try it out, or maybe just watch some videos. Also, if you pay above the average which is about $4.65, you get some indie games from a company called Frozenbyte, all of which look cool. So if you want to get it, go here.