![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dsf
Dependencies: BLE_API mbed nRF51822
PIDController.hpp@0:b5906c81772b, 2017-02-05 (annotated)
- Committer:
- stoicancristi
- Date:
- Sun Feb 05 16:31:58 2017 +0000
- Revision:
- 0:b5906c81772b
BLE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
stoicancristi | 0:b5906c81772b | 1 | #ifndef PIDCONTROLLER_H |
stoicancristi | 0:b5906c81772b | 2 | #define PIDCONTROLLER_H |
stoicancristi | 0:b5906c81772b | 3 | |
stoicancristi | 0:b5906c81772b | 4 | #include "Controller.hpp" |
stoicancristi | 0:b5906c81772b | 5 | #include "ControllerParams.hpp" |
stoicancristi | 0:b5906c81772b | 6 | |
stoicancristi | 0:b5906c81772b | 7 | #define TE 0.1 |
stoicancristi | 0:b5906c81772b | 8 | #define dif(a,b) (a-b) |
stoicancristi | 0:b5906c81772b | 9 | |
stoicancristi | 0:b5906c81772b | 10 | class PIDController : public Controller { |
stoicancristi | 0:b5906c81772b | 11 | |
stoicancristi | 0:b5906c81772b | 12 | private: |
stoicancristi | 0:b5906c81772b | 13 | float kp; |
stoicancristi | 0:b5906c81772b | 14 | float ti; |
stoicancristi | 0:b5906c81772b | 15 | float td; |
stoicancristi | 0:b5906c81772b | 16 | |
stoicancristi | 0:b5906c81772b | 17 | public: |
stoicancristi | 0:b5906c81772b | 18 | |
stoicancristi | 0:b5906c81772b | 19 | virtual void updateParams(ControllerParams&); |
stoicancristi | 0:b5906c81772b | 20 | virtual float calculateCmd(void) const; |
stoicancristi | 0:b5906c81772b | 21 | virtual ~PIDController(); |
stoicancristi | 0:b5906c81772b | 22 | |
stoicancristi | 0:b5906c81772b | 23 | void setKp(float); |
stoicancristi | 0:b5906c81772b | 24 | float getKp() const; |
stoicancristi | 0:b5906c81772b | 25 | |
stoicancristi | 0:b5906c81772b | 26 | void setTi(float); |
stoicancristi | 0:b5906c81772b | 27 | float getTi() const; |
stoicancristi | 0:b5906c81772b | 28 | |
stoicancristi | 0:b5906c81772b | 29 | void setTd(float); |
stoicancristi | 0:b5906c81772b | 30 | float getTd() const; |
stoicancristi | 0:b5906c81772b | 31 | }; |
stoicancristi | 0:b5906c81772b | 32 | |
stoicancristi | 0:b5906c81772b | 33 | #endif |