New Robotics Code

Dependencies:   mbed-rtos mbed

Fork of Project by Thomas Elliott

Welcome to the robot wiki.

Files at this revision

API Documentation at this revision

Comitter:
IanTheMBEDMaster
Date:
Mon Mar 18 14:38:40 2013 +0000
Parent:
14:669f2f1566b0
Child:
16:cf9519c35510
Commit message:
added max turn radius bounding

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Mar 18 04:21:05 2013 +0000
+++ b/main.cpp	Mon Mar 18 14:38:40 2013 +0000
@@ -638,6 +638,8 @@
     DF = aF/(IRF+bF);
     DR = aR/(IRR+bR);
     
+    //
+    
     // calculate errors
     eW = Kpos*(Nominal - (DF + DR)/2) + Kor*(DR - DF);
     
@@ -646,6 +648,15 @@
     
     uW = KpW*eW + KiW*aeW;
     
+    if (uW > 5)
+    {
+        uW = 5;
+    }
+    else if (uW < -5)
+    {
+        uW = -5;
+    }
+    
     // set differential speeds
     userSetL = TSpeedL + uW;
     userSetR = TSpeedR - uW;