有没有办法去除加速度计数据中沿重心轴的小偏差 [英] Is there any way to remove the small bias along the gravity axis in the accelerometer data

查看:124
本文介绍了有没有办法去除加速度计数据中沿重心轴的小偏差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与此问题类似:
CMDeviceMotion userAcceleration drift

我在iOS5 SDK中使用CMDeviceMotion.userAcceleration来绘制其x,y,z组件。与上面的帖子一样,我看到z加速度分量总是显示小的正值(0.005 - 0.015),而当我的iPhone 4s坐在平坦的表面上时,x和y分量以零(-0.005 - 0.005)为中心。

I'm using CMDeviceMotion.userAcceleration in iOS5 SDK to plot its x, y, z components over time. Like the above post, I see z acceleration component shows always small positive values (0.005 - 0.015) while x and y components are centering along zero (-0.005 - 0.005) when my iPhone 4s is sitting on a flat surface.

即使我的手机没有移动一点,这个小偏差仍然会增加估计的速度(我通过积分加速度数据来计算)。有没有已知的方法可以从加速度计数据中消除这种偏差?我不能简单地从z分量中减去偏差,因为如果设备处于某个任意方向,偏差似乎沿着重力轴在x y和z上扩展。

This small bias keeps adding up to the estimated velocity (which I compute by integrating the acceleration data) even when my phone is not moving a bit. Is there any known way to remove this bias from the accelerometer data? I cannot simply subtract the bias from z component because it seems that the bias spreads over x y and z along the gravity axis if the device is in some arbitrary orientation.

我知道CMDeviceMotion.userAcceleration中的数据已经使用Gyro数据计算了重力,但想知道是否有任何有效的方法可以消除这种残留偏差?

I know that the data in CMDeviceMotion.userAcceleration has already factored out the gravity using Gyro data but wonder if there is any effective way to remove this residual bias?

推荐答案

老问题,但我想分享一些见解。加速度计中的部分偏差实际上并非来自传感器中的任何不准确性,而是来自Apple所做的计算中的疏忽。计算假设重力始终为1 G(根据定义为9.80665 m / s2)。任何剩余必须是用户加速。

Old question, but I wanted to share some insight. Part of the bias in the accelerometers actually does not come from any inaccuracies in the sensors, but from an oversight in the calculations that Apple does. The calculations assume that gravity always is 1 G (which is by definition 9.80665 m/s2). Any left-over must then be user acceleration.

然而,重力在全世界范围内略有不同。如果您所在区域的重力不是精确到9.80665 m / s2,则用户加速度会有一个小偏差,可通过低通滤波器检测到。通过以下计算可以消除这种偏差:

However, gravity varies slightly all over the world. If the gravity in your area is not exactly 9.80665 m/s2, then there will be a small bias in the user acceleration, which is detectable with a low-pass filter. Such a bias can removed with the following calculation:

- (void) handleDeviceMotion:(CMDeviceMotion *)m atTime:(NSDate *)time
{
    // calculate user acceleration in the direction of gravity
    double verticalAcceleration = m.gravity.x * m.userAcceleration.x + 
                                  m.gravity.y * m.userAcceleration.y +  
                                  m.gravity.z * m.userAcceleration.z;

    // update the bias in low pass filter (bias is an object variable)
    double delta = verticalAcceleration - bias;
    if (ABS(delta) < 0.1) bias += 0.01 * delta;

    // remove bias from user acceleration
    CMAcceleration acceleration;
    acceleration.x = m.userAcceleration.x - bias * m.gravity.x;
    acceleration.y = m.userAcceleration.y - bias * m.gravity.y;
    acceleration.z = m.userAcceleration.z - bias * m.gravity.z;

    // do something with acceleration
}

提醒你即使消除了这种偏差,仍然存在很多噪声,并且每个加速度计芯片也可能存在不同的制造偏差。因此,你仍然很难获得速度,并且肯定会从中获得定位。

Mind you, even with that bias removed, there is still a lot of noise, and there could also be a manufacturing bias different for each accelerometer chip. Therefore, you will still have a hard time deriving velocity and certainly position from this.

这篇关于有没有办法去除加速度计数据中沿重心轴的小偏差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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