Motor current controller

Fork of CURRENT_CONTROL by LDSC_Robotics_TAs

Revision:
4:1a6ba05e7736
Parent:
3:c787d1c5ad6a
Child:
5:7ccd2fb7ce7e
--- a/CURRENT_CONTROL.h	Fri Apr 22 16:29:35 2016 +0000
+++ b/CURRENT_CONTROL.h	Thu Apr 28 09:07:32 2016 +0000
@@ -27,8 +27,9 @@
     } PWMIndex;
 
     CURRENT_CONTROL(PinName curChannel, PinName PwmChannel1, PinName PwmChannel2, PWMIndex pwmIndex, float Kp, float Ki, float Kd, float samplingTime);
-    void Control(float curRef);
-    void SetAnalog2Cur(float ratio);
+    float saturation(float input, float limit_H, float limit_L);
+    void Control(float curRef, float speed);
+    void SetParams(float Analog2Cur, float angSpeed2Backemf, float voltage2DutyRatio);
     
     //functions for test////////
     void ChangePwmPeriod(float microSeconds);
@@ -44,10 +45,13 @@
 
     float currentOffset;
     float curFeedBack;
-    float analog2Cur;
+    
     AnalogIn currentAnalogIn;
     float analogInValue;
     
+    float analog2Cur;
+    float Kw;
+    float voltage2Duty;
     LPF lpFilter;