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.
Dependencies: mbed
Diff: PID_Cntrl.h
- Revision:
- 0:4ed9a8952ddc
- Child:
- 1:314e2e3727f2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/PID_Cntrl.h Tue Apr 30 15:34:47 2019 +0000
@@ -0,0 +1,29 @@
+class PID_Cntrl
+{
+public:
+
+ PID_Cntrl(float P, float I, float D, float tau_f, float Ts, float uMin, float uMax);
+
+ float operator()(float error) {
+ return doStep((double)error);
+ }
+
+ virtual ~PID_Cntrl();
+
+ void reset(float initValue);
+ float doStep(double error);
+ void set_limits(double ,double );
+ float get_ulimit(void);
+
+private:
+
+ double Iold;
+ double eold,yold,del;
+ double uMax;
+ double uMin;
+ double Ts;
+ double P,I,D;
+ double p, Ka;
+ void setCoefficients(float P, float I, float D, float tau_f, float Ts);
+
+};