|
Explore TEAMS!
|
Student /
Lab5BraitenbergVehicleByLisaPinalsLab 5 Braitenberg Vehicle By Lisa Pinals
Blue cohort
Summary The purpose of this lab was to create a program that made the robot act like a Braitenberg Vehicle. This program must use two photo sensors to either be photophilic and find the light or photophobic and run from the light. The two different modes should be user accessible using the Cr8's buttons. In the photophilic mode, the Cr8 must locate the light, go to it, and stop when it gets there. The Cr8 must also be able to locate the light without being in the direct line of sight from the light source. This requires some sort of search pattern. In the photophobic mode, the Cr8 must locate the darkest part of the room, go to it, and stop when it gets there.
Debugging Tools Debugging tools also had to be used throughout this program. I incorporated many different LED indicators so I could know which part of the program the Cr8 was having trouble with. Also I incorporated more beeps than are currently in the code. When I finished debugging certain areas of code, I took out beeps to decrease the annoyance level of the robot. In addition to LEDs and beeps, I also used the cricket display as a debugging tool for the external sensors. To learn the values of the photoresistor sensors at the light and in darkness, I wrote a mini program that every few seconds gives back a sensor reading. This was a very useful tool in learning raw data values as well as discovering the difference in measurements between my two photo sensors. This mini program is commented out at the beginning of my lab 5 code. Also, within my lab 5 code, I used the cricket display. When the robot is turning in it's small circle to find where the most light is coming from, the cricket display is showing the highest value. If at a point in the rotation the Cr8 senses more light, this value on the cricket display will be replaced by the higher value. This lets the user know where the Cr8 sensed the most light. Through these debugging tools, I was able to complete lab 5 relatively painlessly and effectively.
Conclusions My Braitenberg vehicle was very successful! The photophilic mode is started by pressing the play button. This was demoed to work even when not in the direct line of sight of the light source and also very far from the light source. The Cr8 does a small circle and finds the place where the most light is coming from. Then, the Cr8 goes back to this spot in the rotation and switches to a more Braitenberg like mode. If the right sensor detects more light than the left sensor, it turns slightly right and vice versa. Once at the light, the Cr8 stops. The photophobic mode works in a similar way. However, when the Cr8 does it's small circle in the photophobic mode, it is looking for the least amount of light. It then goes to the spot with the least light, and similar to the photophilic mode, the Cr8 switches into a more Braitenberg like mode. Then if the right sensor detects less light than the left sensor, it turns slightly right and vice versa. Once at darkness, the Cr8 will stop. This program is safe throughout and can deal with crashing into obstacles. When the Cr8 crashes in either mode, it turns away from the bump sensor that was activated and continues to search for light or darkness depending on the mode. This is very effective in a realistic situation where the Cr8 will have to navigate around obstacles to get to the light.
Lessons Learned
Pictures Attach:lisapinalslab5.jpg Δ |