Project

General

Profile

Statistics
| Branch: | Revision:

root / control / pid_control.h @ 901514c8

History | View | Annotate | Download (443 Bytes)

1
#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
    float pid(float input);
13

    
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