9/10

Dependents:   Right_Arm_9_10 Right_Arm

Files at this revision

API Documentation at this revision

Comitter:
oshin1030
Date:
Sun Sep 19 13:33:48 2021 +0000
Parent:
4:6bff84284ecb
Commit message:
9/19;

Changed in this revision

MotorController.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6bff84284ecb -r 2e5f40e761bd MotorController.cpp
--- a/MotorController.cpp	Fri Sep 10 09:00:54 2021 +0000
+++ b/MotorController.cpp	Sun Sep 19 13:33:48 2021 +0000
@@ -125,7 +125,7 @@
     if(fabs(devia)<ANGLE_ERROR) {//収束幅の設定
         omega=0;
     }
-    printf("duty_1:%f\t",duty);
+    //printf("duty_1:%f\t",duty);
     if(duty > max_duty) duty = max_duty;
     if(duty < -max_duty)duty = -max_duty;
     turn(duty);
@@ -136,17 +136,17 @@
     ec_->calOmega();
     double angle;
     if(angleA >= 0){
-            angle = ec_->getRad()*36/60 + (-102 - angleA/3 - angleA*16.63/90)*3.14159265359f/180;
+            angle = ec_->getRad()*36/60 + (-115 - angleA/3 - angleA*16.63/90)*3.14159265359f/180;
         }else if(angleA < 0){
-            angle = ec_->getRad()*36/60 + (-102 - angleA/3 + angleA*16.63/90)*3.14159265359f/180;
-        }
+            angle = ec_->getRad()*36/60 + (-115 - angleA/3 + angleA*16.63/90)*3.14159265359f/180;
+    }
     double devia = target_angle - angle;
     double omega = ac_omega_pid->calP_D(devia,ec_->getOmega());
     double duty=calSc(omega);
     if(fabs(devia)<ANGLE_ERROR) {//収束幅の設定
         omega=0;
     }
-    printf("duty_2:%f\t",duty);
+    //printf("duty_2:%f   ",duty);
     if(duty > max_duty) duty = max_duty;
     if(duty < -max_duty)duty = -max_duty;
     turn(duty);
@@ -163,7 +163,7 @@
     if(fabs(devia)<ANGLE_ERROR) {//収束幅の設定
         omega=0;
     }
-    printf("%f\t%f\t%f\t\r\n",duty, target_angle, angle);
+    //printf("%f\t%f\t%f\t\r\n",duty, target_angle, angle);
     if(duty > 0.2) duty = 0.2;
     if(duty < -0.2)duty = -0.2;
     turn(duty);