gpt4 book ai didi

加速度计数据 : How to interpret?

转载 作者:行者123 更新时间:2023-12-04 00:00:43 24 4
gpt4 key购买 nike

我正在试验一个 3 加速度计分线板。 X 轴和 Y 轴很容易控制,但 Z 轴有点神秘。我试图找到一种方法来解释我的代码中的数据,以在设备在空中抬起时增加输出,并在降低时减少输出。这可能吗?如果是这样,如何?也许如果有人可以指出我有帮助的良好引用来源。

最佳答案

加速度计的基本理解: (仅用于一些概念上的澄清)

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

如果您有兴趣,请阅读全文 Sensing Orientation With The ADXL335 + Arduino .
您还可以从这个 question 的公认答案中获得一些有用的信息。如果您决定将陀螺仪与加速度计一起使用,这可能是您最终会做的事情。

关于加速度计数据 : How to interpret?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5871429/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com