08-21-2011 05:31 PM
This is the first time I have tried to use the accelerometer sensor. Before I start ripping my hair out, I thought I would check for some best practices...
When the device (my 9800 Torch) is sitting stationary on the table, it registers quite a bit of noise. More than an app would be able to tolerate. I assume I should just collect the samples in a buffer and average them. I'm using a raw channel. What have others done?
A bigger issue seems to be inconsistent acceleration based on orientation. i.e. Gravity measured in the vertical axis is not the same as gravity measured in the horizontal axis. It varies quite a lot. e.g. 960 vs 1020. Even int the same axis, top_up and bottom_up give substantially different numbers - off as much as 10%.
It's clear that you can have a calibration button and calculate the offsets. But that means the user needs to ensure they have a level surface to calibrate it. Is there some factory calibration data stored in the device somewhere?
Any other advice on the topic will be mist appreciated.
08-24-2011 12:54 PM - edited 08-24-2011 01:19 PM
Reading 100 samples into a buffer an reading them seems to have had a very positive aeffect.
But how do you deal with the offsets in the accelerometer? eg 1020 vertical vs 980 upsidedown?
Is it safe to assume that all BBs will have the same offsets?
Can anyone comment on the linearity of the readings? Are they compensated for internally? Or do I really need to build a lookup table to correct them?
08-24-2011 04:59 PM
What you are seeing is expected. During manufacturing accelerometer calibration is performed to reduce the offset and misalignment as much as possible. However slight variations will be seen from device to device and there is no API that gives the offset data. You could address this by adding a calibrate routine in your application. Many third party applications use this approach.
08-24-2011 10:14 PM
Is it safe to calibrate it in 3 axis instead of 6? i.e. is it just an offset? So 1020 down would read 980 up? Or should I calibrate up and down separately?
08-25-2011 04:42 AM
i think it is not safe to calibrate it in 3 Axis instead of six, u will get Acceleration Values in negative also,it depends upon u , ur requirments,Also for reducing noise u can take sample after several intervals(intervals of 200-300, or 500ms ),and can take decisions to catch sample when Acceleration Difference of previous and next values is grater than 10, or 20 , or can design sensitivity accordingly range.
don't say "Thanks" press Kudos (like button at left ) button instead!
Accept as solution if my suggestion works..
01-13-2012 10:34 PM
Thought I should update on progress...
In the end, I found it very useful to read the data sheets for the accelerometer chips themselves. The manufacturers of the chips gave a lot of good guidance on how to work with their chips. Some even gave source code examples. Try googling things like "MEMS ACCELEROMETER DATA SHEET". There are lots. It doesn't have to be the chip as in the BB. It's the approach that's important. Calibration is one of the better covered topics.