広田 勇斗 / MD_PID

Dependencies:   QEI

Dependents:   Omni_2017_z BETA_A ALPHA_A GAMMA_A ... more

Revision:
11:b621815834c1
Parent:
10:2351419aff1b
Child:
12:d930cbffd2c9
--- a/MD_PID.cpp	Wed Sep 13 02:41:40 2017 +0000
+++ b/MD_PID.cpp	Thu Sep 14 00:25:53 2017 +0000
@@ -24,6 +24,7 @@
 
 double MD_PID::Drive(double ref, double stop)
 {
+    ref *= 6;
     /*
     if(ref1 != ref)
     {
@@ -44,7 +45,7 @@
             Read_Speed();
         }
         else
-            duty = PID(ref);
+            duty -= PID(ref);
 
         if(duty > 1.0)
             duty = 1.0;
@@ -55,7 +56,7 @@
     if( ( (ref >= 0) ^ (Speed() >= 0) ) && fabs(Speed()) > stop)
         duty = 0;
 
-    printf("duty:%.2f\r\n", duty);
+    //printf("duty:%.2f\r\n", duty);
     md->rotate(duty);
     return duty;
 }