How to calculate horizontal angle from from (Iphone) Accelerometer data.

AI Thread Summary
The discussion focuses on calculating the horizontal angle from iPhone accelerometer data, specifically using acceleration values (ax, ay, az) and a fixed radius. Participants highlight issues with the current calculations, particularly the formula for angular acceleration, which is debated for its correctness. Suggestions include double integrating acceleration data to derive angular displacement and using spherical coordinates for more accurate calculations. Additionally, one user seeks assistance in implementing code for angle determination based on accelerometer data for a video installation project. The conversation emphasizes the need for clarity in mathematical processes to achieve accurate angle calculations.
RaviTiwari
Messages
2
Reaction score
0
Hi All,

Thanks in Advance.Need help on maths related to angular motion.We have a device that returns the acceleration in ax,ay,az for motion along a curve.we are trying to calculate the
angle using these acceleration values and the radius (which is fix in our case).

Below is what we are trying to do with these values.However whatever angles
we are getting from calculation does not match the actual angle.what could
wrong we be doing there. kindly enlighten me.

Is there any other method to calculate the angle given these set of data is
available with us.Calculating angle of rotation from acceleration data[ax,ay,az].

1)Calculate resultant acceleration from ax,ay,az.
Resultant Acceleration = SQRT (ax^2 + ay^2 +az^2) * G; //G = 9806.7 mm/s2;

2) Calculate angular Acceleration
Resultant Acceleration = Radius * Angular acceleration;
Angular acceleration (Alpha) = Radius / Resultant Acceleration ;

3) Angular velocity (omega) = omega zero ( previous) + alpha* time;

4) Angular displacement = Angular velocity *time;

5) Convert angular displacement from radian to degree.
Angle = angular displacement *57.3;

6) Sample Data

ax ay az dt(time difference)
0.018169 -0.036337 -1.144622 0.009766
0.054506 -0.036337 -1.071948 0.009766
:
:
:
:
-0.109012 -0.054506 -1.199128 0.018311
-0.163517 0.018169 -1.453488 0.009521
-0.163517 -0.036337 -1.398983 0.009033
 
Physics news on Phys.org
Hmm, I not entirely clear what your doing. As you say the radius is fixed I assume this is some sort of circular motion. In that case I think you're best off double integrating the acceleration data to get displacement then relate the displacement to the angle.
 
Hi Reasonableman,

Thanks for reply and sorry for late reply.We are using Iphone Accelerometer to measure the Range of Motion. We said radius is fixed as the arm/hand of the user will be fixed in our case.

Now regarding the use of double integrating, let me explain what i have understood by this please correct me if i am wrong here

Theta_n = Theta_(n-1) + Omega_(n-1) * t_(n-1) + 0.5 alpha_n*Power(tn, 2);

where
Theta is angular displacement.

We are doing this still results are not correct. Also shared here is an excel that has values generated for various angles along with the calculation.

Again thanks for your help.
 

Attachments

Hi
RaviTiwari, you said Angular acceleration (Alpha) = Radius / Resultant Acceleration , is this right??
if Resultant Acceleration = Radius * Angular acceleration ==> Angular acceleration (Alpha) =Resultant Acceleration/Radius,
despite, the unities are not compatible, so I suggest to calculate the speed by integring the acceleration then use this formula:
angular velocity=speed/radius.
 
Here would be my process. Using your time step and cartesian acceleration measurements, calculate cartesian velocities and change in positions. We now have dx,dy,dz,\dot{x},\dot{y},\dot{z},\ddot{x},\ddot{y},\ddot{z}

From here, you can calculate the spherical trasnlations:
r = \sqrt{x^2 + y^2 + z^2}
\theta = \tan\left(\frac{y}{x}\right)
\psi = \sin\left(\frac{z}{r}\right)
If at any point now you wish to know velocities/accelerations in that coordinate system, you can take derivatives to find velocity
\dot{r} = \frac{x\dot{x}+y\dot{y}+z\dot{z}}{r}
\dot{\theta} = \frac{x\dot{y}+y\dot{x}}{x^2 + y^2}
\dot{\psi} = \frac{r\dot{z}-z\dot{r}}{r^2\sqrt{1-\left(\frac{z}{r}\right)2}}

Similarily, you can derivate that to get accelerations in spherical coordinate systems.
 
Hi RaviTiwari,

I'm an artist trying to build a video installation with an iphone and I need to accomplish a very similar thing: I'll have an iphone moving in a constant pendular motion and I need to determine it's angle/position.

My problem is that the last time I did some real math was back in College in 1996. Did you manage to implement the code to determine the angle based on the iphone accelerometer? If so, would it be possible for you to share the code with me?

Otherwise, does anyone know where I can find a thorough mathematical explanation of what is needed so that I can give a try at understanding it and implementing it?

Thanks in advance,
Nuno
 
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...
Back
Top