Ultrasonic distance sensor improvement using a two-level neural-network

6
Ultrasonic Distance Sensor Improvement Using a Two-Level Neural Network A. Carullol, F. Ferrarisl, S. Graziani2, U. Grimaldi', M. Parvis' 'Dipartimento di Elettronica - Politecnico di Torino Corso Duca degli Abruzzi, 24 - 1-10129 Torino - Italy Tel +39-11-564-4114, Fax +39-11-564-4099, E-Mail [email protected] 2Dipartimento Elettrico, Elettronico e Sistemistico - Universita di Catania Vide Andrea Doria, 6 - 1-95125 Catania - Italy Tel +39-95-339535, Fax +39- 95-330793, E-Mail [email protected] Abstract - This paper discusses the performance improve- ment that a neural network can provide to a contactless distance sensor based on the measurement of the time of flight (TOF) of a ultrasonic (US) pulse. The sensor, which embeds a correction system for the temperature effect, achieves a distance accuracy (rms) better than 0.5 mm over 0.5 m by using a two-level neural network that processes the US echo in order to correctly determine the TOF in the presence of environmental acoustic noise. able with a two-level neural network, set in such a way that higher noise levels can be treated. II. DISTANCE MEASUREMENT ISSUES In TOF-based measurements, the distance to be meas- ured is obtained by the relationship: I. INTRODUCTION Ultrasound-based distance measurement is nowadays recognised as being a simple and cheap answer to many typical demands of industrial manufacturing [l-71. Never- theless, the wide use of such a technique in an industrial environment is often prevented by several drawbacks, such as poor resolution - especially when the cheapest devices, which imply quite large US pulse wavelengths, are concerned - and sensitivity to temperature and envi- ronmental noise. The temperature effect can be satisfactorily compensated by adding a little circuitry to the sensor [8,9]. As to the distance resolution of US sensors, some of the authors have shown [ l o ] that quite good results can in principle be obtained if suitably shaped pulses are employed to drive the transmitting transducer. Unfortunately, applying such a technique to the low-cost commercial devices leads to US echoes whose energy is quite low: this makes the issue of the noise sensitivity even more dramatic. It has already been shown that the employment of a neural network, namely a Multi-Layer Perceptron (MLP), can provide quite a good accuracy improvement when low environmental noise is present [ l l ] , thanks to the interpo- lating capabilities inherent to the MLP. The purpose of this paper is to discuss the performance improvement attain- where dis the measured distance, kis a constant whose value, which depends on the geometry of the signal path, is close to 0.5 and is determined with a preliminary calibration, v is the propagation velocity in the medium and TF is the signal TOF. The measurement uncertainty is thus determined as [12]: where the terms ci are the partial derivatives of (1) with respect to all the xi quantities that significantly affect the measurement result, while u(xJ are the standard uncer- tainties of the same quantities. In the described case, the measurement model that must be applied in order to take all the significant uncertainty sources into account is in the form: (3) d= k. v(0, RH). TF where the dependence of the velocity of sound on the temperature 8 and the air relative humidity RH has been outlined. Therefore, if the uncertainty of k is made negli- gible, the measurement uncertainty is expressed as: 0-7803-2615-6/95/$4.00 0 1995 IEEE 828

Transcript of Ultrasonic distance sensor improvement using a two-level neural-network

Ultrasonic Distance Sensor Improvement Using a Two-Level Neural Network

A. Carullol, F. Ferrarisl, S. Graziani2, U. Grimaldi', M. Parvis' 'Dipartimento di Elettronica - Politecnico di Torino

Corso Duca degli Abruzzi, 24 - 1-10129 Torino - Italy Tel +39-11-564-4114, Fax +39-11-564-4099, E-Mail [email protected] 2Dipartimento Elettrico, Elettronico e Sistemistico - Universita di Catania

Vide Andrea Doria, 6 - 1-95125 Catania - Italy Tel +39-95-339535, Fax +39- 95-330793, E-Mail [email protected]

Abstract - This paper discusses the performance improve- ment that a neural network can provide to a contactless distance sensor based on the measurement of the time of flight (TOF) of a ultrasonic (US) pulse. The sensor, which embeds a correction system for the temperature effect, achieves a distance accuracy (rms) better than 0.5 mm over 0.5 m by using a two-level neural network that processes the US echo in order to correctly determine the TOF in the presence of environmental acoustic noise.

able with a two-level neural network, set in such a way that higher noise levels can be treated.

II. DISTANCE MEASUREMENT ISSUES

In TOF-based measurements, the distance to be meas- ured is obtained by the relationship:

I. INTRODUCTION

Ultrasound-based distance measurement is nowadays recognised as being a simple and cheap answer to many typical demands of industrial manufacturing [l-71. Never- theless, the wide use of such a technique in an industrial environment is often prevented by several drawbacks, such as poor resolution - especially when the cheapest devices, which imply quite large US pulse wavelengths, are concerned - and sensitivity to temperature and envi- ronmental noise.

The temperature effect can be satisfactorily compensated by adding a little circuitry to the sensor [8,9]. A s to the distance resolution of US sensors, some of the authors have shown [ lo ] that quite good results can in principle be obtained if suitably shaped pulses are employed to drive the transmitting transducer. Unfortunately, applying such a technique to the low-cost commercial devices leads to US echoes whose energy is quite low: this makes the issue of the noise sensitivity even more dramatic.

It has already been shown that the employment of a neural network, namely a Multi-Layer Perceptron (MLP), can provide quite a good accuracy improvement when low environmental noise is present [ l l ] , thanks to the interpo- lating capabilities inherent to the MLP. The purpose of this paper is to discuss the performance improvement attain-

where dis the measured distance, k is a constant whose value, which depends on the geometry of the signal path, is close to 0.5 and is determined with a preliminary calibration, v is the propagation velocity in the medium and TF is the signal TOF.

The measurement uncertainty is thus determined as [12]:

where the terms ci are the partial derivatives of (1) with respect to all the xi quantities that significantly affect the measurement result, while u(xJ are the standard uncer- tainties of the same quantities.

In the described case, the measurement model that must be applied in order to take all the significant uncertainty sources into account is in the form:

(3) d= k . v ( 0 , R H ) . TF

where the dependence of the velocity of sound on the temperature 8 and the air relative humidity RH has been outlined. Therefore, if the uncertainty of k is made negli- gible, the measurement uncertainty is expressed as:

0-7803-2615-6/95/$4.00 0 1995 IEEE 828

(4) when the TD fires on different periods of the pulse wave- $(d)=(c, u(H))2+(CI+/U(RH)J+(crF u(T,)J form.

The sensitivity coefficrients vary with 1 he actual tempera- ture; however, the maximum values in the range of 0°C to 40°C are:

In order to attain a TOF resolution that is better than one period of the echo waveform, it is therefore necessary to post-process, in some way, the echo itself. In the case described, an Analogue-to-Digital Converter (ADC) is used to sample the echo from the time instant it crosses the threshold: one hundred samples at 500 kHz are ac- quired, which allows the meaningful part of the echo to be correctly described. The post-processing is thus per- formed by a digital computing unit.

The compensation of the temperature effect is based on a direct measurement of the air temperature, which is carried out via a low-cost solid-state commercial Sensor that exhibits a temperature uncertainty of 0.50~: the cor- rection is implemented during the computations per- formed by the digital computing

(5) CO= d . 1.8 K-’

cRH = d . 4.3 (%FIH)-’ c = 180 m ! ~

where d is the measured distance, expressed in metreS.

The relative humidity effect is usually neglected, while Several authors have already developed distance meas- urement systems including a thermal compensation (see, for instance, [8,9]). Such compensaticns are based on a direct measurement of the temperature and on a more or less accurate correction of the estimated velocity of sound,

TF

according to the temperature detected. 111. NEURAL NETWORK POST-PROCESSING

The TOF uncertainty (/(T,) is mainly Ziffected by the fie- quency of the employed ultrasound, therefore the meas- urement accuracy increases as the frequency increases. In the sensor dealt with in this paper, low frequency ultrasonic pulses generated with piezoelectric transducers resonant at 40 kHz weire employed.

For the post-processing of the echoes the authors decided to employ a neural network, fed with the acquired samples of each echo received. Among the different suitable neural network architectures, a two-level one was chosen: a Competitive Layer (CL) is firstly used to identify the cluster each echo belongs to (and therefore to compensate the largest deal of noise) and then a MLP is used for each identified cluster, with the aim of interpolating within the slight residual measurement dispersion mentioned above. The criteria used in dimensioning both networks are briefly explained below.

Such a choice permitted quite a cheap sensor to be built, since the cost of the transducers is about one dollar and a very cheap hardware! is sufficient to perform the meas- urement: basicallv onlv a threshold detector (TD) and a counter are requiied to measure the TOF of the transmit- ted Dulse. Furthermore the relativelv low attenuation of A. Competitive Layer

sound in air at that frequency allows measurements of up to a few metres and the probability of diffraction in most common environments is quit low, beirig the pulse wave- length of about 8 mm.

It is not possible to fclresee the valule of the standard uncertainty U( TF), beCalJSe the measured TOF distribution varies according to the (different measuirement conditions; nevertheless one should note that an error in the echo detection of one period of the echo waveform corresponds to a 4 mm distance error. It is therefore inecessary that the sensor is able to discrimlinate a suitable fraction of an echo period. The most important source of errors in the echo detection is the environrnental noise. There are two appar- ent effects of the environmental noise: (a slight dispersion of the measurements, \when the TD fires at different in- stants within the same pulse period, and a clustering of measurements around inultiples of the pulse wavelength,

The neural network size, as well as the training method, can easily be decided by considering that the CL can be trained using echoes whose characteristics are all well known, because they are generated in stated and known conditions. This allows the network to be trained in a supervised manner, e.g. by applying a Learning Vector Quantisation (LVQ) method.

The LVQ method is based on the computation of some kind of “distance” between the input signal and the weight vectors. The determination of the winning neuron in the CL is performed on the basis of the same distance function. The authors chose the Euclidean distance; however other choices lead to similar results [13]. The weight vectors are a sort of “mean” of the signals that make the neuron win: such “mean signals” characterise the class each neuron can recognise.

829

-120 -80 -40 0 40 80 120 Time (ps)

1

0 -120 -80 -40 0 40 80 120

Time shift (ps) Fig. 1. Average echo and relevant Euclidean “self-dis-

tance” function.

The number of neurons required to correctly identify the different echoes (i.e. the number of classes that have to be drawn out of the mentioned clusters) therefore depends on the distances between the echoes themselves. The phenomenon that plays a crucial role in spreading the echoes over the classes and clusters, rather than the amplitude noise, is the phase noise in which the former is transformed by the threshold detection described above. It is therefore possible to predict the behaviour of the network with reasonable accuracy by computing the Euclidean “self-distance” function of the echo theoretically expected in the absence of noise (Fig. 1): the null distance refers to an echo that matches the neuron weight.

The CL can correctly identify the echoes only if the self-distance corresponding to the amplitude of each class is reasonably less than the self-distance D,, , which cor- responds to the local minima adjacent to the absolute one. In the case described, such adjacent local minima are located at a time shift Cmax = 2 ps.

Therefore 1 ps wide classes were chosen as a reasonable compromise between network complexity and safety of discrimination in noisy conditions. This resulted in five or six classes (i.e. neurons) for each cluster and therefore,

as the maximum number of cluster is limited by the number of echo periods, the maximum possible neuron number is less than twenty.

The use of 1 ys wide classes implies an intrinsic standard uncertainty, due to the time quantisation, that can be evaluated in 0.28 ps hypothesizing a rectangular distribu- tion of errors within each class. The MLP is used to reduce this uncertainty.

B. Multi-Layer Perceptron

The MLP is used to perform an interpolation within each class. The MLP input vectors are the outputs of the CL neurons which represent the distance of the received echo from the “mean signals” characterising each class.

The MLP therefore has to be trained to estimate the actual TOF of the current echo by examining those distances.The number of neurons of the MLP’s hidden layer cannot be determined theoretically, as in the previous case, due to the inherent characteristics of MLPs: however, the problem complexity only requires a few neurons to be employed.

One MLP was implemented for each cluster: only one MLP is thus activated once the CL has detected the cluster the echo belongs to. In this way the computational complexity, both in the training and the retrieval phases, is strongly reduced.

IV. NEURAL NETWORK TRAINING

A. Training Sef Generation

A neural network has to be trained on the basis of a number of examples (in this case, the echoes), whose corresponding targets (in this case, the actual TOF rele- vant to each echo) are known, that is sufficient to com- pletely describe the possible cases the network will have to process during its retrieval phase. It is therefore appar- ent that the generation of the training set is a critical task.

The main problem is that the network is required to give a TOF resolution of a fraction of a microsecond: the actual TOF of the echoes of the training set has therefore to be known within a few tens of nanoseconds. This, in turn, requires distance d, air temperature 0 and relative humidity RHto be known with very little uncertainty, which is not an easy task. The authors avoided this problem by using the arrangement shown in Fig. 2. A digitising oscilloscope, with the same number of bits as the ADC employed in the sensor, was used to acquire echoes from a target set at a fixed distance of about 0.5 m in a sealed ambient with temperature controlled to within 0.01 “C. Under such con-

830

Amplifier

Fig. 2. Arrangement of the sensor, used to generate the training :;et for the neural network.

ditions the TOF is stable within 50 ns. The oscilloscope was triggered at a suitable fixed delay after the transmis- sion of the US pulse: it then acquired one thousand samples of the echo at the sampling frequency of 2.5 MHz; the reference TOF was deterrnined as the mean value of the time location of the highest peak of one thousand echoes.

The sensor hardware was simulated by searching each acquired echo for the time it crosses thle threshold and by sub-sampling it five timies, synchronously with the sensor clock, finally obtaining the mentioned one hundred sam- ples at 500 kHz for each echo. The echoes were then labelled with the time {difference between the reference TOF, computed as described above, and their own thresh- old crossing time TOF.,, (Fig. 2): such differences were the values the network was trained to estimate.

Although this was a perfect simulation of the sensor be- haviour, all the available examples would have referred to the same TOF, and furthermore the TOF differences fed into the network would a d have been multiples of 2 ps: thus the neural network could not have extracted the amount of knowledge necessary to successfully interpolate at the desired level. Example:; of echoes whose TOFs vary by less than the 2 ps sampling interval have in fact to be shown to the network during the training phase, labelled with a difference that actually corresponds to those TOFs, and therefore non-multilple of 2 ps. As actually varying the measured distance of the small necessary TOF skew is

quite a difficult operation, such echoes were created arti- ficially: before simulating the sensor behaviour, the echoes acquired with the oscilloscope were time-shifted of multi- ples of the initial 0.4 ps sampling interval, while the rele- vant target difference was computed from the reference TOF, time-shifted by the same amount.

Ten thousand echoes per measurement session were recorded while artificially generating acoustic noise in the sealed ambient. The training set was generated by extract- ing, from such records, one to two thousand echoes so that all the target values were well represented in the set.

B. Training Strategies

The echoes that each neuron in the CL has to recognise are very similar, due to the amplitude noise to phase noise transformation. This suggests that averaging all the ech- oes pertaining to each class and pre-setting the weights of the relevant neuron to such a value should make the training easier.

This in fact greatly speeded up the training phase: a negligible improvement was obtained by performing a post-training with the conventional LVQ rule.

This strategy has the further advantage that only the neurons corresponding to classes that are actually pre- sent are generated, thus avoiding ineffective neuron re- d u ndancy.

The training of the MLPs was performed in a conventional way, with a Levenberg-Marquardt algorithm, which insured a very fast convergence. Topologies were tested with four to eight neurons in the hidden layer; a seven hidden neuron network was adopted, which still gave the best results with a low complexity.

V. EXPERIMENTAL RESULTS

The training and the subsequent tests were carried out in the presence of a large artificially induced acoustic noise: after the receiving transducer the noise peak amplitude was about 40% of the echo peak amplitude. The typical TOF dispersions obtained in sessions of ten thousand

TABLE I TOF STANDARD UNCERTAINTY OVER TEN THOUSAND MEASUREMENTS

TD CL MLP

4TF) (PI 8.6 0.45 0.28

831

TABLE II STANDARD UNCERTAINTY CONTRIBUTIONS

Measured distance Measured distance d = 0.5 m d-0.2 m

TD CL MLP TD CL MLP

2.4 0.0066 0.0025 2.4 0.0066 0.0025 6?., *(T$

XI O4m2

0.068

0.13

0.01

0.021

u2,(d) 2.6 0.2 0.2 2.4 0.037 0.033 XI O-‘m‘

qJd) 1.6 0.44 0.44 1.5 0.19 0.18 mm

measurements with the TD alone, after the CL processing and after the MLP interpolation are reported in Table I.

The CL provides a reduction of the TOF dispersion of about twenty times with respect to the results of the TD alone, while the MLPs further cut the dispersion by 35%. The reduction provided by the neural network makes the TOF contribution to the distance uncertainty negligible, with respect to the other sources discussed in section 11, unless a very accurate measurement of both temperature and humidity is performed.

Table I I is obtained from (4) and shows the distance stand- ard uncertainty, u,(d), for two distances of 0.2 m and 0.5 m, when the temperature is measured with a standard uncertainty u(0) = 0.29”C and the relative humidity is within the typical range of 30% to 90% (which corresponds to a standard uncertainty u(RH) = 17 %RH). It appears that, after the neural post-processing, the contribution of the relative humidity predominates and the TOF contribu- tion becomes completely negligible at the larger distance. Under these conditions, the developed sensor provides an accuracy better than 0.5 mm over a 0.5 m measured distance. However, it is important to remark that, whenever differential measurements are performed in steady tem- perature and relative humidity conditions, the neural net- work cuts the distance standard uncertainty down to the

level of 50 pm, without requiring the measurement results to be filtered or smoothed.

VI. CONCLUSIONS

Post processing ultrasonic echoes by means of neural networks is an effective solution to improve the measure- ment accuracy of ultrasonic distance sensors when low frequency pulses are employed. A Competitive Layer trained with a Learning Vector Quantisation method (i.e. in a supervised manner) is able to reduce the standard uncertainty of the time of flight measurement down to 0.45 ps, which corresponds to a distance standard uncer- tainty of about 75 pm. A second level Multi-Layer Percep- tron, which adds a negligible computational complexity, further reduces the distance standard uncertainty to 50 pm.

The neural post-processing therefore makes the problem of the TOF uncertainty minor: the uncertainty contribution of the relative humidity is in fact likely to become the dominant effect, provided the usual compensation of the temperature effect is performed.

The first level Competitive Layer can be conveniently designed and trained by exploiting the a-priori knowledge about the processed echoes both to choose the neuron number and to pre-set their weights. If this is done, training the network can be almost effortless.

The implemented two-level approach allowed a very low computational complexity to be obtained. As a conse- quence, the strict necessity of employing special fast and costly Digital Signal Processors is removed, while a throughput of 100 measurements per second is still pos- sible.

REFERENCES

[ I ] G. De Cicco, B. Morten, M. Prudenziati, A. Taroni and C.Canali, “A 250 kHz piezoelectric transducer for operation in air: application to distance and wind measurement ,” Ultrasonics Symposium Proceed-

[2] P. Kleinschmidt and V. Magori, “Ultrasonic robotic-sensors for exact short range distance meas- urement and object identification,” Ultrasonics Sym- posium Proceedings, IEEE, vol. 1, pp. 457-462, 1985. J. Loschberger and V. Magori, “Ultrasonic robotic sensor with lateral resolution,” Ultrasonics Sympo- sium Proceedings, IEEE, pp. 547-551, 1987.

i n g ~ , IEEE, pp. 321-324, 1982.

[3]

832

[4] D. Marioli, E. Sardini and A. Taroni, “Ultrasonic dis- tance measurement for linear and angular position control,’’ IEEE Trans. IM, vol. 37, no. 4, pp. 578-581, December 1988. Honeywell Micro Switch, Series 942 Ultrasonic Dis- tance Sensors - Data Sheet €107. Honeywell Print- ing Shop, 1988. C. Loughlin, “Ultrasonic measurement: keeping your distance,” Sensor Review, vol. !3, no. 2, pp. 85-89, April 1989. Lundahl Instrument, DCU-70 Programmable Ultra- sonic Sensor Manual. C. Canali, G. De Cicco, B. Morl:en, M. Prudenziati and A. Taroni, “A temperature compensated ultra- sonic sensor operating in air for distance and prox- imity measurement,” I€€€ Trans. /E, vol. 29, no. 4, pp. 336-341, November 1982.

[5]

161

[7]

181

[9] A. Carullo, F. Ferraris, U. Grimaldi and M. Parvis, “A non-invasive temperature-compensated distance meter,” unpublished.

[lo] U. Grimaldi and M. Parvis, “Enhancing the ultrasonic sensor performance by the optimisation of the driving signal,’’ Measurement, in press.

[ll] F. Ferraris, S. Graziani, U. Grimaldi and M. Parvis, “A neural network for fast response ultrasonic dis- tance sensors,” IEEE Instrumentation and Measure- ment Technology Conference - Innovative Ideas for lndustry, Irvine, California, pp. 631 -635, May 1993.

[ 1 21 ISO, Guide to the Expression of Uncertainty in Meas- urement. p. 19, 1993.

[13] T. Kohonen, Content-Addressable Memories. Berlin: Springer-Verlag, pp. 19-25, 1980.

833