Application Analysis of Ultrasonic Sensor in the Mobile Robot Distance System
Publish Time: 2020-04-28 Origin: Site
I. Introduction
In the process of real-time obstacle avoidance and path planning for autonomous mobile robots, the robot must rely on the acquisition of external environmental information, sense the presence of obstacles, and measure the distance of obstacles. At present, robot obstacle avoidance and ranging sensors include infrared, ultrasonic, laser and visual sensors. Laser sensors and visual sensors are expensive and require high requirements for controllers. Therefore, infrared and ultrasonic level transducers are mostly used in mobile robot systems.
Most systems use a single sensor for information collection, but because of the problem of measuring blind spots, the range of ultrasonic sensors is generally between 30 and 300 cm; while the detection distance of infrared distance sensors is short, generally within tens of centimeters. To a certain extent, it can make up for the shortcomings of ultrasonic sensors that cannot be measured at close range. Therefore, this system uses multiple infrared and ultrasonic sensors to measure and collect distance information.
2. Ranging principle and method
(1) Ultrasonic sensor
Ultrasound refers to sound waves with a resonance frequency higher than 20Hz. The higher the frequency, the stronger the reflection ability. Ultrasonic sensors are inexpensive, and their performance is hardly affected by light, dust, smoke, electromagnetic interference, and metal, wood, concrete, glass, rubber, and paper can reflect nearly 100% of ultrasonic waves, so they can be used to detect objects .
The method of ultrasonic distance measurement is the echo detection method. The transmitting transducer continuously emits sound pulses. After the sound wave encounters the obstacle, it is reflected back and received by the receiving transducer. The distance of the obstacle is calculated according to the speed of sound and time difference. The relationship between distance and speed of sound and time is expressed.
(2) Methods to improve the accuracy of ultrasonic ranging transducer
1. Use the appropriate frequency and wavelength: using high power ultrasonic transducer to measure the distance, the frequency is too low; the external noise interference is more; the frequency is too high, and the attenuation is large during the propagation process. In addition, the ultrasonic sensor is prone to generate blind spots during the measurement process, and the receiving end is prone to receive leaky waves. To improve this shortcoming, it is necessary to reduce the length of the transmitted wave string and increase the frequency of the transmitted wave. However, if the length of the transmitted wave string is too short, the transmitting transducer cannot be excited or the excited vibration does not reach the maximum value; if the frequency of the transmitted wave is too high, the attenuation is large, and the working distance decreases. Tests have shown that using 40 kHz ultrasonic waves to transmit the pulse group contains 10-20 pulses and has good propagation performance.
2. Improving the timing accuracy of the system can also improve the accuracy of ultrasonic distance transducer. The higher the counting frequency of the timer, the smaller the ranging error due to the quantization error of time.
3. Compensating the time delay of the system circuit can reduce the ranging error and improve the ranging accuracy. In the formula, △ t is the delay time, s; s1, s2 are two known measurement distances, m; t1, t2 are the corresponding measurement time, s.
(3) Infrared obstacle avoidance sensor
Infrared is an electromagnetic wave between visible light and microwave. Therefore, it not only has the characteristics of visible light linear propagation, reflection, refraction, etc., but also has certain characteristics of microwaves, such as strong penetration and ability to penetrate certain opaque Matter etc. The infrared sensor includes an infrared emitting device and an infrared receiving device. All objects in nature will radiate infrared radiation as long as the temperature is above absolute zero. Therefore, infrared sensors must have stronger transmitting and receiving capabilities.
The basic principle of the infrared ultrasonic sensor's ranging is that the light-emitting tube emits infrared light, and the light-sensitive receiving tube receives the reflected light of the object in front of it, and then judges whether there is an obstacle in front of it. The distance of the object can be judged according to the intensity of the emitted light. Its principle is that the intensity of the light received by the receiving tube varies with the distance of the reflecting object. The reflected light intensity is close to the distance, and the reflected light intensity is far away.
At present, an infrared photoelectric switch, which is one of the most used sensors, has a transmission frequency of about 38 kHz and a relatively short detection distance. It is usually used for the recognition of short-distance obstacles. This system uses this kind of sensor.
(4) Defects of infrared distance measurement
Affected by the characteristics of the device, the general infrared photoelectric switch has poor anti-interference and is greatly affected by ambient light; and the color of the detected object and the smoothness of the surface are different, and the intensity of the reflected infrared light will be different.
Third, the hardware system structure
(1) System composition
The distance measuring system is composed of single-chip microcomputer, ultrasonic transmitting and receiving circuit, infrared transmitting and receiving circuit, digital display circuit and serial communication circuit.The control core is Lingyang 16-bit microcontroller SPCE061 A. There are 2 16-bit programmable timers / timers, 14 interrupt sources, 32-bit universal programmable input / output channels, and 7-channel 10-bit A / D on the chip. converter.
(2) Ultrasonic sensor circuit
The I / O9-I / O11 port of Lingyang MCU is connected to the three-way ultrasonic transmitting circuit, and the I / O3-I / O5 is connected to the three-way ultrasonic receiving circuit. The 40 kHz signal transducer generated by the single-chip microcomputer is output by the I / O, and is boosted by the booster amplifier circuit composed of the inverter 4049B. Finally, it is transmitted by the ultrasonic transmitting transducer UCM40T; the sound wave returns to the obstacle and is received by the receiving transducer UCM40R, The signal is amplified by a two-stage amplifier circuit composed of OP07, frequency-selected by a phase-locked loop audio decoder LM567, filtering out interference signals, and finally, inputting into a single-chip microcomputer through an I / O port. The single chip microcomputer calculates the distance of the obstacle through the transmission time of the sound wave.
(3) Infrared sensor circuit
The I / O0 ~ I / O6 of Lingyang MCU can be used as a 10-bit A / D converter. In this system, the I / O0 ~ I / O2 ports of Lingyang MCU are used as A / D converters. I / O6 ~ I / O8 are connected to three infrared transmitter circuits, and I / O0 ~ I / O2 are connected to three infrared receivers with circuit. When the I / O port of the single-chip microcomputer outputs a high level, it conducts with the infrared luminescent tube TLN205 and emits infrared light; the light wave is reflected after encountering an obstacle and received by the infrared receiving tube TPS708, which generates a current corresponding to the light intensity. After the two-stage amplifying circuit composed is amplified, it outputs an analog voltage of 0 ~ 3V, which is input to the single-chip microcomputer through the A / D port. The single chip microcomputer calculates and judges the distance of the obstacle through the magnitude of the voltage.
4. Software Design
The single-chip computer SPCE061 A selects the system frequency fosc = 20.480MHz, the CPU clock frequency (CPUCLK) is fosc / 2 = 10. 24 MHz, the clock source selects the frequency 32768 Hz, the clock source selects the frequency 1Hz, and the SPCE061A provides 216 Bit timing / counter: TimerA and TImerB. The clock source of TImerA is formed by the operations of clock source A and clock source B; the clock source of TImerB is only clock source A.
The 40 kHz ultrasonic pulse is a square wave with high and low levels each occupying 12.5 μs. The CPU clock count is delayed by 123 instruction cycles, which is 12.5 μs. The single-chip computer can generate a pulse signal of 40 kHz by continuously generating high and low levels of 12.5 μs. A pulse group of 20 pulses is emitted every time for 0.5 ms, and the pulse emission and the interval time are at least 20 ms, which is output from the I / O port. . The system selects timer A as a timer interrupt of 20 ms and timer B as an ultrasonic counter. Because the ultrasonic sensor has a dead zone measurement , in the program design, the distance measurement of more than 30 cm is completed by the ultrasonic sensor, and the infrared sensor is completed within 30 cm.
In the infrared ranging process, the timer A is used to generate a 0.1S interrupt for A / D sampling, and the voltage value is converted into distance information. In the main program, first, enter the infrared detection subroutine. If an obstacle is detected, enter the data transmission, display and motion control subroutine; if no obstacle is detected, entering the ultrasonic detection subroutine. Ultrasound detects obstacles, then enters the data transmission, display and motion control subroutines. If no obstacles are detected, infrared detection is performed cyclically infrared and ultrasonic detection subroutines, respectively.
V. Measurement results
During the test, obstacles of the same size, texture and color are used for measurement. Tests show that the system's ranging accuracy is within 1% from 0 to 200 cm, which can accurately measure the distance of obstacles. The distance measurement within 30 cm is done by infrared sensors, and the distance measurement between 30 and 200 cm is done by ultrasonic sensors.
6. Conclusion
This paper studies a low-cost, low-power, high-performance mobile robot side-distance system, a multi-sensor system using ultrasonic and infrared sensors, which effectively solves the problem of measuring blind spots in a single sensor ranging system; The three sensor groups are assembled at three different positions of the robot, so that the robot can complete the ranging tasks in three different directions.