Accelerometer data: How to interpret?

前端 未结 4 1116
臣服心动
臣服心动 2021-01-30 18:36

I\'m experimenting with a 3 accelerometer breakout board. The X and Y axis are very easy to control, but the Z axis is a bit of a mystery. I\'m trying to find a way of interpret

相关标签:
4条回答
  • 2021-01-30 19:14

    Without any sort of context, this is hard to answer...

    The accelerometer measures acceleration:

    In physics, acceleration is the rate of change of velocity over time. In one dimension, acceleration is the rate at which something speeds up or slows down.

    • Positive values indicate an increase in velocity.
    • Negative values indicate an decrease in velocity.
    • Zero values indicate constant velocity (which might not be zero).
    0 讨论(0)
  • 2021-01-30 19:20

    I can say that gravity (Earth attraction) is equal to constant acceleration of approx 9.8 m/s/s. So, before calculating acceleration, one should substract this value from the measure.

    0 讨论(0)
  • 2021-01-30 19:23

    Basic Understanding Of Accelerometers: (Only for some conceptual clarification)

    Accelerometers measure acceleration, often caused by motion. But when they are standing still, the only acceleration the accelerometer senses is due to gravity pulling down on it.

    Imagine a box that has little springs sticking straight out from the sides of the box, and that the accelerometer measures how hard gravity is stretching out those springs. The springs on the side are all bending the same amount, the spring on the bottom is all stretched out, and the one at the top is not stretched at all (because the spring is pull back into itself), so the accelerometer sees it as feeling no gravity, or 0g (gravity). If you rotate the box 90º and follow the spring on the top. It is now on the side and is hanging down some and the sensor sees it now feels .5g. Rotate 90º again, and it is at the bottom, stretched out, and it feels 1g. Rotate again 90º and we are at the side again, with it feeling .5g, and 90º rotation again, we are back at the top and it feels 0g. So we made a full rotation and the accelerometer saw this: 0g-> .5g -> 1g -> .5g -> 0g.

    If you look at this, it means that the accelerometer can really only sense differences in 180º of movement as the other 180deg is just a mirror image. So how can we sense 360 deg of movement?

    The trick to this is that while one axis can only sense a 180deg difference, so can the another axis, but they sense it differently. If you look at the chart to the right, you can see the sensed values while rotating round the X Axis. (The x never changes because it is always facing the same direction) – So we can combine the y, and z values to find x using a trigonometry function called Atan2 who then gives us values back as -180º to 180º (but in radians, so it is -π to π and well have to convent it).

    Sensed gravity during rotation around X-axis

    If you are interested you should read the full article Sensing Orientation With The ADXL335 + Arduino. You might also get some useful information from the accepted answer of this question if you decide to use gyro along with the accelerometer which is likely what you might end up doing.

    0 讨论(0)
  • 2021-01-30 19:33

    I've wrote code that leverages the accelerometer. It measures the rotation of the device on each of its own 3 axis. Great for making games. The accelerometer measures angular acceleration instead of linear. Basically, you can use it to determine the orientation of a device in 3 dimensions. Think about the 3 different ways an object can spin and you'll realize what those x, y, and z numbers are.

    0 讨论(0)
提交回复
热议问题