How to start in order to modify the PID controller

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

How to start in order to modify the PID controller

Post 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
tugayalperen
Beginner
Posts: 19
Joined: Mon May 14, 2018 8:33 am

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

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

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

Post 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.
giandoman
Member
Posts: 37
Joined: Wed Sep 27, 2017 1:23 pm

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

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

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

Post 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.
giandoman
Member
Posts: 37
Joined: Wed Sep 27, 2017 1:23 pm

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

Post by giandoman »

Thanks
Post Reply