Ping info
grigio
Posts: 13
Hi I'm a new Parallax user and I'm working with Ping sensor. I've some question for you:
because I need high precision in measuring distance of few tenths of centimeters, I wish to know if the distance measured with Ping starts from the front of the two "eyes" or not.
thanks
Paolo
because I need high precision in measuring distance of few tenths of centimeters, I wish to know if the distance measured with Ping starts from the front of the two "eyes" or not.
thanks
Paolo
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
Http://www.parallax.com
·
thank
A "distance of a few tenths of centimeter" is a distance of a few millimeters. Is that what you are dealing with --measuring targets at (only) a few millimeters distant from the Ping?
PAR
Oh, and also the dynamics of the system you are measuring --e.g, how fast, what direction(s)·is the object of interest changing its distance from your Ping?
Post Edited (PAR) : 9/14/2006 5:43:36 AM GMT
"Distance Measuring" systems have three metrics. The first is the 'range' of the measurement -- in the Ping's case it measures from 2 cm to 3 meters. The second is the 'resolution' of the measurement -- how many digits you can get.· The third is the 'accuracy' of the measurement -- how many of those digits actually represent reality.
For an example, a laser-ranging system could have a range of 2 cm to 3 meters, with a resolution of 0.1 cm, with an accuracy of 0.01 cm. This means when the unit tells you the distance is 201 centimeters, you know the 'real' distance is between 200.9 to 201.1 centimeters, +/- 0.01 cm.· Usually 'resolution' and 'accuracy' are pretty close together.· If your 'resolution' is 0.1 cm, but your 'accuracy' is 1 cm, then that extra digit does you not much good.·
From the earlier example, if your 'resolution' was 0.1·cm, but your 'accuracy' was +/- 1 cm, then a measurement of 201.2 centimeters means the 'real' distance is 200.2 cm to 202.2 cm.
Now, from your question, it's not clear what 'range' you are measuring. Is the 'range' a few tenths of a centimeter? Or is the 'resolution' you need a few tenths of a centimeter?
It also sounds like you're asking -- "okay, so the unit says 201 centimeters distance. Since the unit itself is a centimeter and a half thick or so, where is the 'start' of the measurement?"
That last question you could answer just by trying it, I would think.
Edited:· ****
A perusal of the PDF document for the 'ping' sensor indicates the distance is measured "from the front of the sensor" -- thus, from a plane laid across the front of the emitter-reciever 'eyes'.· Also, the BS2 gets its results back from the 'ping' sensor as a pulse (measured with PULSIN) with a 'resolution' of 2 uSec (representing 0.0689 cm).· It's not clear from the Parallax documentation what the 'accuracy' of the 'ping' sensor is, maybe somebody from Parallax can do an experiment, to find out what·this might be.
Post Edited (allanlane5) : 9/14/2006 2:30:27 PM GMT
and thanks to allanlane5 for the specification about resolution and accuracy. measures I made is a path between 10 and 20 cm and I would get also mm from the ping. From·resolution (2 us => 0.0689 cm) it seems to me possible.
thanks to all
Paolo
Cair = 331.5 + (0.6 x Tc) m/s
The speed of sound in air also changes with pollution and humidity, but only very slightly.
If the temperature in your target environment is not strictly controlled, the application will probably need to measure the temperature and use to correctly scale the time to distance calculations.· The DS1620 <http://www.parallax.com/detail.asp?product_id=604-00002> takes measurements in 1/2 °C increments.· You'll want to try a few sample calculations to find out if measurements within 0.5 °C will be precise enough to keep your measurements in check.
The size, shape, and angle of the target surface may cause some measurement inconsistencies.· This is something you'll probably have to test.· If there are inconsistencies and they are repeatable, it·may still be possible to write code to correct the measurements.·
I'm using ping and ds620·thermometer together in my room; data are sent every second via serial port to a pc; the board is on top of a pile of CD's (8 cm in height) to avoid reflection of ultrasonic from top of the table. Ping is at 10 cm from the wall.
Actually temperature is 24 °C so I'm expecting Cair· to be 345.7 m/s.
variable rawDist (measured echo pulse) from ping is 318. This should be multiplied by the scale factor for BS2 (that is 2) and then divided by 2 to cancel the return trip, so it·should be the travel time in usec.
with this data I find that the distance that ping measures is 0.1099 m or 10.99 cm.
If I change distance from ping to the wall to 8 cm I get a travel time of 270 usec at 24.5 °C·(therefore Cair·will be·346.2 m/s)
again => distance measured from ping ·is 9.35 cm.
Why this?
Scientific method is to hold most parameters fixed, and change one parameter at a time, and see what difference it makes. In this case, you're varying both air temperature and distance. Thus it becomes difficult to explain which change is causeing the effect you see.
So, it could be your "temperature adjustement" code which is causing an error.
It could also be the humidity of the air. If you take the 10 cm -> 318 count -> 636 uSec, then the speed of sound in air is 314.5 m/Sec. If you use 314.5 m/Sec, then the 8 cm count (270) gives you 8.5 cm.
So, perhaps the Ping sensor doesn't measure as accurately as you need at close ranges. Try 10 cm to 20 cm. Check how 'repeatable' the measurement is -- does it 'bounce' much for different readings?
1) If you're measuring from the front surface of the transducers, the actual transducers are a short distance behind the front surface, perhaps a few mm. That could account for around 0.5cm longer path.
2) We don't know how long it takes from the point where the PING electrically generates the 40KHz pulse train until the transducer generates an adequate sound amplitude to be detected. It may take a pulse or two and that delay could contribute to the apparent distance error.
3) It would be interesting to graph the PING measured distances compared to the physical distances over the range of the PING, certainly from the minimum distance (2cm) to at least one meter. It may be that you need to make a calibration /compensation table and apply corrections to the raw data in addition to the temperature.
You have two unknowns here, the actual speed of sound in air (cair) for your·temperature,·humidity and air quality, and the actual zero distance (sO) for the Ping))) rangefinder.
·
Try taking two different distance measurements.· You will then have two distance measurements (s) and two time measurements (t).··You can use these to solve for cair and sO with algebra (two equations·with two unknowns).· It would be a good idea to verify your results by repeating at several different pairs of distances.
But you're right -- 5 to 10 measurements at various distances 'should' be able to determine if the response IS linear (which I agree it 'should' be, there's no reason why not).
Oh, and having determined the relationship equation, hopefully a quick 'calibrate' check at the start of a day of operations will validate any air temperature drift.
·
If it turns out to be linear, it will take less work to finish the project.· If it turns out to be nonlinear, well,·earlier in this thread, I said, "If there are inconsistencies and they are repeatable, it·may still be possible to write code to correct the measurements."· Also Mike Green said, "It may be that you need to make a calibration /compensation table and apply corrections to the raw data in addition to the temperature."
·
There are all kinds of PBASIC tricks for calibration as well as for making systems self calibrating.··You·mentioned averaging earlier, and I think that will·definitely help.· In addition, we've got a number of different types·of scaling at our disposal along with lookup tables for patterns that tend to defy equations, and EEPROM for storing a series of measurements that can be loaded for linear approximation over smaller intervals.
Specially to Mike and Andy because they finally gave me the answer to my first post: from where ping star to measure?
I'll try next week with some experiment to find if there·linear relation or not between "Actual Measured Distance"·and "Ping Reported Distance" as allanlane5 said.
FOr allanlane5: there is no reason why I measured two distance at two temperature, I made them this morning continuosly while posting message with the window open so as the time goes to midday temperature of my office room raised. furthermore I made some test at four dstance so I can try to find some relation to show you all.
Increasing Humidity increase sound speed as temperature does. Instead from my data I get C values less than C at T=0°C and RH=0%. there is something strange!
bye