# Calculating Speed with an accelerometer

Discussion in 'Electronic Design' started by [email protected], Mar 7, 2005.

1. ### Guest

Im thinking of a senior project for next year, and thought of making a
module that calculates velocity and then can transmit the data
wirelessly. I could demonstrate it on a r/c car, rocket, etc.

The wireless data transmission isnt the problem, the speed calculation
accelerometers that output a PWM signal that a micro could then count
over time and determine velocity.

But since theres no absolute reference coming from the accelerometer,
it seems like the calculated velocity could easily get out of sync over
time and with stop/go bumpy acceleration.

Anybody have any thoughts on this? Are there other approaches better
suited?

Ben

2. ### martin griffithGuest

On 7 Mar 2005 13:39:25 -0800, in sci.electronics.design
GPS seems obvious

martin

"An eye for an eye makes the whole world blind"
Gandhi

Integral of acceleration provides velocity information, subject to
restrictions of the resolution of your measurements and the bandwidth of

Voltage across the drive motor also provides velocity information,
subject to a voltage drop error in the armature resistance when
providing torque (either due to friction (minimal) or acceleration), and
scaled by an unknown constant.

Creative coding in a micro may allow these techniques to cross check
each other.

4. ### Phil HobbsGuest

<snip>

Using accelerometers by themselves tends to become inaccurate very
quickly, since any dc offset or drift turns into a position error that
grows quadratically or cubically, respectively, with time.

Inertial navigation of this sort is very much easier for a land vehicle
than for a rocket, because in free fall, the acceleration due to gravity
won't register on the accelerometer--and tiny, tiny errors in finding
the vertical direction have large effects.

Cheers,

Phil Hobbs

5. ### DaveMGuest

If you think about it, an accelerometer measures change in velocity. At a
constant velocity, the accelerometer output would be zero (or nearly zero).
A more appropriate way would be to sense motor speed with a tach or by
sensing power being supplied to the motor.

--
Dave M
MasonDG44 at comcast dot net (Just subsitute the appropriate characters in

Never take a laxative and a sleeping pill at the same time!!

6. ### John LarkinGuest

Even a 1% acceleration zero error will accumulate rapidly into a big
velocity error. And tilt looks just like acceleration. For a rocket,
with high g's and a short burn time, this would be usable (in fact,
it's done), but for something like a car, probably not.

John

7. ### James MeyerGuest

For a rocket, the easiest way would be to include a small transmitter in
the rocket. The transmitter's output frequency would be doppler shifted due
directly to velocity. A receiver on the ground would measure the shift. Both
transmitter and receiver would need appropriate frequency stability.

Jim

8. ### Guest

Congradulations, you just fell upon the problem with inertial
navigation; that and drift in the gyros. Better components, lower
drift, better tracking.

9. ### John LarkinGuest

Right. It might be difficult to get an oscillator that's sufficiently
g-insensitive to make this work.

John

10. ### Tim ShoppaGuest

Are there other approaches better suited?

Find somebody with a good radar speed gun, and offer them "I'll give
you this accelerometer if you measure my speed for me".

Tim.

11. ### Rich WebbGuest

And Kalman filters... ;-)

12. ### MacGuest

IIRC, it is not at all obvious that this is the best approach or that it
will even work.

--Mac

13. ### Ken SmithGuest

I don't think the vehicle case is any easier. You have the lumps and
bumps and jerking around to make sure that any inaccuracy in the ADC gets
found.

When a lump pushes the car up, tips it and shoves it sideways all at once,
you are really screwed unless you have a rotation detector that is quite
good. With out it, the exact same data can come from two very different
events where the car speed and direction are both different between the
cases.

14. ### Ken SmithGuest

An atomic clock or Laser may be required.

15. ### Ken SmithGuest

Kalman filters are nice but they can easily lead you to making pretty
looking lies. GPSes commonly use Kalman filters. Sometimes you'll see a
path like this:

..........................*........................
..........................*........................
.........................*.........................
........................*..........................
......................**...........................
....................**.............................
..................**...............................
................**.................................
.............***...................................
.........****......................................
********..................************************

The GPS'es model for what was going on got very far from the real physics
for a while and then the code realized it screwed up and corrects its
self. I've seen as many a 3 or 4 of these in 8 hours of GPS data.

16. ### MacGuest

This is the understatement of the year.
The accelerometer idea won't work at all, except maybe in a rocket, as
suggested by someone elsewhere in the thread.

I suggest you forget about the accelerometer and use GPS or ultrasonics,
or just use the rotation speed of the axle or motor or something.

--Mac

17. ### Guest

If I went with a GPS approach, would a GPS have enough precision to
resolve between an rc car moving pretty short distances, on the order
of a tens of feet maybe?

If the resolution is there, it seems plausable that changes in position
could be timed.

18. ### MacGuest

The position reported by the GPS has plenty of precision. But there is a
lot of error. How the error varies with time is something I'm not too sure
about, but that is what you need to know. For example, if you imagine
logging positions from a stationary GPS over half an hour, you would
expect that the reported position would wander during that half hour. But
if it never wanders more than a foot or two over the course of a minute,
then GPS might work. If it jumps around 20 feet per second, then it
probably won't work for you.

There are differential GPS's that will definitely work, but for that,
you have to buy two, and they are expensive, and require either a radio
link or data post-processing. These things will give you sub-inch
precision and relative accuracy.

The way they work in the post processing mode is that instead of just
solving for position, they record all the GPS information from all the
satellites they can track. Later the post processing software figures out
the position of the mobile GPS with respect to the stationary one to very
high resolution.

If you have a real-time radio link between the two units, then they
transmit enough information back and forth to do the same thing, but the
mobile unit then does it itself, internally, in real time.

I wonder whether you could just use two regular GPS's, with one on the
vehicle, and one stationary, but nearby. Then whatever hardware is
receiving the messages from the RC car could also receive messages
from the stationary GPS, and subtract the two GPS positions (vector wise)
to get a vector from the known location of the stationary GPS.

There are a lot of reasons why this might not work very well, but it is a
thought. I doubt it would work any worse than a single GPS, which still
might work OK, especially if you have a good view of the sky.

Good luck. Don't let the scope of this project get out of control.
Otherwise you'll never finish! ;-)

--Mac

19. ### BarbarianGuest

All of the GPS receivers that I am familiar with will give you a speed
calculation once per second, not very practicle for an R/C vehicle moving in
fits and spurts.

20. ### James MeyerGuest

However, it's head and shoulders above an accelerometer approach.

What was the consensus concerning why doppler shift woldn't work?

Jim