How to start in order to modify the PID controller

Firmware/software/electronics/mechanics
Post Reply
giandoman
Beginner
Posts: 29
Joined: Wed Sep 27, 2017 1:23 pm

How to start in order to modify the PID controller

Post by giandoman » Thu Sep 13, 2018 4:03 pm

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

tugayalperen
Beginner
Posts: 11
Joined: Mon May 14, 2018 8:33 am

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

Post by tugayalperen » Sat Sep 29, 2018 1:17 pm

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.

arnaud
Bitcraze
Posts: 1779
Joined: Tue Feb 06, 2007 12:36 pm

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

Post by arnaud » 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.

giandoman
Beginner
Posts: 29
Joined: Wed Sep 27, 2017 1:23 pm

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

Post by giandoman » Tue Oct 02, 2018 12:19 pm

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?

arnaud
Bitcraze
Posts: 1779
Joined: Tue Feb 06, 2007 12:36 pm

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

Post by arnaud » Mon Oct 08, 2018 12:19 pm

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.

giandoman
Beginner
Posts: 29
Joined: Wed Sep 27, 2017 1:23 pm

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

Post by giandoman » Wed Oct 10, 2018 4:47 pm

Thanks

Post Reply