Fork of PID by
PID.hpp@2:73618cad4762, 2016-02-25 (annotated)
- Committer:
- inst
- Date:
- Thu Feb 25 16:22:59 2016 +0000
- Revision:
- 2:73618cad4762
- Child:
- 4:ed6aea0299df
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
inst | 2:73618cad4762 | 1 | #ifndef INCLUDED_PID_H |
inst | 2:73618cad4762 | 2 | #define INCLUDED_PID_H |
inst | 2:73618cad4762 | 3 | |
inst | 2:73618cad4762 | 4 | template <typename T, typename K = T> |
inst | 2:73618cad4762 | 5 | class PID{ |
inst | 2:73618cad4762 | 6 | public: |
inst | 2:73618cad4762 | 7 | PID(K kp, K ki, K kd); |
inst | 2:73618cad4762 | 8 | |
inst | 2:73618cad4762 | 9 | T update(T error); |
inst | 2:73618cad4762 | 10 | |
inst | 2:73618cad4762 | 11 | private: |
inst | 2:73618cad4762 | 12 | const K kp_; // 比例制御係数 |
inst | 2:73618cad4762 | 13 | const K ki_; // 積分制御係数 |
inst | 2:73618cad4762 | 14 | const K kd_; // 微分制御係数 |
inst | 2:73618cad4762 | 15 | |
inst | 2:73618cad4762 | 16 | T integral_; |
inst | 2:73618cad4762 | 17 | T prev_error_; |
inst | 2:73618cad4762 | 18 | }; |
inst | 2:73618cad4762 | 19 | |
inst | 2:73618cad4762 | 20 | #include "PID_impl.hpp" |
inst | 2:73618cad4762 | 21 | |
inst | 2:73618cad4762 | 22 | #endif |