You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
432 B
24 lines
432 B
#ifndef _PID_H_
|
|
#define _PID_H_
|
|
|
|
class PID {
|
|
|
|
private:
|
|
double Min, Max;
|
|
double Kp; // proportional factor
|
|
double Ki; // integral factor
|
|
double Kd; // derivative factor
|
|
double Integral;
|
|
double PreviousError;
|
|
int64_t PreviousTime;
|
|
|
|
public:
|
|
PID(double min, double max, double kp, double kd, double ki);
|
|
~PID();
|
|
|
|
double Update(double target, double value, int64_t time);
|
|
static int64_t getTime(void);
|
|
};
|
|
|
|
#endif
|