Robofun 機器人論壇

標題: mpu6050 靈敏度調整 [打印本頁]

作者: x10532x    時間: 2014-7-12 01:39
標題: mpu6050 靈敏度調整
各位 大家好
想請問大家一下 關於mpu6050的問題在這款mpu6050的加速度計部分  有 ±2g, ±4g, ±8g, and ±16g 四種範圍可以選擇
原本以為這四種靈敏度 如果不動放在桌上(如果是z軸朝桌面)則會呈現 1g
但經過我更改靈敏度範圍  則分別是 1g, 2g, 4g, and 8g
想請問這個狀況是正確的嗎?
根據我查到的資料更改方式是 arduino 比如輸出x軸加速度是ax
依datasheet 除以lab (ax/16384.0) 這樣的方式去更改靈敏度
有神人可以幫我解答嗎?  感謝
作者: vegewell    時間: 2014-7-12 03:34
回復 1# x10532x
不動放在桌上(如果是z軸朝桌面)則會呈現 1g
設定±2g, ±4g, ±8g, and ±16g 四種範圍 只是輸出值不同(依各人喜好) 都是最多1g(Full Scale Range)
比如輸出x軸加速度是ax 除以lab
設定為±2g -----> ax/16384.0
設定為±4g -----> ax/8192.0
設定為±8g -----> ax/4096.0
設定為±16g -----> ax/2048.0
---------------------------------------------------------------------
#define MPU6050_ACCEL_FULL_SCALE   0
Configure the full scale range of accelerometer outputs.

Select the full scale range of accelerometer outputs according to the following table.

AFS_SEL
Full Scale Range
0
+-2 g
1
+-4 g
2
+-8 g
3
+-16 g
returned result is a 16bit signed integer, so if you want to get the gravity (g). the result need to be divided by 65536/full scale range.
for example:

MPU6050_ACCEL_FULL_SCALE set to 2 (+-8 g)
65536/16.0 = 4096.0
the read Accel_X result is 3863
which means the angle velocity is 3863/4096.0 ≒ 0.943 g
作者: x10532x    時間: 2014-7-13 02:16
回復 2# vegewell


   感謝你!!!!




歡迎光臨 Robofun 機器人論壇 (https://robofun.net/forum/) Powered by Discuz! X3.2