-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPID.h
More file actions
33 lines (28 loc) · 739 Bytes
/
PID.h
File metadata and controls
33 lines (28 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef PID_H
#define PID_H
class PID
{
public:
PID();
float control(float target, float nowrpm);
float PI_lateD(float target, float nowrpm);
float control_P(float target, float nowrpm, float new_Kp);
float control_PI(float target, float nowrpm);
void setParameter(float new_Kp, float new_Ki, float new_Kd);
void setParameter(float new_Ku, float new_Pu);
void reset(float target);
float Ku;
float Pu;
float Kp;
float Ti;
float Td;
float Ki;
float Kd;
private:
float integral;
float prev_hensa;
float nowtime;
float prev_time;
float lateD;
};
#endif