Problem: To make an autonomous robot that has line-following capabilities, and goes to the spot along the line with the most light.
Solution: An eye inspired tank-drive autonomous robotic plant holder that follows a black line on the ground. The eye tank uses two motors connected to a motor shield that is programmed with a PID controller to follow a black line. The purpose is to get the plant to recieve as much sunlight as possible throughout the day.
Iteration One: The first iteration was a to have the robot be in the shape of an eye and to have threads as the wheels with two motors attached. Our first step was a base with two slits cut in the center and separate pieces that stuck into the base and held screws into place that would be attached to the tank tread wheels. When we did more research into actual tank treads, they seemed too expensive to be just a design asthetic, so we chose to use wheels with gears instead. The gears we designed had three identical large gears and two small gears. It was important to have an odd number of gears so that three wheels could be attached that would move in the same direction. When we first cut out our gears the dimensions were not perfect and therefore the gears did not mesh correctly.
Iteration Two: Our second iteration included recutting a base that instead of having many pieces that held the bolts that held the gears into place, it would have the same number of slots, but have all the gear holders connects for better stability and more precision for when we would recut the gears. When we assembled this with the gears and wheels it turned out that the lock nuts would not be able to hold the gears into place because the wheels had large holes in them. Also, the smaller gears were so small that they kept breaking and also could not be held into place well.
Iteration Three: In our third iteration we decided to make all the gears the same size and have the same sized wheels. We decided to do this because it would allow us to keep our second base in tact and only change the wheels and gears instead of the entire design. This gear and wheel design worked and is part of our final design.
Iteration Four: In our fourth iteration we designed a box that fits over the arduino, motor shield, and battery pack. We also added an C shaped piece of wood to the top of the box to prevent it from falling off the box. We also added a switch at the bottom of the base that is connected to the battery pack and turns the robot on and off. When we were testing the light values for the PID controller we realized that the initial phototransistor that we put on had too high a resistance and was only reading values from 0-5 compared to 0-1000. We replaced the phototransistor and decided to thread those wires through one of the sides of the box. For the outer shell we decided to create an eye-like structure that includes four pieces of wood that secure into place four curves ribs that all connect to a circle that will hold a plant.
Motor Shield Circuitry: A motor shield controls the two motors of our design. The reason we need a motor shield is because the adruino can only power 5V and the motors we want to run need 12V. The motor shield consists of two H-bridges. Each H-bridge contains four transistors which are basically small switches the attact and detach wires together and therefore control the electrical flow of the battery. In addition to that, the H bridge allows each motor two move both forward and in reverse. This allows the robot to turn faster.
PID Controller: The PID stands for proportional, integral, derivative. The way the controller works is that it is connected to a light sensor. The light sensor takes in light values. In our program we test what the light values are of the black line to a white piece of paper. We set a goal for what we want the light sensor to be constantly reading to the median light value of the black line and white paper. When the light sensor reads a value that isn't the target value it counts it as an error. The proportional piece takes the error value and sets that to the speed of one of the motors so that the robot turns. The integral adds all the errors up so that the speed is equivalent to that sum of errors instead of just one. This allows the controller to account for small errors. The derivative acts as a stabilizer for the motor it predicts future errors by assuming that the future error is equivalent to the previous error. The PID controller is a good controller compared to a P controller because it helps the robot be more precise and not oscillate so much.