May 25, 2011

Journal Entry #8.5

After some more progress with my code, and after solving a pair of problems, I have built an autonomous car. It isn't running in my track, yet, and there is still a significant amount of coding to be done, but as the video below shows, it isn't too dumb.

The first problem I solved was one which bothered me from the beginning - steering. I last left this problem thinking that a second motor driver could help get it to steer. At the least, I could run one of the motors off a separate power source. This turns out to be unnecessary. I bought a couple weeks back a newer rechargeable battery for my car, thinking that would solve my issues. I never actually tested it, though. An important lesson: If you think you have a solution, give it a try. Plugging my new battery into my car allowed me to run both motors off a single motor driver. After doing it a bit, though, I started to have issues - the car became sluggish. Thinking back to how I solved the original steering problem (getting the wheels to turn), I turned the drive motor up to full power and voila, it was working great again. The one drawback from this is that it'll be harder to drive my car slow; however, I'm testing on carpet right now, so on a wooden floor I can likely reduce the speed.

The other issue was one I mentioned in my last journal, about needing a decoupling capacitor to protect my sonar sensor when I turned the motors on. Well, I bought that capacitor, and it does its job. The theory behind it is that it works; certainly there is a more technical explanation, likely on Wikipedia, but suffice to say that my sensor works when I add an RC (resistor-capacitor) circuit to its power source (you may note that I actually have two resistors in the circuit. The reason for this is I did not have a 100ohm resistor, which the diagram called for, but two 220ohm resistors. So by putting them in parallel, the equivalent resistance is 110ohms, which is close enough).

Solving those two problems enabled me to produce this cool video: