加速度计重力组件 [英] Accelerometer gravity components

查看:272
本文介绍了加速度计重力组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题肯定是解决地方很多次了,请赐教,如果你知道它们的存在,谢谢。

I know this question is definitely solved somewhere many times already, please enlighten me if you know of their existence, thanks.

简要介绍: 我想计算从一个3轴加速度计重力因素对每个3轴。 我已经使用2轴自由体图制定出加速度计的重力因素,世界XZ,YZ和XY轴。但是该解决方案似乎稍微偏离,这是可以接受的极端情况下,当只有1加速度计轴暴露于重力,但对于这两个45度的俯仰和滚转,将合并的总幅度大于重力(由Xa ^ 2 +衙得到^ 2 +杂^ 2 = G ^ 2; XA,雅和杂志在其X-加速度计读数,Y和Z轴)

Quick rundown: I want to compute from a 3 axis accelerometer the gravity component on each of these 3 axes. I have used 2 axes free body diagrams to work out the accelerometer's gravity component in the world X-Z, Y-Z and X-Y axes. But the solution seems slightly off, it's acceptable for extreme cases when only 1 accelerometer axis is exposed to gravity, but for a pitch and roll of both 45 degrees, the combined total magnitude is greater than gravity (obtained by Xa^2+Ya^2+Za^2=g^2; Xa, Ya and Za are accelerometer readings in its X, Y and Z axis).

更多细节: 该装置是Nexus之一,并有一个磁场传感器,用于方位角,俯仰和横滚除了3轴加速度计

More detail: The device is a Nexus One, and have a magnetic field sensor for azimuth, pitch and roll in addition to the 3-axis accelerometer.

在世界轴(以Z在同一方向的重力和X或Y指向北极,不认为这重要的多吗?),我以为我的设备对一个间距(P) YZ轴,和在XZ轴的辊(R)的。有了,我用简单的触发获得: 仙(R)= AX / GXZ COS(R)=一个z / GXZ 谭(R)= AX /了Az

In the world's axis (with Z in the same direction as gravity, and either X or Y points to the north pole, don't think this matters much?), I assumed my device has a pitch (P) on the Y-Z axis, and a roll (R) on the X-Z axis. With that I used simple trig to get: Sin(R)=Ax/Gxz Cos(R)=Az/Gxz Tan(R)=Ax/Az

还有另一套供节距,P

There is another set for pitch, P.

现在我定义重力有3部件在世界轴,一个GXZ即可测量只在XZ轴,一个GYZ为YZ,和一个GXY为XY轴。 GXZ ^ 2 + GYZ ^ 2 + GXY ^ 2 = 2 * G ^ 2 在2G是因为重力在这个定义中有效地包含两次。

Now I defined gravity to have 3 components in the world's axis, a Gxz that is measurable only in the X-Z axis, a Gyz for Y-Z, and a Gxy for X-Y axis. Gxz^2+Gyz^2+Gxy^2=2*G^2 the 2G is because gravity is effectively included twice in this definition.

呵呵和XY轴产生一种更奇特的......我会解释,如果以后需要。

Oh and the X-Y axis produce something more exotic... I'll explain if required later.

从这些公式我得到一个公式AZ,并取消了棕褐色的操作,因为我不知道如何处理tan90计算(这是无穷大?)。

From these equations I obtained a formula for Az, and removed the tan operations because I don't know how to handle tan90 calculations (it's infinity?).

我的问题是,任何人都知道我做的是否正确/错误或能够给我指出了正确的方向?

So my question is, anyone know whether I did this right/wrong or able to point me to the right direction?

谢谢! DVD

推荐答案

据我了解你的问题,你知道你的设备的俯仰和偏航(从磁力计),并希望利用这些信息以及计算重力的分量您的每一个(设备)的坐标轴?

As I understand your question, you know the pitch and yaw of your device (from the magnetometer) and want to use this information to calculate the component of gravity along each of your (device) coordinate axes?

作为一个物理学家,我带来了欧拉角代替俯仰偏航辊,但望着<一个href="http://en.wikipedia.org/wiki/Yaw,_pitch,_and_roll">http://en.wikipedia.org/wiki/Yaw,_pitch,_and_roll我会计算具体步骤如下: 假设你的设备最初沿全局坐标系为导向,使重力肾小球内皮细胞:= {0,0,-g} (在本地帧)。现在,我们来计算肾小球内皮细胞的局部坐标,我们通过偏航俯仰翻滚(你提到偏航没有做任何事情)。 对我来说这是最容易与旋转矩阵:我们必须改变角度的迹象,因为肾小球内皮细胞原地踏步。我会做这与数学,因为这是我的锤子,这是一个钉子

As a physicist I'm brought up with Euler angles instead of pitch-yaw-roll, but looking at http://en.wikipedia.org/wiki/Yaw,_pitch,_and_roll I would calculate this as follows: Assume that your device is initially oriented along the global coordinate frame, so that gravity is gvec:={0,0,-g} (in the local frame). Now we have to calculate the local coordinates of gvec as we go through the yaw-pitch-roll (yaw doesn't do anything as you mention). To me this is easiest with rotation matrices: we have to change the sign of the angles since gvec stays put. I'll do this with Mathematica because that's my hammer and this is a nail

yaw = RotationMatrix[-yawangle,{0,0,1}];
pitch = RotationMatrix[-pitchangle, {0,1,0}];
roll = RotationMatrix[-rollangle,{1,0,0}];
gvec={0,0,-g}
yaw.gvec
pitch.yaw.gvec
roll.pitch.yaw.gvec

输出是偏航之前,当地的坐标肾小球内皮细胞,和偏航,俯仰和滚转后(所以最后一行下面应该是你的答案):

The output is the local coordinates for gvec before yaw, and after yaw, pitch, and roll (so last line below should be your answer):

{0,0,-g}
{0,0,-g}
{g Sin[pitchangle],0,-g Cos[pitchangle]}
{g Sin[pitchangle],-g Cos[pitchangle] Sin[rollangle],-g Cos[pitchangle] Cos[rollangle]}

这篇关于加速度计重力组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆