Page 1 of 1

Hover mode using sensor fusion

Posted: Thu Dec 17, 2015 10:54 am
by bmagnus
Hello everyone,

as part of a project course, three classmates and I designed our own hovering scheme for the Crazyflie. The algorithm uses an extended Kalman filter that combines barometer and accelerometer measurements to obtain estimates of the quadcopter's vertical velocity. There are actually more states being estimated by the EKF, but only the vertical velocity is used in the controller. We control the quad using an LQ controller with integral states, but it should be straightforward to include a simple PI controller in the original controller as well. Below are some videos of the hover mode in action:

https://www.youtube.com/watch?v=JoWU8qoAk84 - Static hovering/reference tracking
https://www.youtube.com/watch?v=0IYrcBMY4uM - Maneuvering

The velocity estimates provided by the EKF are free from drift, and are thus very suitable for control.

Let us know what you think!

Re: Hover mode using sensor fusion

Posted: Thu Dec 17, 2015 1:08 pm
by arnaud
Hi,

This looks really great, awesome job! The performance are much better that the current, very simple, implementation.

Have you had problem when flying in a small room and closing/openning the door? We have seen huge pressure change when that happen and I am curious if an EKF can filter that out.

Are you planning of releasing the code? This would help me a lot in getting stable flight in the UWB local positioning system (currently I have crude PIDs and the thrust is the biggest issue).

Re: Hover mode using sensor fusion

Posted: Thu Dec 17, 2015 4:16 pm
by chad
Wow! That's a really stable hover. Very nice.

Re: Hover mode using sensor fusion

Posted: Fri May 20, 2016 12:16 pm
by nanobot9000
Any chance to share the code. I would really like to try this out. Thanks!

Re: Hover mode using sensor fusion

Posted: Fri May 20, 2016 2:20 pm
by Mitteau
Hi
Looks excellent.
Impatient to test this
JCM

Re: Hover mode using sensor fusion

Posted: Sat May 21, 2016 1:45 pm
by Mitteau
Hi
Did you use Normal Flight Mode or Advanced one? Is it a pertinent question?
Have you modified PID coefficient of controller?
Thanks
Regards?
Jean-Claude

Re: Hover mode using sensor fusion

Posted: Mon May 30, 2016 5:10 pm
by Yaro
Very nice!

I want to ask(a newbie question) about the difference between this method using Kalman filter and method used in current CF AltHold. This method with Kalman filter should fusion Baro and Acc values to estimate vertical velocity and perform a filtering. While CF doesn't do this? What method uses CF?

Re: Hover mode using sensor fusion

Posted: Tue May 31, 2016 8:51 am
by arnaud
Hi Yaro,
The CF currently use accelerometer and baro but using a complementary filter: the altitude is estimated with the accelerometer and a little bit of the pressure reading is added to it. So for short period the accelerometer is the main sensor but over longer time it will converge towards the pressure reading. Which is good because unlike the accelerometer the pressure is stable over time. The kallman filter will do the same but much better. I am no expert so you can look a wikipedia to see how complex and awesome a Kallman filter is: https://en.wikipedia.org/wiki/Kalman_filter, or maybe someone passing by could summarize the Kallman filter :-).