Go to Post Look for metal shavings in a pwm port; that's caused us to crash plenty of times. - Gary Dillard [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 05-08-2004, 10:46
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Using and Coding an ultrasonic sensor

Quote:
Originally Posted by BurningQuestion
I was thinking of using a sensor such as this one . Can you recommend a better one? How do you write the code for a sensor like this?
I'm all for any attempt by teams to move away from dead reckoning to something more sophisticated. I think autonomous is going to become a real drag if we don't start heading that direction. With that said...

The sensor you listed here wouldn't have been allowed this year (I don't think any of the approved suppliers carry it). Hopefully the rules will be relaxed next year, but you never know. I don't have experience with any of these sensors, however we did investigate the use of them for our robot this year. Depending on what the rules are next year with regards to infrared emitters on the robot, there's some IR rangefinder devices that I believe are much cheaper than these ultrasonic ones.

Writing code for proximity sensors depends a lot on the sensor in question. Many of the IR prox sensors just output an analog voltage (hook it up to an analog input on the RC and just read the value! Pretty convenient!) The sensor you selected above appears to work a little differently and would be harder to work with. Basically you hook the output of that sensor up to a digital input on the RC, and after you tell it to measure distance, it will send a high signal to the digital input for a length of time that is proportional to the distance to the target. This means you need a good way to accurately measure time. So, you need to set up one of the timers on the processor to run at a known rate, then you probably want to hook the sensor up to an interrupt line and trigger the interrupt on both the rising edge and falling edge (I believe the RC supports this, but it's been a while since I looked at it). Then you just start the timer when you get the rising edge interrupt and stop it when you get the falling edge (and don't forget to account for rollover). Obviously it'd be a lot easier to try to find a sensor that just gives you an analog output
Quote:
Originally Posted by Lisa Perez
is there any way that these sensors may be programmed in such a manner that they will not react to other robots on the field but rather, just the playing field itself?
Unfortunately no. All these sensors can tell is if there's an object that reflects sound (or IR, for the infrared ones) within it's path. The sensor has no knowledge of what type of object it is, which is why navigating with these would be very difficult, because you can't really be sure if the reflection you're getting is from the playfield wall or from another robot, or a ball, or some junk that got dropped on the field, or....
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 15:38.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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