![]() |
||||
Measuring RPM via Photo reflector
Computer
Interface
|
Tone Decoder Circuit In order to obtain a 5% reduction in time, the robot is capable of detecting a 3.5kHz tone to begin its trials. The project designers hope that such bonuses may help the robot to be more competitive during competition. The tone decoder circuit is presented in Figure 6. The circuit is based around two integrated circuits: An LM385 audio amplifier and the LM567 tone decoder IC. The LM385 is used to amplify the weak signal picked up by the condenser microphone, and the LM567 is used to filter the signal and provide a logic low when the signal is present. An audio signal is picked up by a small condenser microphone and fed to the input of the audio amplifier. The LM385 is useful in that it requires only a single positive supply voltage, unlike most similar amplifiers. This reduces the need for an additional power supply -- a serious consideration for a small robot. The LM385 is designed to give a typical gain of 20, but the use of feedback may increase the gain to more than 100. The potentiometer between the output pin and the negative input pin supplies this feedback and allows the circuit to be adjusted. After the audio signal is amplified, it passes through a filter capacitor (C4) and into the input pin of the LM567. The LM567 is precisely designed for the decoding of tones. The frequency of an internal local oscillator is set by a timing resistor Rt on pin 5 and a timing capacitor on pin 6. This operating frequency of the LM567 is approximately equal to this local oscillator frequency. As the part's data sheet states, the frequency can be obtained by choosing Rt and Ct such that Frequency = 1 / (1.1 * Rt * Ct), or The advisors for this project indicated that the 68HC12 microcontroller by Motorola is to be used as the robot "brains". The 68HC12 is a 16-bit microcontroller with several useful features relevant to this project, including 8MHz clock speed Program code to control the robot is written in the 68HC12's native assembly language. Another nice feature is that 68HC11 code can be compiled and executed on the 68HC12. See Appendix C for a listing of the current source code. Algorithms for Robot Control Because the floorplan is fixed and the placement of the candle can be considered random, the robot can be programmed to traverse the house in a specific room order. The entire program operation is straightforward: Wait for the tone, then proceed to first room, if candle is present, locate and extinguish it, otherwise proceed to the next room. Once the candle has been successfully extinguished, the robot will return to the starting location for a bonus reduction in time. Figure 7 shows a program flowchart for this operation.
In order for the robot to accomplish the above tasks, it must first navigate through the hallways in order to find a room. Ideally, the robot must be able to find its way into a given room from any location in the house. Figure 8 demonstrates how this is to be accomplished. Simply put, the robot is able to follow a given wall by comparing sensor readings with the calibration readings. If the robot determines that it is too close to the specified wall, it sets the motor directions and turns away from the wall. Similarly, if the robot is too far from a wall, it will set the motor directions and turn toward the wall. Although this may seem like a poor control method, the small steps of the stepper motors provide a seemingly fluid robot movement. A relatively simple means of navigating the entire house, then, is to simply follow a given wall until a room has been entered. As mentioned before, this condition can be detected when the floor sensor picks up the white line marking the room doorway.
|
|||