Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NewpidDror Recieverdror Trancieverdror CANrecive
Diff: PID.cpp
- Revision:
- 1:c307cd559154
- Parent:
- 0:9a6f7aafe531
- Child:
- 3:6c2c985408df
diff -r 9a6f7aafe531 -r c307cd559154 PID.cpp
--- 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;