Python controller

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
Posts: 1
Joined: Mon May 09, 2022 3:12 pm

Python controller

Post by juanyule19 »

Altitude controller python
I am doing my internship in drone trajectory control. I have a problem, I'm a bit new in control systems and I have to make a control to improve the trajectory using pyhon code. I know that control can be done with a PID, but it is my understanding that the CF already has Kp, Ki and Kd values determined.
The following image shows a square trajectory (blue signal = CF). How can I improve the trajectory? Where can I start to control the altitude of the drone?

Posts: 1027
Joined: Fri Jul 06, 2018 11:13 am

Re: Python controller

Post by kimberly »


I'm assuming that you are using the crazyflie python library (CFlib) right? There is actually 3 controllers within the crazyflie's firmware currently that you can try out, but indeed the PID is probably the easiest.

You should probably tune the position and velocity controller of the PID controller, and you can do that by means of paramters. You should look at the posCtlPid.zKp/d/i, and the velCtlPid.vzKp/d/i. These can be either changed from the Cfclient's parameter tab or through the cflib with your own made script (you can use this example as well).

I have made this tuning script a while ago, but I must say that there are some issues with it currently, so just beware of that. There is an ticket open to integrate this in the cfclient
Post Reply