简易水温控制系统

  • 格式:docx
  • 大小:205.66 KB
  • 文档页数:13

简易水温控制系统 TYYGROUP system office room 【TYYUA16H-TYY-TYYYUA8Q8-一个简易水温控制系统的设计———控制算法设计摘要在工农业生产和日常生活中,对温度的检测与控制始终有着非常重要的实际意义和广泛的实际应用。

为了加深计算机控制理论的理解,故设计一个温度控制系统,该系统主要由温度信号采集与转换模块、主机控制模块、温度控制模块、液晶显示模块四部分组成,控制算法为PID算法。

系统可实现稳态误差小于1℃,最大超调小于1℃,并且调节时间较短,恒定效果好。

温度控制系统的对象存在滞后,它对阶跃信号的响应会推迟一些时间,对自动控制产生不利的影响,因此对温度准确的测量和有效的控制是此类工业控制系统中的重要指标。

温度是一个重要的物理量,也是工业生产过程中的主要工艺参数之一,物体的许多性质和特性都与温度有关,很多重要的过程只有在一定温度范围内才能有效的进行,因此,对温度的精确测量和可靠控制,在工业生产和科学研究中就具有很重要的意义。

本文阐述了过程控制系统的概念,介绍了一个基于数字传感器DS18B20和单片机STC89C52的简单温度控制系统,以电热水壶为被控对象,通过实验的方法建立温度控制系统的数学模型,采用了PID算法进行系统的设计,达到了比较好的控制目的。

该系统可通过液晶显示器LCD1602显示数据或字符,通过按键设定参数;通过DS18B20测温,实现电热杯水温控制;通过PL2303下载端口,实现单机和上位机的通讯。

实验表明该系统能够实现对温度的控制,具有一定的控制精度。

该系统测温电路简单、连接方便,可用于简单温度控制的场合。

关键词:单片机;温度传感器;液晶显示器;PID算法AbstractIn industrial and agricultural production and daily life, the testing and control of temperature has always had very important practical significance and extensive practical application. In order to deepen the understanding of the computer control theory, the design of a temperature control system, the system is mainly composed of temperature signal acquisition and conversion module, host control module, temperature control module, liquid crystal display module four parts, the control algorithm for PID algorithm. System can realize the steady state error is less than 1 ℃, the maximum overshoot less than 1 ℃, and the adjustment time is shorter, constant effect is good. Lagged temperature control system of the object, its response to the step signal will delay some time, produce adverse effect to the automatic control, so effective for accurate temperature measurement and control is an important indicator in the industrial control system. Temperature is an importantphysical quantities, it is also one of the main process parameters in industrial production process, many properties of objects and features are related to temperature, a lot of important process can only be effective in a certain temperature range, thus, accurate measurement and reliable control of temperature, in the industrial production and scientific research has the very vital significance. This paper expounds the concept of process control system, introduced a digital sensor DS18B20 and single chip microcomputer based STC89C52 simple temperature control system, electric kettle for controlled object, and through the experiment the method to establish the mathematical model of temperature control system, using PID algorithm to the design of the system, to achieve the better control. Through DS18B20, the temperature control of the electric heat cup is achieved. Through the PL2303 download port, the communication between the single machine and the above machine is achieved. The experiment shows that the system can control the temperature, and has certain control accuracy. The system is simple and easy to connect, which can be used for simple temperature control.Key words: single chip microcomputer;the temperature sensor;Liquid crystal display;PID algorithm目录一﹑设计任务与要求1.基本要求1L水由1kW的电路加热,要求水温可以在一定范围内由人工设定,并能在环境温度变化时实现自动调整,以保持在设定的温度。

2.主要性能指标(1).温度设定范围:10℃~100℃,最小分辨率为1℃。

(2).控制精度:温度控制的稳态误差<0.2℃.(3).能够实时显示当前水温(4).具有通信能力,可通过RS-232串口输出当前温度值至上位机。

(5).采用适当的控制方法,当设定温度或环境温度突变时减小系统的 调节时间和超调量。

二﹑方案论证由于水温控制系统的控制对象具有热储存能力大,惯性也较大的特点,水在容器内的流动或热量传递都存在一定的阻力,因而可以将被控对象归于具有纯滞后的一阶惯性环节。

该系统可以采用以下几种控制方案: 1.输出开关量控制对于惯性较大的过程可简单地采用输出开关量控制的方法。

这种方法通过比较给定值与被控参数来控制输出的状态:通过控制加热回路的晶闸管的导通或关断来控制加热时间,控制过程简单易行,但容易引起反馈回路产生振荡。

因此这种控制方案一般在大惯性系统对控制精度和动态特性要求不高的情况下采用。

控制设计PID 控制算法(常规PID ﹑微分先行PID ﹑中间反馈PID 等),对给定值与被控参数的偏差进行PID 运算,输出控制量来控制加热回路。

三﹑系统设计 1.硬件设计图3-1 水温控制系统结构图⑵系统硬件总体设计框图图3-2 水温控制系统硬件总体设计框图⑶单元电路设计 ①单片机最小系统②温度传感器信号调理及A/D 转换电路 ③键盘接口电路④LCD1602液晶显示电路 ⑤驱动电路2.(⎥⎦⎢⎣DI P dt T u 0( (3-1)由上式可得PID 控制器的传递函数为:s T K sT K K s D D P I P P ++=1)( (3-2)其中,Kp 为比例增益,Ti 为积分时间,Td 为微分时间。

(2)控制系统模型分析 建立微分方程:M*C*dT/dt=W0*k(t)-β*M*C*(T(s)-T0) 将上式经拉普拉斯变换得:在假设室温为0℃的条件下,将上式经拉普拉斯变换推导出被控对象(即水温)的数学模型为:G(s)=T(s)/K(s)= W0/MC*s+-β*MC= W0/MC/s/β+1 (3-3) 各项参数为: W0——900(瓦) (kg)C--------4200(J/kg*C) β所以,G(s)=1000s+1PID 控制器的传递函数为:采用试凑法进行参数整定,控制器的参数按先比例、再积分、后微分的顺序进行,步骤如下: 令PID 调节器的Ti=∞,Td=0,使其成为纯比例调节器。

比例度按经验数据设置,整定纯比例控制系统的比例度。

加入积分作用。

在加积分作用之前,应将比例度加大为原来的倍。

将积分时间IT 由大到小调整。

加入微分作用,这时可将比例度调到原来的数值或者更小一些。

再将微分时间由小到达调整,直到过渡过程曲线达到满意为止。

通过试凑法得到PID 参数为: Kp=20000,Ti=30000,Td=5000. MATLAB 仿真结果图3-7 PID 控制框图图3-8仿真结果图四、实验结果实验中烧水高度为,设定温度为83度。

PID 参数调节结果是P=70,I=4,D=0,超调量为℃,上升时间为626s,稳态误差2℃,扰动加水 cm ,加水后温度降落℃,恢复时间200S 。

电热水杯温度上升曲线如下图: 五、结论本系统以AT89C51单片机为控制核心,利用DS18B20采集温度并配合PID 控制算法提高了水温的控制精度,使用PID 控制算法和移相触发可控硅调节方式实施自动控制系统,具有控制参数精度高、反映速度快和稳定性好的特点。