Inverted Pendulum / Mbed 2 deprecated IP-Interface

Dependencies:   mbed QEI

Revision:
24:8a62311f2c5e
Parent:
23:5238b046119b
diff -r 5238b046119b -r 8a62311f2c5e main.cpp
--- a/main.cpp	Fri Nov 18 11:55:33 2016 +0000
+++ b/main.cpp	Mon Nov 28 02:49:16 2016 +0000
@@ -7,9 +7,15 @@
 
 #define TRACK_LENGTH 296
 #define TRACK_MIDDLE TRACK_LENGTH/2
-#define Kp 1
-#define Ki 100
-#define Kd 100
+
+#define Kp 1    // Typically the main drive in a control loop, KP reduces a large part of the overall error.
+
+#define Ki 100 //Reduces the final error in a system. 
+               //Summing even a small error over time produces a drive signal large enough to move the system toward a smaller error.
+               
+#define Kd 100 // Counteracts the KP and KI terms when the output changes quickly. This helps reduce overshoot and ringing. 
+               //It has no effect on final error.
+
  
 Serial pc(USBTX, USBRX);
 //Use X4 encoding.