I’ve been working on using the ADXL335 accelerometer with an Arduino UNO.
I have a question regarding a 3-axis accelerometer and vector math.
What I want:
I want to figure out, how to track acceleration of the 3-axis (x, y, z) accelerometer (e.g. if the accelerometer is moving at 10m/s^2, I want the number 10 and if at 1m/s^2, I want the number 1).
Despite I have NO electronics/physics background, I know roughly that accelerometers spit out readings of the acceleration applied to the axises, and also they naturally take in account the gravity on the z-axis.
In my project the accelerometer is hanging in mid air, attached at the end of a string (kinda like a pendulum) - so it can move in any random direction. My hypothesis is that by calculating the changes of the acceleration in each loop of the Arduino code will allow me to get the value of the combined change of the 3-axis. The issue here I think is that the accelerometer is moving in any random direction in space, making the situation difficult to calculate acceleration of all the 3-axises and combining them into one.
Now, I found this tutorial here Das Blinken Top Hat - learn.sparkfun.com that seems to be trying to achieve something similar.
It states that I have to do a thing called vector math, to "combine the three acceleration vectors into one. For our purposes we care only about the movement of the hat (magnitude of movement), not direction:
A^2 + B^2 + C^2 = Z^2
This is the bit I’m confused about. Do you know why they did this? “Combining” the three acceleration sounds like what I want to do, but what does it mean to combine acceleration “vectors”?
Thanks in advance!