当前位置:文档之家› High precision Ranging System高精度超声波测距系统

High precision Ranging System高精度超声波测距系统

High-precision Ultrasonic Ranging SystemZhang Ping, Guo HuiSchool of Mechatronics Engineering, University of Electronic Science and Technology of ChinaChengdu, 611731, ChinaEmail: zhangping3344521@Abstra ct – The ultrasound is easy to transmit and has good reflection. Its speed is far less than the speed of flight. So this paper designs an ultrasonic ranging system based on STC89C52RC. This system can be effective in the range of about 372 cm. After repeated test, the measurement error can be less than 1 cm. So this system can be applied to intelligent avoidance and vehicle transportation and other systems.Keywords – SCM; ultrasound; send; receive; ranging, temperature compensation.I.INTRODUCTIONAt present, the main methods of ultrasonic ranging include pulse-echo method, phase modulation, frequency modulation and FFT-based approach. In these methods, the pulse-echo method has good adaptability; this method not only can be used for manual testing, but also combined with the automated systems. So it is most widely used at home and aboard.Nowadays, the theori e s of microwave and laser ranging have been applied to the ultrasonic ranging system. It can be a very good research. On the other hand, the filtering and analysis of the echo can also draw more and more attention of many experts and scholars. With the enhanced understanding of the ultrasonic theory, we know how to improve the precision and the anti-jamming capabilities will be the most the important performance indicators.In this paper, the pulse-echo theory is used to design the entire system. The following content is mainly divided into three parts. The first section describes the hardware architecture of the system. The second part describes the software processing of the system. The third section describes the techniques of data processing. In such a case, the reader can have a comprehensive understanding of the system.II.THE PRINCIPLE OF ULTRASONIC RANGINGSYSTEMConsidering the requirement of the actual project, we choose the ultrasound, the frequency of which is 40 kHz. Ultrasonic sensor is this kind device which can converse the sound and the electrical power, also known as ultrasonic transducer or ultrasonic probe. In certain frequency range, it can convert the electrical signal to the external ultrasonic signal or change the external ultrasonic signal to the electrical signal. In this paper, we choose the T/R40-12 piezoelectric ultrasonic transducer. It works at the frequency of 40 kHz. Its external diameter is 12cm. Ultrasonic generator sends the ultrasonic signal at a certain time. After the ultrasonic signal reflected from the measured object, the ultrasonic receiver can receive the signal. As long as we record the time between the sending time and the receiving time, we can calculate the distance from the ultrasonic sender to the measured object. The formula for calculating the distance is:D = S/2 = V ×T /2 (1)D is the distance between the ranging device and the measured object. S is the distance which the ultrasound transports. V is the speed of the ultrasound. T is the time which the ultrasound transports. Because ultrasound is also a kind of sound wave, the speed can be affected by the temperature. So in this paper, it uses the method of temperature compensation to improve the accuracy of the system.III.HARDWARE OF THE SYSTEM The system block diagram of ultrasonic ranging system is fig. 1. The hardware mainly includes the SCM system, the display circuit, the temperature compensationcircuit and the circuit of sending and receiving ultrasound.Fig.1 The block diagram of this systemA.The circuit of sending ultrasoundThe schematic of sending ultrasound is the figure 2. The sending circuit mainly includes the inverter and the ultrasonic transducer. At first the port P1.0 of SCM is inverted, connected to one pole of the ultrasonic transducer, and then inverted again, connected to another pole of the ultrasonic transducer. By means of this push-pull method, we can improve the emission intensity of the ultrasound. Paralleling the inverter; we can increase the driving capability of outputting. The pull-up resistor R1 and R2 not only increases the driving capability of outputting the high level, but also increases the damping___________________________________ 978-1-4244-8160-6/11/$26.00 ©2011 IEEEeffect of the ultrasonic transducer and shorten the time ofits free oscillations.Fig.2 The circuit of sending ultrasoundB. The circuit of receiving ultrasoundThe schematic of receiving ultrasound is the fig. 3.ASIC CX20106 is used for detecting infrared. Considering the carrying frequency of CX20106 is 38kz which is very close to the frequency of the ultrasound, we design the receiving circuit by making use of CX20106.Fig.3 The circuit of receiving ultrasoundC. SCM system and the display circuitSCM STC89C52RC is the core of this ranging system, by using the 12MHz crystal oscillator to obtain a morestable clock frequency and reduce the errors. The port P1.0 of the SCM output the 40 KHz square wave that is required by the ultrasonic transducer. The external interrupt 0 is used to monitor the returning signal. The simple and practical four bit common anode LED is used for the display circuit. The segment code is driven by 74LS245, and the bit code is driven by the transistor 9012. It is shown in fig. 4.D. The circuit of temperature compensationIn the ultrasonic ranging system, a good many factors can affect the speed, such as the environmental interference, the frequency of the base pulse, etc. But the environmental temperature can be the main factor. According to the formula (2), we can see that the temperature varies from 0ć to 40ć, the speed of ultrasound varies from 331.4m/s to 354.85m/s. Take the room temperature 20ć as the base, the speed is 343.32m/s and the rate of change is 6.83%. So the temperature factor can not be ignored. In the summer, the temperature is often more than 40ć. So in the ultrasonic ranging system, it is necessary to have the temperature compensation in order to reduce the error. Nowadays most of the temperature monitoring system takes the method of temperature sensor. First of all, we convert the temperature signal to the electric signal, secondly amplify the electric signal, and thirdly convert the analog signal to the digital signal by the A/D converter. This kind of circuit is very complex and can be easily affected by the parameters of the components. For these reasons, this paper uses the temperature sensor DS18B20 and SCM to design this precision temperature measurement system. It can increase the accuracy of the measurement to some extent. The port DQ of the DS18B20 can directly be connected to the port P3.7 of the SCM. The circuit isshown in fig. 5.Fig.4 SCM system and the display circuitFig.5 The circuit of temperature compensationDS18B20 is the latest digital temperature sensor from America. It is different from the traditional thermistor temperature sensors. We can directly read the measured temperature values. According to the actual requirements, we can realize the 9 or 10 bit A/D conversion through simple programming. As a result, DS18B20 can make the system has a simpler structure and higher reliability.After measuring temperature, we correct the speed of the ultrasound by the following formula:V (T) = (331.05+0.607T) (m/s) (2)In the above formula, T is the Celsius temperature of the environment (ć).IV. SYSTEM PROGRAMMINGThe programming of the ultrasonic ranging system mainly include the main program, sending subroutine, receiving subroutine, temperature compensation subroutine and display subroutine. On one hand, the assembly language is efficient and easy. On the other hand, the ranging program not only need complex calculation,but also requires a highly accurate result. So we chooseassembly language to design this system. A. The main programThe main program firstly initialize the system environment, set the T0 timer for the 16-bit timer mode, Secondly set the general interrupt enable bit EA, then initialize the display port P0 and P2. After measuring the temperature value by making use of the DS18B20, the temperature compensation subroutine modifies the sound speed. At this time, it begins to call the sending subroutine. In order to avoid the direct transmission from the transmitter to the receiver, It need a delay of about 0.1ms (this is the reason for the minimum distance can be measured), then enable the external interrupt 0 to receive the return signal. As a result of using the 12MHz crystal oscillator, the timer increase one, the interval is 1us, when the main program detects that the flag is successful, it start to calculate the distance according to the timer T0, the result will be sent for LED display. Then just repeat this processing. The main program flow chart is shown in fig.6.Fig.6 The flow chart of the main programB. Sending subroutine and receiving subroutineThe sending subroutine is the role of sending about 2 ultrasonic pulses through port P1.0 (about 40kHz square wave), the pulse width is about 12us. At the same time, the timer T0 starts timing. This system makes use of the external interrupt 0 to detect the echo. Once received the echo (the pin INT0 appears a low level), it immediately access to the interrupt program, then stop the timer T0 andset the successful flag. If the echo has not been detected when the timeroverflow, the timer T0 overflow interrupt will close the external interrupt 0. At the same time, it clears the successful flag. It means that this ranging processing is unsuccessful. C. Temperature compensation subroutine and displaysubroutineAccording to the real-time temperature detected, it calculates the speed of sound by substituting the formula (2).Display program shows the distance in the way of look-up table.V. DATA PROCESSINGNot only the processing that the circuit deal with the signal will produce a fixed delay t, but also the processing that SCM collect the signal will produce a fixed delay t. Both the above process certainly lead to some measurement errors, But this system modify the delay to reduce the ranging error.Suppose that S1 and S2 are two fixed distance. t1 and t2 are corresponding to the two fixed distance respectively(including the t factor). So S1 and S2 are actually corresponding to the time t1- t and t2- t. That is S1=0.5V(t1- t),S2=0.5V(t2- t),it can be calculated:211221t S t S t S S'(3)After several measurements, we can calculate the system delay t. According to the formula (1), we can determine the distance measured. This processing can reduce the system error to some extent.VI. ACTUAL MEASUREMENT AND ANALYSIS The measurement data is shown in table 7.Table 7.The actual measurement data (unit: cm)Actual distance 5 10 15 20 25 30 35 Display distance 25 25 25 25 26 31 35 Actual distance 350 355 360365 372 380385Display distance351 356 361366 374 25 25The experimental data show that: the blind spot of theultrasonic ranging system (the least distance that the ultrasonic sensors can detect) is 25cm. The largest distance is 372cm. While designing the program, to avoid the direct transmission of the ultrasound from the transmitter to the receiver, the program has a delay about 1.4ms, so the ultrasonic ranging system has a least ranging distance. Because the propagation of the ultrasound may cause a certain decay and the transmit power is limited, it is difficult to detect the long-rang echo. So there will be a largest measurable distance. On the other side, the temperature compensation can improve the accuracy of the measurement.VII. CONCLUSIONIn this paper, it makes use of the reflection characteristics of ultrasound. We design this kind of ranging system based on STC89C52RC. Its effective range is from 25cm to 372cm by means of non-contact measurement. Once the environment temperature changes, it improves the measurement accuracy of the system bytemperature compensation circuit. After modifying the system delay, it can reduce the system latency measurement error and have a significantly improved accuracy. The results validate the rationality of the system including both the hardware and the software. This ranging system is reliable and stable. It is fully able to meet a number of high-precision occasions, such as level measurement, robot positioning, etc.ACKNOWLEDGMENTFirst of all, I thank the IEEE for providing this template, secondly I want to thank my instructor Mr. Guo, last but not least, We sincerely thank all colleagues who previously provided technical support.REFERENCES[1] WANG AI ZH. Design and reality of ultrasonic ranging systembase on the microcontroller[J]. Journal of Xinzhou Teachers University, 2010,26(2): 44-46.[2] KANG Y P, LIU ZH Y, GUO X, et al. Design of high-precisionultrasonic wave ranging system[J]. Experimental Technology and Management, 2010, 27(3): 61-64.[3] WANG ZH J, SU X Y, HAN Y P. Ultrasonic distancemeasurement system with high precision based on AT89C51 microprocessor[J]. Sensor Technology & Applocation, 2010(1): 21-24.[4] HAN L R. A survey of methods for improving ultrasonic rangingprecision[J]. Telecommunication Engineering, 2010, 50(9): 132-136.AUTHOR BIOGRAPHYZhang Ping was born in HuNan, China, in 1986.He received B.Eng. from Jishou University, China ˈin 2009 . Now he is a graduate student in Department of Mechatronics Engineering, University of Electronic Science and Technology of China. His research interests include Integrated circuit, EDA.Guo Hui received the Master degree in North China Electric Power University, the Ph.D. degree in Nanjing University of Aeronautics and Astronautics. He did his postdoctoral work in Nanjing University. His research interests are in the Mechatronics.。

相关主题