Friday, April 22, 2011

Broken Drone

HOW THE DRONE BROKE
We were trying to use a serial cable to connect to the drone motherboard. The drone motherboard has a port on it that is labeled as USB but it has a non-standard connector. On line were instructions on how to make a cable that would connect to the drone motherboard, but the instructions were not entirely clear.

The part of the process that was clear was that some special software needed to be compiled for the drone. This was a kernel module called 'dwc_otg.ko'. Then once the software was in place a special cable could be used to connect to the drone. The kernel module sources were modified and built for the ARM processor and installed on the drone. This took some time.

Then we ended up making two cables, one that was just a wire connecting a standard USB male connector with a specially made connector on the other side for the drone. The second cable was made with the standard USB male connector, an intermediary circuit in between, and again the special connector for the drone.

There were two test circumstances that we wanted to try. First we wanted to test the cables with a USB thumb drive, checking the 'dmesg' output on the drone to see if the device detected the drive. Then we wanted to connect to a computer and try to figure out a way to use the connection as something like a serial terminal. The reasoning for using the thumb drive was that the thumb drive had no power supply, so there was no chance of damaging the drone. In the forum posts people had success with this kind of testing, and the 'dmesg' output showed that a memory device was connected at the serial port.

We tried the cable with the intermediary circuit first. There was 'dmesg' output showing that the kernel module was working, but nothing showing the drive itself was recognized. There was some output on dmesg, but it was just a string of hexadecimal numbers, and it did not look like the output that people on the forums were getting. Then we tried that cable with a computer on the other end of the cable instead of the thumb drive. Again nothing showed on 'dmesg' to identify a computer.

Then on another day we tried the cable with no intermediary circuit. First we tried it with the thumb drive. There was output from 'dmesg' but not enough to identify the drive. Then, thinking that nothing would happen, we connected that cable to a computer. This is how the drone was damaged.

FIXING THE DRONE
Immediately after the drone was damaged we rebooted it. All the indicator lights on the motors went from red to green as they were supposed to do for a normal boot up. The drone even flew briefly, taking off and landing. The first indication was that it was not seriously harmed.

Later it stopped working, so at first we were confused as to what was happening. We could still telnet in to the motherboard but we could not fly the drone, and during boot up, two of the four motor lights that were supposed to light up and turn from red to green did not do that. We took the drone apart and identified a spot on the motherboard where a component had burned. For this reason we decided that the motherboard needed to be replaced.

A new motherboard was ordered and we installed it, but the two motor lights that would not light up before still would not light up. At the time of this writing the drone is still broken, and we are looking at the motors themselves as the cause of the latest problem. The idea now is to interchange the motors in different positions on the drone to see if the motor itself is broken or if it's some kind of other problem. The motors are replaceable but everyone is wary of replacing a part and finding that the drone still does not work.

UPDATE:
It was determined that two motors were broken. New motors were ordered and the old ones were replaced. The drone now works.

Friday, April 1, 2011

Watchdog Command

While working on my embedded program, I found that it needed to constantly be sending something called the "watchdog" command. Once this command is being sent every 100-150ms or so, the pitch and roll values actually make a difference.

Here is the command:
AT*COMWDG=seq