Shop OBEX P1 Docs P2 Docs Learn Events
Dynamic Acceleration without tilt? — Parallax Forums

Dynamic Acceleration without tilt?

RedWolfRedWolf Posts: 2
edited 2009-10-27 19:42 in Accessories
I am a newbie so please please forgive me if this is s dumb question. Is it possible to write the basic stamp code in such a way as to recognize dynamic acceleration without tilt/ static acceleration from the H48C accelerometer? I need to sense deceleration/acceleration along one axis regardless of the tilt orientation of the sensor. My problem is that the sensor is giving me the same values for static tilt acceleration as it does for dynamic acceleration and I get a "false positive" reading. Any ideas?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-26 19:24
    No. According to Einstein, inertial and gravitational acceleration are equivalent. There's no way to tell them apart using acceleration measurements alone. To do what you want, you need an inertial frame of reference, such as a gyro, a three-axis compass, or — if in a controlled envronment — an external optical reference.

    -Phil
  • MikeKMikeK Posts: 118
    edited 2009-10-27 01:29
    My physics is a bit (a lot, really) rusty, but if you only care about the magnitude of the acceleration, and not the direction, could you use sqrt(x**2 + y**2 + z**2), where x, y, and z are the acceleration in each axis, and subtract the value at rest (1, g, etc) to get the dynamic value?

    Mike
  • SRLMSRLM Posts: 5,045
    edited 2009-10-27 02:10
    Could you clarify what you mean by "static acceleration" and "dynamic acceleration"?
  • James LongJames Long Posts: 1,181
    edited 2009-10-27 02:40
    SRLM said...
    Could you clarify what you mean by "static acceleration" and "dynamic acceleration"?

    I think he means static acceleration (gravity, which makes the sensor read 1G). Dynamic acceleration would be any movement forces.

    The problem here is deciding which is static, and which are dynamic.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-27 03:29
    MikeK said...
    ... if you only care about the magnitude of the acceleration, and not the direction, could you use sqrt(x**2 + y**2 + z**2), where x, y, and z are the acceleration in each axis, and subtract the value at rest (1, g, etc) to get the dynamic value?
    Yes, I think that will work. No matter how it's tilted, the computed magnitude for g should always be the same and can be subtracted from the overall magnitude. The difficulty comes when you need the directions and can have tilt and acceleration on any axis.

    -Phil
  • Dave HeinDave Hein Posts: 6,347
    edited 2009-10-27 15:39
    RedWolf,

    Can you describe your application in more detail?· You may need a gyro in addition to the accelerometer to distinguish between the effects of gravity and acceleration.· Since we know that we're in a gravity field of 1G we know that a "sensed" 1G of vertical acceleration actually means that we're not really accelerating in that direction.· If we define Z to be the vertical axis, then the actual acceleration in that direction is Az = Asz - G, Asz is the acceleration measured from the sensor in the Z direction.·· For the other directions Ax = Asx and Ay = Asy.

    If the sensor is rotated relative to vertical things become more coplicated.· You would have to subtract out the gravitational component for each dimension.· That's where the gyro comes in to provide the angle.· However, the gyro will drift so you'll need other sensors to recalibrate the gyro.

    Dave
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-27 18:39
    I just ran through the math, and I was wrong. You can't subtract magnitudes, or even squared magnitudes. The vector additions just don't work that way. To do what you want, you will still need a measure of the tilt that's independent of accelration, so you can tell how much gravity to subtract from each component of the measured acceleration.

    -Phil
  • RedWolfRedWolf Posts: 2
    edited 2009-10-27 19:42
    Thanks for all of the input.· I will give the gyro addition some thought.



    RedWolf
Sign In or Register to comment.