How to do PID tuning and log the data
Posted: Tue Nov 05, 2019 3:28 pm
Hi, guys. Before posting my questions please understand that I am new to crazyflie and has little background in coding.
Using crazyflie 2.1, I am trying to write a python code that can tune the PID gains while performing sequential maneuver. The example is like the following:
Step 1: Connect to the crazyflie and lift it up to (x,y,z)=(0,0,0.5) with gain set #1.
Step 2: Move to (1,0,0.5) -> (1,1,0.5) -> (0,1,0.5) -> (0,0,0.5)
Step 3: Change the PID gains (gain set #2) and lift it up to (0,0,1)
Step 4: Repeat Step 2.
...
While doing it I want to log the position and attitude data, and save it to a file.
I have been looking at cflib examples and found position_commander_demo.py being useful. I also looked at basiclog.py but could not fully understand how it works. And I cannot find a code where I can update PID gains in real time during flight.
Also, is there a way to do it in cfclient?
I know some of you might think my questions are too easy or vague, but I really need help from you guys to start off my experience with crazyflie.
Using crazyflie 2.1, I am trying to write a python code that can tune the PID gains while performing sequential maneuver. The example is like the following:
Step 1: Connect to the crazyflie and lift it up to (x,y,z)=(0,0,0.5) with gain set #1.
Step 2: Move to (1,0,0.5) -> (1,1,0.5) -> (0,1,0.5) -> (0,0,0.5)
Step 3: Change the PID gains (gain set #2) and lift it up to (0,0,1)
Step 4: Repeat Step 2.
...
While doing it I want to log the position and attitude data, and save it to a file.
I have been looking at cflib examples and found position_commander_demo.py being useful. I also looked at basiclog.py but could not fully understand how it works. And I cannot find a code where I can update PID gains in real time during flight.
Also, is there a way to do it in cfclient?
I know some of you might think my questions are too easy or vague, but I really need help from you guys to start off my experience with crazyflie.