Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: HbMotor.h
- Revision:
- 32:7f4145cc3551
- Parent:
- 29:eb3d72dd94aa
- Child:
- 35:3779201b4c73
--- a/HbMotor.h Wed Dec 19 12:22:22 2018 +0000 +++ b/HbMotor.h Thu Dec 20 11:38:09 2018 +0000 @@ -26,46 +26,37 @@ private: //std::bitset<4> ready; //bool ready; - eMotPos pos; // 位置 - INT16 typ; // 流入側or出力側 - INT16 val; // - INT16 ofs; // オフセットスロットル - INT16 pwmMin; // - 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 tblVal[100]; // %->PWMの変換テーブル + eMotPos pos; // 位置 + INT16 typ; // 流入(IN)側or出力(OUT)側 + INT16 val; // User入力値 + INT16 attval; // 姿勢制御の入力値 + INT16 ofs; // オフセットスロットル値 + INT16 pwmMin; // + 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 public: -/**/ HbMotCtrl(eMotPos Pos, INT16 Type);//コンストラクタ ~HbMotCtrl();//デストラクタ - bool isReady();//使用できるようにパラメータがセットされたかどうか(今は使わないかなぁ) + //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); + + INT16 calcPwm(INT16 rpm); - //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 + void setRpmValue(eMotInType type, INT16 value); // 値セット + //void setRpmOfs(INT16 value); // Rpm + INT16 getRpmValue(eMotInType type); // Rpm + //INT16 getRpmOfs(); // Rpm }; class HbSubProp{ @@ -86,19 +77,14 @@ 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 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(INT16 val); // rpm - void setOfs(INT16 val); // rpm - INT16 getValue(); // rpm - INT16 getOfs(); // rpm + void setValue(eMotInType type, INT16 val); // rpm + //void setOfs(INT16 val); // rpm + INT16 getValue(eMotInType type); // rpm + //INT16 getOfs(); // rpm // あとで実装したい関数たち //void addValue(float val);