电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

C语言PID算法

C语言PID算法_第1页
1/11
C语言PID算法_第2页
2/11
C语言PID算法_第3页
3/11
PID 算法(c 语言)(来自老外) (2010-02-17 00:18:24) 转载 #include #include //定义 PID的结构体 struct _pid { int pv; //integer that contains the process value 过程量 int sp; //*integer that contains the set point 设定值 float integral; // 积分值 -- 偏差累计值 float pgain; float igain; float dgain; int deadband; //死区 int last_error; }; struct _pid warm,*pid; int process_point, set_point,dead_band; float p_gain, i_gain, d_gain, integral_val,new_integ;; //---------------------------------------------- pid_init DESCRIPTION This function initializes the pointers in the _pid structure to the process variable and the setpoint. *pv and *sp are integer pointers. //---------------------------------------------- void pid_init(struct _pid *warm, int process_point, int set_point) { struct _pid *pid; pid = warm; pid->pv = process_point; pid->sp = set_point; } //----------------------------------------------pid_tune DESCRIPTION Sets the proportional gain (p_gain), integral gain (i_gain), derivitive gain (d_gain), and the dead band (dead_band) of a pid control structure _pid. 设定PID参数 ---- P,I,D,死区 //---------------------------------------------- void pid_tune(struct _pid *pid, float p_gain, float i_gain, float d_gain, int dead_band) { pid->pgain = p_gain; pid->igain = i_gain; pid->dgain = d_gain; pid->deadband = dead_band; pid->integral= integral_val; pid->last_error=0; } //---------------------------------------------- pid_setinteg DESCRIPTION Set a new value for the integral term of the pid equation. This is useful for setting the initi...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

C语言PID算法

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部