Electronic – arduino – Making accelerometer sense nonconventional gravity

accelerometerarduinogravity

I am working on a project of finding the bevel angle of a worm drive blade. To find the angle, I have decided to use 2 accelerometers. One of it being my reference and will sit on the footplate, the other one will be on the housing and moves with the bevel pivot.

I want the accelerometer sitting on the footplate to be my reference. Hence, whenever it moves, gravity will be perpendicular to the accelerometer. This is of course impossible to create because gravity is always pointing DOWN!! Is there a math equation or algorithm such that it would take the G values of the footplate accelerometer and create a " nonconventional, pseudo" gravity ?

Please let me know if there is any clarification needed. I am using the MPU6050 accelerometer.

enter image description here

Best Answer

Each accelerometer (when stationary) gives you a 3 vector for the direction of gravity.

Let's assume that both accelerometers are offset-free, and have the same gain on all three axes. If they are not that ideal, then it's fairly easy to obtain an offset and gain for each axis with a calibration step that involves rolling each to a large number of random angles, and deriving offsets and gains such that the magnitude of gravity (sqrt(sum of squared components)) is constant regardless of the accelerometer orientation.

The angle between two 3 vectors is now calculated via their dot (or scalar) product, which gives you the cosine of that angle. See wikipedia dot product for full details.

Related Topic