26 lines
337 B
C
26 lines
337 B
C
#ifndef _PIDCTRL_H_
|
|
#define _PIDCTRL_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
struct pid_data {
|
|
int32_t kp;
|
|
|
|
int32_t ta;
|
|
|
|
int32_t ki;
|
|
int32_t err_sum;
|
|
int32_t err_sum_max;
|
|
int32_t err_sum_min;
|
|
|
|
int32_t kd;
|
|
int32_t err_old;
|
|
|
|
int32_t out_max;
|
|
int32_t out_min;
|
|
};
|
|
|
|
int32_t pid_ctrl(struct pid_data *pid, int32_t error);
|
|
|
|
#endif /* _PIDCTRL_H_ */
|