Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 264
Registered: ‎10-05-2010
My Device: Not Specified

Dealing with accelerometer sensor noise

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.

 

Thanks

Peter

Highlighted
Developer
Posts: 264
Registered: ‎10-05-2010
My Device: Not Specified

Re: Dealing with accelerometer sensor noise

[ Edited ]

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?

 

Thanks

BlackBerry Development Advisor
Posts: 15,698
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Dealing with accelerometer sensor noise

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.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 264
Registered: ‎10-05-2010
My Device: Not Specified

Re: Dealing with accelerometer sensor noise

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?

 

Thanks

Peter

Developer
Posts: 79
Registered: ‎09-22-2010
My Device: 9700

Re: Dealing with accelerometer sensor noise

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..

Developer
Posts: 264
Registered: ‎10-05-2010
My Device: Not Specified

Re: Dealing with accelerometer sensor noise

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.