Sunday, May 10, 2015

Sciborg Line Following

For the last project with the Sciborg, Paige and I needed to get our Sciborg to follow a line of white tape on a piece of darker wood. We used a light sensor to tell the difference between the light tape and the dark wood. We ran into many difficulties along the way.

Bang Bang Control
For the first part of the project, we needed to use bang bang control to make the Sciborg follow the sensor. We started by trying to make the light sensor read the the middle of the tape. However, this only allowed the Sciborg to turn in one direction and would result in the Sciborg moving in circles when it got to turn instead of following the line. After talking with a fellow student, however, we learned that the Sciborg should follow the edge of the line instead. This way, the Sciborg could turn right when it read a very light reading or left when it read a dark reading. This allowed for more control of the Sciborg.



Proportional Control
Our second objective was to get the Sciborg to follow the line using proportional control. Our sciborg can be a bit finicky and won't move at a certain range of power. Because of this, we need to add extra lines of code to make sure the Sciborg doesn't hit that range. The next problem we ran into was the speed of the Sciborg. When we first made the code, the Sciborg would move faster than it could read the light. This would cause the Sciborg to spin wildly instead of following the line. However, after changing the gain and limits, the Sciborg followed the line.





Reflection
Making the code in arduino was very aggravating because it took a long time to make the code work like it should. However, it was rewarding once the code actually worked. Overall, I liked working with arduinos and I feel that I know the language pretty well now. 


No comments:

Post a Comment