Hover mode using sensor fusion

Firmware/software/electronics/mechanics
Post Reply
bmagnus
Beginner
Posts: 1
Joined: Wed Dec 02, 2015 1:40 pm

Hover mode using sensor fusion

Post 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!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Hover mode using sensor fusion

Post 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).
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Hover mode using sensor fusion

Post by chad »

Wow! That's a really stable hover. Very nice.
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
nanobot9000
Beginner
Posts: 26
Joined: Mon Apr 11, 2016 4:33 pm

Re: Hover mode using sensor fusion

Post by nanobot9000 »

Any chance to share the code. I would really like to try this out. Thanks!
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: Hover mode using sensor fusion

Post by Mitteau »

Hi
Looks excellent.
Impatient to test this
JCM
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: Hover mode using sensor fusion

Post 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
Yaro
Member
Posts: 31
Joined: Wed May 20, 2015 11:28 am

Re: Hover mode using sensor fusion

Post 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?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Hover mode using sensor fusion

Post 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 :-).
Post Reply