搜索
bottom↓
回复: 2

An Introduction to Robot Sonar 机器人声纳的文章

[复制链接]

出0入0汤圆

发表于 2007-6-14 16:22:47 | 显示全部楼层 |阅读模式
http://www.robotbuilder.co.uk/Resources/Articles/138.aspx



An Introduction to Robot Sonar                                          Bill Marshall

What is Sonar?

Sonar is a method of finding the distance to an object by measuring the time it takes for a pulse of sound (usually ultrasound) to make the round trip back to the transmitter after bouncing off the object. At sea level, in air, sound travels at about 344 metres per second (1130 feet per second). In practical terms this means 2.5 cm is covered in about 74 microseconds. These sorts of numbers are easily managed by a simple microcontroller system. Imagine the time measurements you would have to make if light was used instead! In principle, all you do is send a burst of ultrasound from a suitable transmitter, setting a clock or timer running at the same time. When the receiver picks up the reflected signal or ‘echo’, the clock is stopped and the elapsed time is proportional to the distance. Easy. Well, yes and no. There are some practical problems that need to be addressed.



Transducer Characteristics

An ultrasonic transducer is basically a miniature loudspeaker tuned to emit or receive a single frequency, usually 40 kHz. The sound does not emerge from the front of the



device in a nice pencil-shaped beam, but has a shape like that in Figs. 1b and 1c.







            





Remember that these shapes are three-dimensional, so Fig.1a would be a cylinder shape. The wide beam transducer puts out a lot of energy sideways, and if the receiver sensitivity has the same shape then you may have problems with the ‘direct’ signal. In other words the receiver picks up the transmitted pulse not just the echo. I found I had just this problem when I used the URR Cybot’s transducers with my new Cy-Q circuits, so I replaced them with narrower beamwidth devices with a pattern like Fig.1c. The length of the main ‘lobe’ gives an indication of likely maximum range. Obviously, use enough power and you can detect objects many metres away, but this is pointless in a small, Cybot-sized robot. Two metres should be enough; less if all you want to do is avoid hitting things rather than construct a ‘map’ of the room.



Reflection Problems

If targets were always at right-angles to the axis of the beam, distance measurements would be reliable and accurate. Unfortunately they seldom are, and to make it worse the target material may be such that no signal is bounced back at all. Fig. 2 illustrates some problematic situations. For simplicity, the signal path is shown as a single line.







           



  



If the robot is heading towards the wall at an angle, then you can see from Fig.2a that the measured distance will be too long.  A strange effect occurs when the angle with the wall becomes shallower as in Fig.2b. At a certain critical angle, Specular Reflection takes place and all the signal is reflected away from the robot. In other words, the wall disappears because there is no echo! This critical angle depends on the wall material and its surface: a very smooth gloss finish on a skirting board can lead to specular reflection. Slightly rough surface materials, such as cardboard cause the signal to be scattered in all directions, so at least some makes it back to the receiver. Fig.2c shows how specular reflection in a corner can fool the sonar into making a very large error indeed.



The hardness of the target material is also an important factor. A skirting board will reflect most of the energy, absorbing very little, but soft furnishings (or trouser legs!) will do the reverse. This means that the maximum detection range is large for the walls, but soft objects may not be ‘seen’ until the robot is nearly on top of them. Note that this does not affect the accuracy of distance measurements, only the maximum range at which a particular object can be detected.



Noise Interference

The sonar signal is a short burst of ultrasound at 40 kHz, way above frequencies humans can hear. Bats use sonar at these and higher frequencies and a useful tool for ‘listening’ to your sonar is a Bat Detector available in kit form for about 20 GBP. The transducers are tuned piezo-electric devices so the transmitter only emits the one frequency, and the receiver is very insensitive to frequencies away from 40 kHz. Most extraneous noise from say, the robot’s motors will thus be ignored. However motor vibration fed to the transducer through the robot body will cause trouble. Sharp mechanical shocks can also provide a false echo, for example if the front castor runs over a crack in a hard floor. That is why Cybot’s transducers are mounted in foam rubber. Only the receiver transducer needs this treatment however. An alternative would be to mount the motor/gearbox assemblies on foam rubber instead.



Electronics

The transmitter transducer can be driven directly from say, a pair of microcontroller port lines, taking each high and low alternately. The piezo-electric device behaves like a church bell when struck: it resonates at its natural frequency. A single pulse applied to the terminals will set it ‘ringing’ at 40 kHz for a number of cycles, adequate for this job. The receiver transducer output will be very small, so an amplification circuit is necessary to bring it up to a sensible level. The clock or timer necessary for measuring the signal ‘time of flight’ can usually be found built-in to most microcontrollers. A circuit diagram for a 4-channel sonar system is given in Fig 3.













A 74HC138 decoder chip provides the transmitter drive. Logic signals Sel Tx0 and Sel Tx1 enable one of 4 possible transducer units. These same signals drive the CD4052 analogue multiplexer ensuring that the corresponding receiver output is routed back to the microcontroller via Sonar Rx Out. Pulsing a transmitter just involves toggling Toggle Tx from 0 to 1 and back again.



The Sonar Rx Out signal connects to a comparator input of a suitable microcontroller such as the PIC 16F627 or 16F877. The reference input to the comparator will be set by experiment to minimize the reception of false echoes caused by noise.



Programming

The program is quite simple:



Enable a 16-bit timer and its interrupt on overflow. Set up comparator reference and enable its interrupt.

Select sonar channel.

Pulse transmitter, clear timer and set it counting.

Either an echo arrives before the timer overflows, generates a comparator interrupt and stops the timer with a count proportional to the time taken for the echo to return.

or   no echo arrives and the timer overflows generating a different interrupt indicating no in-range object detected. This time-out is necessary, otherwise the robot will wait for ever if there is no target.  

If an echo is detected, wait around for the whole burst to be received before sending another pulse. This wait period can be determined by trial and error, or if an oscilloscope is available the received burst length can be measured.

  



There are other issues and problems, but these are the main ones. At least air is a uniform medium: in the sea, sonar encounters problems with temperature boundaries and layers of varying salinity. It’s amazing underwater sonar works at all!

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

发表于 2007-6-14 20:40:24 | 显示全部楼层
不错的文章。

标题改为“An Introduction to Robot Sonar 机器人超声定位(测距)简介”是不是更让大家好理解些?

声纳,总感觉是船上用的东西。

出0入0汤圆

发表于 2016-1-15 21:27:55 | 显示全部楼层
很不错的文章
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-28 02:47

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表