ManualControl

Dependencies:   TPixy-Interface

Fork of MbedOS_Robot_Team by ECE4333 - 2018 - Ahmed & Brandon

Revision:
2:ca2a7430739b
Parent:
1:3e9684e81312
Child:
3:4def4ca68910
--- a/PiControlThread.cpp	Sat Feb 03 00:05:08 2018 +0000
+++ b/PiControlThread.cpp	Sat Feb 03 00:37:57 2018 +0000
@@ -58,7 +58,7 @@
     // in seconds between interrupts, and start interrupt generation:
     PeriodicInt.attach(&PeriodicInterruptISR, 0.05);   // 50ms sampling rate
     
-    Kp = 2;
+    Kp = 2.2;
     Ki = 0.01;
     
 }
@@ -85,7 +85,7 @@
         vel = (float)((6135.92 * dPosition) / dTime) ;
         
         setpoint_mutex.lock();
-        e = SaturatingSubtract(setpoint, vel);  // e is the velocity error
+        e = SaturatingSubtract(setpoint, dPosition);  // e is the velocity error
         setpoint_mutex.unlock();
         
         // disable integration if u is saturated