ManualControl

Dependencies:   TPixy-Interface

Fork of MbedOS_Robot_Team by ECE4333 - 2018 - Ahmed & Brandon

Revision:
20:9118203f7c9c
Parent:
19:4fbffc755ed7
Child:
21:7fee709bb063
--- a/PiControlThread.cpp	Fri Mar 23 19:03:35 2018 +0000
+++ b/PiControlThread.cpp	Fri Mar 23 22:10:38 2018 +0000
@@ -86,7 +86,7 @@
 
     // Specify address of the PeriodicInt ISR as PiControllerISR, specify the interval
     // in seconds between interrupts, and start interrupt generation:
-    PeriodicInt.attach(&PeriodicInterruptISR, 0.0125);   // 12.5ms sampling period -> 80kHz
+    PeriodicInt.attach(&PeriodicInterruptISR, 0.010);   // 10ms sampling period -> 100Hz
      
 }
 
@@ -107,8 +107,8 @@
         DE0_read(&sensors);
         
         // might not be needed
-        sensors.dp_right = SaturateValue(sensors.dp_right, 140);
-        sensors.dp_left = SaturateValue(sensors.dp_left, 140);
+        sensors.dp_right = SaturateValue(sensors.dp_right, 112);
+        sensors.dp_left = SaturateValue(sensors.dp_left, 112);
         
         // Maximum velocity at dPostition = 560 is vel = 703
         velR = (float)((6135.92 * sensors.dp_right) / sensors.dt_right) ;
@@ -123,8 +123,8 @@
         mutexSetpoint.unlock();    
             
         // Make sure our limit is not exceeded
-        setpointR = SaturateValue(setpointR, 140);
-        setpointL = SaturateValue(setpointL, 140);
+        setpointR = SaturateValue(setpointR, 112);
+        setpointL = SaturateValue(setpointL, 112);
        
         /*********************Differential End*********************************/