From ddd27a8704242999d672705539d957807693e32f Mon Sep 17 00:00:00 2001 From: ouazaryahia Date: Tue, 10 Sep 2013 20:33:18 -0700 Subject: [PATCH] Update PID_v1.cpp output = kp * error + ki*sumerror + kd * dInput; --- PID_v1/PID_v1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PID_v1/PID_v1.cpp b/PID_v1/PID_v1.cpp index 6c95895..8e71ded 100644 --- a/PID_v1/PID_v1.cpp +++ b/PID_v1/PID_v1.cpp @@ -60,7 +60,7 @@ bool PID::Compute() double dInput = (input - lastInput); /*Compute PID Output*/ - double output = kp * error + ITerm- kd * dInput; + double output = kp * error + ITerm + kd * dInput; if(output > outMax) output = outMax; else if(output < outMin) output = outMin;