- Thu Apr 05, 2012 9:52 am
#142383
Hi Guys,
Im totally new to i2c and arduino. I just got my first batch of components I ordered and I am trying to understand / decipher calibration of the BMA180 from its datasheet.
I have the sparkfun BMA180 up and running over i2c and I am getting a skewness from all three axis.
Setup:
Arduino FIO 3v + BMA180 hooked up to analog 4,5 for i2c.
BMA180 set for 8G mode and 10Hz sampling rate
Reading raw acceleration values after gently rotating the BMA180 to all 6 sides I consistently ( give or take 50 ) get these results:
min_x:-1212
min_y:-1250
min_z:-809
max_x:822
max_y:813
max_z:1309
Now by my calculations at 0.99mg * value, ( 8G mode ), I get to 1.2G in one direction and 0.8G in the other direction.
I think 1G should be around 1035 in 8G mode, is that right?
So I clearly need to recalibrate somehow, since my negative axis are all like 250 off. I have looked at the datasheet and tried to understand the fine calibration chapter, but all my attempts to enable calibration by setting offset_finetuning ( 0x22 ) to 11 or 10 and then setting en_offset_x to 1 have yielded no change in my X axis values at all.
So im wondering if im writing to the correct memory location, since I find the same en_offset_x and offset_finetuning in higher memory registers eg 0x42. But the datasheet doesnt say if purple is rw/ro or if green is rw/ro? what is white and greyed out?
The alternative is to actually change the offset_x/y/z values but I dont quite understand how to do that. I know that my deviations are:
min_x:-1277 // -1036 = +241
min_y:-1245 // -1036 = +209
min_z:-785 // -1036 = -251
max_x:810 // 1036 = + 226
max_y:853 // 1036 = +183
max_z:1289 // 1036 = -253
So do I simply read back my current offsets and add or subtract these numbers directly?
My current offsets are:
X:1644 Y:1800 Z:2447
from what I understand 2048 is the zero trim offset. So is each number here a multiple of 0.99mg in 8G mode? or does the sensor itself take care of the conversion?
Can anyone help me with some code examples of actually calibrating a BMA180 and if im using the correct memory registers?
Thanks for any help!
Kegan
Im totally new to i2c and arduino. I just got my first batch of components I ordered and I am trying to understand / decipher calibration of the BMA180 from its datasheet.
I have the sparkfun BMA180 up and running over i2c and I am getting a skewness from all three axis.
Setup:
Arduino FIO 3v + BMA180 hooked up to analog 4,5 for i2c.
BMA180 set for 8G mode and 10Hz sampling rate
Reading raw acceleration values after gently rotating the BMA180 to all 6 sides I consistently ( give or take 50 ) get these results:
min_x:-1212
min_y:-1250
min_z:-809
max_x:822
max_y:813
max_z:1309
Now by my calculations at 0.99mg * value, ( 8G mode ), I get to 1.2G in one direction and 0.8G in the other direction.
I think 1G should be around 1035 in 8G mode, is that right?
So I clearly need to recalibrate somehow, since my negative axis are all like 250 off. I have looked at the datasheet and tried to understand the fine calibration chapter, but all my attempts to enable calibration by setting offset_finetuning ( 0x22 ) to 11 or 10 and then setting en_offset_x to 1 have yielded no change in my X axis values at all.
So im wondering if im writing to the correct memory location, since I find the same en_offset_x and offset_finetuning in higher memory registers eg 0x42. But the datasheet doesnt say if purple is rw/ro or if green is rw/ro? what is white and greyed out?
The alternative is to actually change the offset_x/y/z values but I dont quite understand how to do that. I know that my deviations are:
min_x:-1277 // -1036 = +241
min_y:-1245 // -1036 = +209
min_z:-785 // -1036 = -251
max_x:810 // 1036 = + 226
max_y:853 // 1036 = +183
max_z:1289 // 1036 = -253
So do I simply read back my current offsets and add or subtract these numbers directly?
My current offsets are:
X:1644 Y:1800 Z:2447
from what I understand 2048 is the zero trim offset. So is each number here a multiple of 0.99mg in 8G mode? or does the sensor itself take care of the conversion?
Can anyone help me with some code examples of actually calibrating a BMA180 and if im using the correct memory registers?
Thanks for any help!
Kegan