简体   繁体   English

使用 9 轴 IMU 将加速度双重积分到位置

[英]Double Integration of Acceleration into Position using 9-Axis IMU

First post on this forum, hope I'm doing this right.在这个论坛上的第一篇文章,希望我做对了。 I know there have been several threads on double integration of acceleration in the past, and I know about the errors inherent in an accelerometer that isn't a 200k+ military grade sensor.我知道过去有几个关于加速度双重积分的主题,我知道加速度计固有的误差,而不是 200k+ 军用级传感器。 Fortunately my purposes I just need it to be approximately correct (+/- 3 inches) for no longer than ten seconds.幸运的是我的目的我只需要它大约正确(+/- 3 英寸)不超过 10 秒。

I'm almost there already.我快到了。 I am using the linear acceleration off a bno055 IMU.我正在使用 bno055 IMU 的线性加速度。 I'm sampling at a rate of 50hz (every 20ms).我以 50hz(每 20 毫秒)的速率进行采样。 Every time I sample, I use basic trapezoidal integration to move from acc to velocity and velocity to position.每次我采样时,我都会使用基本的梯形积分来从加速度移动到速度,从速度移动到位置。 I have a "discrimination window" to throw out at-rest error, and a "movement end detect" code to set the velocity back to 0 after the acceleration is 0 for a given amount of counts.我有一个“鉴别窗口”来排除静止错误,还有一个“运动结束检测”代码,在加速度为 0 后,对于给定的计数,将速度设置回 0。

It's working after a fashion, I just need it to work a little bit better.它在时尚之后工作,我只需要它工作得更好一点。 I'm seeing some really odd kickback where I move the accelerometer and the position moves with it pretty correctly until I stop, then the position "kicks back" by several inches - sometimes nearly back to where I started.我在移动加速度计时看到了一些非常奇怪的反冲,并且位置随着它的移动非常正确,直到我停下来,然后位置“反冲”几英寸 - 有时几乎回到我开始的地方。 Brought in a friend much smarter than I am and he recommended I integrate smarter, using 4 or 5 data points instead of the last two that I use in trapezoidal integration.带了一个比我聪明得多的朋友,他建议我更聪明地积分,使用 4 或 5 个数据点,而不是我在梯形积分中使用的最后两个数据点。

So my question: How can I use the last four or five data points to integrate more precisely than basic trapezoidal integration?所以我的问题是:如何使用最后四个或五个数据点进行比基本梯形积分更精确的积分? I tried looking into Euler and RK4 but it's been a long time since I've done higher-level math and I didn't know where to start.我尝试研究 Euler 和 RK4,但自从我完成高级数学以来已经很长时间了,我不知道从哪里开始。 If someone could explain rather simply, that would be awesome.如果有人能简单地解释一下,那就太棒了。 Thanks.谢谢。 For background, this code is all running on a microcomputer so I can't run the data through matlab.对于后台,这段代码都是在微机上运行的,所以我无法通过matlab运行数据。

PS.附注。 I was also recommended using a high-pass filter, but again, when I tried to start reading up on digital high pass filters I just couldn't make sense of it.我也被推荐使用高通滤波器,但同样,当我试图开始阅读数字高通滤波器时,我就是无法理解它。 I thought I'd start with the smarter integration and see what that does.我想我会从更智能的集成开始,看看它有什么作用。

Although the OP has undoubtedly solved this problem in the two years since posting, I am responding because I encountered the same issue and discovered the solution after reading this question.虽然OP在发布后的两年内无疑已经解决了这个问题,但我正在回应,因为我遇到了同样的问题并在阅读这个问题后找到了解决方案。

For the OP's purpose the trapezoidal integration or even a midpoint estimate of integration would work fine.出于 OP 的目的,梯形积分或什至积分的中点估计都可以正常工作。 More complex or more accurate integrations are not necessary for the curves representing this kind of simple motion and will not help with this particular problem.表示这种简单运动的曲线不需要更复杂或更精确的积分,并且不会帮助解决这个特定问题。

The problem described is that the position is tracked properly for a period of time, but the position jumps backwards when the device stops moving.描述的问题是在一段时间内位置被正确跟踪,但是当设备停止移动时位置向后跳。 This behavior occurs because of improper use of velocity damping.这种行为是由于速度阻尼使用不当造成的。

When the device is moved and then stopped there is a momentary acceleration and then some period of constant velocity motion (zero acceleration) and then a period of deceleration (decreasing velocity) until the device is once again at rest.当设备移动然后停止时,会出现瞬时加速,然后是一段时间的匀速运动(零加速度),然后是一段时间的减速(降低速度),直到设备再次静止。

The OP reports using OP 报告使用

"movement end detect" code to set the velocity back to 0 after the acceleration is 0 for a given amount of counts. “运动结束检测”代码用于在给定计数的加速度为 0 后将速度设置回 0。

The OPs problem was very likely that during the period of constant velocity motion, the acceleration was zero so the velocity was artificially reset to zero in this attempt at a noise-reducing (dampening) algorithm. OPs 问题很可能是在恒速运动期间,加速度为零,因此在尝试降低噪声(阻尼)算法时人为地将速度重置为零。 The subsequent deceleration then causes a negative velocity for some period of time, returning the calculated position almost all the way back to the starting point.随后的减速会在一段时间内导致负速度,将计算出的位置几乎一直返回到起点。

If tracking small discrete movements, one solution to this particular problem is to detect and track the cycle of acceleration -> coasting -> deceleration and to apply dampening algorithms only after the deceleration part of the cycle has completed.如果跟踪小的离散运动,这个特定问题的一个解决方案是检测和跟踪加速 -> 滑行 -> 减速的循环,并仅在循环的减速部分完成后应用阻尼算法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM