# MPU6050 accelerometer double integration doesn't work

**URL:** https://discourse.processing.org/t/mpu6050-accelerometer-double-integration-doesnt-work/42654
**Category:** Project Guidance
**Created:** [August 27, 2023, 4:09pm UTC](https://discourse.processing.org/t/mpu6050-accelerometer-double-integration-doesnt-work/42654 "2023-08-27T16:09:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![MrImskiy](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@MrImskiy](https://discourse.processing.org/u/MrImskiy)
#### Post date: [August 27, 2023, 4:09pm UTC](https://discourse.processing.org/t/mpu6050-accelerometer-double-integration-doesnt-work/42654/1 "2023-08-27T16:09:12Z")

</div>

Hi everyone!

Is there anyone here who has experience in integrating the MPU6050 twice to get the displacement? I have worked on it for months, but without any result. After reading in different forums that a very small iteration time was needed when integrating an accelerometer twice, I decided to work on my iteration time and managed to get an iteration time of 3 ms with the help of people from this forum. However, even this did not give me any satisfying result. The way I integrate twice is as following:

acceleration reading =\> low-pass filter =\> high-pass filter =\> integration =\> high-pass filter =\> integration

I have also tried all sorts of combinations and cut-off frequencies, with bias compensations, or with only one high-pass filter, without low-pass filter, you name it, but the results I get are far from being satisfying…

I hope someone has the answer!

Thanks in advance!

MrImskiy

---

<div class="post-metadata">

### Author: ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)
#### Post date: [August 28, 2023, 8:35pm UTC](https://discourse.processing.org/t/mpu6050-accelerometer-double-integration-doesnt-work/42654/2 "2023-08-28T20:35:32Z")

</div>

Hi, do you have your raw data from the sensor to download?

---

<div class="post-metadata">

### Author: ![MrImskiy](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@MrImskiy](https://discourse.processing.org/u/MrImskiy)
#### Post date: [August 28, 2023, 8:53pm UTC](https://discourse.processing.org/t/mpu6050-accelerometer-double-integration-doesnt-work/42654/3 "2023-08-28T20:53:00Z")

</div>

Thanks for your reply @jb4x! Yes I do! Here is the we-transfer [link](https://we.tl/t-3fguz5S6a9) of the file. The movement I am making here is:

sensor is on the table =\> sensor is taken up in the z-direction =\> stays there for a few seconds =\> sensor is brought back to the table.

---

<div class="post-metadata">

### Author: ![MrImskiy](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@MrImskiy](https://discourse.processing.org/u/MrImskiy)
#### Post date: [August 28, 2023, 8:55pm UTC](https://discourse.processing.org/t/mpu6050-accelerometer-double-integration-doesnt-work/42654/4 "2023-08-28T20:55:25Z")

</div>

It is not really raw data actually, it is data in units of m/s², but it is not manipulated.
