ROBOSTEP_5期 / Mbed 2 deprecated George_Master_Param

Dependencies:   mbed robot

Revision:
41:645266b004a2
Parent:
40:23a64e9f46a6
Child:
42:b00cdc97f492
--- a/moves/moves.cpp	Thu May 16 06:34:39 2019 +0000
+++ b/moves/moves.cpp	Thu May 16 09:20:59 2019 +0000
@@ -4,7 +4,7 @@
 #include "microinfinity.h"
 #include "debug.h"
 
-const float kPidSpan_s = 0.01;
+const float kPidSpan_s = 0.02;
 const int kToleranceDeg= 10;
 PwmOut motor_lo_f(pin_pwm[0][0]); //モータ正転
 PwmOut motor_lo_b(pin_pwm[0][1]); //モータ逆転
@@ -146,6 +146,12 @@
     leg_li.setPIDcontroller(&pid_li);
     robot.setLeg(&leg_lo, &leg_li);
     robot.setTickerTime(kPidSpan_s);
+    
+    motor_lo.SetSlowDuty(0.1);
+    motor_li.SetSlowDuty(0.1);
+    motor_lo.SetSlowRange(150, 190);
+    motor_li.SetSlowRange(150, 190);
+    robot.SetGroundRange(180,360);
 }
 
 void reset()
@@ -179,15 +185,15 @@
     int target_deg = 180 + target_step*180;
     //1歩分進む
     while (fabs(leg_lo.GetPosi_deg() - target_deg) >kToleranceDeg) { //loが収束していない時
-        //ticker_time毎にモータに出力する
         robot.StartTime();
         float ground_omega_rad_s = 10;
         float relative_deg = 120;
         robot.RunUnSync(ground_omega_rad_s,  relative_deg);
+        FileWrite();
         robot.WaitRestTime();
     }
     step_num_l = target_step;
-    FileWrite();
+    
 }
 void stop()
 {