Hello everybody,
i know it may sounds complex, but i would like to know (at least) where to start to implement a new controller for the crazyflie in order to substitute it to the classic PID.
For example i would like to implement an LQR control. Where should i start?
Thanks
How to start in order to modify the PID controller

 Beginner
 Posts: 17
 Joined: Mon May 14, 2018 8:33 am
Re: How to start in order to modify the PID controller
Hi there,
I am also highly interested in this subject so if you have gained any information about it, I would be very happy if you share it with me. Thanks in advance.
I am also highly interested in this subject so if you have gained any information about it, I would be very happy if you share it with me. Thanks in advance.
Re: How to start in order to modify the PID controller
Hi,
You should start by looking at the stabilizer loop to understand how the different parts fits together. The controller is called there: https://github.com/bitcraze/crazyflief ... zer.c#L185. There is currently two controller implemented, you can look at how the two current controller are implemented and add yours to controller.c: https://github.com/bitcraze/crazyflief ... ntroller.c.
I hope this helps you getting started.
You should start by looking at the stabilizer loop to understand how the different parts fits together. The controller is called there: https://github.com/bitcraze/crazyflief ... zer.c#L185. There is currently two controller implemented, you can look at how the two current controller are implemented and add yours to controller.c: https://github.com/bitcraze/crazyflief ... ntroller.c.
I hope this helps you getting started.
Re: How to start in order to modify the PID controller
Thank you very much Arnaud! I'm sure that it will help.arnaud wrote: ↑Sun Sep 30, 2018 8:00 amHi,
You should start by looking at the stabilizer loop to understand how the different parts fits together. The controller is called there: https://github.com/bitcraze/crazyflief ... zer.c#L185. There is currently two controller implemented, you can look at how the two current controller are implemented and add yours to controller.c: https://github.com/bitcraze/crazyflief ... ntroller.c.
I hope this helps you getting started.
I have one more question: which mathematical model did you consider for the drone? Do you have any reference paper?
Re: How to start in order to modify the PID controller
When publication have been used for the implementation you will find it in the code, for example it is the case for the kalman filter and the Melinger controller. Some of the code has been developped without any formal mathematical model or publication, this is the case of the PID controller for example.