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
PID_Cntrl.h
- Committer:
- altb2
- Date:
- 2019-05-07
- Revision:
- 1:314e2e3727f2
- Parent:
- 0:4ed9a8952ddc
- Child:
- 3:477db0d9895e
File content as of revision 1:314e2e3727f2:
#ifndef PID_CNTRL_H_
#define PID_CNTRL_H_
// PID Controller Class (Template)
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 update((double)error);
}
virtual ~PID_Cntrl();
void reset(float initValue);
float update(double error);
private:
float e_old,D_old,I_old;
float tau_f,Ts;
float Kp,Ki,Kd;
float uMin, uMax;
// here some local variables are defined
};
#endif