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.
shared/PID_Control/PI_D/PI_D.h
- Committer:
- e2011220
- Date:
- 2021-04-14
- Revision:
- 0:ee7e9405e1c7
File content as of revision 0:ee7e9405e1c7:
#ifndef PI_D_H_
#define PI_D_H_
#include "PID.h"
class PI_D : public PID
{
public:
PI_D(double k = 0, double Ti = 0, double Td = 0, double target = 0, double current = 0)
{
PID::set_PID(k, Ti, Td);
set_state(target, current);
}
~PI_D(){}
protected:
virtual double _get_control();
virtual void _calc_p();
virtual void _calc_i();
virtual void _calc_d();
virtual void _reset();
private:
inline void _update(double *array, double present)
{
array[0] = array[1];
array[1] = present;
}
double _p, _i, _d;
double _diff[2];
double _integral;
double _measure[2];
};
#endif