Added one task
Dependencies: mbed
Diff: Robot/inc/pid.h
- Revision:
- 0:fb4269aa5fb4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Robot/inc/pid.h Fri May 26 03:51:19 2017 +0000 @@ -0,0 +1,38 @@ +/* + * File: pid.h + * Author: Owner + * + * Created on 2016/02/29, 1:12 + */ + +#ifndef PID_H +#define PID_H + +#include <stdint.h> + +#define PID_CONTROL_ENABLE 1 +#define PID_CONTROL_DISABLE 0 + +typedef struct{ + + float kp; + float kd; + float ki; + float diff[2]; + float i_term; + + uint32_t is_enabled; + uint32_t is_initialized; + +} PID_Struct; + +void PID_Struct_Init(PID_Struct *, float, float, float); +void PID_Enable_Control(PID_Struct *); +void PID_Disable_Control(PID_Struct *); +uint32_t PID_Check_Status(PID_Struct *); +float PID_Control(PID_Struct *, float, float); +float PD_Control(PID_Struct *, float, float); +float PI_Control(PID_Struct *, float, float); + +#endif /* PID_H */ +