To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 26421
26420  |  26422
Subject: 
RE: NXT Ultrasonic sensor / Retreiving 8 OBjects at Once
Newsgroups: 
lugnet.robotics
Date: 
Wed, 6 Sep 2006 22:10:27 GMT
Reply-To: 
<dickswan@sbcglobal.net!NoMoreSpam!>
Viewed: 
2828 times
  
Juergen Stuber wrote on Wednesday, September 06, 2006 2:18 PM

since sound travels at about 333 m/s (depending on temperature and
pressure), a meter takes 3 milliseconds. At the maximum range of 2.5
meters, times two that would be 15 milliseconds per reading.

Unfortunately, you cannot operate a ultrasound sensor at this rate. I
think it is much slower than this. Before you start a new "ping" you
have to ensure that all the echoes from distant devices on first ping
have been received before starting the next ping.

My experience with other sensors (e.g. the SRP04 sensor used in the high
school FIRST competition) is that a periodic polling interval of around
75 msec is usually used.

I couldn't find any documentation on the LEGO ultrasound sensor
"continuous polling rate". But there is a register readable by I2C to
"read" or "set the continuous polling interval. So I loaded up the
RobotC I2C debugging window and spent a few minutes to discover.

1. The 'polling interval' (I2C read of 02 40) was value 0.
2. This seemed a little strange so I did a "warm reset" on the sonar
   sensor (I2C write 02 41 04) and the 'polling interval' value changed
to
   1.
3. So this was pretty useless. I was hoping that it might be some nice
   units like "msec between poll". A guess is that there's a minimum
   polling interval of around 75 msec and this value might represent
   additional delay to add between polls.

I think the "single shot" sample mode may allow you to bypass the sensor
driven polling delay. I think when you issue a "single shot sample" it
will start immediately and not on a periodic cycle.

I had the US DK in front of me and a debugging window all open, so I
used the opportunity to explore the US capability to simultaneously
"measure distances for up to 8 objects at a time". This capability is
only available with "single short command". What I found was.
1. Whenever the US sensor sends a ping it stores the distance to the
   first eight echoes that it receives. These are stored in I2C
   registers 0x42 to 0x49 in the US sensor. They are ordered from
shortest
   to longest distance.
2. You can retrieve all eight distances by performing a simple single
   multi-byte I2C read of all eight registers. Here's typical values (in

   hex) received " 09 10 20 FF FF FF FF FF" indicating three pings
   received at 9, 16 and 32 cm (converted hex to decimal).

I know some people are writing a "mapping" scheme by rotating the US
sensor in a full circle. Having all eight readings might be useful for
this.


One final note. As I was reading the H/W Development Kit (HDK) and the
Ultrasound appendix, I noticed a little anomaly that I haven't seen
repeated before. The HDK provides a recommended "I2C register" mapping
(pg 10). The actual mappings of the LEGO sensor (pg 2 of the US DK)
don't correspond to the guidelines! US sensor uses registers 11-14 for
configuration values whereas guidelines recommend registers 18-1B. I
guess the US sensor was developed in advance of the guidelines. :)



Message has 2 Replies:
  Re: NXT Ultrasonic sensor / Retreiving 8 OBjects at Once
 
This here: (...) Is exactly what I want to do! Do you have any links? If any of your friends have any of their work online I'd love to check it out.. Thanks! Ben (18 years ago, 6-Sep-06, to lugnet.robotics)
  Re: NXT Ultrasonic sensor / Retreiving 8 OBjects at Once
 
(...) (URL) Hansen (18 years ago, 7-Sep-06, to lugnet.robotics)

Message is in Reply To:
  Re: NXT Ultrasonic sensor
 
Hi, (...) since sound travels at about 333 m/s (depending on temperature and pressure), a meter takes 3 milliseconds. At the maximum range of 2.5 meters, times two that would be 15 milliseconds per reading. Cheers Jürgen (18 years ago, 6-Sep-06, to lugnet.robotics)

13 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR