PID

Fork of PID by LDSC_Robotics_TAs

Revision:
2:f8864ce26cd8
Parent:
1:4df4895863cd
Child:
3:dccd51230bf5
--- a/PID.cpp	Fri Apr 22 09:38:38 2016 +0000
+++ b/PID.cpp	Tue Nov 21 05:55:11 2017 +0000
@@ -9,6 +9,7 @@
     error[1] = 0.0;
     error[2] = 0.0;
     output = 0.0;
+//    pidOutput = 0.0;
     reference = 0.0;
     sampletime = 0.0;
     Outputlimit_bool = false;
@@ -59,7 +60,8 @@
     feedbackvalue = setfeedbackvalue;
     
     error[0] = reference - feedbackvalue;
-    output = output + ( Kp + Ki + Kd )*error[0] + ( -Kp - 2.0*Kd )*error[1] + Kd*error[2];
+//    pidOutput = ( Kp + Ki + Kd )*error[0] + ( -Kp - 2.0f*Kd )*error[1] + Kd*error[2];
+    output = output + ( Kp + Ki + Kd )*error[0] + ( -Kp - 2.0f*Kd )*error[1] + Kd*error[2];
     error[2] = error[1];
     error[1] = error[0];