Shop OBEX P1 Docs P2 Docs Learn Events
IR-augmented Echo-location with the Ping))) — Parallax Forums

IR-augmented Echo-location with the Ping)))

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2011-10-01 09:17 in Robotics
One method that's often used for locating a robot in a confined indoor space involves ultrasonic transponders at known locations that can be polled individually by the robot. By measuring the ultrasonic pulse's time-of-flight from each transponder, its distance can be ascertained. A triangualtion computation can then be performed to get the bot's location.

As it turns out, the Parallax Ping))) can be used in both the transponder units and the robot's time-of-flight sensor, without any electrical modification. For a long time, I hadn't thought the latter (passive sensor) was possible, since the Ping))) has to send an ultrasonic pulse to activate its receiver. But that requirement is easily mooted by covering the transmit transducer so no sound can escape. Then, when the Ping's input pin is pulsed, it will simply wait for an echo that can never return (since no pulse was emitted), or for a pulse from another Ping.

With this in mind, I made a trip to the local hardware store to look for something to block the transmit transducer. What I found was a plastic hole plug (for 3/4" holes) that could be mis-applied as a cap to fit the transducer very snugly. A test with the cap in place confirmed that no pulse could escape; hence no echo would be received. Here's a photo of the Ping with its cap:

attachment.php?attachmentid=67770

The overall idea is this:

Scanner: The "scanning" unit sends a coded IR signal to transponder "A".
····Transponder: The transponder waits for its particular signal to be received via IR.
Scanner: As soon the scanner has sent the coded signal, it pulses its Ping I/O pin to activate the "echo" detection.
····Transponder: When the transponder receives its coded signal, it triggers its Ping, which sends an ultrasonic pulse.
Scanner: The Ping waits for an "echo", in this case a pulse from the transponder. The amount of time it waits is proportional to the transponder's distance.

Scanner: The same procedure is repeated for transponder "B".

Once the times from both transponders are known, their distances can be computed. Assuming you know the distance between the two transponders, you can compute the scanner's location in Cartesian coordinates by triangulation. Here's an illustration:

attachment.php?attachmentid=67769

The relevant formulae are:

····x2 + y2 = a2
····(d - x)2 + y2 = b2

These two equations can be solved for the two unkowns, x and y, using the known values for a, b, and d. (This is left as an exercise for the reader, but it's not that hard. smile.gif The difficult part will be converting the resulting expressions into PBASIC code.)

To get any distance from an IRED, it's necessary to trigger it with more current than a BASIC Stamp pin can provide. Here's a circuit I used to boost the current:

attachment.php?attachmentid=67771

Although the IR receivers are fairly isotropic (direction-insensitive), the IREDs themselves are highly directional. The ultrasonic transducers are also direction-sensitive, but it's not so bad when they have a transponder blasting at them, rather than a much more feeble echo. For these reasons, I decided to mount the scanning Ping and IRED on a rotating turret on my BOE-Bot, so that the tranponders could be scanned for in a 180-degree sweep. (I fabricated a custom turret from acrylic, but I'm quite sure that Parallax's Ping scanner could be pressed into service to hold the IRED, with only minor mods or additions.)

The two transponders were built up from BOEs, Pings, and IR receivers, and their circuitry does not vary from that presented in Parallax's documentation. The BOEs are gross overkill for this, but they're what I had, and they're conveniently powered from 9V batteries, thus easy to place in the "arena".

Here's a composite photo of my scanner and one transponder:

attachment.php?attachmentid=67772

The PBASIC code for this project is attached as a zip, below. As it stands, the project is incomplete, since nothing has been done to incorporate the distance info into a real navigation program. My objective was mainly as a feasibility study, to see if echolocation could be performed with standard Parallax parts and minimal alteration. To this limited extent, I feel that the experiment was a success.

Thanks,
-Phil

Update (2010.02.16): Corrected a typo in one of the BS2 files.

_

Post Edited (Phil Pilgrim (PhiPi)) : 2/16/2010 8:16:02 PM GMT
400 x 339 - 11K
305 x 280 - 14K
346 x 274 - 2K

Comments

  • ercoerco Posts: 20,254
    edited 2010-02-16 00:25
    More PhiPi genius! Very clever ultrasonic ranging implementation, thanks for sharing this.

    Between this, the Stingray and Ken's plywood platform, I predict a brisk uptick in PING sales. Buy P'lax stock NOW.

    Didn't the wood platform Ken sent you have 8 or 10 PINGs on it? My Poor Cousin robot can't afford all those fancy ultrasonics for range detection. We're looking at sensors made from tin-foil pie pans, a spoon, and an old AM radio. [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2010-02-16 00:30
    Phil,

    Clever idea!

    Do you or anyone else know of ultrasonic emitters that might be considered as point sources rather then having than having directionality?

    Graham
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-16 01:27
    erco,

    Yes, Ken's platform has 10 Pings. (I had to borrow one of them for this experiment.)

    Graham,

    You've anticipated my next experiment! I believe that the Ping transducers can be made much less directional by affixing apertures (vertical slots, in this case) in front of the them, causing dispersion. What I'm not sure of, though, is how that will affect their range.

    In the reverse sense, I had also hoped to be able to narrow their cone of acceptance by using a Fresnel zone plate aperture (acoustic lens). But, so far, the required working distance has been a problem, since the the Ping picks up an echo from the lens itself and stops listening. The same thing happened when I fabricated a parabolic reflector for the Ping: 'couldn't get it close enough to be in the Ping's "deaf zone". And putting a barrier between the transmit and receive transducers has proven ineffective in preventing self-reflections, for some reason.

    I've been looking for transducers with wide beam patterns, but with little success. I was hoping to use them to design a Prop-driven phased array which could be steered electronically, rather than having to rotate one mechanically. But it's pointless to attempt that with directional transducers.

    -Phil
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2010-02-16 01:42
    I'm interested in a few thing one is just triangulation of a similar nature to what you have done, the other is echo location. I watched a documentary recently about a kid who had lost his eyes to cancer but was then able to learn to use echolocation, he used short sharp clicks from his mouth and listened for the resulting reflections.

    They talked about sound being a bit like light and the fact he was seeing with sound but really it would not be possible for him to image anything as such, the ears only giving a little directionality. However in our world of straight vertical surfaces (walls, doors, etc) I got the impression that perhaps a lot of the sounds you get back are fairly stereotyped, even I could tell my bathroom door was open when I spent some time in a blindfold around the house. So I wanted a clicker to play with, I'm interested in simplified navigation around buildings.

    I have toyed with taking a transducer apart to see what can be done with it.

    Graham
  • BocephusBocephus Posts: 58
    edited 2010-02-16 02:33
    Very interesting Phil! Thanks for the detail and for sharing.
  • WhitWhit Posts: 4,191
    edited 2010-02-16 03:23
    Phil Pilgrim (PhiPi) said...

    You've anticipated my next experiment! I believe that the Ping transducers can be made much less directional by affixing apertures (vertical slots, in this case) in front of the them, causing dispersion. What I'm not sure of, though, is how that will affect their range.
    Phil,

    Thanks so much for posting this! I feel a trip to the hardware store coming on.

    Can't wait to see your Ping))) with a set of Kanye Sunglasses! smilewinkgrin.gif

    attachment.php?attachmentid=67780

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
    461 x 314 - 27K
  • DufferDuffer Posts: 374
    edited 2010-02-16 07:31
    Perhaps if you rotated the PING))) 90 degrees and devised a cylinder as below to fit over the transducer, the trumpet and inverted cone·might give you the omni-directional signal that you want for your stationary transponder. Sorry, I'm no artist. I think I saw this kind of setup used to build a cylindrical omni-directional outdoor speaker somewhere, but I don't remember where.

    Duffer

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Any technology, sufficiently developed, is indistinguishable from magic.· A.C. Clark(RIP)
    576 x 616 - 7K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-19 05:35
    One of the difficulties with the original transponder setup was that the robot could rotate it's IRED and Ping))) through only 180°. This meant that it had to be oriented a certain way to trigger all the transponders. In order to remedy this, I built a servo turret that gears the servo rotation up by 2X to rotate the IRED/Ping through a full 360°. Photos are attached below.

    -Phil

    _

    Post Edited (Phil Pilgrim (PhiPi)) : 2/19/2010 5:41:49 AM GMT
    648 x 621 - 62K
    720 x 625 - 65K
  • agfaagfa Posts: 295
    edited 2010-02-19 12:32
    Phil,

    As always, very impressive.· I have read·several examples of various·triangulation methods, but this is the first example I've seen of a working model.· I'm curious about the range and accuracy of your tests.· I'm also curious about the source of the gear set you used.

    Thanks for sharing.

    agfa
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-19 16:31
    agfa,

    I haven't done any tests on accuracy yet. At this point, it's mostly just a proof of principal for the hardware. I made the mount (from acrylic) and gearset (from Delrin) using a laser cutter. The gear involutes were created in Rhino using a macro, then exported to CorelDraw. The design was finished in, and output to the laser cutter from, Corel.

    -Phil
  • Damo2Damo2 Posts: 10
    edited 2010-02-22 21:04
    Hey Phil, very clever idea.

    I believe the ping has a narow beam angle possibly 10 degrees, and an accurate range to about 3 meters.·· For the robot to perform tri-angulation, it would have to be in the area where the two beams cross, which would only be a small area anyway.

    I'm sure there are some very clever people out there who could work around this problem.

    I think the same theory could apply using IR leds and sensors, since you can use multiple IR leds on ech transmitter to give· a wide coverage angle. Then using the angle of detection from the reciever (using a servo) to·do the triangulation without any distance measurements.

    Seeing new ideas always gets me thinking !!!·
  • ercoerco Posts: 20,254
    edited 2011-10-01 09:17
    Damo2 wrote: »
    I believe the ping has a narow beam angle possibly 10 degrees, and an accurate range to about 3 meters.·· For the robot to perform tri-angulation, it would have to be in the area where the two beams cross, which would only be a small area anyway.

    I would bet that the apparent range is at least doubled since the ultrasonic signal is going from Ping1 to Ping2 instead of Ping1>>reflection>>Ping1. The beam width may also enjoy an effective increase since there is no reflection absorbtion.
Sign In or Register to comment.