Shop OBEX P1 Docs P2 Docs Learn Events
Digest Number 641 — Parallax Forums

Digest Number 641

ArchiverArchiver Posts: 46,084
edited 2001-05-10 17:11 in General Discussion
Tracy:
If I remember my physics (and that's a streeeeeetch of remembering) 1/2 a
t^2 will give you distance travelled.

Message: 1
Date: Wed, 09 May 2001 13:23:41 -0400 (EDT)
From: rpogge@3...
Subject: Re: accelerometer

ok this helps a ton thanks Tracy.
It will be very steep and over short periods of time-
aproxamatly 4 seconds for 0-60 MPH, and I would also like 0-100 MPH.
I need accuracy to tenths of a second, so I will go in incrememts of 0.1
seconds instead of 1 second, I would realy liek it to be acurate to
hundredths,
but I wonder if the amount of error at this level would make that
pointless.

-Ryan

> >Pop quiz:
> >
> >If I have only the inputs of acceleration and time, how do
> >I determine the time that elapses between 2 speeds (like 0 and 60
> MPH)?
> >
> >anyone remember the physics equation(s)? [noparse]:)[/noparse]
> >
> >-Ryan
>
> Hi Ryan,
>
> Integrate acceleration over time. In the computer, that will mean
> taking samples of the acceleration at, say, one second increments,
> and adding them up, second by second.
> velocity(t) = velocity(t-1) + [noparse][[/noparse]accel(t) * oneSecond]
> Of course (caveat emptor) this can lead to serious errors over a long
> time period, depending on accuracy of the measurements, accuracy of
> the clock, and accuracy of the discrete time calculations. If the
> acceleration is steep, you'd do better to average the acceleration
> for each second.
> velocity(t) = velocity(t-1)
> + [noparse][[/noparse](accel(t)+accel(t-1))/2 * oneSecond]
> Better yet, take the samples every 0.1 second, say, then divide the
> velocity by 10 at the end.
>
>
> 'BS2 integrator
> ' enter with initial velocity
> ' and initial accel0
> loop:
> gosub waitforsecond ' do this by the clock
> seconds=seconds+1
> gosub getacceleration ' current value accel1
> velocity = (accel0+accel1)/2 + velocity
> accel0=accel1
> if velocity<60 then loop ' grab the target time
> debug ? seconds
> end
>
>
> If acceleration is constant, you can use
> v = 1/2 a t^2.
>
> -- regards,
> Tracy Allen
> electronically monitored ecosystems
> mailto:tracy@e...
> http://www.emesystems.com



\
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. If you are not the intended recipient
of this message you are hereby notified that any use, review,
retransmission, dissemination, distribution, reproduction or any
action taken in reliance upon this message is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer. Any views expressed in this message
are those of the individual sender and may not necessarily reflect
the views of the company.
\

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-05-10 17:11
    > If I remember my physics (and that's a streeeeeetch of remembering) 1/2 a
    >t^2 will give you distance travelled.

    Right, thanks for pointing that out. Several people did get it right!

    > If acceleration is constant, you can use
    velocity = a*t + v0
    distance = (v0*t) + (a*t*t/2)
    where
    v0= initial velocity
    a=acceleration
    t=time

    -- Tracy
Sign In or Register to comment.