Modifying the Kalman Filter?

Firmware/software/electronics/mechanics
Post Reply
JarvisX
Beginner
Posts: 4
Joined: Sat Jun 12, 2021 12:00 am

Modifying the Kalman Filter?

Post by JarvisX »

Hello, crazyfliers!

I am a Crazylie Bolt user, and our team creates "unnormal" drones with Bolt, i.e., the rotor placements are different from normal quadrotors. I would like to ask a series of questions about the stabilizer on firmware. Thanks in advance to anyone that can help!
1. What triggers the Kalman filter to reset? From my observation on cfclient, the Kalman filter reset happens when the estimated angular velocity exceeds an upper bound. Everything resets to 0 as a result, including the estimated position and roll-pitch-yaw. Is there a way to temporarily disable the reset?
2. Since we build drones of special structures, are we able to change the dynamic model in the Kalman filter so that the estimation conforms to our real model? For the controller and the power distribution, we are able to make the change by altering several lines in the corresponding files. Are we able to do similar things to the Kalman filter?

Cheers!
Jiawei
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Modifying the Kalman Filter?

Post by kristoffer »

Hi Jiawei!

1. The Kalman filter is reset by the kalman supervisor https://github.com/bitcraze/crazyflie-f ... pervisor.c.
It resets the kalman filter when the position or velocity is "unreasonable". You can modify it (or disable it) according to your needs, or adjust the acceptable ranges using the kalman.maxPos and kalman.maxVel parameters.

2. The central parts of the kalman filter is implemented in https://github.com/bitcraze/crazyflie-f ... man_core.c and you will also find the implementations of the measurement models in the same directory. At the top of the kalman_core.c file, you can find references to the papers that the implementation is based on. Hopefully this will help you to find what need to modify.
JarvisX
Beginner
Posts: 4
Joined: Sat Jun 12, 2021 12:00 am

Re: Modifying the Kalman Filter?

Post by JarvisX »

Thank you, Kristoffer! I will dive into the files you mentioned!
Post Reply