広田 勇斗 / MD_PID

Dependencies:   QEI

Dependents:   Omni_2017_z BETA_A ALPHA_A GAMMA_A ... more

Revision:
3:0157bb21ba04
Parent:
2:5b2331251b3e
Child:
4:374ca057d8d5
--- a/MD_PID.cpp	Tue Aug 30 01:46:33 2016 +0000
+++ b/MD_PID.cpp	Tue Aug 30 02:51:29 2016 +0000
@@ -22,7 +22,7 @@
     Reset();
 }
 
-double MD_PID::Drive(double ref)
+double MD_PID::Drive(double ref, double stop)
 {
     /*
     if(ref1 != ref)
@@ -52,7 +52,7 @@
             duty = -1.0;
     }
     
-    if( ( (ref >= 0) ^ (Speed() >= 0) ) && fabs(Speed()) > 0.3)
+    if( ( (ref >= 0) ^ (Speed() >= 0) ) && fabs(Speed()) > stop)
         duty = 0;
     
     md->rotate(duty);