Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Right_Arm_9_10 Right_Arm
Revision 5:2e5f40e761bd, committed 2021-09-19
- 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 |
--- 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);