I have been working on this problem for a few weeks, what seems to be approaching the best idea is first taking the average.
Then get the standard deviation.
Then the range of values that should be zero is:
mean +- 2*standard deviation
If we do this for every axis that seems to work best.
Someone else on the forums also suggested (if you are trying to get distance from acceleration) using simpson's rule.
Here's some wiki pages to get you started:
Z-Score
Standard Deviation
Simpson's Rule
by the way we call a calibration method on disabledInit() and it completes in about 30 seconds.
Edit: Hard mounted
Does anyone know of a better way?