Autonomous Car pt.4

Date Sun 12 May 2013

It finally drives!

I've done a lot more work on the code for the autonomous car. I played around with running the GPS heading updates through a FIFO array to try and smooth out any irregular data before sending it to the Kalman filter. I was a bit worried that this would slow down the heading updates too much, and it did. It evens out the data, but also causes a significant lag, making the car pretty much undriveable. I commented out the FIFO code, but left it in there in case anyone finds a use for it later on. You can find the latest version of my navigation code on my Github page.

I started playing around with the core timer on the PIC micro. Right now I'm using the core timer to change the update rate for the SD logger and the LCD screen. Previously, both of them were updating every time through the control loop. With the control loop running at around 50Hz, it produces a ton of data. Instead, I slowed down the update rate to 250ms. Although I haven't verified it yet, slowing down the writing to the SD card should speed up the control loop.

I made some changes to the navigation portion of the code. It still sends the new GPS heading updates through the Kalman filter with the gyroscope angular rate, but now uses dead reckoning from the gyroscope in between GPS updates. But enough talk- let's get to some pictures and videos.

It now has a roof top LCD that displays heading information while the car is driving.
I've also started working on replacing the breadboard with a PCB. This is still in progress.

Here is a plot of a run in a parking lot. The car's GPS tracks and heading vectors are plotted for each time step. This plot was made using Octave and then Inkscape to overlay the Octave plot on a satellite image. The waypoints are the red circles.

The car's goal was to start in the bottom right coroner, move to the top left, down to the bottom left, then back up to the top right, making an X shape in the parking lot. There's a bit of messy data where it first starts out at the bottom right due to a parked car getting in the way.

And finally here's the video the the car driving through the parking lot.

You can see in the video around 0:30 where the car gets lost at the third waypoint in the top right, but eventually found its way back on track. It's still not clear to me from the data why this happened. I chose the X pattern to test the car's ability to pick the shortest direction to turn toward the next waypoint. It seems to be doing that very well, but is over-shooting the turns, which should be solved by some small adjustments to the PID.

Comments !

comments powered by Disqus