Wednesday, July 7, 2010

Day 2- Where's the line?

Today we continued working on our second project, the bots that use a light sensor to direct their movements, having light values indicate a certain movement. Last night, I was pondering the issue of how to have the bot relocate the line after getting sent off course, and thought I had come up with a viable solution. So, the first thing we tested this morning was programming the bot to, once it saw values that indicated it was off the line, turn right for a set amount of time (about 2 seconds), then turn left for the same amount of time. This, however, was not as successful as I had envisioned. Well, it's all about trial and error!

So, many alterations to the program later, we had designed a complicated mechanism where the bot, after getting off the black tape, would turn right for 3 seconds, then move backwards using the back wheels while turning left for 4 seconds, in hopes that I would return to the line. We also faced yet another problem: the front wheels weren't turning enough, or quickly enough, to get back on the line! After testing out multiple wheel types and positions, our final bot looks something like this:

The robot's ability to follow the line was improving, however, some of the turns were too sharp and it would often be sent on a curve beyond the line, and then lose sight of the line completely. This had us stumped. Luckily, it was about then that Chris gave a brief seminar in which he gave us the following equations regarding the motor speed:


After returning to the bot, we essentially scrapped our original program, and used this method instead. While the back motor propelled the bot forward, the two front motors used varying speed in relativity to the light to turn the bot along the edge of the black tape. As you can see in the following video, this method worked very well!

There's still more tweaking to be done, which will be tomorrow morning's first task. ^_^

No comments: