Wednesday, September 29, 2010

Whiney Sees The Light!!

Whiney now has eyes!!

For Whiney's next adventure, we were challenged to create a program that made Whiney hone in on a light source and then go towards it wherever the light goes. For this challenge, we essentially did the same thing we did to make the line following program. However, we ran into some different problems this time. One of our major difficulties was to account for the discrepancy between the two sensors and how they registered the same amount of light. However, we easily accounted for this difference by setting a variable n to be the approximate difference between the values of the two sensors when they were facing the same amount of light (approx. 125), plus the value of the sensor that gave the smaller value (sensor 3). Thus n = 125 + sensor 3. We used this number n throughout the code in place of sensor 3.

Upon testing the program, we learned that we also had a slight problem with the physical aspect of the robot and the placing of our sensors. In order for our robot to correctly follow our program the way we wanted it to, the sensors must not overlap in the amount of light they see. In other words, the angles through which the sensor can sense light must not overlap or both sensors will be reading most of the same amount of light at the same time when our program relies on the fact that at any particular time unless the robot is pointing straight at the light, one of the sensors will sense the light more than the other depending on how the robot is turned towards the light. In order for us to account for this physical discrepancy, we had to create blinders around our robots light sensors. We used simple flaps of duct tape on the sides of the sensors facing each other to create a blinder down the middle. After we had accounted for all of these things, Whiney correctly followed the light as if it were in love with the lamp. =]
Here's a video of our love-struck Whiney:


No comments:

Post a Comment