root / control / pid_control.h @ 901514c8
History | View | Annotate | Download (443 Bytes)
1 | a6ca8c2b | Priya | #ifndef _PID_CONTROL_H_
|
---|---|---|---|
2 | #define _PID_CONTROL_H_
|
||
3 | |||
4 | class PID_control |
||
5 | { |
||
6 | public:
|
||
7 | PID_control(int p_term, int d_term, int i_term, float goal); |
||
8 | PID_control(int p_term, int d_term, int i_term); |
||
9 | |||
10 | void change_goal(float goal); |
||
11 | |||
12 | 901514c8 | Priya | float pid(float input); |
13 | a6ca8c2b | Priya | |
14 | private:
|
||
15 | int k_p;
|
||
16 | int k_i;
|
||
17 | int k_d;
|
||
18 | |||
19 | float set_config;
|
||
20 | float error;
|
||
21 | float prev_error;
|
||
22 | |||
23 | float P_err;
|
||
24 | float I_err;
|
||
25 | float D_err;
|
||
26 | }; |
||
27 | |||
28 | #endif |