Go Down

### Topic: Measuring distances with the IMU sensor MPU6050 (Read 9599 times)previous topic - next topic

#### celsoscomparim

##### May 31, 2014, 10:28 pm
Hello,
I have been searching the last days, informations and documentations about the IMU sensor MPU6050 from Invensense. I would like to use this sensor to measuring distance, like a motion tracking ,for example: if the board with the sensor moves 1 meter, I want to calculate this 1 meter from the data receiveid from the MPU6050, the data doesn't need to be very accurate. I found a lote of aplication with static moviment, moving static cubes for example, but I didn't find any aplication example mensuring distance.
According to my search the sensor give the digital-output of 6 or 9-axis MotionFusion data in rotation matrix, quaternion, Euler Angle, or raw data format, but how can I calculate the distance from this data.

Please, could one that is familiar with IMU sensors ou familiar with complex math, could give me an ideia to start my project? I would like to have some example, but if isn't possible, any information about mensuring distance with MPU6050 will be welcome.

Thank you very much!
Celso

#### jremington

#1
##### Jun 01, 2014, 12:52 amLast Edit: Jun 01, 2014, 05:34 am by jremington Reason: 1
Inexpensive IMUs can tell you what direction they are moving and if you know the velocity, it is easy to calculate distance.

In principle it is possible to estimate the velocity and distance from the acceleration by double integration, but in practice with hobby-type accelerometers, this works for only very short distances before the estimate becomes hopelessly inaccurate. For a clear explanation, see this page: http://www.chrobotics.com/library/accel-position-velocity

#### sunnynanade

#2
##### Aug 24, 2015, 06:57 pm
Hello, did you find any way out ??
Thank You.

#### kishan_joshi

#3
##### Oct 13, 2018, 09:47 am
Did you find any code or principles because i found so many pdf of researchs that by double integrating acceleration data we can get distance. and ardupilot guys are also doing this kind of stuff so its possible but i dont see any way around from scratch need some help.

1. how we can convert mpu6050 +/-1g to m/s2 , removing gravity from raw data.
2. then what is delta t i know its dt = millis() - t_previous ; but it gives me always 1 which is 0.001s and i dont know why but it don't working but ardupilot guys are doing same thing here's the link

https://github.com/ArduPilot/ardupilot/blob/ArduCopter-3.2.1/libraries/AP_InertialNav/AP_InertialNav.cpp#L56

so they are using same formula but i didn't working with me i want to find a way out.

Go Up