Basic but robust PID library
Dependents: ESP8266_pid_mtrPos_webserver_SDcard_v2 ESP8266_pid_mtrSpeed_Webserver_SDcard ESP8266_pid_spd_and_pos_webserver_SDcard ESP8266_pid_redbot_webserver ... more
Diff: PID.cpp
- Revision:
- 1:c307cd559154
- Parent:
- 0:9a6f7aafe531
- Child:
- 3:6c2c985408df
--- a/PID.cpp Mon Nov 23 02:42:53 2015 +0000 +++ b/PID.cpp Tue Nov 24 00:15:01 2015 +0000 @@ -27,7 +27,6 @@ i_accumulator = clip(*_output, _output_lower, _output_upper); // P and D terms are zero, thus // i term is used to keep output unchanged - sample_timer.attach(this, &PID::sample, _Ts); } @@ -48,6 +47,22 @@ start(); // Enable Sample Interrupt... start() } +float PID::getKp(){ + return _kp; +} + +float PID::getKi(){ + return _ki; +} + +float PID::getKd(){ + return _kd; +} + +float PID::getTs(){ + return _Ts; +} + void PID::sample(){ error = *_setpoint - *_feedback;