Project

General

Profile

Revision c7e517ce

IDc7e517ce43e8346527b9d5780bf7e1394a8e38a8

Added by Thomas Mullins almost 12 years ago

Added ability to change constants in PID_control

View differences:

control/pid_control.h
8 8
    PID_control(float p_term, float d_term, float i_term); 
9 9

  
10 10
    void change_goal(float goal);
11
    void change_p(float p);
12
    void change_i(float i);
13
    void change_d(float d);
11 14

  
12 15
    float pid(float input, double time);
13 16

  
14 17
  private:
18
    void reset();
19
    
15 20
    float k_p;
16 21
    float k_i;
17 22
    float k_d;
18 23
    
19 24
    float set_config;
20
    float error;
21 25
    float prev_error;
22 26
    double prev_time;
23 27

  

Also available in: Unified diff