星期二, 十月 25, 2005

 

A PID CODE

float pid(void)
{
float temp=25;
float temp_set=50;
float ek=0;
float ek_1=0;
float isum=0;
float kp=1.2;
float ki=1;
float kd=1.2;
float pid;

ek=temp_set-temp;

isum=isum+ki*(ek+ek_1);

pid=kp*ek+isum+kd*(ek-ek_1);

ek_1=ek;

return(pid_out);
}

Comments: 发表评论



<< Home

This page is powered by Blogger. Isn't yours?