How to adjust x,y,z acceleration when device not quite level

Comments & issues
Post Reply
itsalltoomuch
Phidgetsian
Posts: 6
Joined: Tue Dec 20, 2016 10:37 am
Contact:

How to adjust x,y,z acceleration when device not quite level

Post by itsalltoomuch »

Hi,
We have multiple 1044 3/3/3 devices that are glued to floors as level on each axis as possible.
At idle a reasonably level device will look like x: -0.0038 y: 0.00455 z: 0.00122 (reduced by 1)

When the floor is shaken, the readings are displayed in a typical acceleration by time graph and for each axis the base of each series is always offset from zero.

Is there a recommended approach to adjusting the values read to reduce the typical offset from initial zero?

We have experimented with recording 1000 readings and calculating the maximum for x,y,z and then using this value to adjust actual values but this seems a bit clumbsy. Although the devices are running all the time, readings are only taken for a brief period once the acceleration goes above a threshold value.

TIA
User avatar
mparadis
Site Admin
Posts: 960
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: How to adjust x,y,z acceleration when device not quite l

Post by mparadis »

I'm not clear on what you're looking for- are you hoping to calibrate out this small amount of tilt, or are you finding that the sensors don't return to the same zero position after being moved?
itsalltoomuch
Phidgetsian
Posts: 6
Joined: Tue Dec 20, 2016 10:37 am
Contact:

Re: How to adjust x,y,z acceleration when device not quite l

Post by itsalltoomuch »

Hi,
I'm wanting to to calibrate out this small amount of tilt.
User avatar
mparadis
Site Admin
Posts: 960
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: How to adjust x,y,z acceleration when device not quite l

Post by mparadis »

It's been a while since I've done this kind of math, but I believe you have to use some linear algebra:

1. When the accelerometer is at rest, measure the acceleration in all three axes and convert it into a vector.

2. Create a rotation matrix that rotates the vector into your desired vector (in this case, [0 0 1])

3. For all future data, convert into a vector and use the rotation matrix to determine the actual levelled acceleration.
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests