Top Topics

74*245 Motor Driver

H-Bridge Driver

Simple PWM Gen.

Handy Method Measuring RPM

Measuring RPM via Photo reflector

Introduction to Robotic

DC, Stepper,and Servo Motor

Related Link

Microcontroller Tutorial

Computer Interface
Tutorial

.............more links

 

 

 

BACK NEXT

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
Rt * Ct = 1 / (1.1 Frequency)

For this circuit, Rt is comprised of a fixed 5k resistor and a potentiometer so that the frequency of operation can be adjusted, or the circuit can be tuned. After the circuit was constructed and tuned to a relatively low volume input signal, several measurements were recorded. These measurements show the gain of the amplifier to be approximately 60, and the bandwidth of the tone decoder to be approximately 500Hz (or 14.3% of the operating frequency).
The Motorola 68HC12 Microcontroller

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
32Kbytes of on-chip programmable Flash EEPROM
8 channels of 8 bit analog to digital conversion
8 timer channels and associated interrupts
768bytes of on-chip byte erasable EEPROM
As indicated previously, 6 channels of analog to digital conversion are being used to perform sensor readings. The improved clock speed (compared to the 68HC11 predecessor) will allow more computations per second, resulting in improved navigation control. The Flash EEPROM can allow larger and more complex programs to be written.
Unfortunately, the Flash EEPROM array on the 68HC12 chip can only be reprogrammed 100 times. This is a serious limitation when designing, testing, and debugging program code. Because of this limitation, the project designers have attempted to keep the code simple so that it can fit into the 768 bytes of byte-erasable EEPROM. The byte-erasable EEPROM is more useful in that it can be reprogrammed 10,000 times. Ideally, as reliable and stable sections of the robot control code are completed, they could be programmed into the Flash EEPROM and used at a later time. However, the default programming utility (D-Bug 12) that allows programming of the byte-erasable EEPROM resides in the Flash EEPROM. Any programming to the Flash EEPROM array will remove the important debugging utility and make code development much more difficult. Ideally, a smaller programming utility could be developed to replace D-Bug12 and coexist in Flash EEPROM with other robot functions.

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.


Figure 7: Program Flowchart Showing Overview of Robot Operations

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.


Figure 8: Flowchart Wall-Following Algorithm

BACK NEXT