v1

Files at this revision

API Documentation at this revision

Comitter:
kangmingyo
Date:
Wed Jul 10 04:30:47 2019 +0000
Parent:
6:366ec55e64fe
Commit message:
update_velocity v2

Changed in this revision

motor.cpp Show annotated file Show diff for this revision Revisions of this file
motor.h Show annotated file Show diff for this revision Revisions of this file
diff -r 366ec55e64fe -r 42c478f9a1fe motor.cpp
--- a/motor.cpp	Wed Jul 10 04:08:29 2019 +0000
+++ b/motor.cpp	Wed Jul 10 04:30:47 2019 +0000
@@ -187,7 +187,7 @@
 }
 float MotorCtl::CalculateVelocity()
 {
-    return (DeltaCnt*1000.0)*3.14159265359*0.043/(float)(DeltaT*CntPerRev)
+    return getRPM()*3.14159265359*0.043/60;
 }
 
 
diff -r 366ec55e64fe -r 42c478f9a1fe motor.h
--- a/motor.h	Wed Jul 10 04:08:29 2019 +0000
+++ b/motor.h	Wed Jul 10 04:30:47 2019 +0000
@@ -17,7 +17,7 @@
         int getRPM();
         float CalculateCumDis();
         float CalculateRelaDis();
-        float CalculateVelocity()
+        float CalculateVelocity();
         int getTarget();
         int getError();
         float getKP();