INTRODUCTION:
The goal of the project is to create a robot that will follow a black line on a white sheet of paper and solve a maze created out of those materials. The project also included a list of specifications that were to be followed. These specifications are: • The maze will have black lines, 1/4 to ¾ of an inch in width on white paper • The maze will be no larger than 10x10 feet. • All paths meet at 90 degree angles • Dead ends and loops possible • Robot must fit in a 6x6 inch square • Must be able to operate without a power cord • Designed to finish a maze in the fastest possible time.
PROJECT DESCRIPTION:
Choose PIC18F2525 because it has multiple CCPs to allow for multiple pulse width modulators, it has __ analog inputs in case they were needed, it is compatible with the compiler software on our computer, didn’t care about a very fast clock speed…
Chose H-driver because it supplies the motors with enough current to run and we have used the H-driver in class before.
Chose regulator because it has a heat sink, so won’t burn up easily, outputs 5 volts with 1A max current.
Motor package, PCB board, and motor chassis were all from the same company and work together.
Used analog sensors because they can be used as digital sensors and require less code to implement. The sensors used include the emitter and the receiver as one part (didn’t have to worry about the emitter and receiver working together).
THEORY OF OPERATION OF DESIGN:
A switch is used to turn the robot on or off. When it is on it is connected to a power supply of 4 AA batteries with 1.5 volts each for a total of 6 volts, this is considered the unregulated power. Unregulated power goes to a 5 volt regulator. Regulated power runs to the PIC, the H driver, the RJ11, and the 4 sensors. Unregulated power runs to the H driver as well.
The robot decides its direction based off of the outputs of the four sensors. The robot has 4 different states, and they are: Forward, Left, Right, and Turn Around. The state priority is in this order: Left, Forward, Right, and, lastly, Turn Around. The four sensors are placed close together at the front of the robot. Each sensor has a corresponding LED that lights up when the sensor is high. The left and right sensors are slightly farther back then the front two sensors and the front sensors are centered and side by side. The robot enters the Left state whenever the left sensor goes high until the front two sensors go high. When the two center sensors are high and the left sensor is low, the robot enters the Forward state. If neither of the previous conditions are true and the right sensor is high, then the robot enters the Right state until the front two sensors go high. If none of the sensors are high, then the robot enters the Turn Around state where it does a 180o right turn in place.
With the 4 previously mentioned states our robot is able to make turns, turn around from dead ends, correct itself on straight lines, and create random turns that ignore the left turn priority. The robot is able to do the second 2 mentioned abilities because of the positioning of the sensors. By having the left and right sensors extremely close to the front sensors, the robot is able to make very small left and right turns to keep itself on a straight line. The robot is able to randomly ignore state priority because of while loops used in the code. For example, the motor is coming to a 3 way intersection with left and straight directions in front of it. Under normal priority the robot should turn left at the intersection. When the robot approaches the intersection it may be caught in the Right state in order to correct itself on the straight line. The robot exits the Right state once the front 2 sensors have gone high, so there is a possibility that the robot is in the Right state as it enters the intersection. If this is true, the left sensor will be ignored until the front sensors go high and the robot will go through the intersection straight because the left option was ignored.
By being able to stay on the lines of the maze, follow turns, turnaround, and provide occasional random turn priority, the robot should be able to find its way through any maze eventually even if there are loops within the maze.
CONFUSIONS AND LESSONS LEARNED:
Overall, the final design worked as intended. However, several different versions of our wiring diagram were created before we had a working robot. This created some setbacks during the construction phase, however any problems that arose during this time were quickly found due to our methodical checking of the circuit being built at the time for any shorts or wrong connections.
Throughout the duration of this project we gained experience in building circuits that worked with each other to create a final outcome, and along the way we learned a few valuable lessons. Checking solder connections meticulously pays off and will save a lot of time in future work, and checking that everything works as intended on a system-by-system basis will further help with the overall construction of any soldering project. Once a system is checked for physical connections, the programming interface must be tested as well. We wrote a lot of very short programs to test each module for individual functionality before interfacing it with another section of the design, as its easier to debug one small section rather than one very large section consisting of several subsections.
In addition to checking for proper connections, ohmmeters are the quintessential debugging tool for a circuit physically as well as logically for code, and one should be kept nearby at all times. These two lessons saved a lot of time when creating the final version of our design, without running constant checks on our circuit with an ohmmeter we would not have been able to assemble our robot as quickly as we did.
The other important lesson learned came from the design of our circuit: DC power is a valuable asset when debugging a circuit, especially if the final design is battery powered. DC power allows the user to constantly run new tests without worrying about draining batteries and having to replace them constantly. DC power may draw more current, but in the end, if the circuit can handle the DC power it will be able to run on batteries.
FUTURE WORK:
If more time was given for the project, our final wiring diagram would be modified to accommodate a DC power rail and a battery power rail using a three-way switch. This would cut down on the total amount of current drawn when running the robot off of batteries. Another addition to the final design would be to create a more aesthetic looking enclosure for our robot and possibly creating a surface mount PCB to minimize noise from wires and increase the overall cleanliness of our circuit.
SCHEMATICS:
BLOCK DIAGRAM