# How to detect trajectory of an object using IMU sensor data?

I'm playing with an idea of putting Arduino microcontroller and IMU sensor inside of a ball in order to measure the trajectory and speed of the ball and also determine when it's not in motion.

Any ideas on how to do that? So far I've gotten raw values - 6 DOF (X, Y, Z from the accelerometer and X, Y, Z from the gyroscope) but they are quite noisy and trying to make sense of them. Also one of the other challenge is getting location in 3D space as the data is relative to the Arduino but it has no understanding of where it is in real world.

Some things in my initial research came up are using Kalman filter to clean up data, similar question/answer posted here: https://stackoverflow.com/questions/42176603/getting-a-trajectory-from-accelerometer-and-gyroscope-imu and Transform linear acceleration from frame of reference of IMU to vehicle but still not clear to me yet.

• Look up vector math, integration, dead reckoning. You're also going to need either quaternions or Euler angles. Good luck studying! Commented Feb 8 at 16:57
• Those aren't broad. Those are the fundamentals if you want trajectory. Speed is easier since you only need vector math and integration...assuming no rotation. If rotation then it becomes complicated again. Quaternions and Euler angles are quite involved. In any case you will need vector math to get a taste of how to do anything at all with IMUs so at least look at that. Specifically pay attention to how unit vectors work and can indicate a direction independently of magnitude. Commented Feb 8 at 16:58
• You can gloss over dot and cross products while trying to understand unit vectors, until you get into rotations, but they are basic operations. Off the top of my head they aren't too important for what you are trying to do but you should be aware. Commented Feb 8 at 17:04
• electronics.stackexchange.com/questions/605890/… Commented Feb 8 at 17:09
• It's not everything you need but its the beginning unit vector stuff. Just pay attention to the way the unit vector comes together in those equations. You will probably need a bit of other supplementary reading but if you get that you can move on to other stuff. Commented Feb 8 at 17:09