Project

General

Profile

Statistics
| Branch: | Revision:

root / control / pid_control.h @ 71780e9c

History | View | Annotate | Download (461 Bytes)

1
#ifndef _PID_CONTROL_H_
2
#define _PID_CONTROL_H_
3

    
4
class PID_control
5
{
6
  public:
7
    PID_control(float p_term, float d_term, float i_term, float goal); 
8
    PID_control(float p_term, float d_term, float i_term); 
9

    
10
    void change_goal(float goal);
11

    
12
    float pid(float input);
13

    
14
  private:
15
    float k_p;
16
    float k_i;
17
    float 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