Thursday, May 7, 2015

Brightness Line Following

We used the sciborg and an ultasonic sensor to follow a white line on the dark ground. First, we used bang-bag control to follow the line. We used edge-following for the car and we wrote our code so that it would drive straight unless it sensed it was off the line, then it would turn back to the line.

Here is our code:



We had to play around with our code a bit, adjusting the delay, difference between the speeds of the wheels, and whether if turned left or right when it went off the line.



We then used proportional control to keep the sciborg on the line. Doing proportional control was hard because we didn't know how to find a gain value but we were eventually able to by creating three ranges of values, one light, one dark, and one in-between. 


We put an absolute value function around the error function to make sure the output values were always positive. 



No comments:

Post a Comment