aa

Dependencies:   mbed TrapezoidControl QEI

Revision:
33:656aa14904a5
Parent:
32:90f018b10ad6
Child:
34:cef6c124a52d
diff -r 90f018b10ad6 -r 656aa14904a5 System/Process/Process.cpp
--- a/System/Process/Process.cpp	Sat Sep 21 11:28:06 2019 +0000
+++ b/System/Process/Process.cpp	Sat Sep 21 13:14:12 2019 +0000
@@ -121,7 +121,11 @@
 int mode =1;
 int cross=0;//十字数える用
 int count=100000;//wait代替え
-int slow=30;
+
+///*********PWM調整用*********///
+int fast =40;
+int normal = 30;
+int slow = 20;
 
 #pragma endregion USER-DEFINED_VARIABLES_AND_PROTOTYPE
 
@@ -471,13 +475,13 @@
 //   printf("1:%d 2:%d 3:%d 4:%d 5:%d 6:%d 7:%d 8:%d\n\r",g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7]);
     count++;
     if(mode==1) {//スタートゾーンから白線検知
-        motor[TIRE_FR].pwm = 30;
+        motor[TIRE_FR].pwm = normal;
         motor[TIRE_FR].dir = BACK;
-        motor[TIRE_FL].pwm = 30;
+        motor[TIRE_FL].pwm = normal;
         motor[TIRE_FL].dir = FOR;
-        motor[TIRE_BR].pwm = 30;
+        motor[TIRE_BR].pwm = normal;
         motor[TIRE_BR].dir = BACK;
-        motor[TIRE_BL].pwm = 30;
+        motor[TIRE_BL].pwm = normal;
         motor[TIRE_BL].dir = FOR;
         if(g[2]==0) {
             count=100000;
@@ -491,21 +495,21 @@
             mode=3;
             mtc2=true;
         } else {
-            motor[TIRE_FR].pwm = 30;
+            motor[TIRE_FR].pwm = normal;
             motor[TIRE_FR].dir = FOR;
-            motor[TIRE_FL].pwm = 30;
+            motor[TIRE_FL].pwm = normal;
             motor[TIRE_FL].dir = FOR;
-            motor[TIRE_BR].pwm = 30;
+            motor[TIRE_BR].pwm = normal;
             motor[TIRE_BR].dir = BACK;
-            motor[TIRE_BL].pwm = 30;
+            motor[TIRE_BL].pwm = normal;
             motor[TIRE_BL].dir = BACK;
         }
     } else if(mode==3) { //横ライントレースから縦ライントレースへ
         motor[TIRE_FR].pwm = 0;
         motor[TIRE_FR].dir = FREE;
-        motor[TIRE_FL].pwm = slow;
+        motor[TIRE_FL].pwm = normal;
         motor[TIRE_FL].dir = FOR;
-        motor[TIRE_BR].pwm = slow;
+        motor[TIRE_BR].pwm = normal;
         motor[TIRE_BR].dir = BACK;
         motor[TIRE_BL].pwm = 0;
         motor[TIRE_BL].dir = FREE;
@@ -518,13 +522,13 @@
             mode=4;
         }
     } else if(mode==4) { //横ライントレースから縦ライントレースへ
-        motor[TIRE_FR].pwm = slow;
+        motor[TIRE_FR].pwm = normal;
         motor[TIRE_FR].dir = BACK;
-        motor[TIRE_FL].pwm = slow;
+        motor[TIRE_FL].pwm = normal;
         motor[TIRE_FL].dir = BACK;
-        motor[TIRE_BR].pwm = slow;
+        motor[TIRE_BR].pwm = normal;
         motor[TIRE_BR].dir = FOR;
-        motor[TIRE_BL].pwm = slow;
+        motor[TIRE_BL].pwm = normal;
         motor[TIRE_BL].dir = FOR;
         if(g[0]==0) {
             count=0;
@@ -534,13 +538,13 @@
     } else if(g[0]!=99&&mode==10) { //縦ライントレース
         switch(g[0]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 if(count>100000) {
                     cross++;
@@ -553,66 +557,66 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 253:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 254:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 3:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -621,9 +625,9 @@
             case 2:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -666,9 +670,9 @@
     } else if(mode==11) {
         motor[TIRE_FR].pwm = 0;
         motor[TIRE_FR].dir = FREE;
-        motor[TIRE_FL].pwm = slow;
+        motor[TIRE_FL].pwm = normal;
         motor[TIRE_FL].dir = FOR;
-        motor[TIRE_BR].pwm = slow;
+        motor[TIRE_BR].pwm = normal;
         motor[TIRE_BR].dir = BACK;
         motor[TIRE_BL].pwm = 0;
         motor[TIRE_BL].dir = FREE;
@@ -680,13 +684,13 @@
             mode=12;
         }
     } else if(mode==12) {
-        motor[TIRE_FR].pwm = slow;
+        motor[TIRE_FR].pwm = normal;
         motor[TIRE_FR].dir = FOR;
-        motor[TIRE_FL].pwm = slow;
+        motor[TIRE_FL].pwm = normal;
         motor[TIRE_FL].dir = BACK;
-        motor[TIRE_BR].pwm = slow;
+        motor[TIRE_BR].pwm = normal;
         motor[TIRE_BR].dir = FOR;
-        motor[TIRE_BL].pwm = slow;
+        motor[TIRE_BL].pwm = normal;
         motor[TIRE_BL].dir = BACK;
         if(g[2]==0) {
             count=0;
@@ -696,13 +700,13 @@
     } else if(mode==20) {
         switch(g[2]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 if(count>70000) {
                     cross++;
@@ -716,33 +720,33 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
             case 253:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -751,44 +755,44 @@
             case 254:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
                 mtc2=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
             case 3:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
             case 2:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
@@ -829,9 +833,9 @@
     } else if(mode==21) {
         motor[TIRE_FR].pwm = 0;
         motor[TIRE_FR].dir = FREE;
-        motor[TIRE_FL].pwm = slow;
+        motor[TIRE_FL].pwm = normal;
         motor[TIRE_FL].dir = FOR;
-        motor[TIRE_BR].pwm = slow;
+        motor[TIRE_BR].pwm = normal;
         motor[TIRE_BR].dir = BACK;
         motor[TIRE_BL].pwm = 0;
         motor[TIRE_BL].dir = FREE;
@@ -843,13 +847,13 @@
             mode=22;
         }
     } else if(mode==22) {
-        motor[TIRE_FR].pwm = slow;
+        motor[TIRE_FR].pwm = normal;
         motor[TIRE_FR].dir = BACK;
-        motor[TIRE_FL].pwm = slow;
+        motor[TIRE_FL].pwm = normal;
         motor[TIRE_FL].dir = BACK;
-        motor[TIRE_BR].pwm = slow;
+        motor[TIRE_BR].pwm = normal;
         motor[TIRE_BR].dir = FOR;
-        motor[TIRE_BL].pwm = slow;
+        motor[TIRE_BL].pwm = normal;
         motor[TIRE_BL].dir = FOR;
         if(g[0]==0) {
             solenoid.solenoid3 = SOLENOID_ON;
@@ -860,13 +864,13 @@
     } else if(mode==30) {
         switch(g[0]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 if(count>100000) {
                     cross++;
@@ -880,66 +884,66 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 253:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 254:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 3:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -948,9 +952,9 @@
             case 2:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1020,13 +1024,13 @@
     } else if(mode==40) {
         switch(g[3]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 if(count>30000) {
                     cross++;
@@ -1040,33 +1044,33 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 253:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1075,44 +1079,44 @@
             case 254:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
                 mtc2=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 3:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 2:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
@@ -1179,13 +1183,13 @@
     } else if(mode==50) {
         switch(g[1]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 if(count>100000) {
                     cross++;
@@ -1198,66 +1202,66 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 253:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 254:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 3:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1266,9 +1270,9 @@
             case 2:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1338,13 +1342,13 @@
     } else if(mode==60) {
         switch(g[3]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 if(count>50000) {
                     cross++;
@@ -1358,33 +1362,33 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 253:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1393,44 +1397,44 @@
             case 254:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
                 mtc2=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 3:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 2:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
@@ -1502,76 +1506,76 @@
                 }
                 break;
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 253:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 254:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 3:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1580,9 +1584,9 @@
             case 2:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1623,13 +1627,13 @@
             }
         }
     } else if(mode==100) {
-        motor[TIRE_FR].pwm = 20;
+        motor[TIRE_FR].pwm = slow;
         motor[TIRE_FR].dir = FOR;
-        motor[TIRE_FL].pwm = 20;
+        motor[TIRE_FL].pwm = slow;
         motor[TIRE_FL].dir = BACK;
         motor[TIRE_BR].pwm = 23;
         motor[TIRE_BR].dir = FOR;
-        motor[TIRE_BL].pwm = 20;
+        motor[TIRE_BL].pwm = slow;
         motor[TIRE_BL].dir = BACK;
     } else {
         motor[TIRE_FR].pwm = 0;
@@ -1656,13 +1660,13 @@
         }
     }
     if(mode==1) {//スタートゾーンから白線検知
-        motor[TIRE_FR].pwm = 30;
+        motor[TIRE_FR].pwm = normal;
         motor[TIRE_FR].dir = FOR;
-        motor[TIRE_FL].pwm = 30;
+        motor[TIRE_FL].pwm = normal;
         motor[TIRE_FL].dir = BACK;
-        motor[TIRE_BR].pwm = 30;
+        motor[TIRE_BR].pwm = normal;
         motor[TIRE_BR].dir = FOR;
-        motor[TIRE_BL].pwm = 30;
+        motor[TIRE_BL].pwm = normal;
         motor[TIRE_BL].dir = BACK;
         if(g[2]==0) {
             count=100000;
@@ -1676,21 +1680,21 @@
             mode=3;
             mtc2=true;
         } else {
-            motor[TIRE_FR].pwm = 30;
+            motor[TIRE_FR].pwm = normal;
             motor[TIRE_FR].dir = FOR;
-            motor[TIRE_FL].pwm = 30;
+            motor[TIRE_FL].pwm = normal;
             motor[TIRE_FL].dir = FOR;
-            motor[TIRE_BR].pwm = 30;
+            motor[TIRE_BR].pwm = normal;
             motor[TIRE_BR].dir = BACK;
-            motor[TIRE_BL].pwm = 30;
+            motor[TIRE_BL].pwm = normal;
             motor[TIRE_BL].dir = BACK;
         }
     } else if(mode==3) { //横ライントレースから縦ライントレースへ
         motor[TIRE_FR].pwm = 0;
         motor[TIRE_FR].dir = FOR;
-        motor[TIRE_FL].pwm = 20;
+        motor[TIRE_FL].pwm = slow;
         motor[TIRE_FL].dir = FREE;
-        motor[TIRE_BR].pwm = 20;
+        motor[TIRE_BR].pwm = slow;
         motor[TIRE_BR].dir = FREE;
         motor[TIRE_BL].pwm = 0;
         motor[TIRE_BL].dir = BACK;
@@ -1715,13 +1719,13 @@
     } else if(g[1]!=99&&mode==10) { //縦ライントレース
         switch(g[1]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 if(count>100000) {
                     cross++;
@@ -1734,66 +1738,66 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 253:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 254:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 3:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1802,9 +1806,9 @@
             case 2:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1874,13 +1878,13 @@
     } else if(mode==20) {
         switch(g[2]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 if(count>70000) {
                     cross++;
@@ -1894,33 +1898,33 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
             case 253:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -1929,44 +1933,44 @@
             case 254:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
                 mtc2=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
             case 3:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
             case 2:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 mtc2=true;
                 break;
@@ -2034,13 +2038,13 @@
     } else if(mode==30) {
         switch(g[1]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 if(count>100000) {
                     cross++;
@@ -2053,66 +2057,66 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 253:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = BACK;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 254:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = FOR;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = FOR;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = BACK;
                 mtc=true;
                 break;
             case 3:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -2121,9 +2125,9 @@
             case 2:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -2193,13 +2197,13 @@
     } else if(mode==40) {
         switch(g[3]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 if(count>30000) {
                     cross++;
@@ -2213,33 +2217,33 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 253:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -2248,44 +2252,44 @@
             case 254:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
                 mtc2=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 3:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 2:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
@@ -2352,13 +2356,13 @@
     } else if(mode==50) {
         switch(g[0]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 if(count>100000) {
                     cross++;
@@ -2371,66 +2375,66 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 253:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 254:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 3:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -2439,9 +2443,9 @@
             case 2:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -2511,13 +2515,13 @@
     } else if(mode==60) {
         switch(g[3]) {
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 if(count>50000) {
                     cross++;
@@ -2531,33 +2535,33 @@
                 }
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 253:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -2566,44 +2570,44 @@
             case 254:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = FOR;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
                 mtc2=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = BACK;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = FOR;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 3:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
             case 2:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 mtc2=true;
                 break;
@@ -2675,76 +2679,76 @@
                 }
                 break;
             case 98:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 break;
             case 0:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 255:
-                motor[TIRE_FR].pwm = 60;
+                motor[TIRE_FR].pwm = fast;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 40;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 40;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 60;
+                motor[TIRE_BL].pwm = fast;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 253:
-                motor[TIRE_FR].pwm = 20;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 20;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 254:
-                motor[TIRE_FR].pwm = 30;
+                motor[TIRE_FR].pwm = normal;
                 motor[TIRE_FR].dir = BACK;
                 motor[TIRE_FL].pwm = 0;
                 motor[TIRE_FL].dir = FREE;
                 motor[TIRE_BR].pwm = 0;
                 motor[TIRE_BR].dir = FREE;
-                motor[TIRE_BL].pwm = 30;
+                motor[TIRE_BL].pwm = normal;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 1:
-                motor[TIRE_FR].pwm = 40;
+                motor[TIRE_FR].pwm = slow;
                 motor[TIRE_FR].dir = BACK;
-                motor[TIRE_FL].pwm = 60;
+                motor[TIRE_FL].pwm = fast;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 60;
+                motor[TIRE_BR].pwm = fast;
                 motor[TIRE_BR].dir = BACK;
-                motor[TIRE_BL].pwm = 40;
+                motor[TIRE_BL].pwm = slow;
                 motor[TIRE_BL].dir = FOR;
                 mtc=true;
                 break;
             case 3:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 20;
+                motor[TIRE_FL].pwm = slow;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 20;
+                motor[TIRE_BR].pwm = slow;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -2753,9 +2757,9 @@
             case 2:
                 motor[TIRE_FR].pwm = 0;
                 motor[TIRE_FR].dir = FREE;
-                motor[TIRE_FL].pwm = 30;
+                motor[TIRE_FL].pwm = normal;
                 motor[TIRE_FL].dir = FOR;
-                motor[TIRE_BR].pwm = 30;
+                motor[TIRE_BR].pwm = normal;
                 motor[TIRE_BR].dir = BACK;
                 motor[TIRE_BL].pwm = 0;
                 motor[TIRE_BL].dir = FREE;
@@ -2796,13 +2800,13 @@
             }
         }
     } else if(mode==100) {
-        motor[TIRE_FR].pwm = 20;
+        motor[TIRE_FR].pwm = slow;
         motor[TIRE_FR].dir = BACK;
-        motor[TIRE_FL].pwm = 20;
+        motor[TIRE_FL].pwm = slow;
         motor[TIRE_FL].dir = FOR;
         motor[TIRE_BR].pwm = 23;
         motor[TIRE_BR].dir = BACK;
-        motor[TIRE_BL].pwm = 20;
+        motor[TIRE_BL].pwm = slow;
         motor[TIRE_BL].dir = FOR;
     } else {
         motor[TIRE_FR].pwm = 0;