42 lines
551 B
C
42 lines
551 B
C
/*
|
|
* PID.h
|
|
*
|
|
* Created on: 2022年03月22日
|
|
* Author: User
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
{
|
|
|
|
void (*Init)(void);
|
|
uint8_t(*Realize)(uint8_t,uint16_t);
|
|
} PID_t;
|
|
|
|
// typedef struct
|
|
// {
|
|
// int target_val; //目标值
|
|
// int actual_val; //实际值
|
|
// int err; //定义当前偏差值
|
|
// int err_next; //定义下一个偏差值
|
|
// int err_last; //定义最后一个偏差值
|
|
// uint8_t kp,ki,kd; //定义比例,积分,微分系数
|
|
// }_pid;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern PID_t xdata PID_Func;
|
|
|
|
|
|
|