CF system identification and PID tuning questions

Discussions about all things Bitcraze
Post Reply
Jason Yang
Beginner
Posts: 2
Joined: Tue Jul 24, 2018 4:57 pm

CF system identification and PID tuning questions

Post by Jason Yang »

Hi everyone,

I have bought a CF and a flow deck, and successfully used it to stabilize the quadcopter. Now I plan to tune the onboard PID controller and hope to see how quickly I can make the quadcopter react to a command of, for example, increasing its height from h to h+delta h. Since I am quite a novice in this area, could I ask you guys some questions I have met?

Questions:
(1) Can I use the parameter tab in the main UI to change the PID gains? I notice that there are two groups of PID gains in the parameter tab, pid_attitude and pid_rate. What is the difference between them?

(2) I also hope to theoretically calculate the minimum value of the response time which CF can achieve. Is there anyone who had done something similar before? Where can I find the specific CF hardware data and specifications including motor dynamics, the maximum rotational speed of the rotor, the block diagram or the internal structure of the closed-loop system and so on?

Thanks and best regards,
Jason
jparker310
Beginner
Posts: 5
Joined: Mon Jan 08, 2018 6:27 pm

Re: CF system identification and PID tuning questions

Post by jparker310 »

I had the same questions and hope to tune the PID of the Crazyflie 2.0 as well. Does anyone know how/where to edit this in the Crazyflie firmware or can offer any first steps?

Thanks!

Jacob Parker
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: CF system identification and PID tuning questions

Post by arnaud »

(1) Yes, most if not all of the PID tuning parameters are accessible as parameter. There is a couple of PID cascaded in the Crazyflie: the rate PID controls the rotation rate of the platform (in degree/s), the attitude PID controls the platform attitude (in degree) and above that there is a velocity and position PID. My guess is that you will be more interested in looking at the velocity and position PID loops, they are declared here in the code: https://github.com/bitcraze/crazyflie-f ... #L268-L305. The param should have logical names, in doubt you can look at the source code to see how the variable is used.

(2) Characterisations have been done on the Crazyflie previously, you can find them in the research portal on our website: https://www.bitcraze.io/research/#publi ... azyflie-20. The last line, the one from ETH Zurich, is the most complete as far as I know.

Generally, if you want to know more about the controllers you can look in the firmware source code starting from controller.c and going up to the different controllers.
Post Reply