|
After the NEIRG games this past weekend, Jona asked me for the details on how
I did proximity detection, and in case my findings might be interesting I'm
posting them here.
After trying all the other methods described in this forum, I still wasn't
satisfied (I'm trying to apply it to finding a sumo opponent). Lacking any
electronic equipment, I turned to the only bit I had - the RCX, datalog-equiped.
An RCX with a light sensor served as a "Recorder", running a NQC program that
was nothing more than 810 repeated AddToDatalog(SENSOR_2) commands, which
allowed me to sample the light hitting the sensor every 3 ms or so. By sending
IR messages towards this Recorder, I verified two points:
1) SendMessage(); lasts somewhat under 45 ms (allowing
Recorder 9-14 samples of an incoming SendMessage()
message).
2) The message itself "looks" noisy, with wildly
irregularly varying bright & dark samples on a 3 ms
resolution level.
Techniques like simple Ping (send message and look for a "significant"
difference in readings between two readings) have problems because they might be
comparing two peak values, or two low values, and therefore not see a
significant change even during a reflection. Another method is to sample the
ambient level (before SendMessage()) & compare it to the level during a "ping",
which will given you a possible "hit" roughly 50% of the time. After a couple of
other methods (like averaging), I hit on "max-picking LIDAR":
i = SENSOR_2; // record an 'ambient' light level
SendMessage(255); // send an IR message out...
Wait(2); // ... and pause till message gets going
j1 = SENSOR_2; // |
j2 = SENSOR_2; // | rapidly as possible, sample the
j3 = SENSOR_2; // | light level multiple times
j4 = SENSOR_2; // |
if (j2>j1) j1=j2; //
if (j3>j1) j1=j3; // compare results, keeping max in j1
if (j4>j1) j1=j4; //
k = j1-i; // the difference is the brightest reflection
All these calculations mean you don't have as a high a repetition rate, but the
increased reliability makes up for it (Simple Ping will run about 25 pings/sec
but mis-interpret at least half, while Max-picking LIDAR runs at 17 pings/sec).
It will reliably detect a wall at 3 feet, and can distinguish different
distances reliably (still no absolute distance measurements, of course, but with
calibration...). As for smaller targets, a lone RCX broadside at 1' registers
clearly, better than twice the background level. Not too bad, overall.
If you want higher reliability and can handle lower frequency sampling, just
use more samples in the routine above (the choice of four samples was a
trade-off for speed and frequency in the sumo contest, and not ideal for all
applications).
Thanks to all the folks that have given me ideas, hints, help, and snippits
of code - I wouldn't have gotten half as successful a solution with out both the
help & proding of others.
--
Brian Davis
|
|
Message has 1 Reply: | | Re: Max-picking LIDAR
|
| (...) .. major snippage ... Nice work! Although I like building custom sensors, I also really enjoy the ingenuity of people working with what's available. I have a question which may help others duplicate your work - did you expressly ensure the RCX (...) (21 years ago, 4-Mar-04, to lugnet.robotics)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|