本帖最后由 小人 于 2013-5-20 00:00 编辑
林定祥 发表于 2013-5-19 18:46
也在学习,有些难,但是有两个问题必须澄清:
1、此传感器是重力加速度传感器,也即传感器不管怎么放或怎么动 ... 我很赞成你的观点,首先你提出的两个问题很关键:
- 如例2 所说运算的时候
假设此时手机沿z轴正向加速度为2m/s^2,那么android会返回2+9.8=11.8这么一个值;
假设此时手机沿z轴负向加速度为2m/s^2,那么android会返回(-2+9.8)=7.8这么一个值 但在论坛里看到有前辈说MPU6050的加速度值本身就是通过DMP处理器融算出来的结果,不知道是否因为通过DMP处理后的的加速度值只为陀螺的旋转服务,所以目前静止时出来重力的值都均为1?所以我们若-9.8是不对的.我大胆猜想我们在z轴减1就可以了。
关于DMP根据论坛里johnsonzzd的提醒是:
MPU6050已经不需要咱们自己写程序把角速度和角速度融合得到角度了。它里面同时集成了角速度和陀螺传感器,内部还有处理器(Digital Motion Processor)在进行数据处理,可以直接从它的内部寄存器把角度读出来,这个东西就是所谓的DMP。
我的地址从程序里可以看出来,MPU6050 mpu(0x68);。
http://www.i2cdevlib.com/devices/mpu6050#help
What is the DMP?
The DMP, or Digital Motion Processor, is an internal processing unit contained within the MPU-6050 and its successors (MPU-6150, MPU-9150, possibly more in the future). The processor has been described by InvenSense employees as a sort of limited CPU, or alternatively as an enhanced ALU (arithmetic logic unit), which is built with an instruction set designed for very specific 3D math operations necessary for orientation calculation. There is currently no known resource for understanding what this instruction set is or how it works |
|
- 第二点如果你说的“速度变慢会得到负值”,也正是加速度的定义。如果MPU6050的原理也是这样,那么我现在所得到的值也是合理的。只是他一直按移动速度给值的话,那我从哪里得到反方向运动的量呢?
|