-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathRBEPID.h
More file actions
42 lines (37 loc) · 739 Bytes
/
RBEPID.h
File metadata and controls
42 lines (37 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
34
35
36
37
38
39
40
41
42
/*
* Messages.h
*
* Created on: 10/1/16
* Author: joest
*/
#ifndef PID_H_
#define PID_H_
class RBEPID {
public:
RBEPID();
float kp = 0.00015;
float ki = 0;
float kd = 0;
float last_error = 0;
float sum_error = 0;
int sampleRateMs = 5;
/**
* setpid set PID constants
*/
void setpid(float P, float I, float D);
/**
* calc the PID control signel
*
* @param setPoint is the setpoint of the PID system
* @param curPosition the current position of the plan
* @return a value from -1.0 to 1.0 representing the PID control signel
*/
float calc(double setPoint, double curPosition);
/**
* Clear the internal representation fo the integral term.
*
*/
void clearIntegralBuffer();
private:
};
#endif