Subject:
|
Re: Ultrasonic maximum timing
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Thu, 18 May 2000 17:43:08 GMT
|
Original-From:
|
Will Bain <willb@selwaySAYNOTOSPAM.umt.edu>
|
Viewed:
|
1105 times
|
| |
| |
Hey all --
I was wrong about the speed of sound.
The mistake I made was forgetting that the sonar measures round trip time, so the
constant I experimentally determined for use in my code actually represents *two*
centimeters per 143 clock ticks (instead of one cm per 143 ticks as I had said earlier).
If the clock ticks at 2 MHz (as I believe it does, using an 8 MHz oscillator), this equates to 626 mph, which is fairly close to the nominal speed of sound.
Regardless of my error, the maximum range (corresponding to 32767 ticks) is still about 2.29 meters by my calculation.
-- Will
> I think the register maxes out at 32767. Since it's a 2 MHz processor, this gives:
>
> (32767 cycles) / (2,000,000 cycles/second) = 0.01638 seconds
>
> Up here in the Rocky Mountains, the speed of sound is about one centimeter
> every 143 half-microseconds, so the maximum range is 2.29 meters.
>
> Adam Oliver wrote:
> >
> > Greetings all,
> >
> > I'm using a homebuilt sonar based on Kam Leang's design, which seems to be
> > working quite well. I just have one question with regard to the timing on
> > the input port. I'm using the same sonar driver as for the polaroid - right
> > now I can't remember which input is used for the return "echo".
> >
> > My question is, what is the maximum time that the timer can measure before
> > returning a -1? I'm curious, as I'd like to know the maximum distance I can
> > measure on the HB, so I can set my sonar unit up accordingly.
> >
> > Thanks for your help
> > Adam
+---------------------------------------------------------+
Conscience: the inner voice which warns us that someone
may be looking. -- H. L. Mencken
--
MIME ATTACHMENTS DISCARDED:
1. Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Content-Length: 1485
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|