I wonder if it's usually practical to use an accelerometer to measure the height of a ball tossed in the air. That is, would it be accurate to integrate the acceleration measured over time twice? An accelerometer like the MPU6050 has DMP for calculating pitch, roll, and yaw but nothing for height. Would it be too slow to integrate ay twice on a low-end MCU like the MSP430?

Edit: The height of travel will be less than 10cm.

  • \$\begingroup\$ No. It is not very practical. Use a barometer instead. \$\endgroup\$ – mkeith Dec 27 '16 at 7:04
  • 1
    \$\begingroup\$ @mkeith I'm actually expecting a height of less than 100mm, so I don't think there'll be any significant change in pressure. \$\endgroup\$ – John M. Dec 27 '16 at 7:43
  • 1
    \$\begingroup\$ A lot of the MEMS barometers I've seen can discern a cm or so of altitude change. Not what I'd call 'stellar performance' for your application, but then, I don't know what precision you need. \$\endgroup\$ – Sam Dec 27 '16 at 20:32

All an accelerometer will give you is time of flight.

while the ball is in the air it's in free-fall and the accelerometer will read zero.

if you can assume a level playing field you can calculate maximum height from time of flight.

for 10cm height time of flight will be about 200ms

throw in a 3 axis gyro, and you can estimate how hard it was thrown and and how much of that throw was vertical, but time of flight is probably still your best bet.

  • \$\begingroup\$ Right. But why a gyro and not an accelerometer? Wouldn't I want to measure the linear acceleration instead? \$\endgroup\$ – John M. Dec 27 '16 at 10:58
  • \$\begingroup\$ @JohnMunroe - Unless you can guarantee that the ball is thrown along the sensitive axis of the accelerometer, you'll need a 3-axis accelerometer, along with some software to combine the 3 axes worth of data to synthesize the actual acceleration, and even then you won't know if the throw was vertical - that's what you need the gyros for. You'd need to determine the local g vector (most easily done at rest, but not necessarily), then keep track of rotations to determine the vertical component of your launch acceleration. And gyro drift will be the biggest source of error. \$\endgroup\$ – WhatRoughBeast Dec 27 '16 at 13:44
  • \$\begingroup\$ @WhatRoughBeast If I'm only interested in the vertical displacement, wouldn't only the vertical linear acceleration be relevant? That is, there'd be no need to keep track of rotations - am I right? \$\endgroup\$ – John M. Dec 27 '16 at 16:31
  • \$\begingroup\$ @JohnMunroe - Only if "you can guarantee that the ball is thrown along the sensitive axis of the accelerometer". Can you make that guarantee? If so, you only need one. \$\endgroup\$ – WhatRoughBeast Dec 27 '16 at 16:37
  • 1
    \$\begingroup\$ from a frame of reference of an observer standing on the ground, timing the flight is equivalent to integrating the gravitational acceleration, it won't tell you current height, but when it lands (about 100ms late) you'll know how high it went. (assuming no aerodynamic effects) \$\endgroup\$ – Jasen Dec 29 '16 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.