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
Revision 1:c307cd559154, committed 2015-11-24
- Comitter:
- electromotivated
- Date:
- Tue Nov 24 00:15:01 2015 +0000
- Parent:
- 0:9a6f7aafe531
- Child:
- 2:07397aa513c6
- Commit message:
- Added methods to return currently set params;
Changed in this revision
| PID.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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;