werkend!

Dependencies:   PID QEI_adapted

Fork of MotorThrottle by Bram S

Files at this revision

API Documentation at this revision

Comitter:
jordymorsinkhof
Date:
Mon Oct 30 15:51:11 2017 +0000
Parent:
1:f808e6189b2b
Commit message:
Changed nothing;

Changed in this revision

Motor.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Motor.cpp	Mon Oct 30 13:52:12 2017 +0000
+++ b/Motor.cpp	Mon Oct 30 15:51:11 2017 +0000
@@ -9,6 +9,8 @@
 {
     SetPID(1,0,0);
     _GearRatio=1;
+    MotorThrottle=0;
+    MotorDirection=0;
 }
 
 void Motor::GotoPos(float Rad){
@@ -47,6 +49,7 @@
     MotorDirection=0;
     MotorThrottle=0.0f;
     encoder.reset((int)4200.0f*_GearRatio*(HomingPos/2.0f/3.1415));
+    Stop();
 }
 
 void Motor::SetPID(float P,float Ti,float Td){
@@ -62,7 +65,7 @@
 }
 
 void Motor::SetOutputLimits(float Omin, float Omax){
-    controller.setInputLimits(Omin,Omax);
+    controller.setOutputLimits(Omin,Omax);
 }
 
 void Motor::Stop(){