# my quadcopter settling time is very large

my quadcopter's settling time is very large, that is it sets its setpoint in very large amount of time, during which it has covered a large distance. But at settle point, when i gives it a jerk or push its returns to settle in normal duration. doesnt over shoots(little). The problem is with the settling time that is when i move the stick front or back it takes huge amount of time. what could be wrong. i have tried giving more P value and I value to PID but then it overshoots and get unstable. This is my PID program. the PID values are given. I read 6 channels from remote using the command pulsein(). which i guess is taking upto 20ms per command.

kp = 1.32;
ki= 0.025;
kd= 0.307;
void PID() {
error = atan2(lx,ly);
error *= 1260/22;
error = setpoint1 - error;
now = millis();
dt = now - ptime;
ptime = now;
dt /= 1000;
integ = integ + (error * dt);
der = (error - prerror) / dt;
pidy = (kp * error);
pidy += (ki * integ);
pidy += (kd * der);
//Serial.println(error);
prerror = error;
}


pidy is added and subtracted to esc speeds respectively.

• It will be beneficial if you provide the graph of the response with the actual values of PID gains. Oct 11, 2015 at 13:34
• I have no reach to take out the graph. but I will say that my quadcopter is imbalanced w.r.t weight on every side.(no extra weight, just usable elements). I tied it to rope. when not started, it is resting(tilting) on one side. when started it takes 15 to 20 seconds to level. now when i push it to tilt, it reaches back to its level in 1 to 1.5 secs. kp=1.32,ki= 0.025,kd= 0.307 Oct 11, 2015 at 13:40
• Remove the D gain, or implement an observer. Numerical differentiation is bad practice. Oct 11, 2015 at 13:44
• then longer osscilations are produced. But I havent practiced much without D gain. Will PI work?. Oct 11, 2015 at 14:02
• A quadcopter can be stabilized withou any D gain. Don't add D unless you cannot stabilize your system. Tune firstly for P, while I and D are zero. You will probably observe some drift without I. Set I to prevent drift, but don't increase it more than necessary or it could cause instability. Oct 11, 2015 at 20:35