Page 1 of 1

How to start in order to modify the PID controller

Posted: Thu Sep 13, 2018 4:03 pm
by giandoman
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

Re: How to start in order to modify the PID controller

Posted: Sat Sep 29, 2018 1:17 pm
by tugayalperen
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.

Re: How to start in order to modify the PID controller

Posted: Sun Sep 30, 2018 8:00 am
by arnaud
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/crazyflie-f ... 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/crazyflie-f ... ntroller.c.

I hope this helps you getting started.

Re: How to start in order to modify the PID controller

Posted: Tue Oct 02, 2018 12:19 pm
by giandoman
arnaud wrote:
Sun Sep 30, 2018 8:00 am
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/crazyflie-f ... 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/crazyflie-f ... ntroller.c.

I hope this helps you getting started.
Thank you very much Arnaud! I'm sure that it will help.
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

Posted: Mon Oct 08, 2018 12:19 pm
by arnaud
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.

Re: How to start in order to modify the PID controller

Posted: Wed Oct 10, 2018 4:47 pm
by giandoman
Thanks