You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
incubator_embeded/HARDWARE/PID.h

40 lines
460 B

#ifndef _PID_H
#define _PID_H
void PID_Init(void);
void PID_Calc(void);
typedef struct Pid
{
float set_tem;//用户设定值
float now_tem;//当前温度
float Kp;
int t; //PID计算周期--采样周期
float Ti;
float Td;
float Ek; //本次偏差
float Ek_1;//上次偏差
float SEk; //历史偏差之和
float Iout;
float Pout;
float Dout;
float OUT0;
float OUT;
int C1ms;
int pwmcycle;//pwm周期
int times;
}PID;
extern PID pid;
#endif