teamALI / Mbed 2 deprecated HB2018

Dependencies:   mbed FreeRTOS

Revision:
29:eb3d72dd94aa
Parent:
28:fdb3b144e342
Child:
32:7f4145cc3551
--- a/HbMotor.h	Sat Dec 15 14:20:04 2018 +0000
+++ b/HbMotor.h	Mon Dec 17 13:25:00 2018 +0000
@@ -24,7 +24,7 @@
 
 class HbMotCtrl{
 private:
-    std::bitset<4> ready;
+    //std::bitset<4> ready;
     //bool    ready;
     eMotPos   pos;          // 位置
     INT16  typ;          // 流入側or出力側
@@ -34,11 +34,13 @@
     INT16   pwmMax;          // 
     INT16   rpmMin;         // 
     INT16   rpmMax;          // 
+    INT16   rpmOfs;         // 調整用オフセット
+    float   rpmGain;        // 調整用ゲイン
     float   coefA;          // PWMとRPMの関係の曲線の係数A
     float   coefB;          // PWMとRPMの関係の曲線の係数B
     float   coefC;          // PWMとRPMの関係の曲線の係数C
-    INT16   curPwmVal;      // 計算してセットした値
-    INT16   curRpmVal;      // 指定された現在のRPM
+    //INT16   curPwmVal;      // 計算してセットした値
+    //INT16   curRpmVal;      // 指定された現在のRPM
     //INT16  tblVal[100];     // %->PWMの変換テーブル
 
 public:
@@ -48,14 +50,22 @@
     bool isReady();//使用できるようにパラメータがセットされたかどうか(今は使わないかなぁ)
     void setPwmLimt(INT16 Min, INT16 Max);
     void setRpmLimt(INT16 Min, INT16 Max);
+    void setRpmOffset(INT16 ofs);
+    void setRpmGain(float gain);
     void setMotCoef(float a, float b, float c);
     //void makeTable();       // 変換テーブル作成 パラメータセット後呼ぶ
     INT16 calcPwm(INT16 percent);
+    INT16 calcPwm(UINT16 rpm);
 
-    void setValue(float value);  // パーセンテージ0~50
-    void setOfs(float value);    // パーセンテージ0~50
-    float getValue();  // パーセンテージ0~50
-    float getOfs();    // パーセンテージ0~50
+    //void setValue(float value);  // パーセンテージ0~50
+    //void setOfs(float value);    // パーセンテージ0~50
+    //float getValue();  // パーセンテージ0~50
+    //float getOfs();    // パーセンテージ0~50
+
+    void setRpmValue(INT16 value);  // Rpm
+    void setRpmOfs(INT16 value);    // Rpm
+    INT16 getRpmValue();  // Rpm
+    INT16 getRpmOfs();    // Rpm
 };
 
 class HbSubProp{
@@ -76,13 +86,19 @@
     void setRpmLimIn(INT16 min, INT16 max);
     void setRpmLimOut(INT16 min, INT16 max);
     void setPwmLimit(INT16 min, INT16 max);
+    void setRpmGain(eMotType type, float gain);
+    void setRpmOffset(eMotType type, INT16 ofs);
     void setCoef(eMotType type, float a, float b, float c);
     //void makeTbl();
 
-    void setValue(float val);  // パーセンテージ0~50
-    void setOfs(float val);    // パーセンテージ0~50
-    float getValue();  // パーセンテージ0~50
-    float getOfs();    // パーセンテージ0~50
+    //void setValue(float val);  // パーセンテージ0~50
+    //void setOfs(float val);    // パーセンテージ0~50
+    //float getValue();  // パーセンテージ0~50
+    //float getOfs();    // パーセンテージ0~50
+    void setValue(INT16 val);  // rpm
+    void setOfs(INT16 val);    // rpm
+    INT16 getValue();  // rpm
+    INT16 getOfs();    // rpm
 
     // あとで実装したい関数たち
     //void addValue(float val);