![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
PID
Dependencies: BLE_API mbed nRF51822
Diff: PID.h
- Revision:
- 1:d3e12393b71d
- Parent:
- 0:1f4d5c5491b8
--- a/PID.h Mon Oct 24 16:10:48 2016 +0000 +++ b/PID.h Thu Jan 12 16:04:37 2017 +0000 @@ -5,7 +5,7 @@ #include "math.h" #define Te 100 -#define SUPERIOR_MARGIN 100 +#define SUPERIOR_MARGIN 1 #define INFERIOR_MARGIN 0 typedef struct @@ -17,15 +17,21 @@ class PIDClass { public: - PIDClass(int _Kr, int _Ki, int _Kd, int _SetPoint); + PIDClass(float _Kr, float _Ki, float _Kd, float _SetPoint); float ComputeCommand(float inputADC); + float getKr(){return Kr;} + float getKi(){return Ki;} + float getKd(){return Kd;} + void setKr(float new_Kr){Kr = new_Kr;} + void setKi(float new_Ki){Ki = new_Ki;} + void setKd(float new_Kd){Kd = new_Kd;} private: - int Kr; - int Ki; - int Kd; - int SetPoint; + float Kr; + float Ki; + float Kd; + float SetPoint; }; #endif \ No newline at end of file