2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
33:9f14e89f74eb
Parent:
32:eb7c263cb5cf
--- a/autoMode.h	Sun Sep 20 04:31:34 2015 +0000
+++ b/autoMode.h	Sun Sep 20 05:50:31 2015 +0000
@@ -2,8 +2,8 @@
 #define AUTOMODE_H
 
 /***PID Controller***/
-PID velocity_controller(36.0,5274.0 ,0.0,RATE);
-PID direction_controller(36.0,5.0,0.0,RATE);
+PID velocity_controller(5.0,3000.0,0.0,RATE);
+PID direction_controller(2.6,3000.0,0.0,RATE);
 
 /***Ps3 correspondence***/
 void autoPs3()
@@ -39,7 +39,7 @@
 /***The function is PID controller initialize.***/
 inline void initializeControllers()
 {
-    velocity_controller.setInputLimits(-200000.0, 200000.0); //x1
+    velocity_controller.setInputLimits(-10000.0, 10000.0); //x1
     direction_controller.setInputLimits(-10.0, 10.0); //x2
 
     //Pwm output from MOVE_OUTPUT_LIMIT_BOTTOM to MOVE_OUTPUT_LIMIT_TOP
@@ -76,12 +76,12 @@
 {
     velocity_following();
     sita_following();
-//    Vr                  = ( x1 + x2 ) / 2.0;
-//    Vl                  = ( x1 - x2 ) / 2.0;
-    Vr                  = x1 + x2;
-    Vl                  = x1 - x2;
-    if( abs(Vr) < 0.05 ) Vr = 0.0;
-    if( abs(Vl) < 0.05 ) Vl = 0.0;
+    Vr                  = ( x1 + x2 ) / 2.0;
+    Vl                  = ( x1 - x2 ) / 2.0;
+//    Vr                  = x1 + x2;
+//    Vl                  = x1 - x2;
+    if( abs(Vr) < 0.1 ) Vr = 0.0;
+    if( abs(Vl) < 0.1 ) Vl = 0.0;
     Move_r( ( float ) Vr );
     Move_l( ( float ) Vl );
 }