How do I improve GPS accuracy with an Accelerometer using Kalman Filter

So, I am working on a project using an Arduino UNO, an MPU-6050 IMU and a ublox NEO-6m GPS module.
My goal is fuse the GPS and IMU readings so that I can obtain accurate distance and velocity readouts.

Right now I am able to obtain the velocity and distance from both GPS and IMU separately.
I am not familiar with the Kalman filter. I have found the "kalman.h" library online, but I do not know how to implement it.

Can somebody please explain me out in implementing the Kalman Filter?

OR if there's any existing code which can do the trick, kindly share it with me

Thanks in advance :slight_smile:

hey yzak,

What is a kalman filter? Why do you need one? How should it work?

I don't mean to sound like a school teacher but it would probably help if you answer those questions and then try playing with the library.

If you still have problems then don' t hesitate to ask us :wink:

Regards,
Teunman

Almost all of the Arduino "Kalman filter" code that you find on line is wrong, with one exception: RTImulib. However for this application you will have to write your own anyway.

The best textbook reference for how a Kalman filter works is "Optimal State Estimation" by Dan Simon. You need to be comfortable with matrix algebra.

teunman:
hey yzak,

What is a kalman filter? Why do you need one? How should it work?

I don't mean to sound like a school teacher but it would probably help if you answer those questions and then try playing with the library.

If you still have problems then don' t hesitate to ask us :wink:

Regards,
Teunman

hello teunman,
Thanks for replying so quickly,
Kalman filter is an error correction algorithm. Here, I am planning to minimise the errors in my GPS output using the readouts from an accelerometer.
Kalman filter helps to merge both the outputs GPS and accelerometer.

jremington:
Almost all of the Arduino "Kalman filter" code that you find on line is wrong, with one exception: RTImulib. However for this application you will have to write your own anyway.

The best textbook reference for how a Kalman filter works is "Optimal State Estimation" by Dan Simon. You need to be comfortable with matrix algebra.

Thanks a lot for pointing me in the right direction. But the RTImulib seems like it is very complicated, I am finding it really hard to understand.

I am finding it really hard to understand.

That is why I recommended the book. It is very clear for such a challenging subject.

Start with this free introductory article by the same author, on line here.

Hey yzak,

Like jremington said, this looks like a complicated thing to do. Why exactly would you want higher accuracy?

doing some digging if found this post IMU + GPS accuracy - Project Guidance - Arduino Forum.

Have a look at it and maybe tell us what your project is (what are you doing that requires high accuracy? how accurate does it have to be?)