77范文网 - 专业文章范例文档资料分享平台

温度控制的PID算法的C语言程序 - 图文(7)

来源:网络收集 时间:2019-04-14 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

e(k) <ε使用变速积分PID算法。

图9 温度控制曲线图

四 源程序

本设计方案软件实现完全使用汇编程序语言。具体源程序略。

五 结果分析论述

本文针对电热锅炉温度控制系统模型,提出了一种基于单片机AT89S51的设计方案。设计中运用PID算法更新T1的定时常数,PWM输出控制可控硅的通断,从而实现对温度的连续控制。设计结果由图7和图本设计的控制器工作稳定,控制精度高,改进的PID算法超调量大大降低;软件采用模块化结构,9可以看出:

提高了通用性。本设计的目的不仅仅是温度控制本身,主要提供了单片机外围电路及软件包括控制算法设计的思想,应该说,这种思想比控制系统本身更为重要

[求助]

如果用PID算法控制温度要怎么做?

小弟的毕业设计是做个温度控制系统,可PID控制那块儿我是一点不会啊。眼看时间就要到了, 那位大哥,各路高手能不能给段C程序啊。是以18B20为传

感器

pangya622

TOP

2# 大 中 小 发表于 2009-5-23 19:13 只看该作者

参考下我收藏的

#i nclude #i nclude

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.

------------------------------------------------------------------------*/

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 initial output of the

pid controller at start up.

------------------------------------------------------------------------*/

void pid_setinteg(struct _pid *pid,float new_integ)

{

pid->integral = new_integ; pid->last_error = 0;

}

/*------------------------------------------------------------------------ pid_bumpless

DESCRIPTION Bumpless transfer algorithim. When suddenly changing

setpoints, or when restarting the PID equation after an extended pause, the derivative of the equation can cause a bump in the controller output. This function will help smooth out that bump. The process value in *pv should be the updated just before this function is used.

------------------------------------------------------------------------*/

void pid_bumpless(struct _pid *pid)

{

pid->last_error = (pid->sp)-(pid->pv);

}

/*------------------------------------------------------------------------ pid_calc

DESCRIPTION Performs PID calculations for the _pid structure *a. This function uses the positional form of the pid equation, and incorporates an integral windup prevention algorithim. Rectangular integration is used, so this function must be repeated on a consistent

time basis for accurate control.

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库温度控制的PID算法的C语言程序 - 图文(7)在线全文阅读。

温度控制的PID算法的C语言程序 - 图文(7).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/595282.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: