+ Post New Thread
Results 1 to 20 of 20
 1st March 2008, 09:34 #1
 Join Date
 Jul 2007
 Posts
 17
 Helped
 0 / 0
 Points
 1,070
 Level
 7
accelerometer speed
i using a adxl202 accelerometer and i want to calculate speed using the accerelation calculate from the accelerometer.anyone know how to do so?
 1st March 2008, 11:19 #2
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
accelerometer math
Simply speed is acceleration time integral. That means, a speed measurement could only work for short time intervalls. As an example, an acceleration measurement error of 0.1 g sums up to 60 m/s speed error within a minute.
 1st March 2008, 11:35 #3
 Join Date
 Aug 2006
 Location
 Bikini Bottom, between a rock and a pineapple
 Posts
 339
 Helped
 29 / 29
 Points
 2,999
 Level
 12
speed from accelerometer
You can of course, but the math will be super complex. (well not really that complex, it became complex just because microcontroller only recognize arithmetic).
Case:
> 10 kph for 10s =...? Yes, 0G!
> 1G for 10s =...? Yes, 98m/s! Good!
> 1G for 1s, 1.2G for 0.8s, 0.8G for 1s, etc=...? Uuuuuuuummm??? Gee don't know!! Anyway that's the correct answer.
 1st March 2008, 11:35
 1st March 2008, 12:25 #4
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
accelerometer speed measurement
You can of course, but the math will be super complex
 1st March 2008, 12:28 #5
 Join Date
 Jul 2007
 Posts
 17
 Helped
 0 / 0
 Points
 1,070
 Level
 7
accelerometer to measure speed
u mean not possible to calculate the speed or not complex in calulating the speed?
 1st March 2008, 12:28
 1st March 2008, 13:35 #6
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
speed accelerometer
I meant not complex. I thought, the calculation would be obvious from general physical knowledge. The said integration is approximated by addition. Have a fixed measurement interval of e. g. 10 ms and new acceleration measurement for each interval. After correcting the offset, simply add measurements in an accumulator, that's your speed measurement.
As already mentioned, there will be considerable drift problem.
 3rd March 2008, 02:50 #7
 Join Date
 Aug 2006
 Location
 Bikini Bottom, between a rock and a pineapple
 Posts
 339
 Helped
 29 / 29
 Points
 2,999
 Level
 12
using accelerometer to determine speed
Yeah the math is not so complex for us, but you should consider cleaning up noises...e.g on a bumpy road, accelerometer tends to make fail calculation. You can compensate this thou, but like I said, the math will be complicated.
Complicated math that I mean is the real world math, not just v=a*t
Easily you can compensate using Newton's law:
F=M*x"+B*x'+K*x
There you got the bumpy road compensation using the shock absorber constant... Oh no.., I forgot, you should compensate down hill up hill, hard breaking, dragging (momentum force), slope, and the tilt of where you put your acceleration sensor.
So what is the equation for those? Use triple axis accelerometer and find a good book about measurement and instrumentation.
 3rd March 2008, 08:24 #8
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
measure speed with accelerometer
I think, your considerations aren't applicable for cars. Did you understand the meaning of acceleration measurement error for this application, as I calculated it in the example? If you know a sensor, that has factor 100 or 1000 better accuracy than said ADXL202, we can continue the discussion.
 3rd March 2008, 08:24
 3rd March 2008, 09:18 #9
 Join Date
 Aug 2006
 Location
 Bikini Bottom, between a rock and a pineapple
 Posts
 339
 Helped
 29 / 29
 Points
 2,999
 Level
 12
accelerometer calculate speed
Yes, your calc is absolutely correct. I'm just adding some more base on experience. I've built one, but never use it to measure speed. But it is still applicable to measure horse power, tilt angle, and GForce. Anyway, conventional car's Gforce was only around 1.5G max.
If you want to measure speed, use speedometer, much easier to apply.
 3rd March 2008, 10:08 #10
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
accelerometer calculations
Yes, I aggree. Of course, it would be very interesting to measure speed based only on inertial sensors, but it's effectively impossible by today's state of the art.
 1st October 2009, 08:12 #11
 Join Date
 Oct 2009
 Location
 singapore
 Posts
 3
 Helped
 0 / 0
 Points
 579
 Level
 5
Re: calculate speed using accelerometer
hi
I really need help. I want to calculate speed from a tri axial acclerometer.
I tried calculating the speed from data which i mentioned below
Calculation of velocity from discrete acceleration data:
Integral of acceleration will give velocity value. Since data given for acceleration is discrete so we have calculated velocity value at x direction (Vx) through integrating under discrete acceleration data at x direction by using matlab programme. Similarly Vy and Vz was calculated. Total velocity value will be sqrt(Vx*Vx + Vy*Vy + Vz*Vz)
but the speed which i am getting through this method is 30m/s for one subject which is impossible.
I didnot process the data before calculation (which could be the reason behind inaccuracy).
Please. somebody help me in processing my data and correcting the method of calculating the speed.
I am using tri axial acceleromter (glink), and i attached it on sacrum during run. The subject ran on 400m track which is not bumpy . distance was 50m on plane surface.
Please some body help
 1st October 2009, 08:58 #12
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
calculate speed using accelerometer
Seems like you wanted to emphasize my previous statement by an experiment?
I see two points:
 Genereal uncertainty of acceleration measurement. Did you estimate expectable error limits for your experiment?
 Gravitation and sensor inclination. Ideally, you would compensate the z acceleration measurement for g. But you can't expect an exactly upright sensor position, it has actually a varying inclination angle. How do you deal with this problem in your calculation?
 1st October 2009, 09:11 #13
 Join Date
 Oct 2009
 Location
 singapore
 Posts
 3
 Helped
 0 / 0
 Points
 579
 Level
 5
Re: calculate speed using accelerometer
hey thanks a tonn for your reply.
To tell you the fact. Its embarassing but I am not really good in mathematics, data processing and physics.
I am physical education and sports science students. So I dont know how to estimate the error limit for this data.
I am so sorry if i sound a bit dumb.
It would b a great help if you could tell me steps which i should do..
I am using accelerometer for the first time in my life and i hv never dealt with these kind of calculation.
in conclusion, i am totally in a mess.
please help!!
I can also send a set of data to you
please reply.
 1st October 2009, 16:32 #14
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
calculate speed using accelerometer
As a starting point, you should know the accuracy of the accelerometer and the maximum inclinitation angle that can be expected during the experiment.
To understand the basic problem with inclination, you should consider, how you can distinguish between a horizontal acceleration and a small inclination, that produces a g*sin(phi) apparent acceleration? In my opinion, you can't at all.
 2nd October 2009, 10:54 #15
 Join Date
 Sep 2009
 Posts
 6
 Helped
 0 / 0
 Points
 615
 Level
 5
Re: calculate speed using accelerometer
soooorrrrryyyyy i do not know
 2nd October 2009, 11:20 #16
 Join Date
 Oct 2009
 Location
 Alexandria, VA
 Posts
 2
 Helped
 0 / 0
 Points
 573
 Level
 5
Re: calculate speed using accelerometer
How about this for a consideration.
If you consider temporary inclinations, could you not assume that any and resulting error due to change in attitude would be canceled by a return to the original attitude. For example, when a car accelerates, it tends to tilt back, which would incorrectly imply a greater motion acceleration. As it levels off, this would incorrectly imply less acceleration, so the results would tend to cancel.
Second:
I see a solution by taking a baseline reading of the vectors before a test run. In the basic case, set the Z in a position to read Z=1, and X=Y=0. Tilt can be compensated by adding or subtracting gravity component vectors from X based on a change in Z which you'd know is due to tilt.
I think this can also be done with any sensor position as long as a baseline data set is taken for all values. There will always be a gravity value of 1 with known baseline component vectors, which can be subtracted to get G. To eliminate tilt, you'd have to create a baseline plane, and any resulting Z' component of the calculated vector would be due to tilt. This would require more calculations. I was just looking at this by doing some graphical vector analysis, so I'm not 100% sure at this point.
Of course as was said before, the drift factors due to errors would be amplified greater with added calculations and transformations due to fixed data precision and error %.
I'm thinking of creating a device to measure 060 times in a car as well as HP values based on accelerometers alone, but first need to model this in software, and get the math right.
 2nd October 2009, 11:20
 2nd October 2009, 12:46 #17
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
Re: calculate speed using accelerometer
Tilt can be compensated by adding or subtracting gravity component vectors from X based on a change in Z which you'd know is due to tilt.
and Δx = +17.5 mg. The Δx produces an integrated error of about 10 m/s after a minute, but the Δz value is more or less undetectable and thus can't be used to compensate the x measurement.
 3rd October 2009, 03:47 #18
 Join Date
 Oct 2009
 Location
 Alexandria, VA
 Posts
 2
 Helped
 0 / 0
 Points
 573
 Level
 5
Re: calculate speed using accelerometer
Yes, I can see that is correct. If the sensor is tilted during a run, the accuracy would be off. This brings me back to the first point I made and some limiting factors and assumptions to be made to make this method useful.
1. Assume and ensure the device is fixed at the beginning of the run and remains fixed.
2. Assume a dynamic inclination will reset itself. I'm thinking those errors will cancel like I mentioned earlier.
3. If you don't want to have to positionally zero X and Y, provide a reset feature, which will take a baseline reading of X and/or Y, and this can be factored into every calculation as a fixed inclination error.
4. Intended for cars and runs under a minute. This implies any changes in attitude will return to the normal starting attitude. Also assuming we're starting and ending in the same attitude, and not starting level and ending on a hill.
I also don't see how the errors would accumulate. A fixed 1% error for example would accumulate by addition only, since each sampling calculates velocity change and would end up giving a resulting velocity error also of 1%
Any thoughts?
 3rd October 2009, 13:34 #19
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 37,632
 Helped
 11530 / 11530
 Points
 219,645
 Level
 100
calculate speed using accelerometer
My considerations have been related to the discussed runners experiment.
Obviously, the acceleration measurement would be zeroed at the beginning. But you can't assume the sensor keeping it's upright position respectively initial inclination exactly, you have to consider at least several degrees variation. Also, there's no reason to assume, that the inclination will reset or have any predictable development during the experiment.
In this case, you clearly get an velocity error increasing in time.
 14th October 2009, 20:02 #20
 Join Date
 Oct 2009
 Location
 singapore
 Posts
 3
 Helped
 0 / 0
 Points
 579
 Level
 5
Re: calculate speed using accelerometer
Hello folk,
I calculated the speed from acclerometer but when i shift the starting point of run by even .1sec, the speed changes like anyting.
do i have to deal with offset? tilting angles?
I am doing 50m run on flat surface (400m).
Please let me that how can i fix the starting point and what are the steps i have to follow for the calculation.
please help
+ Post New Thread
Please login
LinkBacks (?)

Track position of flying object with Arduino + [sensor of some kind]?  Arduino Forum
Refback This thread11th November 2013, 02:05 
???????? ?? ???? ?? ???? (0100??/? , 0402?., ??????? ?? ???????? ? ??.), ????? ?????? ??????????????? (???????? 1)  ????????  ??????????? ??????? Android  Android ?????
Refback This thread27th May 2013, 17:01 
Track position of flying object with Arduino + [sensor of some kind]?  Arduino Forum
Refback This thread7th March 2013, 04:57 
android  How to measure the speed of car by phone with accelerometer and gyroscope?  Stack Overflow
Refback This thread10th November 2012, 01:38 
Android: how to know speed of car by phone with accelerometer and gyroscope?  Stack Overflow
Refback This thread8th November 2012, 10:14 
crshbndct comments on Hey Rideit! I was wondering if any of you were Android savvy enough to write a small app that would make using ear buds while riding safer?
Refback This thread7th June 2012, 20:51  21st July 2011, 21:38

SparkFun Electronics &bull; View topic  Track position of flying object with Arduino + sensor?
Refback This thread20th June 2011, 12:43