Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Speed Trap

2004-03-10 by Wagner Lipnharski

LightYearCS wrote:
> You would most likely need a high speed timer to do this.  The
> microprocessor can read the results but I'm not sure if the built in
> timers would be fast enough to record the events.  You would have to
> define the parameters regarding accuracy.
>
>
>
> What are your acceptable tolerances?
>
>
>
> Barry


Wow, a 4MHz clock and timer running at full clock, would give him 250ns
resolution.
Suppose a 10cm apart sensors, and the projectile launches at 331m/s (sound
speed), then the two sensors distance 10cm would be covered within 302.115
microseconds.  The AVR counter would count a value of 1208.
Isn't that enough?

The correct division would generate 1208.4592 counts, but it will count only
1208.

The 250ns resolution would give him speed span of 10cm/250ns = 400km/second.
A round integer counting of 1208 would means 331.125m/s, but, if counting
bumps to 1209 it would mean 330.9m/s, at this range, one count would
represent a delta 0.225m/s

For further resolution, you can always use a faster clock (see AtTiny26) or
increasing the distance between the sensors.

I guess the worse nighmare would be to adjust exactly the distance between
the sensors. An physical installation error of 1mm (will happens easily)
(instead of 10cm you install them 9.9cm apart); a 331m/s projectile will
cover 99mm distance in 299.094 microseconds, 4MHz clock will count a round
integer of 1196, but you thinking it was 100mm distance will lead to a wrong
calculation, resulting in 0.1 / 1196 x 250ns = 334.448m/s.

So you see, the biggest problem in accuracy is to positionning exactly the
sensors.
Far distance between the sensors, better accuracy.

You could always calibrate the unit, but finding a "referente high speed"
will always be a problem.
You can't simply go to the store and ask for a 1000km/h speed reference. :)

The only easy way is to get a sinchronous AC motor, lets say 600rpm (10rps),
install a 1m diameter large disk at the shaft, make a mark at the edge,
measure the speed of that mark with the installed sensors 10cm apart.  1m
diameter = 3.14159 m circunference, 10rps = 31.4159m/s, 10cm apart =
3.178741ms, 4MHz counter should count 12714.96.  Reversing the numbers:  0.1
/ 12714 x 250ns = 31.46138m/s



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2/28/2004

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.