PENGUIN ROBOT Ping UltraVision - the Code
Title: Penguin Ping Ultra Vision
Code Name: penguin_ping_ultravision.bpx
Purpose: PING))) Expansion Enables Ultra Vision
This program is amazing. Now Penguin can see from 1-inch
out to 9-feet! Just plug in the Parallax PING))) and run this
code.
Ultravision is a unique way of seeing things, even in total
darkness!
humanoido
Code Name: penguin_ping_ultravision.bpx
Purpose: PING))) Expansion Enables Ultra Vision
This program is amazing. Now Penguin can see from 1-inch
out to 9-feet! Just plug in the Parallax PING))) and run this
code.
Ultravision is a unique way of seeing things, even in total
darkness!
humanoido
' DIRECTORY ' --------- ' INTRO TO ULTRA EYE ' RANGEFINDER ' EXTRA EYE ' RANGE & ACCURACY ' VISION CLARITY ' TIMING CALIBRATION ' PROCEDURE ' RAW TIME ' FUN PROJECTS ' INTRO TO ULTRA EYE ' ------------------ ' Penguin Ping))) Ultra Vision ' Plug in the Parallax Ping))) ultrasonic sensor and add ' an ultra eye to Penguin. Parallax Part number 28015. ' RANGEFINDER ' ----------- ' Penguin becomes an ultrasonic rangefinder for finding distances ' to walls during construction projects. ' EXTRA EYE ' --------- ' Penguin now has an extra eye. This ultrasonic eye can be ' supplemented with readings of light intensity and infrared ' measurements using Penguin sensors. ' RANGE & ACCURACY ' ---------------- ' This code adds ultrasonic vision. Range and accuracy will ' vary based on surrounding conditions and materials. Range is ' typically from 1-inch to 9-feet. Calibration *** is indicated in ' the comments. ' VISION CLARITY ' -------------- ' Vision clarity is defined by the reflectivity of the object ' surface, inherent Ping))) resolution, and ambient noise. ' TIMING CALIBRATION ' ------------------ ' The timing is calibrated as indicated in the comments. ' PROCEDURE ' --------- ' The Debug screen displays the startup splash screen, and is ' followed by: ' ' Raw Time ' Distance in Centimeters ' Distance in Inches ' Distance in Feet (remainder given below) ' Remainder in Inches ' RAW TIME ' -------- ' Raw time is the ping round trip time. ' FUN PROJECTS ' ------------ ' Try looking at a variety of different objects from feathery ' and fluffy to smooth and hard. Measure and compare the reported ' Penguin distances with a mechanical tape measure. Determine ' which objects affect vision and in what manner. ' Some typical materials to try: window glass, mirror, wood, metal, ' walls, floors, cloth, screen, feathers, carpet, people. ' Try ranging on very small objects. What is the smallest object ' the eye can discern? ' Try ranging on two objects. At what close separation distance ' will both objects still resolve? ' How does the angle to various materials effect the results? ' Do the same optical properties exist with ultrasound vision ' as with light waves? ' Using two Penguins, can you detect the ping from the other ' Penguin? How can a useful application be developed from this ' approach? ' Establish a program to recognize specific objects by ' texture. ' Write a program for Penguin to find and touch two objects.
Comments
When I tested the program the scale is wrong, the distances are too big, 62" reads 71".
How did you arrive at the factor of
time = time ** 2080/2
Shouldn't it be
**2257 (uS to cms) *0.8 (for Px counts to uS)
ie **1806
ie
time = time ** 1806/2
David
Parallax and Wikipedia quote 344m/S for speed of sound.
Wikipedia @21degC and presumably near sea level which is where most people live.
Google just gives - speed of sound at sea level = 340.29 m / s
Temperature seems to be the main factor.
My readings were taken at 20degC and 350ft above sea level and normal weather
62" reading as 71" would imply the program was for a speed of 344*62/71=300m/S
http://www.fighter-planes.com/ has a table of SPEED OF SOUND AT DIFFERENT ALTITUDES
300m/S equates to about 30,000 ft at -44degC.
using a factor of 1806 gives 57" for 58" actual so it is about right
1806 is the factor required for 0.8uS counts
the factor for 1uS counts would be 1806/0.8 = 2257 (which is the factor quoted in the Ping documentation)
2257/65536=0.0344
1/0.0344 =29.04 uS/cm which implies 344m/S
which is where we started.
So unless the factor is for on the wing of a plane at 30,000ft where is it for?
Alternatively what is wrong?
David
humanoido
I don't see how a damaged Ping could give bad results since both the ping flight time and the output pulse must governed by the Ping processor clock and so any errors would cancel out.
David
humanoido
The factors are in the universal version already written by Parallax in 2005.
Ping_Demo.BS2
in the folder
28015-BScode-v1.4
in the zip
28015-BScode-v1.4.zip
which can be downloaded from
http://www.parallax.com/Store/Sensors/ObjectDetection/tabid/176/CategoryID/51/List/0/Level/a/ProductID/92/Default.aspx?SortField=ProductName,ProductName
which is the Ping page in the Store.
This has conditional compilation for various Stamps including the BS2px
<snip>
#SELECT $STAMP
#CASE BS2, BS2E
Trigger CON 5 ' trigger pulse = 10 uS
Scale CON $200 ' raw x 2.00 = uS
#CASE BS2SX, BS2P, BS2PX
Trigger CON 13
Scale CON $0CD ' raw x 0.80 = uS
<snip>
RawToIn CON 889 ' 1 / 73.746 (with **)
RawToCm CON 2257 ' 1 / 29.034 (with **)
<snip>
David