TJ-WW03-H03/APP_smoke_N_V1.3/PID/PID.H

53 lines
854 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _pid_
#define _pid_
//#include "stm32f10x_conf.h"
#include "main.h"
typedef struct
{
float curr; //当前温度
float set; //设定温度
// float pid_P; //P
// float pid_I; //I
// float pid_D; //D
// short Ek;//
// short Ek_1;//
// short Ek_2;//
//int PID_OUT;//
float En;
float En_1;
float En_2;
float last_En;
float Sen;
float Sen_max;
float Sen_min;
float Kp; //比例系数
float Tsam; //采样周期---控制周期每隔Tsam控制器输出一次PID运算结果
float Ti;//积分时间常数
float Td;//微分时间常数
float Dout;//增量PID计算本次应该输出的增量值--本次计算的结果
u16 calc_cycle;
short currpwm; //当前的pwm宽度
u16 pwm_cycle;//pwm的周期
}PID;
u8 pid_our_control( u16 currentTemp );
extern u8 STATUS;
extern PID pid;
void PIDParament_Init(void); //
void pid_calc(void); //pid??
#endif