# Problem

Currently working on reverse engineering this application zepp.com/baseball. This is a wearable device that can track a users

• speed
• positional tracking
• when the object makes contact with another one
• 3-D Rendering

Currently using an accelerometer and gyroscope to get the yaw, pitch, and roll(orientation) of the device, but do not know how to use that information to calculate speed, or if the device has collided with another object?

• A device that can track a users 3-D Rendering? What does that mean? – Bending Unit 22 May 20 '16 at 9:47

You are essentially making your own IMU. The way this works is essentially:

• the accelerometer gives you linear acceleration
• the rotational gyro gives you angular velocity
• integrate the rotational gyro over time to give you angular position
• integrate the accelerometer over time to give you linear velocity
• double integrate the accelerometer over time to give you linear position

Of course, integrations like this introduce errors, so that is why people typically combine estimates from many different sensors (and sensing modalities) with something like a Kalman Filter.

Also note that these integrations don't work anymore if you max out the sensing range of your sensors. For example, some cheap accelerometers won't measure over 3gs. And I imagine that swinging a bat and hitting a ball will produce some pretty high gs. And a low resolution (bit count) will also severely affect the accuracy.

• To accomplish accuracy with calculating speeds. I was going to use an air speed sensor hobbyking.com/mobile/viewproduct.asp?idproduct=62752 and correlate that speed data to the accelerometer and gyroscope data. The end goal is to just use a as a standalone gadget that just has an accelerometer and gyroscope to accurately measure velocity. What do you think about this idea fusing the speed sensor data with accelerometer? – Kehlin Swain May 22 '16 at 15:59
• Well, you can't directly correlate the accelerometer to speed because they are fundamentally different quantities. But you may be interested to know that centripetal acceleration is $$a=v^2/r$$. So you really need to know where the device is on the bat. I think a better solution would be to just throw the air speed into the Kalman filter too. – Ben May 24 '16 at 16:26
• The device will be on the knob of the bat, and so if I know how many revs that the device moved. I can use that for angular velocity? – Kehlin Swain May 24 '16 at 17:57
• do you think the that repp is using the angular velocity of the device to calculate it's speed? – Kehlin Swain Jun 6 '16 at 23:05