Project

General

Profile

Revision 71780e9c

ID71780e9c3f71dc76792785ada940cacd83cda58e

Added by Priya about 12 years ago

tested pid_control and fixed it. added the test file for future reference

View differences:

control/pid_control.cpp
1 1
#include "pid_control.h"
2
#include "assert.h"
3 2

  
4
PID_control::PID_control(int p_term, int d_term, int i_term, float goal); 
3
PID_control::PID_control(float p_term, float d_term, float i_term, float goal) 
5 4
{
6 5
  P_err = 0;
7 6
  I_err = 0;
......
14 13
  set_config = goal;
15 14
}
16 15

  
17
PID_control::PID_control(int p_term, int d_term, int i_term)
16
PID_control::PID_control(float p_term, float d_term, float i_term)
18 17
{
19 18
  P_err = 0;
20 19
  I_err = 0;
......
42 41

  
43 42
  return k_p*P_err + k_i*I_err + k_d * D_err;
44 43
}
45

  

Also available in: Unified diff