原始版本

This commit is contained in:
冯佳
2025-06-19 21:56:46 +08:00
parent fe98e5f010
commit a4841450cf
4152 changed files with 1910684 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#ifndef __PID_H__
#define __PID_H__
typedef struct
{
float kp;
float ki;
float kd;
float setpoint; // 目标值
float integral; // 积分项
float prev_error; // 上一次误差
float output; // 输出
unsigned long last_time; // 上次计算的时间戳单位ms
} PID_TypeDef;
void PID_Init(PID_TypeDef *pid, float kp,float ki, float ka);
float PID_Calculate(PID_TypeDef *pid,float measured,unsinged long now_time);
#endif // __PID_H__