Skip to content

Commit aedc8c8

Browse files
Create PIDEasy.h
1 parent 5c2ab4c commit aedc8c8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

libraries/PIDEasy/src/PIDEasy.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef PIDEASY_H
2+
#define PIDEASY_H
3+
4+
class PID {
5+
public:
6+
PID(float kp, float ki, float kd);
7+
8+
float compute(float error, unsigned long dt);
9+
void setWindUP(float min, float max);
10+
void setConstrain(int min, int max);
11+
void setSmoothingDerivate(float sD);
12+
void setDampingFactor(float dF);
13+
14+
private:
15+
float kp, ki, kd;
16+
float previous_error;
17+
float previous_derivative;
18+
float integral;
19+
float min_windup, max_windup;
20+
float derivative_smoothing, dampingFactor;
21+
int min_constrain, max_constrain;
22+
};
23+
24+
#endif

0 commit comments

Comments
 (0)