Motion Tracking with Accelerometer

29 visualizzazioni (ultimi 30 giorni)
Karlee McFarlane
Karlee McFarlane il 27 Mag 2020
Modificato: James Tursa il 30 Mag 2020
Hi, I'm very new to coding and accelerometer studies, so any help is appreciated.
I have a device that has only one 3-axis accelerometer, no gyroscope, no magnetometer. After doing movements, I get a csv file with accelerations in x,y,z axes. I want to plot the movements that I did from these data in 3d. I am able to read the files on matlab, filter the noise, and use cumtrapz to get velocity and displacement. But these plots are not helpful, and I don't know how to proceed from here.
How do I track the motion of the device and basically recreate the 3d motion plot?
The figure below shows the plots of x, y and z acceleration, velocity and displacement. Thank you.
  5 Commenti
Karlee McFarlane
Karlee McFarlane il 30 Mag 2020
In this example, there is no quiescent period at the beginning, but I can perform new movements if it's needed. Why is this signficant?
Direction of gravity is z axis, I believe.
James Tursa
James Tursa il 30 Mag 2020
Modificato: James Tursa il 30 Mag 2020
A quiescent period would allow you to calibrate so you know the sensor biases + gravity. For a rough result, you would just subtract the beginning value (or probably an average of some beginning values) from all of the data. This ignores the fact that the object is actually moving because of Earth rotation (there is in reality a non-zero component of centripetal acceleration present), but for your purposes I am assuming you can ignore that. You would need to decide that.
Without the quiescent period you don't have this information. So in that case you will have to use a formula for the gravity and use your best judgement for direction based on the test setup.

Accedi per commentare.

Risposte (1)

Star Strider
Star Strider il 27 Mag 2020
The cumtrapz results do not appear to be accumulating with respect to time. Without being able to see the data or your code, my guess is that you are not integrating across the time dimension. The third argument to cumtrapz is the dimension (with time being the first argument and your signal being the second argument). Check to be certain that you are integrating across the correct dimension, then see if the results change.
The ‘x’ result should probably look something like this simulation:
t = 0:10;
xacc = t.*cos(t*2*pi/9);
xvel = cumtrapz(t, xacc);
xdis = cumtrapz(t, xvel);
figure
subplot(3,1,1)
plot(t, xacc)
title('Acc')
subplot(3,1,2)
plot(t, xvel)
title('Vel')
subplot(3,1,3)
plot(t, xdis)
title('Dsp')
.
  2 Commenti
Karlee McFarlane
Karlee McFarlane il 27 Mag 2020
Thank you for your answer. Yes, you're right, I was doing cumtrapz(xacc, t), instead of (t,xacc). Silly me!
This is what I get now.
But still, how do I convert this into a precise 3d animation of the exact movements that I did with the device? I read somewhere that it's impossible to get exact location and orientation of device without gyro and mag...?
Star Strider
Star Strider il 27 Mag 2020
But still, how do I convert this into a precise 3d animation of the exact movements that I did with the device?
What you read somewhere is correct, however the might be a way to get something out of the data you have.
I have no idea what you want to animate, however using the animatedline function (R2014b and later versions) would be the place to start.

Accedi per commentare.

Categorie

Scopri di più su Graphics Performance in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by