⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pid.i

📁 This is Temperature PID regulator for Tamman ovens. Temperature is measured by thermocouple via lm35
💻 I
字号:
float pid(float thempSet, float themp)
{

extern float errThemp[3];		

float	tauDiffFilter;		

float	tauOutFilter;		

float OutPID;
float KoeffNormOut;
float Differential;
float Integral;
float tmpReal;

KoeffNormOut = 255/30		;	

errThemp[2] = errThemp[1];
errThemp[1] = errThemp[0];

errThemp[0] = (themp - thempSet) * KoeffNormOut;

Differential += (((errThemp[0] - errThemp[2]) * 1			 * 0.5) - Differential) / tauDiffFilter;

Integral += (((errThemp[0] + 2*errThemp[1] + errThemp[2]) * 1		 * 0.25) / 1			);

if(Integral > (float)255)
Integral = (float)255;
else
if(Integral < (float)0)
Integral = (float)0;

tmpReal = errThemp[0] + Integral + Differential / 1		;

if(tmpReal > (float)255)
tmpReal = (float)255;
else 
if(tmpReal < (float)0)
tmpReal = (float)0;

OutPID += (tmpReal - OutPID) / tauOutFilter;	

return OutPID;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -