|
Explore TEAMS!
|
Student /
Lab5RichardsLightFollowingBraitenberg VehicleSummary and ProblemsMy Lab 5 Project was the Braitenberg Vehicle, which is designed to look for and and go towards a light source, using light sensors. This was the photophilic portion of Braitenberg(towards light), there is also a photophobic portion(away from light) that could be done. When I started lab 5, I thought it would be really hard because of the name Braitenbrg Vehicle sounded really complicated to me. The first thing I did was make a flowchart of what I planned on doing in my program. Then I decided that I would split my code into two separate parts then combine them later. These two parts were random driving, which I used spiraling for, and the light following. The code for spiraling was relatively easy to write, but the light following was another story. I couldn’t think of anything to do until a while later. When I finally tested out my code, I had to point my light sensors towards the inside so that make proportional control would work. The speed of the wheel depended on the opposite sensor. Most of the problems I ran into were when I first tried writing the codes. I had to rearrange my separate codes a few times before they worked. Also when I was making the spiraling code, it would only go in a small spiral then restart. Then I realized I had to add the dist_m*1000 to my spiraling code so that it would be accumulative. Lessons I learned:
Debugging:For my debugging I mainly used the cr8 display. When I did the spiraling code I saw that the spiraling restarted every time the display went back to 0, and that’s when I remembered that the dist_mm goes to 0 and the dist_m increases to 1. I also used the debugging with the light sensors, in my code I switched which sensors the display was showing with the advance button when I was trying to write the code. After playing around with that, I found out that 1 sensor always sensed less than the other, so I shortened the straw that it saw through, so that side would sense more light. This worked quite well in making them equal so it made my light following easier to finish. |