Find Speed,distance,motion Via 3 axis Accelerometer

Status
Not open for further replies.

aamirqau

Junior Member
May 20, 2010
2
0
0
i have 3 axis accelerometer Device which gives these Points ,
11:28 AM------AccX = 1949 AccY = 1609 AccZ = 1999
11:28 AM------AccX = 1950 AccY = 1617 AccZ = 2001
11:28 AM------AccX = 1952 AccY = 1604 AccZ = 1998
11:28 AM------AccX = 1947 AccY = 1613 AccZ = 2000
11:28 AM------AccX = 1953 AccY = 1616 AccZ = 1999
11:28 AM------AccX = 1943 AccY = 1604 AccZ = 1997
11:28 AM------AccX = 1949 AccY = 1604 AccZ = 2002
11:28 AM------AccX = 1947 AccY = 1616 AccZ = 2002
11:28 AM------AccX = 1948 AccY = 1618 AccZ = 2003
and so on

Now this is the acceleration?

if device is attacched with the person and person is moving,i want to know that either the person is static or he is walking,
And also the distance he has covered and what is the speed?
Any help would be really appreciated

Regards,
Aamir
 

PottedMeat

Lifer
Apr 17, 2002
12,365
475
126
you need to know
-what the baseline readings are with no movement
-from that you can figure out the angle of each axis from 'g'
-from that you can probably figure out acceleration in each direction
-integrate for velocity
-integrate again for distance?


not to mention the type of device, what those numbers mean with respect to 'g', sampling rate, etc.
 

aamirqau

Junior Member
May 20, 2010
2
0
0
Thx for the reply,
Device : ±1.5g - 6g Three Axis Low-g
Micromachined Accelerometer
when i connect it will give start reading like this ,i am not major in physics,
This is the data sheet for the accelerometer,
http://www.freescale.com/files/sensors/doc/data_sheet/MMA7260QT.pdf
i am unable to know the values in term of g ,
can you please see this and can tell me if there is any useful info in it?
about sampling rate it gives many readings per second ,i can check exactly the reading count,can you suggest formulas through which i can achieve solution to my problem,
Thx again ,
Regards,
Aamir
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Well, to know the velocity from accelerometer measurements, you need to know the initial velocity. If a is acceleration, v is velocity, and t is time, you (should) know that dv/dt=a. To find the velocity, you need to integrate this (i.e. v=int(a*dt)+v_0, where v_0 is the velocity at t=0). You will need to integrate numerically, as the acceleration isn't a function but a set of discrete points. I'd recommend the multiple-application trapezoidal rule, which is trivial to implement and will be great for your application.

I should also note that your case is 3-d, but that just means you have three integrals to do, as the accelerations are orthogonal such that v_x depends only on a_x, v_y on a_y, and v_z on a_z.

edit: Distance is simply the time integral of velocity. In the 3-d case, distance d=sqrt(d_x^2+d_y^2+d_z^2).
 

BEL6772

Senior member
Oct 26, 2004
225
0
0
Since the sensor will always be reporting the acceleration due to gravity, and it's a bit noisy, you'll have difficulty generating direct speed measurements. Especially if it will be carried around by a person. Constant fluctuations in sensor orientation, even while standing still will be interpreted as changes in speed if you try to use the integral approach.

Comparing the data snippet you gave with the data sheet, it looks like the sensor isn't level and it is only getting about 2.5V on its Vdd pin. The numbers reported appear to be mV on the output pins and are showing the acceleration due to gravity. The variation in the readings represents noise in the system ... unless you were moving the sensor around during the data capture. Experiment a bit to get a feel for how the sensor works. Turn it over, flip it onto each of its four edges, see how the outputs respond. Capture what the outputs do when you walk a few steps with it. You can use the captured response to generate a filter for detecting a step .

At a first level, you can use the accelerometer to detect and count strides then multiply the number of strides by an average stride distance to get distance traveled. You can also keep track of time and do a simple distance/time calculation to get average speed.

Now, the accelerometer will give a bit more data about each stride than a simple "it happened", but it will be a bit of work to use that extra data. You'll need to build profiles of walking, jogging, and running. Use your microprocessor to decide which stride type and do a look-up to preset distances for each stride type to more accurately determine distance covered. Even more advanced would be to try and determine the energy of each stride as it happens by capturing the magnitude of acceleration as the foot is lifted off the ground and calculate distance based on the energy measured. This can be problematic due to the constant acceleration of gravity that the accelerometer is dealing with ... that is a fairly large signal compared to the detailed signals you'd need to get a good measure of 'stride energy'.

Good luck with your project, and have fun!!
 

bobsmith1492

Diamond Member
Feb 21, 2004
3,875
3
81
Finding position via an accelerometer is all but impossible. I've been working with wrist-, head-, and ankle-mounted accelerometer data for almost a year now, and every time I've tried looking at the integral of acceleration to get velocity, or the second integral for position, it turns out the inherent inaccuracy of accelerometers plus the unknown constants (initial position and velocity), plus the acceleration due to gravity, cause the desired signals to be swamped by noise.

1. When you integrate to get velocity, any offset in the device gets amplified and causes your velocity to appear to skyrocket.
2. Gravity will be causing constant acceleration in random directions depending on where the device is mounted on the person and how they move. So, it will look like they are accelerating in different directions which also makes it impossible to distinguish between gravity's acceleration and the person's actual acceleration.

So, that said, the best bet would be to detect strides, like Bel6772 said! A nice bandpass filter should give you a detectable signal. If you have access to Matlab with the signal processing toolbox you can easily try different filter frequencies. I recommend a bandpass, though; cut out the DC components (gravity) and then look for a cyclostationary signal to do a zero-crossing detect.

BEL6772 - using a correlation filter sounds good but the problem is the different ways people can walk and the different speeds. Perhaps the OP could implement an automated training mode: press a button and walk a few steps; the system will record the data, save it, and apply it as a filter to distinguish the person's steps.

When making a correlation filter though...
1. Remove the DC offset from both the signal being feed to the filter and the filter taps
2. Window the filter
3. Use multiple periods of data for the filter (not just one step but two or three)
4. Average a couple different sets of data to create the filter

To process "stride energy," try the following:
1. DC removal via a high pass filter (the easiest way is to subtract the average of the last N points from the current point)
2. Square each axis and sum them together

Good luck again! Don't waste too much time trying to integrate your data though...
 

bobsmith1492

Diamond Member
Feb 21, 2004
3,875
3
81
Wait, how do you guys integrate for velocity and position? The accelerometer gives you back a function of time?

Typically you'd sample the accelerometer to read acceleration points at a specific sampling rate; then you perform numerical integration, such as trapezoidal (in Matlab it's cumtrapz, Cumulative trapezoidal numerical integration).

Integration is very easy given a set of points; just sum all previous points together at each input time and that's your integrated value at that output time. It's not a mathematical integration of a given function, like int(cos(x)) = sin(x); rather, you have a number of points that look like a sine wave, sum them as the occur in real-time, and the result is a sine wave with 90 degrees phase shift.
 

Shadow Conception

Golden Member
Mar 19, 2006
1,539
1
81
Ahh that makes sense. In Physics C, we only ever dealt with functions. I'd always wonder in the back of my head how you'd deal with the motion of something not easily modeled by a simple polynomial.
 
Status
Not open for further replies.
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |