Friday, October 8, 2010

We're switching over to the dark side... not

Onto the next challenge! This one was tough, really tough. Mostly because of mechanical problems. For this challenge we had to make our robot find and follow a moving light. We used different sensors, which detected light and brightness level. They looked like this:
In order to make them more precise, we put 'blinders' around the sensors. This helped narrow the beam of light hitting them.
And so we settled in on how to crack this case. Every program we tried failed, sometimes the robot would turn away from the light instead of towards it, and we couldn't figure out why until other girls in the class suggested we check  our resistors, because that would affect the sensitivity of the sensors. Turns out our resistors were different, and we had no problems after we changed them. Our program worked just as it should.
Our program went like this: the robot starts by turning until it finds the light source (one of the sensors reads a certain number meaning that the light is great enough to assume that the robot is directly facing it). Once it has found the light, it uses the numbers from the light sensors to continue finding the light. If the right sensor drops below a certain number, it means that the light has moved to the left, and so the robot turns left. You can see how having different resistors would throw the program off: the numbers reading from the sensors made no sense because there was a huge discrepancy, which of course made finding a number for when the sensors were facing the light (when the numbers from the sensors should have been pretty equal) impossible.

No comments:

Post a Comment