changes to motor library

Dependents:   pid-car-example

Fork of motor by Lawrence Harlow

Files at this revision

API Documentation at this revision

Comitter:
lh14g13
Date:
Fri Apr 28 08:12:32 2017 +0000
Branch:
motorupdate
Parent:
48:2e39f9fca850
Commit message:
added maximum corner torque

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 2e39f9fca850 -r 98fb0d816007 motor.cpp
--- a/motor.cpp	Fri Apr 28 07:54:55 2017 +0000
+++ b/motor.cpp	Fri Apr 28 08:12:32 2017 +0000
@@ -108,7 +108,7 @@
 // This is a function which works off of the duty cycle. NO SENSOR REQUIREMENT
 
 // this function works off the actual value rather than the change in angle. therefore need to have a variabe which stores where the value is.
-void dutyCycleCorner( float speed, float theta,float tuner)
+void dutyCycleCorner( float speed, float theta,float tuner, float corner)
 {
         bool leftOrRight;
         // sets if the car is going left or right
@@ -121,7 +121,7 @@
         if(theta>0.3)
         {
             theta =0.3;
-            
+            speed = corner;
         }
     //calculates the difference in 
         float deltaW = (((0.1f*tan((theta/0.02222f)* (3.14f / 180.0f)))/0.2f)*speed)*tuner;
diff -r 2e39f9fca850 -r 98fb0d816007 motor.h
--- a/motor.h	Fri Apr 28 07:54:55 2017 +0000
+++ b/motor.h	Fri Apr 28 08:12:32 2017 +0000
@@ -12,6 +12,6 @@
 
 //Corner Control
 
-void dutyCycleCorner( float speed, float angle,float tuner);
+void dutyCycleCorner( float speed, float angle,float tuner, float corner);
 void sensorCorner(float &w1,float &w2,float theta,float speed, float tune);
 //int cornerlimiter = 10;