Author Topic: Sonar Questions  (Read 3988 times)

0 Members and 1 Guest are viewing this topic.

Offline MarkBrownTopic starter

  • Full Member
  • ***
  • Posts: 77
  • Helpful? 0
    • Mark's Projects
Sonar Questions
« on: August 21, 2008, 12:18:46 AM »
I am looking to implement sonar in my next robot.  I have read the tutorials and the datasheet on it and I am comfortable with how to use it.  Unfortunately, all I can find about the range and width is how far and wide the sensors vision is.  My robot will need to be within two inches of object and my sensor of choice will report 6" if the object is between 0" to 6".  This is fine and like the tutorial suggests, I plan to set the sensor 6" or so inside the chassis of my robot.  However, how does sonar read/report say the ground?  If I mounted the sonar so that it was 1/2" from the ground, is the sonar signal sent in a cylindrical funal, where it would bounce off the ground, or flat, just going out to the object and back.  If it where cylindrical, would this even be a problem?  Would the signal just bounce off the ground and keep going somewhere else?

Sorry if these are answered elsewhere, but I couldn't find reference to these types of questions.

Thanks,
Mark
It is human nature to confuse genious with insanity

http://marksproject.blogspot.com/

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Sonar Questions
« Reply #1 on: August 21, 2008, 12:33:26 AM »
yes i believe the angle off the ground is too great for it to bounce back. but i have no supporting evidence.  ;)

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Sonar Questions
« Reply #2 on: August 21, 2008, 05:45:11 AM »
I'll do some tests with my Ping))) sensor tonight. From the datasheet it says that the minimum distance measured is 3cm (1 1/4 inches). I will do measurements paralel with the ground, starting at 1 inch height and going up to 4 inches, to see how good the measurements are. I'll try to detect a round object (a small table salt shaker) to see how the reflection of a round object is detected, and the angle of the sound cone.
Check out the uBotino robot controller!

Offline MarkBrownTopic starter

  • Full Member
  • ***
  • Posts: 77
  • Helpful? 0
    • Mark's Projects
Re: Sonar Questions
« Reply #3 on: August 21, 2008, 10:25:46 AM »
Thank you guys for offering to test for me tonight.  I am looking forward to the results. 

I thought about using the ping))) but after doing some research, I have decided to go with the Maxbotix LV-EZ0, http://www.sparkfun.com/commerce/product_info.php?products_id=8502.  I like that the sensor calculates the range on the sensor already and returns the range result to me, or a voltage value that can be multiplied by a set value to determine the distance.  It will detect from 0 to 255 inches, but 0" to 6" is reported as 6". 

Even the 3" that the Ping))) gives isn't enough and with the ping I still have to do calculations and find someone who has it in stock, unless I am mistaken.
It is human nature to confuse genious with insanity

http://marksproject.blogspot.com/

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Sonar Questions
« Reply #4 on: August 21, 2008, 10:44:49 AM »
The reason I chose to go with the ping is because some local retailers have it, so I just nabbed one when I saw it.

(Radio Shack, Frys Electronics, etc...)


Don't forget the value returned from the sensor does not necesarrily have to be in human readable format when used in your  algorithms. Only when sent to UART with rprintf is it nice to have it in human readable format, which is pretty easy to do.
« Last Edit: August 21, 2008, 10:48:15 AM by pomprocker »

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Sonar Questions
« Reply #5 on: August 21, 2008, 01:48:37 PM »
The conversion to inches is extremely extremely easy to do.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline MarkBrownTopic starter

  • Full Member
  • ***
  • Posts: 77
  • Helpful? 0
    • Mark's Projects
Re: Sonar Questions
« Reply #6 on: August 21, 2008, 02:38:29 PM »
I will look more throughly into the Ping))) for good measure.  I will need four to six of them so I will want to make sure I do the research.
It is human nature to confuse genious with insanity

http://marksproject.blogspot.com/

Offline Brandon121233

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 320
  • Helpful? 0
  • "Genius is %1 inspiration and %99 perspiration"
Re: Sonar Questions
« Reply #7 on: August 21, 2008, 07:23:53 PM »
Definitely go with the Maxbotics EZ1, its super easy to use and it has great results, my sensor it about 2 inches off the ground and it can accurately read about 20 feet out in inch increments before the ground starts to affect it. If you want some more info on it read my tutorial on Walbot I have source code for the Arduino too if you need it http://www.societyofrobots.com/member_tutorials/node/45
Hell, there are no rules here—we're
   trying to accomplish something.

                                                                              —Thomas Edison

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
    • Ro-Bot-X Designs
Re: Sonar Questions
« Reply #8 on: August 21, 2008, 09:38:39 PM »
Unfortunately I can't do the measurements tonight. I had to stay late at work today, but tomorrow I'll have an easier day.

I have one EZ1 sensor, 3 Ping))) sensors and a few GP2D12. I hooked them all to the balancing robot to see wich one will give me the best results.

EZ1 sensor somewhat dissapointed me. It says in the datasheet that it needs 50ms to go through the measurement and sending data in 3 different ways to the microcontroller. I need to take one measurement in the 20 ms refresh rate for the servo pulse, so I had to give it up. However, I kept it on the robot to work in paralel with the other 2 sensors. Then I noteced that it is influenced by the Ping sensor, so I turned the Ping sensor off. I hooked it to an analog pin to have the same code for EZ1 and GP2D12 to compare the readings. I set the loop at about 50ms and wached the raw values printed on my serial port. For this application, the EZ1 is not sensitive enough, it changes the values on a relatively large range of movement (balancing the robot by hand).

GP2D12 has spikes, is not stable, like it changes it's mind at every reading. Perhaps it also has a wait time until the reading is done, so I probably cought it sometimes between measurements and it returned wrong value. Perhaps using the digital versions, like the GP2D12 with I2C interface, will make it more stable, since all the time sensitive operations are done directly in the sensor.

Ping))) on the other hand, it returns data digitaly, no need for A2D conversion, but uses a timer. The good thing is you trigger the pulse when you need it, so if you use more sensors you take the measurements one after the other and they don't influence each other. Something similar may be done with the EZ1 and you can read the data in the same mode you read it for the Ping))) sensor, just you don't need to trigger a pulse, that is done automatically by the sensor. Ping))) returns time of flight (in microseconds, if you set the timer properly), so it has very fine sensitivity. Perfect for the balancer.

When using an ultrasonic sensor to determine the position of an object, allways seweep left-right taking measurements, determine the angle to the left and right where the object just appears and calculate the median angle. That would be the correct angle the object is located. Of course, this method may induce errors, but as you drive towards the object repeating the measuring method, the errors will fade away.
Check out the uBotino robot controller!

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,431
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
    • Nerdcore - Programming, Electronics, Mechanics
Re: Sonar Questions
« Reply #9 on: August 22, 2008, 09:58:19 AM »
On my other post entitled $50 robot ping sensor or something like that, the other guy mentions using the ping on the capture pin with a high resolution timer, and you can an exponentially more accurate reading than what I am doing using PORTC and a regular 8 bit timer.

 

SMF spam blocked by CleanTalk