The first phase of the this project was building the basic rover and starting with the artificial intelligence software. In Phase 2, I have introduced a new program with an algorithm capable of detecting corners. These changes were an attempt to correct the problems that arose in Phase 1.
II.
Program 2 is essentially the skeleton of Program 1. The rover still wanders through an environment negotiating around obstacles. I feel that I want to maintain this kind of program. I am not trying to encourage the robot move to certain location. The purpose of the project is to find problems that arise and try to fix them. If I already know what I assume to be the correct path the rover should take, then I will not very well notice the problems that may arise when the rover is in a real world environment.
Corner detection can be a tricky subject, but I wanted to tackle it. There were a few different methods that I thought of to teach a robot to get out of a corner. The simplest method that I, and others who have been presented the rover, thought was when the two sensors were pressed at the same time, then it would most likely be in a corner. This, taking a straight forward approach will not work. The Basic Stamp is working on a level so small that the chance of the two sensors being pressed at exactly the same moment is inconceivable. Needless to say, I tried this, and was proven correct. What I wanted was a system in which corners would be determined easily.
While it is true that the method for detecting corners described previously could have been made to work by having a timing circuit made out of a resistor, capacitor and transistor, I was not very willing to take that approach. That would constitute memory outside of the microcontroller. There is another branch of robotics that deals with not having a microprocessor called BEAM robotics. I wanted to continue using a processor for all the memory and decision needs.
After thinking about the problem for some time, and watching Program 1, I discovered a method that proved to be useful. As the robot runs into one side of the corner, it backs up and proceeds forward only to hit the other side of the corner with the other sensor. It then repeats the process. I devised an algorithm that assigned both to the front sensors a variable, �a� and �b�. As one sensor would be set off by an object, it would add a value of 1 to the variable. Through observing the nature of the robot in a corner in Program 1, I assumed that if one sensor had hit twice, and the other once, it would be in a corner. Once determining that it was in a corner, it would branch to a subroutine to get it out of the corner, and reset the variables to 0. In the first section which contains the main conditional statements, I could also include a statement that said when one sensor tallied 2 hits, and the other 0, then it would reset the variables to 0. I quickly rewrote Program 1 to include this. I do realize that it is possible to have objects scattered in such a manner that the robot may think it is in a corner when it is really not. The chances of this happening can be decreased by increasing the number of hits necessary for it to branch to the subroutine that gets it out of a corner. As long as one variable is set 1 higher than the other in the conditional statement, corners should still be distinguishable, it will just take longer to find out.
III.
Program 2 seemed to work. It recognized corners when it was in them, then attempted to get out, just as it was intended to do. Although the rover didn't back up long enough to fully maneuver out of the corner, I am still pleased with the results. What's important was that the rover knew it was in a corner which was the main goal of this phase.
What struck me as more important than before in this phase of the experiment is that the robot should be relying more on its actual distance traveled then time spent traveling. Presently, it only has the capability to back up or perform any other move for a certain number of seconds. It would be better to work off of distance rather than time, as distance is definite and time is variable to the motion.
The front bumper still needs to be changed. It is not sensitive in the middle, and besides the fact that its design is awkward. Along with the bumper, one of the stocks that holds the bumper needs to be replaced. It is still scarred from when the robot was test with a large motor.
These problems will form the basis of what Phase 3 will revolve around. An attempt will be made to give the robot an idea of distance. Among other things, I will try to correct the problem with the sensitivity of the bumpers.