Our ME461 final project drew inspiration from the cold weather and snow that (usually) begins around this time. The robot car is a line following car that has the capabilities to follow two different colored lines. At the start, the car will follow the orange track (can be thought of as a road). As soon as it senses a 'snowball' (ball of paper) the car will begin to look for the green lines instead. This can be thought of as the snowplow pushing the snow off to the side of the road out of the way. Once the robot car has pushed the snowplow behind the barrier, it will stop, reverse, and then go back to searching for and following the orange path.
To follow the lines, the car uses a webcam and image color threshold analysis that can differentiate and switch between colors as well as track the center of the lane so that the car can stay in the path. In order to sense when the snowball is in the in the plow, there is ultrasonic sensor attached to the top of the plow that will detect when there is an object closer to it.
To program the robot car with the myRio board, the main program that was used was LabView. LabvView allowed us to gather an image from the web camera and then process the data from the image and create color thresholds which filter out all the other colors except the one we want the car to follow at that moment. To do image analysis, the HSV spectrum was used and the values for hue, saturation, and value were edited to match each color.
The task of following the line and moving throughout the course incorporated knowledge and code from our previous laboratory assignments. The Texas Instruments Launchpad F28379D was used for motor control of the robot. In order to always stay centered in the lane, we measured what the center reading was when we manually placed the car in the center of the lane, then continuously calculated the center offset error using the current value and our known center. This value was then multiplied by a small Kp gain and that product was equal to the turn value. This meant that the car would always automatically shift itself to be in the center of the lane by a continuous series of tiny adjustments. When the car switches to search and follow the green line, a GPIO Digital Out pin was switched low (0) and this data was sent back into LabView. This data was stored in a 'color_variable' which would then change which color the car searched for (orange was 1 and green was 0). When the car was done pushing the snowball behind the barrier, it would reverse back and then the GPIO Digital Out pin was switched high so the car would again start searching for the orange lines.
A video of the car moving through the track as well as an explanation of where each sensor was connected is included below. A big thanks to Dan Block and Siyuan Chen for their help throughout the project. Thanks for a great semester!
Comments
Please log in or sign up to comment.