ManualControl

Dependencies:   TPixy-Interface

Fork of MbedOS_Robot by ECE4333 - 2018 - Ahmed & Brandon

Files at this revision

API Documentation at this revision

Comitter:
asobhy
Date:
Sun Mar 11 00:37:58 2018 +0000
Parent:
15:cf67f83d5409
Child:
17:1184df616383
Child:
24:e88753f090b8
Commit message:
final tuning of the first subsystem done

Changed in this revision

CameraThread.cpp Show annotated file Show diff for this revision Revisions of this file
Drivers/PiController.cpp Show annotated file Show diff for this revision Revisions of this file
PiControlThread.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/CameraThread.cpp	Sat Mar 03 04:47:26 2018 +0000
+++ b/CameraThread.cpp	Sun Mar 11 00:37:58 2018 +0000
@@ -89,6 +89,7 @@
         
         blocksR = pixyR.getBlocks();
         if (blocksR) {
+            
             // signature 0 is cloudy day
             // signature 1 is indoor lighting
             
--- a/Drivers/PiController.cpp	Sat Mar 03 04:47:26 2018 +0000
+++ b/Drivers/PiController.cpp	Sun Mar 11 00:37:58 2018 +0000
@@ -80,9 +80,7 @@
     int32_t uS;
     
     setpointR_mutex.lock();
-    setpointL_mutex.lock();
     e = SaturatingSubtract(setp, dP);  // e is the velocity error
-    setpointL_mutex.unlock();
     setpointR_mutex.unlock();
 
     xTemp = SaturatingAdd(xState, e);
@@ -121,11 +119,9 @@
     int32_t uIntegral;
     int32_t uS;
     
-    setpointR_mutex.lock();
     setpointL_mutex.lock();
     e = SaturatingSubtract(setp, dP);  // e is the velocity error
     setpointL_mutex.unlock();
-    setpointR_mutex.unlock();
 
     xTemp = SaturatingAdd(xState, e);
 
--- a/PiControlThread.cpp	Sat Mar 03 04:47:26 2018 +0000
+++ b/PiControlThread.cpp	Sun Mar 11 00:37:58 2018 +0000
@@ -40,10 +40,10 @@
 void PeriodicInterruptISR(void);
 
 // steering gain
-int Ks = 0.5;
+float Ks = 0.15;
 
 // distance gain
-int Kd = 4;
+float Kd = 10;
 
 // overall robot required speed
 int Setpoint;