Reputation: 329
I have a board which provides acceleration values of a triaxial accelerometer (X, Y, Z: Y is the up vector). I want to get the acceleration direction in the XZ-plane. But the board may be mounted with a tilt. Can I compensate the tilt and how would I do that? I appreciate any hint. It would be nice if someone could point me into the right direction.
Upvotes: 0
Views: 411
Reputation: 215114
You need to calibrate all accelerometer products so that they know what's normally the down direction. Based on your calibration, you get the true (x,y,z) coordinates in relation to the gravity component. The calibration values have to be added/subtracted from each accelerometer read.
Alternatively (and less professionally), you could make some sort of adaptive system which continuously saves the (x,y,z) coordinates whenever there is a total acceleration of 1G +/- margins. You can then apply a median filter to the sorted samples and hopefully you'll get the real coordinates of (x,y,z) corresponding to the gravity component. In order for this to be reliable, you'd have to implement some kind of AI, so that the program learns over time and stores the likely coordinates in NVM. Otherwise the program would always fail each time you get a use case where the total acceleration is 1G in any direction.
Upvotes: 1