Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   Ultrasonic Range Finder (http://www.chiefdelphi.com/forums/showthread.php?t=41520)

polyBot 10-01-2006 19:04

Ultrasonic Range Finder
 
Hi, I was wondering if the minirc from ifirobotics is capable to generate and accept signals to and from an ultrasonic range finder. And if so, how to go about doing so. Please help.

mechanicalbrain 10-01-2006 19:16

Re: Ultrasonic Range Finder
 
I see no reason why not. It uses PWM just like a full sized RC, all you need is a PWM ultrasonic sensor. I recomend either the VEX sensor or Parallax's.

Rickertsen2 10-01-2006 19:24

Re: Ultrasonic Range Finder
 
Well it depends on the rangefinder. I have seen ultrasonic rangefinders that output everything from pwm, to serial data. Specifically what rangefinder are you looking at?

polyBot 10-01-2006 19:33

Re: Ultrasonic Range Finder
 
Thanks. Now, I'm having a problem firing and receiving data from the ultrasonic range finder. Currently using srf05 from acroname

:http://www.acroname.com/robotics/parts/R271-SRF05.html

It takes a 40 kHz frequency. How do I generate this using the first default code? And how can I get the PWM signal back? Thanks a lot for help.

MikeDubreuil 10-01-2006 19:41

Re: Ultrasonic Range Finder
 
Quote:

Originally Posted by polyBot
Thanks. Now, I'm having a problem firing and receiving data from the ultrasonic range finder. Currently using srf05 from acroname

:http://www.acroname.com/robotics/parts/R271-SRF05.html

It takes a 40 kHz frequency. How do I generate this using the first default code? And how can I get the PWM signal back? Thanks a lot for help.

You have to use two I/O pins from the mini-RC. One to send a 10uS pulse and the other to listen for an echo. When I find the code for it I'll try to post it. I'm having a difficult time finding an up to date version.

John Gutmann 10-01-2006 22:58

Re: Ultrasonic Range Finder
 
Why do you need the range finder?

If it is to find how far from the goal you are then there is an easier method. If you plan on using the CMU cam then have a constant in the program for the height of the light and then just derive the angle from the PWM signal of the servo. THen all you need is to do some trig :D

Shu Song 10-01-2006 23:10

Re: Ultrasonic Range Finder
 
Quote:

Originally Posted by sparksandtabs
Why do you need the range finder?

If it is to find how far from the goal you are then there is an easier method. If you plan on using the CMU cam then have a constant in the program for the height of the light and then just derive the angle from the PWM signal of the servo. THen all you need is to do some trig :D

Having the RC do trig calculations takes up a lot of time and might make the program very slow. Whats most of the time done to get around that is to store a table of essential trig values and just have the RC look the values whenever you need them. Now it becomes an O(1) operation and speeds up the code a lot.

But as you've probably guessed by now, you can't possibly store the sin/cos values of every angle so you must round your angles to the nearest 5 or 10 degrees, adding more error on top of whatever calculation you're already doing.

The ultra sound provides for a more accurate range measurement with minimal error.

mechanicalbrain 10-01-2006 23:15

Re: Ultrasonic Range Finder
 
Quote:

Originally Posted by sparksandtabs
Why do you need the range finder?

If it is to find how far from the goal you are then there is an easier method. If you plan on using the CMU cam then have a constant in the program for the height of the light and then just derive the angle from the PWM signal of the servo. THen all you need is to do some trig :D

Actually I've been looking at using ultrasonics to detect other robots in autonomous mode and hopefully avoid them. With the field as open as it is and a bunch of robots moving to similar goals the last thing we want is a game of chicken between two blind robots. :ahh:

Quote:

Originally Posted by Shu Song
The ultra sound provides for a more accurate range measurement with minimal error.

Mmmmm more or less.... I don't know if you ever used them in Physics class or not but from playing with them they tend to by pretty finicky.
One, you have to assume their's nothing between you and the wall.
Two, you are facing the wall almost vertically, they don't like angles that much.
Three, that they have the range. The Parallax sensor I referenced had a range of 3.35 meters and that's pretty darn good for a ultrasonic sensor.
I admit I haven't actually used one in a robot application but we use them routinely in our physics class. They tend to be best at hitting a flattish surface at close range.

Shu Song 11-01-2006 00:09

Re: Ultrasonic Range Finder
 
Quote:

Originally Posted by mechanicalbrain
Mmmmm more or less.... I don't know if you ever used them in Physics class or not but from playing with them they tend to by pretty finicky.
One, you have to assume their's nothing between you and the wall.
Two, you are facing the wall almost vertically, they don't like angles that much.
Three, that they have the range. The Parallax sensor I referenced had a range of 3.35 meters and that's pretty darn good for a ultrasonic sensor.
I admit I haven't actually used one in a robot application but we use them routinely in our physics class. They tend to be best at hitting a flattish surface at close range.

lol, shows you how much I know about this stuff. I believe my team will be taking the trig table approach as we've had trouble with sensors to calibrate in the past. But this ultra sound sensor sounds like it would be just as much a paint to set up as doing the trig for it and compensating for the error.

polyBot 11-01-2006 15:52

Re: Ultrasonic Range Finder
 
When I pulse out (PWM) to the ultrasonic range finder, it seems that the device is firing too rapidly. And how should I go about recieving the signal back. Any ideas?

dcbrown 11-01-2006 17:23

Re: Ultrasonic Range Finder
 
I'm using the SF04 which is similar.

I start a ping via:


iopin_sonar_out = 1; // start 10us pulse

/* wait 10us, @instruction is 100ns and there are 3 per loop */
/* loop counter = 100/3=33 */
for (counter=33; --counter != 0; ); /* ~10us delay */

iopin_sonar_out = 0; // end pulse

Then you wait for the output (echo) line to go high and time the pulse between going high until going low again. Ours is tied to one of the configurable interrupt lines and captures the system clock time in the interrupt routine at the two echo pulse edges then does the math.

You also have to wait some time between pulses, something like 50ms before you can start another ping.

See http://www.robot-electronics.co.uk/htm/srf05tech.htm for more info.

DCBrown

John Gutmann 11-01-2006 23:12

Re: Ultrasonic Range Finder
 
I looked at a few rage finders and the graphs were not linear, wouldn't this propose a problem with having to do extra calculations?

Kingofl337 12-01-2006 11:53

Re: Ultrasonic Range Finder
 
We testing the ultrasonic for EasyC for FRC we found that the Vex Ultrasonic was very good for its size and cost. The unit can measure distance accurately upto 15' away.

polyBot 12-01-2006 18:02

Re: Ultrasonic Range Finder
 
Ok. I've got the ultrasonic range finder firing and returning a signal via PWMs on the miniRC. Now the problem is, the range is only good for about 8 inches, beyond that, it outputs the maximum value (255). What could be the solution here?

MikeDubreuil 29-01-2006 09:54

Re: Ultrasonic Range Finder
 
Quote:

Originally Posted by polyBot
Ok. I've got the ultrasonic range finder firing and returning a signal via PWMs on the miniRC. Now the problem is, the range is only good for about 8 inches, beyond that, it outputs the maximum value (255). What could be the solution here?

Polybot, that setup won't work because you need an accurate way to measure the time of the pulse width. Take a look at my SONAR software driver for a solution.

Gdeaver 29-01-2006 12:46

Re: Ultrasonic Range Finder
 
Some thoughts on Ultrasonic and IR range finders for the 2006 game. Use a range finder to keep a constant distance from the field wall to the robot as you drive to the corner goal. Use another to track the range to the corner goal and determine when to unload into the corner goal. Use a range finder to track onto that power house team that always gets 10 3 pointers in autonomous and bump or whack whatever to throw them off. I don't know if any teams are to the point of integrating the ball shooter, camera, drive train to shoot in autonomous mode but, I have serious concerns about the accuracy of the whole system. Could be that a drive straight - sonar position with way point could be more precise. Time will tell.


All times are GMT -5. The time now is 05:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi