9 valeursPID() :
Kp(0.0),
Ki(0.0),
Kd(0.0),
initialTime(0),
Sp(0.0),
Pv(0.0),
integral(0.0),
previous_error(0.0),
previous_derivative(0.0),
Out(0.0),
Min(-INFINITY),
Max(INFINITY) {}
29 void set(
float Kp,
float Ki,
float Kd,
float Min = -INFINITY,
float Max = INFINITY) {
38 unsigned long currentTime = micros();
44 float error =
Sp -
Pv;
47 if (!isfinite(error) || !isfinite(dt)) {
52 const float epsilon_min = 0.000005;
53 const float epsilon_max = 5;
54 if (dt < epsilon_min || dt > epsilon_max || dt == 0) {
float Kp
Definition: pid.h:10
long initialTime
Definition: pid.h:13
valeursPID()
Definition: pid.h:9
float Out
Definition: pid.h:19
float Pv
Definition: pid.h:15
float Kd
Definition: pid.h:12
float Sp
Definition: pid.h:14
float Min
Definition: pid.h:20
float integral
Definition: pid.h:16
void set(float Kp, float Ki, float Kd, float Min=-INFINITY, float Max=INFINITY)
Definition: pid.h:29
float Max
Definition: pid.h:21
static valeursPID create(float Kp, float Ki, float Kd, float integralCutOff=INFINITY)
Definition: pid.h:23
float previous_error
Definition: pid.h:17
float update()
Definition: pid.h:37
float Ki
Definition: pid.h:11
float previous_derivative
Definition: pid.h:18