本帖最后由 弘毅 于 2014-5-24 21:14 编辑
各位前辈们,为了做个创作前不久买了GY521和 GY86 并在论坛和大家一起学习MPU6050。在论坛里看到很多关于旋转的识别,但我最近想利用MPU6050的加速度能实现空间位移的计算,完全取替我的Kinect。论坛里的前辈们也说会出现很严重误差不太可行。于是在网上希望能找可行的答案。
以下是我的围绕这个话题所找的实例,自己的想法以及遇到的问题。最后附上今天刚整理的带中文书签MPU6050说明。
例子1先呈在youtube上看到的一个例子,是Univercity of Bristol几个学生用6DOF(也即是GY-521三轴加速度+三轴陀螺)制作的测步器,可以看到他们成功测量出各轴旋转以及xyz轴的位移- 视频:3D Tracking with IMU
视频网址 http://www.youtube.com/watch?v=6ijArKE8vKU - 上传的作者描述
This video demonstrates an algorithm that enables tracking in 6DOF (pitch, roll, yaw, and x, y, z displacement) using only an IMU (gyroscope and accelerometer). The algorithm uses assumptions of gait overcome the problems with obtaining a position through the double integration of acceleration.
Data was collected using an x-IMU; a self contained unit with on-board gyroscope, accelerometer and SD-card logging. See: http://www.x-io.co.uk/x-imu
The data was then processed using my own algorithms to achieve the plots shown in this video.
The work presented was conducted by Sebastian O.H. Madgwick during his Ph.D research at the University of Bristol. - 他在评论有关位移的回答
Orientation data is combined with accelerometer data to ‘remove’ gravity and compute accelerations in the Earth frame. This result is then integrated to yield a velocity. This fundamental process is to remove drift from this velocity. A second integration obtains the position shown in the video.
例子2再看这篇——理解Android AcceleroMeter——关于加速器的介绍
文章网址:http://ustcchenjian.wordpress.com/2010/08/29/%E7%90%86%E8%A7%A3android-accelerometer/- 下面我引用他说的这句
x和y轴,都比较好说,即当手机沿着y轴是正向加速时,就给正值,否则给负值。
§我的想法是
- 从加速度计得到xyz各轴的加速度。(暂时排除误差)
我是按照前辈Randy的方法矫正了加速度三个轴的LSB输出
[pre lang="arduino" line="18" file="MPU6050_raw.ino"]Serial.print("a/g:\t");
Serial.print(ax/8192); Serial.print("\t");
Serial.print(ay/8192); Serial.print("\t");
Serial.print(az/8192); [/code] - 通过加速度方程运算出各个轴的S,作为xyz的向量.
?但,目前我仍然停留在第1步,因为加速度计无论我怎么移动,重力Z轴给出的值一直是1以上的值,其他轴无论是正或是反方向移动给出都是负数,到底是
- 我的加速度计设置问题?
- 还是我对加速度计理解不对?
- 另外,如果有别的能算出位移的好点子也希望前辈们赐教。{:soso_e154:}?
*最后,附上最近官方更新的MPU6050寄存器说明和产品说明书,今日为了进一步学习为其加上书签和书签的翻译,分享给研究MPU6050的同学方便查阅。
|