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