Ping Sonar Sensor
PatrickD034
Posts: 4
I am using the Parallax Ping))) Sonar sensor with BS2, and I am having some difficulties with it. Most of the time it will perform correctly, but every so often, it will be unable to detect objects within 12 inches. If I debug, it will sometimes have an object that is 12 inches away, yet the inches variable in my program will be 100+ .. it makes no sense and is acting very inconsistantly. I am running it off AC power, so I don't think that should be an issue ... this is driving me crazy, any help?
Thanks, Patrick
Thanks, Patrick
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Are there any known flaws with this specific code that I should worry about? It seems pretty solid to me..
How large a surface does the target present to the Ping?
Is the surface flat (and perpendicular to the Ping), or some other shape?
Does the inconsisitent distance measure show up erratically·on repeated measurements using the EXACT same setup (i.e., the program loops through a series of pinging events, and the distance is calculated for each event and displayed in your DEBUG window)? Or, is the Ping and/or target and/or some other element in the field of "view" of the Ping moving (however slightly) between pinging events?
Does the "sometimes" event of 100+ distance repeat consistenly, or does that "wrong" value itself change radically between pinging events conducted under identical conditions?
PAR
If I perform the same test over and over again, I would say 75% of the time, when the sensor head-on faces the corner of the book , it will not return the distance to the book. I suppose I could try a shoebox or some other object, maybe the pings pulse is going through the pages of the book?
http://www.parallax.com/detail.asp?product_id=28029
It also occurs to me that the edges of paper pages·would be better at absorbing sound than reflecting it, especially if they are splayed a little bit.
It might be worthwhile to set up various material/angle/distance combinations to test which object characteristics contribute to reflecting sound back the way it came.·
You will have to study the "shape" of your Ping's world more carefully, with respect to the Ping's cone of signal, target characteristics (shape, size, distance, strength of echo), so as to know better what your Ping is actually looking at and measuring the distance to. Such testing will tell you how to design your robot's motion, your Ping's aiming requirements, your target's ability to be seen from various aspects, and your programming requirements to attempt to understand what a particular series of varying-distance signals suggest for your robot to do next.
PAR
I've worked on sound deadning for a home music studio. Once we added insulation to the inner walls. We then had to make one wall surface hard or the music sounded flat to our ears. I hadn't pondered that effect for robot ultrasonic sensors. But Yep it could cause the same type of problem. Hard dense surfaces seem to be the best reflectors for sound. It's amazing the things you learn or Re-learn when you try and make a machine see or hear it's enviroment..
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔