[HELP] distance detection from linear acceleration
I would like to ask for help.
We are trying to detect distance from linear acceleration data. I recorded a session with MetaBase, loging linear accelearation (100Hz). The MMR was on the desk, after 5sec i raised up about 30cm, after 5sec i put down on the desk and so on... So i only moved it in the Z axis.
This is the raw data i recieved (only Z):
As you see there is an offset about +0,02 g. Is it normal when using linear acceleration?
According to this document (https://nxp.com/docs/en/application-note/AN3397.pdf ) i made an offset correction (-0,021) from the avarage of the first 500 samles, made the filtering, moving avarage, integration for velocity, movement detection, and another integration for distance.
What i willing to see is something like this
But what i get is, that the upright move is ok, but when i put in back on the desk, it has an incemental offset:
Can you help me, what can be wrong? Is it because the offset? I attached the raw data i recieved.