ULTRASONIC RANGE FINDING SENSOR

ULTRASONIC RANGE FINDING SENSOR Gheorghe Lazea, Emil Lupu and Silviu Folea Technical University of Cluj-Napoca, Automation Department Bari iu 26, 3400...
Author: Thomas Merritt
4 downloads 1 Views 35KB Size
ULTRASONIC RANGE FINDING SENSOR Gheorghe Lazea, Emil Lupu and Silviu Folea Technical University of Cluj-Napoca, Automation Department Bari iu 26, 3400 Cluj-Napoca, Romania E-mail: [email protected]

Abstract During the research within the MAURO (Mobile Autonomous Robot) project (1995 – 1998) the research team from the 'Robot Control Systems' Laboratory has designed and realized an ultrasonic range finding sensor intended to be used in mobile robot navigation. The sensor has been successively improved and the design was adopted also by other research teams within the Automation Department being used for example for water level measurements. The paper presents the principle, the practical implementation and the performances of the device.

Keywords: Range finding, Sensors, PIC Microcontroller.

1. INTRODUCTION The range finding problem is an old one, and it has a big number of applications. In the last decade it has enjoyed an even greater attention from the researchers, especially related with the applications in the mobile robots navigation. Basically, the range finding sensors can be classified into two categories: I. Time of flight sensors. II. Phase-shift detection sensors. The first method is the most common technique employed, and it consists in measuring the time of flight of a pulse of emitted energy (light or acoustic) traveling to a reflecting object, than echoing back to a receiver. The formula used to compute the distance d is straightforward: (1) 2d = v τ where v is the signal speed of propagation (300 m/sec for sound) and τ is the time elapsed between emission and reception. The method uses commonly ultrasonic acoustic pulses. The use of light pulses places severe requirements on associated control and measurement circuitry: for example to obtain 1mm resolutions the timing accuracy must be around 3 picoseconds, a capability expensive and difficult to realize. The advantages of the method are simplicity and low cost, while the disadvantages are given by the errors which could arise due to sound propagation speed change with temperature and especially due to possible multiple echoes (phenomenon known as crosstalk). One of the first commercially available range finding systems using ultrasonic pulses was introduced by Polaroid in the '80s, developed for automatic camera focusing. Another company which offers a full line of ultrasonic ranging systems with maximum detection ranges from 60 to 900 cm is Massa Products Corp. The specifications for these two systems are presented in table 1 (data taken from [3]).

Table 1. – Specifications for commercially available ultrasonic ranging systems. Producer Polaroid Massa Products Model 6500 E-220B/26 Range (cm) 40-1050 61-914 Beamwidth ? 35° Frequency 49.1kHz 26kHz Resolution 1% 1cm Power 5V/100mA 8-15VDC 2. SENSOR DESIGN Due to difficulties in obtaining such a range finding device from abroad, our research team has decided to implement an 'in-house' version equipped with an intelligent processing unit. The block diagram of the system is presented in figure 1. The emitter and receiver used are MA40S respectively MA40R produced by Murata.

Figure 1. – Block diagram. The central element of the system is the PIC 16C84 microcontroller (µC) produced by Microchip. It's functions are: to fire the emitter, to compute the distance based on the time of flight technique and to transmit the result to a computer via a serial interface. This µC has been chosen due to it's low cost, small dimensions and ease of programming. The microcontroller has a RISC type architecture, with 35 14-bit wide instructions and 8-bit wide data path, running at 4MHz. It features 13 I/O pins with individual direction control and four interrupt sources. The programs are loaded in an on-circuit EEPROM type memory (data retention > 40 years), this making the applications development very comfortable [1]. The microcontroller generates a signal made up from three pulses at 40 kHz (the nominal receiver frequency), signal repeated with a 30 msec. period. This value was obtained imposing a maximum range for the sensor of 6 meters. The echo received is filtered and amplified. In one of the designed variants a controlled amplification is being used (gain increases over time) in order to compensate for the decrease in sound intensity with distance. The amplified signal is introduced in a comparison circuit for pulse shaping and than it is applied on the interrupt pin of the microcontroller (INT). This activates an interrupt routine which stops the real-time clock which holds the time elapsed from the pulse emission. Based on this value, the distance can be computed. In order to reject a possible cross-talk as well as other errors, the microcontroller is programmed to make eight measurements and to send serially the average. Because the microcontroller does not feature a dedicated serial port, the serial data transmission is done using a software routine. The program for the microcontroller has been written in assembly language in a modular way. It performs: - µC initialization - an endless loop to include the serial data transmission - two interrupt service routines:

-

the timer interrupt routine, fired every 30 msec. which commands the emission of 3 pulses and starts the real-time clock - the hardware interrupt routine, fired at echo receiving which reads the real time clock and updates the measured distance value. The system is equipped with 'reset' facility both at start-up (R1C6 circuit giving a 200 msec. time delay) and with push-button (figure 2). The oscillator uses a 4MHz

Figure 2. – Microcontroller schematic. quartz and the internal timing circuitry (pins OSC1 and OSC2). Port B is entirely free and can be used to display data on LCD's or LED's, to control actuators (stepper motors or DC motors through PWM), to command D/A converters or to read various keyboards. The emitter is built using the open-drain output buffer MMC40107 (figure 3). This circuit can sustain 136 mA at 12VDC [2]. The circuit scheme employed drives the MA40S emitter with 24V (±12V) peak to peak voltage.

Figure 3. – Emitter circuit and signal waveform. The low band filter (figure 4) is built using the A081 operational amplifier chosen for its JFET inputs and because it is internal compensated [4]. The cut-off frequency is given by R8, C11 and C12 components. The circuit ensures also a voltage amplification (gain=R7/R8=57). Figure 4. – Receiver circuit with low band filter.

The amplifier – comparator cascade is built using the A082 integrated circuit, a dual JFET operational amplifier [4]. The circuit ensures a voltage amplification of 100 (R13/R14=100) and transforms the received signal into a square wave (figure 5).

Figure 5. – Amplifier and pulse-shaping circuit. The serial transmission of the measured distance uses a SP232 circuit (see figure 6) which builds the voltage levels requested by the RS232 standard (±12V) from the +5VDC input [5].

Figure 6. – Serial data transmission driver. We have developed several variants of the range finding sensor (table 2). The distance between the emitter and the receiver has a major importance regarding the beamwidth and the minimum measurable range, while the tuning of the amplifier gain (figure 5) determines the maximum measurable range. Table 2. – Characteristics of the designed ultrasonic range finding systems. Version 1996 1998 Range (cm) 10-600 3-100 Beamwidth 35° 10° Frequency 40kHz 40kHz Resolution 1cm 0.2 cm Dimensions 17x10cm 8x5 cm Power 12VDC 12VDC

3. CONCLUSION Using the PIC 16C84 microcontroller we have designed and realized a range finding sensor with small dimensions, reliable and relatively cheap, comparable in performances with the commercial versions on the market. The I/O pins and processing time reserves still available from the microcontroller allow the further development of the system. We have already designed a sensor mounted on a rotating pan actuated by a stepper motor controlled by the same µC and we plan to integrate more emitters/receivers in a ring fired by a unique microcontroller.

The applications of the system include industrial and mobile robots guidance, and liquid level measurement in big tanks. The system can also be applied at an intelligent automobile parking control system. REFERENCES [1] MicroChip, (1995), PIC16C8X 8-bit CMOS EEPROM Microcontrollers, Microchip Technology Inc. [2] MicroElectronica, (1994) Data Book, Dual 2-input NAND buffer/driver [3] J. Borenstein, H.R. Everett and L. Feng, (1996), Where am I? Sensors and methods for mobile robot positioning, University of Michigan research report. [4] Motorola, (1997), Analog/Interface ICs, Device Data, Amplifiers and Comparators [5] Maxim, (1997), Product Data Sheets, Interface Products

Suggest Documents