The PING doesn't give you frequency information which you'd need for Doppler sensing. Better to use a wheel encoder to determine the rotational speed of the wheels and use that and the wheel diameter to estimate the speed of the BoeBot. You could use a PING to tell the distance to some fixed object and determine the change in distance over several fixed interval times to determine the speed.
It would be doable in some form, but not as doppler per se. There are some limitations -- you would need to ensure that at all times the 'bot is less than 3 meters from any "wall" (i.e., you must always have an obstacle that reflects the Ping's ultrasonics) and you'd need a reasonably stable external timebase. If you have those, then you could do something like:
1. Measure time (could just be 2hz "ticks" or similar)
2. take a Ping reading
3. save distance
4. wait 1/2 second
5. Measure time
6. take a Ping reading
7. difference between two readings / time = speed
Not sure it's worth it though as the boe-bot moves relatively slowly, and the ultrasonics may give you spurious readings on occasion. Encoders would probably be a more reliable measurement of true speed.
That said, I have often used a trick with ultrasonics not to determine speed, but to see if a 'bot is "stalled" -- if the ultrasonics return a distance of 150cm, and the 'bot is moving forward at full speed, then the next distance reading should be significantly less than the first reading. If it is about the same, then the 'bot must be stalled. Again, this kind of trick only works if the 'bot is always in an environment where the "walls" are less than the maximum readable distance of the sensor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ When the going gets weird, the weird turn pro. -- HST
Yeah, of course, random objects like cats can also trick the 'bot into thinking it's stalled, when in fact a "new" obstacle has really popped up where there wasn't one before ....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ When the going gets weird, the weird turn pro. -- HST
Comments
1. Measure time (could just be 2hz "ticks" or similar)
2. take a Ping reading
3. save distance
4. wait 1/2 second
5. Measure time
6. take a Ping reading
7. difference between two readings / time = speed
Not sure it's worth it though as the boe-bot moves relatively slowly, and the ultrasonics may give you spurious readings on occasion. Encoders would probably be a more reliable measurement of true speed.
That said, I have often used a trick with ultrasonics not to determine speed, but to see if a 'bot is "stalled" -- if the ultrasonics return a distance of 150cm, and the 'bot is moving forward at full speed, then the next distance reading should be significantly less than the first reading. If it is about the same, then the 'bot must be stalled. Again, this kind of trick only works if the 'bot is always in an environment where the "walls" are less than the maximum readable distance of the sensor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php