Go Down

### Topic: Accelerometr for calculating throw distance. (Read 1 time)previous topic - next topic

#### rydes

##### Nov 17, 2012, 10:43 am
Hi. Do you think I could youse an accelerometer for example  MMA 7361 to calculate throw distance of a ball? Im thinking of putting an accelerometer with atmegachip from arduino into small ball and calculate distance from measured accelerations, save them on the chip then connect ball to computer and then recover saved data. But i dont know if the sensor can provide sufficient sensitivity and resolution. Ball would be thrown for distance approximately 4meters by a robot. 10cm precision would be enough for me. What do you think about this idea? Anybody have some experience with that sensor?

#### dhenry

#1
##### Nov 17, 2012, 12:55 pm
It is very simple: just pretend you being a mcu and someone has presented you with a series of g readings. Can you calculate distances from that?

If you can, your mcu can.

If you cannot,  your mcu cannot.

#### rydes

#2
##### Nov 17, 2012, 02:25 pm
Yes I can if I know how acceleration of ball is changing in time I can calculate distance that ball made. Im just asking if the sensor can provide me good quality readings. It can be done in theory, Im trying to find if there are any piratical difficulties.
I was going to measure the distance of throw with ultrasound sensor but it came out that if the object is moving sensor doesnt sees it, and if it small the range of sight of the sensor for small object is very low. I want to avoid buying another useless part because my budget is getting very low ; )

#### dhenry

#3
##### Nov 17, 2012, 02:45 pm
Quote
Yes I can if I know how acceleration of ball is changing in time I can calculate distance that ball made.

That's great.

The following is a sequency of g readings, in x/y/z format:

Code: [Select]
`0/0/10/0/10.5/1/0.51/0/-28/-2/100/1/-2`

Taken in 0.1s intervals.

Can you tell me how far the ball has traveled and why?

#### rydes

#4
##### Nov 17, 2012, 03:29 pmLast Edit: Nov 17, 2012, 03:31 pm by rydes Reason: 1
I can tell you the final coordinates of ball if it started to with V=0, in (0;0) point, and i doesnt spin. (I admin i forgot that the ball can spin : ((( it would be necessary to add gyroscope sensor).
s=(at^2)/2

s=s1+s2+s3+s4 ...
s=((t^2)/2)*(a1+a2+a3+a4+...an)
for x axis
s=((0.1)^2)/2)*(0+0+0.5+1+8+0)
for z and y its similarly

For throwing a ball the readings from sensor would be something like this:
10/2/15 its accerating
8/2/10 its till held by a throwing hand
9/1/12
4/0/8 / now accelerating its over, flight phase begins, it has some Vo, and now gravity and air resitance doing their job. (i could stop measuring if i would now the air resitance coefficient for ball. For small velocities the air resistance could be constant)
0/-2/4
-2/-2/-1
-2.5/-1/0
-1.5/0/-3
-1/0.5/-4
0.5/0/5/-7
0/0/20 now it hits a floor and I stop measuring

#### dhenry

#5
##### Nov 17, 2012, 03:37 pm
Quote
i doesnt spin.

Let me make it simpler for you.

Here is a series of g readings:

Code: [Select]
`0/0/10/1/01/0/00/1/0`
Sampled at 0.1s interval.

Tell me where the ball is.

After that, you will know how doable your project is.

#### rydes

#6
##### Nov 17, 2012, 03:43 pm
i just wrote it post before. how im gonna to calculate it...
Quote
s=(at^2)/2

s=s1+s2+s3+s4 ...
s=((t^2)/2)*(a1+a2+a3+a4+...an)
for x axis
s=((0.1)^2)/2)*(0+0+0.5+1+8+0)
for z and y its similarly

Maybe Im wrong but I think its right. Simple physics, acceleration is derivative of distance you can integrate it

#### dhenry

#7
##### Nov 17, 2012, 04:29 pm
Quote
Simple physics

If you cannot get that simple physics right, how do you expect your mcu to get it right?

Go Up

Please enter a valid email to subscribe

To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy