The Mathematis of Simple Ultrasoni -Dimensional Sensing President, Bitstream Tehnology The Mathematis of Simple Ultrasoni -Dimensional Sensing Introdution Our ompany, Bitstream Tehnology, has been developing eduational robotis produts around radio-ontrolled (RC) ars. Our reasons for doing this are: 1. The RC ar provides a heap, ready-made platform. The RC ar results in a fast autonomous vehile that s fun to experiment with 3. The ontrol eletronis an be used on any RC vehile, so the projet is salable There are a number of miroontroller/eletronis funtions that we re developing to allow the vehiles to navigate autonomously in obstale-rih environments. Of these funtions, one of the most important is the ollision avoidane sensor. We ve made several different versions of this, onsisting of various ombinations of ultrasoni and optial sensors. The one desribed in this paper is an innovative and very useful enhanement of ultrasoni sensing boards. The Ultrasoni Sensor System The simple ultrasoni system has been around for a long time and is well understood. Basially, an ultrasoni transduer, whih an be thought of as a high-frequeny speaker, sends out a signal that will reflet bak from obstales. The ultrasoni sensor, whih an be thought of as a highfrequeny mirophone, piks up these refleted waves and produes an eletroni signal from them (Figure 1). Figure 1 Roboti vehile using an ultrasoni sensor to detet an obstale The ultrasoni waveform transmitted through the air is an aousti signal so it travels at the speed of sound, about 1100 feet per seond. As a result, the robot an aurately determine the distane to the obstale by just omputing the differene between the time of the ultrasoni wave generation at the transmitter and the reeipt of the refleted wave at the ultrasoni reeiver. Figure is an osillosope display of the transmitter input and the (amplified) reeiver output for an obstale just 5 inhes away (having the obstale so lose allows both waveforms to be shown on the osillosope display)
The Mathematis of Simple Ultrasoni -Dimensional Sensing President, Bitstream Tehnology Figure 40 kilohertz ultrasoni transmitter output and refleted return (obstale 5 inhes away) The Need for More Obstale Information Simple transmitter/reeiver pairs like the one in Figure 1 are often used in slow-moving robots. When an obstale is enountered, the response is often programmed so that the vehile baks up and turns to one side or the other. But for higher-performane robots and autonomous vehiles, muh better responses are possible if we just have a little more information. Figure 3 Autonomous vehile approahing wall on its right
The Mathematis of Simple Ultrasoni -Dimensional Sensing President, Bitstream Tehnology Figure 3 illustrates a simple example. If the goal of the autonomous vehile is to run around the ourse as fast as possible without running into anything, the orret maneuver is simply to turn the front wheels briefly to the left and keep going. Yet, the only information that our simple ultrasoni transmitter/reeiver pair an give is that there s something in front of the vehile at a distane, D. There s no additional information about whether the obstale is to the left or to the right. -Dimensional Sensing Using Two Reeivers and Some Math We an modify the sensor in a way that provides signifiantly more information. This sensor will tell us not only that there is an obstale ahead of us, but whether the obstale is on the left or the right and how far to the left or right. To do this we just add one ultrasoni reeiver, as depited in Figure 4, and some mathematis (algebra and geometry). Figure 4 -Dimensional ultrasoni sensor system Before we talk about the mathematis, let s look at the sensing hardware. The sensor system sends ultrasoni energy from its transmitter (as usual). It propagates in all diretions, but the only energy we re interested in is that energy that hits the hair leg, whih is shown by the outgoing arrow in Figure 4. That energy is refleted bak, again in all diretions, but we re only
The Mathematis of Simple Ultrasoni -Dimensional Sensing President, Bitstream Tehnology interested in the energy that strikes one of the two reeivers (RX1 or RX) and that energy is depited by the inoming arrows in Figure 4. Remember from the earlier disussion that ultrasoni sensing is aomplished by measuring the time-of-flight (TOF) between transmission and reeipt of the refleted ultrasoni energy. Observe in the example of Figure 4 that the path from transmitter, TX, to reeiver, RX1, is longer than the path from the transmitter to the reeiver, RX. The question is: if we know the TOF from transmitter-to-rx1 (all it ) and the TOF from transmitter-to-rx (TOF), is there an equation that we an use to ompute the distane, y, and the distane, x, as defined in Figure 5? Note that y is the distane normal to the axis running through the ultrasoni transmitter and reeivers and x is the distane along that axis. Figure 5 Solving the x,y Computation Using Right Triangles There are multiple ways to solve this problem but we will use methods that rely solely on algebra and geometry. As Figure 5 makes lear, we are dealing with three right triangles, all of whih have a ommon side of length y and the other side either x-d, x, or x+d, where D is the spaing between the transmitter and eah of the two reeivers, RX1 and RX. The hypotenuses of these three right triangles have length r 1, r T, and r. So what values do we know or an measure? We know D, the transmitter-to-reeiver spaing, sine it is part of the sensor iruit board design. Our robot will measure the times-of-flight, and TOF. That s all we know. So how do we get x and y from that? A bunh of algebra and geometry, that s how. Note that the hypotenuses and times-of-flight are related by the equations:
The Mathematis of Simple Ultrasoni -Dimensional Sensing President, Bitstream Tehnology r + r T 1 = (Eq. 1) r + r T TOF =. (Eq. ) The speed of sound,, at standard temperature and pressure is 116 feet per seond. The differene between these two times an be immediately written as: r r 1 TOF =. (Eq. 3) The sum of the two times-of-flight is given by: r + r + r 1 T + TOF =. (Eq. 4) For situations in whih the ultrasoni reeive sensors are lose to the transmitter, relative to any of the distanes being measured (that is, D << rn, where n is 1,, or T in Figure 5), the following approximation produes negligible error: ( r 1 + r ) r T. (Eq. 5) Using this approximation, Eq. 4 beomes: + TOF ) = r1 + r. (Eq. 6) By the Pythagorean theorem, the following three equations an be written: x + y = (Eq. 7) r T + + y r1 (Eq. 8) + y r (Eq. 9) ( D) ( D) x = x = Subtrating one from the other of these last two equations produes the result: Combining Eqs. 5, 6, and 7 gives: r1 r x = + TOF 4D 8D TOF ) ) =. (Eq. 10) and applying the result of Eq. 10 to Eq. 11 gives: or r1 + r + TOF x + y = = 4 (Eq. 11) r 1 r y =. (Eq. 1) + TOF ) 16 4 D y = 16 TOF 8D ( ) ( )( ) + TOF TOF +. (Eq. 13)
The Mathematis of Simple Ultrasoni -Dimensional Sensing President, Bitstream Tehnology After some manipulation, this beomes: ( ) TOF ) + TOF 1 4 4 D y =. (Eq. 14) Thus, omputing just the sum and differene of the two times-of-flight allows an aurate estimate of the objet s x and y displaement to the transmitter to be made. Hardware/Software Implementation Figure 6 The Bitstream Tehnology -dimensional ultrasoni sensor board An ultrasoni transmitter and two reeivers are inorporated into a -dimensional roboti sensor board (Figure 6) that Bitstream Tehnology has developed. The board inludes a Texas Instruments MSP430 miroontroller that makes the omputations explained in this paper. The miroontroller is preprogrammed, so that the user does not have to know how to make the floating-point alulations. The output of the board is two voltages, whih represent the distanes x and y with sale fators of 0. volt per foot for y and 1 volt per foot for x. The resolution of the two outputs is approximately 1 inh for y and 0.3 inh for x. The ompany s plan is to offer this board as part of a Kikstarter or Dragon Innovation projet later this year. If you think you might be interested in supporting this projet, please visit us at www.bitstreamtehnology.om.