|
Explore TEAMS!
|
Student /
BraitenburgHohrath
I have the delight of announcing that i have finished lab 5: Braigtenburg! The objective of this lab was to have the robot start on one side of a room, traverse a few obstacles, and find a light located on the other side. With this lab, we were required to have external light sensors. I had 3. Also, we were required to use differential control. I did. The robot was to start in a small opening, go into the middle of the room, and hopefully find the light from there based on the additional light got from the bulb. My robot accomplished this task with substantial vigor.
Basically my code initiallizes by waiting for the play button to be pressed (flashing play while waiting.) When play is pressed it goes spinning 360 degrees and finding 10 light values. Then it averages these values to come up with an average light value for the room. Then, it turns another 360 degrees, searching for the highest light value, and marking it with an angle. It then turns back to this angle and stops. Then, it compares the high light value it got with the room light value. If the high light value is not 150 plus the room light, it goes foward a random ammount of mm, between 1000 and 2200. If a bumper is pressed while moving, it rotates a random ammount of degrees in the opposite direction, between 15 and 90. Then it resets the distance and goes foward 1000-2200 mm. After going the distance unheaded, it rotates 360 again, looking for the highest light value. It then pits the new high value against the average light. In either case, if the high light value is higher than 150 above the average light, it uses the braitenburg principle to drive to the light(the senser light value of the opposite side drives each wheel. When it hits an object in the braitenburg mode, it checks the middle light sensor. this light sensor is different however, the higher the light the lower the light value. So if the light value is under 175,(bright) then the robot has found the light. If this light is over 175, then it rotates 90 degrees, goes foward 200 mm, then turns 360 degrees again, finding the highest light value. Inevitably, this light value is going to set the robot in differential controll mode again, and most likely will find the light.
there is also another mode on this robot. If you press the advanced button to begin with, the robot will show a yellow light and will flash the play button. Pressing the play will activate the photophobic mode of the robot. It will spin 360 degrees, looking for the lowest light value. It will then rotate to where it found this value. Then, it will drive foward until it hits a bumper. This will usually lead it into a corner or crevice with a low light value.
this code integrates the safety features of the robot well. If at any point, the wheel drop sensors or cliff sensors are activated, the robot will flash a red light, beep, and wait for the play button to be pressed. When the play is pressed, it will bypass all the loops and restart to the beginning.
Through many frustrating days and many trials and debugging i was able to demo this program on friday, the 11 of january. My robot basically did everything in my code to a dot. It successfully found the light in about 8 minutes on the first try, without randomness. When i added randomness, it found the light in about 2 minutes. My robot had some trouble, however, getting stuck in places surrounded by white surfaces. It would head into these surfaces and continue to get stuck. Eventually, however, with randomness, i was able to find open area. Once i find an open area where the lightbulb is visible, my robot can easily locate the light. My robot was infinantly more complex than straight up braitenburg. However, i was dismayed to find that straight up braigtenburg actually found the light faster than my code. I will justify my efforts by saying that i learned alot about coding and debugging in my stuggles.
|