Friday, February 1, 2013

Walls, Lines, and Fire

Today went way better than the last ones! I got there early and jump-started our transition from Everette's bot to mine. We moved the encoders, flame sensor, and line sensor over, but were given a new sensor - the ultra-sonic sensor, which is basically a sonar device. It reads the distance to whatever is ahead of it.


Everette made a cool suggestion that we mount the line sensor using the sonar sensor like so:
Fewer parts to worry about.

Next, we needed a good spot to place the flame sensor. Since the candle is going to hold the flame several inches from the floor, we needed a raised platform of some kind on the bot.
I came up with a little something for that:
Kind of ridiculous looking, but quick and easy.

Now to the program.

goForwardUntilCloseToWall();
turnRight(TURN_90);
goForwardUntilLine(); // pretty self-explanatory
scanForFlame(); // this function has the bot turn right 90 degrees, turn back 180 until flame is detected
goForwardUntilLine(); // go up to the candle
scanForFlame(); // correct direction if not facing candle

With three independent sensors, the testing process would take quite a while, though we did have some really promising results early on. I was only concerned that the bot wasn't facing directly toward the candle when it detected it.
The sonar worked pretty well, but the flame and line sensor's tolerance needed quite a bit of tweaking in the program.
By the end of class, our bot's performance was hit and miss, but the final presentation was successful.

Seemed the flame sensor needed a bigger flame than that tiny candle produces.

No comments:

Post a Comment