The information for my autonomous car project is starting to get a bit spread out between all the update posts, so I though making a nice summary was in order.
In part 1, I laid out my plans for the navigation algorithm and spent some time working on the computer vision part of the project. I was looking at sending an unboard camera image from my Android phone to a laptop to do some lane detection. The large variation between different roads posed a problem. I did get the algorithm to work pretty well with a perfect-looking road. There were also some issues with lag between sending the image, processing, and sending it back.
In part 2, I officially scrapped the computer vision aspect. The car got an upgrade from an Arduio Uno to an Arduino Mega (more I/O was needed). I had some trouble with the Uno lacking serial ports. Both the Xbee radio and the GPS needed a serial port, but the Uno only had one. One way to solve this problem is to use software serial, but it has interrupts that interfere with the servo PWM generator.
I was a bit worried about the computation time on the Arduino, so I thought about upgrading again to a ChipKit Max32, which uses a much faster 80MHz PIC32 microcontroller.
I also built a separate dead-man switch using a ATtiny85 microcontroller. The idea was to have a separate IC monitor the radio signal from the hand held transceiver. If the signal was lost, then the ATtiny would tell the car to shut down.
In part three, I upgraded the car to a ChipKit Max32. Since this board runs at 3.3v, I also hacked together a microSD card breakout to start logging data. I also added an LCD, which was great for debugging the code as the car ran.
The car made its first semi-successful run down a straight road and back but had some trouble with GPS signal. I started working on adding dead reckoning to the code to fix address this issue.
The car finally made what I'll call its first real autonomous run. It navigated an "X" pattern in a parking lot.
I played around with different ways to deal with a short term loss of GPS. I tried placing the GPS headings into a FIFO array and calculating the average heading of the array. My thought was that a few missed GPS updates would only slightly change the average of the array. This method worked well, but it also had the same effect on new valid GPS data. The end result was significant lag in the heading update, so I dropped this part of the code.
Instead, the solution ended up being dead reckoning. When the GPS signal is lost, the Kalman filter is bypassed and the heading is instead calculated using only the gyroscope. This seemed to work well, but since the gyroscope will drift, it is only good for short durations.
I decided to play around with Eagle, which was new to me, to make a PCB for the car. I had the PCB (UGV Board) printed at OSHpark. They turned out great!
Finally I submitted my project for the ChipKit Design Contest. For the entry video, I ran through all the features of the car and I got a nice Go-pro video of the car driving around a parking lot. Now even better, thanks to more PID tuning.