RC Plane Autopilot


About this project

With this project, I intend to create an autopilot from relatively cheap materials for use in an RC plane.

Parts

Still needed:

Part Notes

I ordered my RS232<->CMOS and Accelerometer from Digikey. Somewhere on their site was an option to use Canadian currency, but I didn't see it. No more then 20 minutes after I had placed the other, they called me, and asked if I meant to use Canadian or American currency. Of course I meant Canadian. They also offered to change to purolator instead of Fedex. Thats what I call service! Now I know why so many people recomended me to digikey, and while I will do the same.

Also, I ordered my Gumstix directly from them. They, for some reason, like to use UPS. Now, if you're Canadian, and have ever used UPS, you will know how terrible they are. I ordered it on a wednesday. They used the 'express' service, so it should have been End of business day, 2 days later. This meant it should have arrived on Friday afternoon. Sadly, it did not. It arrived at the UPS depot mid-day friday, but just sat there untill Tuesday (as it was a long weekend). When it arrived at my doorstep, my brother decided he was going to decline the package, as it had a mere 15$ shipping fee. I would have paid him back, but instead he decided I don't want the package. Now the UPS guy, instead of realizing to bring it back the next day, marked it as declined, and that it should be shipped back to the sender (the SENDER, not UPS, as they call the local UPS depot 'The Sender'. Morons). So now, I'm racing to call Gumstix and ensure they dont accept it to come back to them. I spent the better part of that week getting my package. I put in a 'change destination' so that it would come to me at work on that wednesday. They informed me that it would be at my office by end of day Thursday. It didn't show up. So instead I called them late Thursday, and asked if I could pick it up. By the time they called me back there was no way for me to get to the depot. I told them I would pick it up friday afternoon. Instead, on friday afternoon, the package arrived at my work. The shipping fees are disgusting too. I had to pay 70$ on a 250$ order from Digium a few months ago. Then I recieved an invoice for it a few weeks later. When I called them and said I had paid it, they just responded with 'Sorry, that was sent in error. It has a balance of 0$'. I bet if I hadn't said anything, they would have asked for my credit card.


The plan


Progress

May 5, 2006

I just received my brand new Garmin GPS 15L-W today. It works! Well, sort of. It's not getting a fix on any satellites. I attribute it to my lack of an antenna. However, it is interfacing with my computer nicely. I'm a bit puzzled by how its saying that its tracking 12 satellites, but getting 'invalid' data, as well as setting the clock correctly. Either way, I need an antenna.

I had to do some gross hacks to get the GPS working. For one, I took an old ATX case I had laying around, and jury rigged it for power. Then, with the free cables, and a power clip (paper clip, bent in oh so many directions), I plugged it into my serial port. I setup my terminal emulation software correctly (in this case, minicom), and hesitantly hit the power. It instantly started spewing data all over my screen. Of course, the manual told me how to disable this, and only show the data I needed (this will be needed later, as the m68k wont have enough horsepower to choke on all of the data at once, so I will need to be selective). It seems to think I'm over in the eastern hemisphere, which is of course wrong. Anyhow, heres the pics, taken with my Nokia camera phone.

Jury Rig 2

May 13, 2006

I recieved my antenna a few days ago in the mail. It was completely in tact, and ready to go. After downloading the almanac, the GPS started getting a fix. Unfortunately, theres no WAAS in Canada, so its probably a little off. Now it was time to plug it, and the board together. Now, I have an RS485 port on the board, that I thought I may be able to use as an RS232 port. Sadly, I was mistaken. So, I disabled my console output on the board, and left only the internet services running. I programmed a small app using mostly ready code, and viola, it started printing.

Well, it wasn't as easy as I just described it. Sadly, the version of uClinux that I have doesn't support printf floats, so doubles didn't work. This is retarded, since the readings I get from it are all in doubles, aka, DDMM.MMMM. Fortunately, atof works. Another problem I ran into was the GPS sends blank fields if it hasn't changed. This made it impossible to predict placement of the values. I ended up getting some code and modifying it so that it would reliably place the data where it needed to be in a machine parsable way, by replacing all commas with \0's, and parsing one by one untill it was done (since PGRMC has a fixed 15 value string). Anyhow, I still dont have a reader for my camera, so heres more pics from my Nokia.

m68k and gps
closeup

May 16, 2006

Today I performed my first active field test. I hooked up my m68k to my power invertor in the car, and had someone drive me around to test that it was getting a proper bearing. Its slow, takes about 5 seconds to fully register a speed change since it plots based on several previous points. This will be OK, since I mainly need airspeed, which will be done with a barometer.

On another note, I've decided to replace my m68k with a gumstix. Its smaller, and has FAR more power. 400mhz compared to 15 on the m68k. It also has bluetooth, and several other interfaces. It doesn't have a network card plugged in by default, but I can use bluetooth for that. It does consume more power though, especially with the bluetooth, but it only needs 3 or 4 volts instead of 12. That will make supplying the power a fair ammount easier. It uses cmos levels on the serial uarts, so I'm going to need an RS232 convertor. I have ordered that from digikey. The 3 axis accelerometer I ordered is QFP, so I'm going to need a socket, or some other way to attach it to the board. I googled, and found a socket for more then 60$! Thats FAR more then the actual chip cost. I may just make my own. It cant be that hard.

May 26, 2006

The gumstix I ordered came in today. To be honest, I had no idea they would be this small. Oh, and never use UPS. Long story... Google for UPS and Canada, and you will understand why. Anyhow, here is a pic of how small it is. Their site is deceptive.

GumStix

May 28, 2006

Serial lines suck. Well, sort of. At first I thought my ICL3232 was busted, but it turns out it was OK. I connected my gumstix to my ICL, with all the capacitors in place. All the wires were in the right place, and I got nothing. It made no sense. So I opened up my bluetooth settings on my nice MacBook, and discovered that the gumstix was not only alive, but accepting serial connections. This was too good to be true! So I was able to get into the device and troubleshoot it. Now, it has some issues with serial ports, in that its terribly slow to do anything with them. It takes several seconds to just set ttyS2 (STUART) with a new baud rate. Anyhow, I found out eventually that the board was OK. So my attention turned back to the ICL3232. I did a voltage analysis on it, and noticed the V- line wasn't at -5.5 like it should be, but instead was at -9.5. Now I was thinking my chip was burnt. After some playing, and a short sleep later, I decided to unplug the serial on it, and plug the board directly into my USB UART. Strangely, this worked. Basicly, I've concluded that the ICL3232 is incapable of driving poorly shielded lines at 115200. Now is when the photos get interesting, as I have a massive clump of wireing.

Also, I have recently discovered how difficult it will be to use my 3 axis accelerometer. I'm hopeful that I can find anyother one that isn't QFP form. This would be exceptionally difficult to interface with, since soldering it will be damned near impossible.

Connecting the Serial