New Robotics Code
Fork of Project by
Welcome to the robot wiki.
Revision 15:407e4152cf3a, committed 2013-03-18
- 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;

