PID control for DJI drone in OptiTrack system

NatNet, VRPN, TrackD, and Plugins
Post Reply
Gitco
Posts: 1
Joined: Wed Dec 22, 2021 8:12 am

PID control for DJI drone in OptiTrack system

Post by Gitco »

Hi together, I'm currently writing my master thesis in computer science. For this, I'm trying to let the DJI Mavic 2 fly inside a building with the help of OptiTrack and a PID control loop. Therefore I'm using the SDK to send control commands in velocity mode (e.g. fly forward with 0.5 m/s and a sending rate of 100 ms).

Currently, I'm struggling a bit with getting the correct Kp, Ki and Kd gains with the Ziegler-Nichols method. When I understood it right, I have to reach Ku so that the drone is oscillating. In my case, that would mean that I have, e.g. a set point of 1.5 m on the y-axis and increase Kp until the drone is oscillating between 1.2 m and 1.8 m, correct? I did this and measured the time from 1.2 m to again this value to get Tu. With those values, I calculated the classic PID but also the 'no overshoot' control type. Both won't reach the goal and are just oscillating around it.

Why is this so? Did I understand something wrong here?

Many thanks for your help!
Post Reply