Finding Relatively Accurate Velocity Using an IMU I am currently working on a project where I am trying to accurately find velocity in a handheld device using an IMU for about 30 seconds.
I have been having major issues doing this because of large amounts of drift from poor calculations due to inaccurate sensor readings.
I have tried tuning offsets for my sensor and using other sensor fusion libraries to find my linear acceleration.
At this point I don't know if I am doing something wrong, going about the process wrong, or if my sensors are just to inaccurate to accomplish this.
I am hoping if anyone may have recommendations on how to accomplish this from the ground up. I currently have two 9DOF IMUS listed below. The first one I tried to use the predefined linear acceleration function to find velocity in ndof mode, using bosch calibration steps. The second i spent hours tuning the offsets on to get linear acceleration and it came out much worse than the first sensor. For the second I can include code but I used the madgwick from the Adafruit_AHRS library for the sensor fusion for sake of time.
Any help is appreciated.

https://www.adafruit.com/product/4646 (BNo055 first board)
https://www.adafruit.com/product/3463 (FXOS8700 + FXAS21002 second board)
Integration of acceleration to derive velocity is a difficult task.  This is the first step in dead reckoning.  Consider some of the following options to improve accuracy:

Some IMUs can be adjusted to increase sample speed. If the
acceleration is sudden, more samples my improve the accuracy of the
calculated velocity.
Try aligning just 1 of the axes of the IMU chip in the direction of
acceleration. Do this to simplify the problem.  Depending on the
Arduino you are using, the processor may not have the power to
perform the trig functions necessary for anything except
acceleration only along 1 of the IMU's axes.
Take care of loosing significant digits.  If using integers, try
multiplying everything up.  For example instead of 1 equaling 1
meter multiply the value up such that 1000 equals 1.000 meters.  Now
integer math can be used to calculate down to the mm.