As a requirement to receive my bachelors in Electrical Engineering, I had to pick a senior project to complete. Amongst the options were some fairly trivial projects, some boring projects, and some new, possibly not completable projects.
A new project created this semester was to build, design, and write code for a completely autonomous flying quadrotor.
The basic concepts.
We have a metal frame that houses our circuitry, and has four rotors that extend from it.
We have 4 servos that control the speed of each motor, rate gyros and ultrasonics to monitor altitude and yaw/pitch/roll (the angle at which the quadrotor is at).
These all make sure that the quadrotor knows where it is in relation to the ground, so that if the altitude decreases, or there is wind, the motors will speed up or slow individually to compensate/correct.
Then we had a camera sticking out of the bottom. My job was to write code in C that would use the camera to track the position of a custom made L.E.D. target, to be able to follow it.
My code would spit out an x,y position of the L.E.D. and pass it on to the autopilot, so that we could adjust our position to always stay overhead.
The interesting part was how we did the calculations. Initially we’d been connected remotely to the quadrotor. Even though the machine had to be autonomous (work without human intervention) we didn’t have a way to calculate camera values onboard. We would send the camera data directly back to out computer, calculate yaw/pitch/roll and then remotely send it back to the autopilot, which would speed up/slow down motors to follow.
This would obviously pose problems, as not only would there be significant lag, but we could lose communication mid-flight.
To fix this problem, we used something called a gumstix.
It is a full computer. Running a 624Mhz ARM CPU, 32MB RAM and 128MB ROM and running a full 2.6.21 linux kernel.
It was small enough to put right on board inside our quadrotor, and connected to the autopilot via a serial cable.