I.
Phase 3 was mainly a period of time in which the robot was given the means to acquire a sense of distance and at the same time, fix some of the mechanical problems that can easily be worked into the scheme of events. The bumpers were the first priority to be worked on. I then moved on into the realm of distance detection.
II.
The rover's bumpers had needed to be corrected since the first phase. It had been put on hold until the time arrived at which other metal parts were to be constructed. Knowing that I was going to do some of that in this phase, I proceeded to correct the bumpers.
The main problem concerning the bumpers was that they were constructed in haste near the end of Phase 1. Typical "L" stock, size .5' x .75' x .0625' had been used. The "L" bend gave the stock rigidness. This would hinder its flexing and ability to contact the sensor upon impact. Furthermore, the inner bumper that was located in the back of the robot was severely bent in a wreck during the motor trials during Phase 1. Although the back bumper has not been incorporated into any programs so far, it eventually will be, and the crookedness of the piece would hinder a smooth action of the outer moving bumper. Perhaps the most defining reason that the bumpers needed to be replaced was due to the fact that they had been hasty constructed. The holes which mount and permit the bumpers to move were drilled separately with a hand drill. Also the inner and outer bumpers were not placed together as they were drilled. This, adding to the inaccuracy of the hand drill, made the holes off center. This, like the other problems, decreased the ability of the bumpers to function smoothly.
In correcting this problem, I wanted to make everything that I found wrong, and make it right. Starting with material, I still used the "L" stock. The only difference was that the .5" perpendicular extension was ripped off on a bandsaw. Essentially, it was then a flat stock size, .75" x .0625". The piece was flexible and had a natural spring tendency to it. The inner back bumper was also replaced with identical "L" shaped 1" x 1" x .0625" stock. Moving on to the drilling process, I made a new inner front bumper that was needed in order to correspond with the new holes that were to be drilled. The original holes that are used to bolt the inner bumpers to the chassis were drilled using the old stock as guides because they were correct in this area. I marked the location of the new holes that were to be drilled to mount the outer bumper. This time a punch was used to start a indention for the drill bit to follow. The inner bumper was clamped to the outer bumper, and the hole was drilled twice, first with a small bit to ensure the accuracy of the larger bit that was to follow. Next they were bolted on to the robot, and the sensors were reattached.
III.
To test the new bumpers, I simply ran Program 2. They seem to be much more sensitive along the edge. Also, it is now possible to set a closer between the bumper and the sensor. One problem remains that has yet to be fixed. The bumpers are still insensitive in the middle. This could stem from the fact that a nut was placed on the inside of the bumper, causing the springs in the middle to tighten and resist more tightening. If that is the case, then shortening the springs will be a quick solution to a long sought question.
IV.
After attempting to correct the bumpers, I had all the materials ready to construct a device for determining distance. There are many such devices that can be used. Ultrasound is one such method. Here, sound waves are put out by a small speaker, and then received. The time it takes for the emitted sound to leave the speaker and then be picked up by the microphone is halved and then multiplied by the speed of sound. This product gives the distance and is easily within the realm of a microprocessor. It does however require the use of much circuitry, in order to produce and receive only a certain frequency. The alternative method that I chose goes along with having sensors that are touch activated. An encoder disk, which is essentially a thin wafer with holes in it, a light source, and a light detector is a much easier method of determining distance.
In the encoder disk system, the disk is mounted on the axle so that it turns at the same r.p.m. as does the wheel. On one side of the disk, there is a light source such as an light emitting diode. On the other side, a light sensor such as a photo resistor or phototransistor reside. As noted previously, the disk has holes in it. As it rotates with the axle, the holes allow light to pass through. This opens the door to many possibilities. A microprocessor is essentially an adding machine. What job would be better suited to it than counting how many times the light is turned on. If there were five holes in a disk, when the processor counts five times that the light has reached the light detector, it is logical to assume that the wheel on the axle has rotated one time. Off course, the more holes that are placed on the encoder disk, the more accurate it will be.
The first task, after deciding on this system, was to explore the many different locations to mount the stock that would hold the light source and the light detector. This involved many variables. The size of the wheel was one such variable. The encoder disk could not be any larger than the diameter of the wheel if it is to spin on the axle as though it were a wheel. This meant that the light source and detector would have to be located somewhere inside the imaginary cylinder that spanned from the circumference of one wheel to that of the wheel on the other side. Realizing that this was going to be difficult, I decided to make it easier by creating a movable motor mount. Two flat pieces of 1" x.125" aluminum, one mounted to the gearbox and the other loosely bolted to it put on top of the chassis, were all that was needed. By loosening it, the gearbox, which holds the axle, could be moved forward or backward, and by tightening it, essentially, it was being clamped in place.
This meant that the light detector and source could be located at any arbitrary point, as long as it was close. With this in mind, I made two identical pieces from "L" stock .5" x .5" x .0625". Preliminary holes were drilled for the detector and source so that they would match up later when the components were installed.
Next, mounting these new pieces became an issue. It was quickly solved by realizing that by mounting only one piece vertically through the chassis, and the other piece to the first piece horizontally, I would be left with a apparatus that was capable of being adjusted in future.
With this done, it was then time to mount the senors. I had a choice of using a phototransistor or a photo resistor. Because I had a photo resistor, and was fairly knowledgeable on how to incorporate it into a logic circuit, I chose to use it. A small piece of aluminum was glued using titanium epoxy to the "L" stock responsible for holding the photo resistor. Then the component itself was glued in place using CA. On the other side, two small extra pieces were glued on the "L" stock with epoxy, and drilled through so that it provided a place to mount a LED with a press fit.
With the two necessary components in place, I decided to build the circuit. After trying different base controlled transistor setups, I arrived at one that worked. The base would be grounded by means of a potentiometer to provide a variable for different light intensities. The photocell would also run into the base while in series with another resistor, which brings it up to a "critical" level. When the photocell is not allowing the maximum current to flow, the base of the transistor shorts to the ground. However when the photocell does allow ample current the transistor opens the flow of current from it's collector to emitter. A diode attached to the emitter acts as the first "brake" in the circuit. If current cannot rise above this level (when it is not supposed to), current will cease to flow out of the transistor. If the current makes it pass the diode, there is one last more diode, an LED that makes the final connection to the Basic Stamp. The LED serves as visual confirmation that the system is working, and as an indicator of how the potentiometer should be set. Furthermore, a resistor completes the grounding circuit of the Basic Stamp when current is not flowing.
Once the circuit was built, I decided to make a optical encoder. On a CAD program, I drew a sheet of different size disks, with different size holes, and different number of holes. The disks were colored black so that light would not pass through them and were printed with the best possible quality to ensure the maximum amount of ink. They were also printed to scale, and I was able to choose which one I wanted to use. I settled with a disk with four holes, slightly smaller than the size of the wheel. I cut out two of them, and using double sided tape, adhered them together with the black side facing outward. They were then glued to a .125� inside diameter wheel collar which is adjustable, and them but on the axle.
V.
The first test of the system was a simple test of the circuitry. A program was written that when the Basic Stamp received a low logic state, from when light wouldn�t shine on the photocell, the wheels would spin in the opposite direction from when the Stamp�s pin was in a high state. This left the program with only two conditional statements. The test of the circuitry proved to be successful, as the wheels changed direction as predicted.
The next test came in making the processor count the number of times that the photocell is in a high state. Another program was written to accomplish this. In it, I introduced the variable "a" and declared at the beginning that a=1. As the program runs, the axle is spinning in one continuous direction. A conditional statement governs that when the input of the Basic Stamp equals 1, or in other words, the high state, it branches to a subroutine. At the subroutine, I had the stamp output information to the computer monitor while at the same time declare that a=a+1. This simple equation serves as the backbone of the counter. After 1 has been added to "a", another conditional statement monitors once again the state of the input. If the input is high, it branches to a subroutine, where it is pause and checks the state again to be sent into the same loop. When the Basic Stamp is receiving a low input from the input, it returns to the first condition with "a" equaling 2. I also included in the program a condition that said that when a=25, it is to stop the the motors.
After writing the program, it became time to run it. It proved to be simple and efficient for determining if the encoder worked. As it turned out, the computer monitor displayed numbers 1 through 25 then stopped along with the wheel.
It may seem curious as to why there is a conditional statement that branches to a subroutine to pause and another conditional statement. This is because the Stamp, as long as the input is high, will continue on its course without pausing for change. On the computer monitor, it can be seen as a continuous stream of 1's then 2's then 3's and so forth. The conditions and pause give the disk time to rotate far enough so that the next time it monitors an input, it will allow the low state. Essentially, this problem arises because the Basic Stamp's clock is running at a far greater speed than the periods of holes on the encoder disk are being read allowing for more cycling on the high states.

  • Back to Robot Main

    E-mail Douglas Isenberg here! 1

    Hosted by www.Geocities.ws