Your question is worded in a way which implies "please give me a working solution for my problem". What have you tried? What wrong values are you seeing? Are you reading the accelerometer or gyroscope? I've written a simple C library which can read the accel/gyro values from a MPU6050:

It's up to you to take that output and send it through a Kalman filter. If you find someone else doing the exact same work as you and they shared their code, great. Otherwise, like most projects, you'll need to gather the available info and write the code.

Have a look at this file in one of my repos https://github.com/BBUK/Bell-Boy/blob/m ... b_dcmimu.c. Specifically the calculate function. This implements an EKF from https://github.com/hhyyti/dcm-imu with what I found to be really stunning results for my use case. It is not for the MPU6050 (it uses another IMU) but the calculate function can accept inputs from anywhere, you just need to supply it with gyro measurements (in degrees/sec) and accelerometer measurements (in g) and a time interval (in seconds). Outputs are roll, pitch and yaw in degrees.

The file is WIP and is for a project that I am only going to properly release in a couple of months so the file may change (but the calculate function won't - I absolutely don't understand what magic it performs!).

Just a little follow up to anyone that is trying to click the link I posted above - it won't work and the solution has developed.

The released version of the code combines the data from two MPU6050s and pushes that to an extended Kalman filter. The main part of the code is now in the "grabber.c" file in the old directory. In case anyone finds it useful, that directory also has some code that undertakes accelerometer calibration "MPU6050_calibrate.c".

Just a little follow up to anyone that is trying to click the link I posted above - it won't work and the solution has developed.

The released version of the code combines the data from two MPU6050s and pushes that to an extended Kalman filter. The main part of the code is now in the "grabber.c" file in the old directory. In case anyone finds it useful, that directory also has some code that undertakes accelerometer calibration "MPU6050_calibrate.c".

Hello just a quick question as I have also implemented the algorithm and you are converting the gyro values from deg2rad and multiplying the g0 factor to the acc values. In the article its never mentioned or have I missed it somewhere?