Matthieu Lapeyre
/
ServoController
Test
PID.h
- Committer:
- matthieulap
- Date:
- 2015-03-18
- Revision:
- 4:4e7b392ed0aa
- Parent:
- 3:cae0b305d54c
File content as of revision 4:4e7b392ed0aa:
//Ben Katz, 2013 //PID Controller class #include "mbed.h" #ifndef PID_H #define PID_H class PIDController{ public: PIDController(float desired_position, float desired_torque, float p_gainp, float d_gainp, float i_gain_p, float p_gain_c, float i_gain_c); ~PIDController(); float goal_position; float current_position; float kp_p; float kd_p; float ki_p; float kp_c; float ki_c; float c_error; float error_sum; float command; float torque_command; float c_torque; float error; float old_error; float integral_error; int counter; Timer timer; float torque; float direction; float past_currents [5]; float command_position(void); float command_torque(void); float command_position_tm(void); private: }; #endif