git-svn-id: https://arducopter.googlecode.com/svn/trunk@859 f9c3cf11-9bcb-44bc-f272-b75c42450872

This commit is contained in:
jasonshort 2010-11-19 07:18:40 +00:00
parent f622222f4a
commit 391e4268c4
1 changed files with 1 additions and 5 deletions

View File

@ -21,11 +21,7 @@ PID::get_pid(long err, long dt, float scaler)
if(_kd != 0){
// Compute derivative component
//derivative = (error - previous_error)/dt
float derivative = (error - _last_error) / dt;
//Serial.print("d: ");
//Serial.println(derivative,DEC);
float derivative = 1000 * (error - _last_error) / dt;
_last_error = error;
output += _kd * derivative; // Sum the derivative component
}