摘要在此次设计中,主要是设计一套能够精确控制温度的恒温箱温度控制系统。
该系统能够实时、自动、准确的测量恒温箱内的温度,然后通过加热和降温将温度控制在设定的误差范围内。
恒温箱在各个领域里都有很重要的意义,但其控制系统又较为复杂,基本上不可能用数学的方法建立准确的模型。
当前是用经典控制和智能控制两种控制算法相结合的方式对温度进行高效的控制。
我们采用STC12C5A60S2单片机作为核心控制器,温度测量采用数字温度传感器,使用PID控制,输出控制用量的调节用的是可控硅触发端的通断,从而实现对温度的控制。
温度在一定范围内可以由人工调节,并能在环境温度降低时实现自动调整。
这样将PID和单片机结合使用,可以将整个控制系统的精度提高,将误差减小。
PID算法是经典的控制算法,在实际的控制中有着很高的地位。
PID算法相对简单,控制精度高。
但是PID调节的参数无法适应系统很长时间,需要对参数不断的整定,以达到更好的控制效果。
该算法最重要的是怎样合理有效的整定其参数,针对这种情况我们就要对其进行仿真建模,通过MATLAB找到更好的解决方法,以免浪费不必要的时间,有效的提高了设计效率,也使控制性能可以达到预期的效果。
关键词:恒温箱;温度控制;MATLAB;PIDThis paper is mainly to design a set of temperature control system that can control the temperature of incubators precisely. This system is capable in automatically and accurately measuring the temperature inside the oven in real-time and control the temperature within the setting error range by heating and cooling. Incubators have a very important significance in various fields. Due to its complication in the control system, basically it is impossible to mathematically establish a mode accurately. The current used algorithm control method is the classical control method and intelligent control method. By combining these two algorithms, an effective control on the temperature is achieved.STC12C5A60S2 microcontroller is used as the core controller. The temperature measurement is done by using PID control on the digital temperature sensor. The amount of output is control by using the trigger of SCR, where the temperature control is achieved. The temperature can be adjusted manually within certain range and it can adjust automatically when the ambient temperature decreases. The combination of usage of PID and microcontroller can increase the accuracy of the control system and therefore reduce the errors.PID is a classical algorithm and control algorithms. It has a very high status in the actual control system. The PID algorithm is relatively simple and has high precision of control. But in order to achieve a better control effect, The PID parameters need a constant tuning and they are unable to adapt in the system for a longer time. Therefore is it important for finding a reasonable and effective tuning for the parameters in which we have to modeling and stimulation. In order to find a better solution without wasting much time, MATLAB is used and this has effectively improve the design efficiency and the control performance achieved the desired results.Key words: Incubators; Temperature control; MATLAB; PID control摘要 (I)Abstract (II)引言 (1)1 绪论 (2)1.1 课题背景,目的和意义 (2)1.2 国内外研究现状 (2)1.3 发展方向 (3)1.4 本章小结 (3)2 恒温箱温度控制系统的总体设计 (4)2.1 恒温箱温度控制系统设计的研究内容与基本要求 (4)2.1.1恒温箱温度控制系统设计的研究内容 (4)2.1.2恒温箱温度控制系统设计的基本要求 (4)2.2 恒温箱温度控制系统的基本工作原理 (4)2.3 控制方案的选择 (5)2.3.1比例控制(P) (5)2.3.2比例积分控制(PI) (6)2.3.3比例微分控制(PD) (6)2.3.4比例积分微分控制(PID) (7)2.4 PID的特点与参数的整定 (8)2.4.1PID调节器的特点 (8)2.4.2PID调节器参数的整定 (8)2.5 本章小结 (9)3 恒温箱温度控制系统的硬件电路的设计 (10)3.1 元器件的选择 (10)3.1.1温度传感器的选择 (10)3.1.2电线的选择 (10)3.1.3显示器的选择 (11)3.1.4 稳压器的选择 (11)3.1.5按键的选择 (12)3.1.6加热负载控制器件的选择 (12)3.1.7核心控制器的选择 (13)3.2 单片机电路的设计 (13)3.3 显示电路的设计 (14)3.4 按键电路的设计 (15)3.5 报警电路的设计 (16)3.6 稳压电路的设计 (16)3.7 过零检测电路 (17)3.8 加热器件驱动电路 (18)3.8.1光电耦合器介绍 (18)3.8.2 可控硅介绍 (18)3.8.3 可控硅驱动电路设计 (19)3.9 热电偶信号处理电路 (20)3.9.1热电偶的基本工作原理 (20)3.9.2MAX6675的介绍 (20)3.9.3热电偶信号处理电路的设计 (21)3.10 模拟样机硬件的制作 (22)3.11本章小结 (22)4 温度控制系统的软件设计 (23)4.1 检测模块设计 (23)4.1.1按键模块程序设计 (23)4.1.2温度检测程序设计 (24)4.2 控制模块程序设计 (24)4.3 显示模块程序设计 (25)4.4 PID程序设计 (26)4.5 系统整体设计 (26)4.6 模拟样机的软件设计 (27)4.7 本章小结 (27)5 恒温箱温度控制系统的建模与仿真 (28)5.1 恒温箱温度控制系统的数学建模 (28)5.2 控制系统的仿真 (28)5.2.1 MATLAB的简介 (28)5.2.2 Simulink的简介 (29)5.2.3PID控制及仿真 (29)5.3 本章小结 (31)6 总结 (32)6.1 结论 (32)6.2 心得体会 (32)谢辞 (33)参考文献 (34)附录一模拟样机程序 (35)附录二元器件清单 (38)附录三模拟样机的温度控制系统的PCB图 (39)引言恒温箱的应用非常广泛。
其工作就是保持温度的恒定,从琐碎的日常生活到精准的科学研究;从能源、化工到医用、军事;从工业生产到农牧业的需要。
可见,恒温箱无处不在。
在当今社会,由于科技快速进步,国家经济水平的高速发展,以及大众对恒温箱的需求的增长,所以就对恒温箱提出了更高的要求。
不仅要控制的精度越来越高,还要经济实惠,更希望恒温箱有一个温度控制的范围,可以让用户自己设置自己所需温度,以满足不同用户的不同需求。
一般的温度控制方法都是设定一个数值为温度的临界点,超过误差允许的范畴则要进行温度调控。
本方法容易操作,价格适中,但结果不理想,控温精度不高,需要较长的时间才可以到达稳定点。
因此,它只适用于对精度要求不高地方。
本次毕业设计中,该系统的作用就是实现对温度的控制与监测。
我们的核心控制器是单片机。
用单片机进行PID计算,可以最大程度的展示软件的灵活性、且容易操作,可以让系统变得更稳定一些。
单片机是每个控制系统中不能缺少的重要组成部分,已广泛地应用于各个领域。
能及时的处理数据,可以使系统在最佳状态下工作,并使控制精度整体提高。
又因为单片机有功能强大,反应灵敏,尺寸小,能耗低,性价比高等优点,因此其市场占有率在日益增加。
PID控制器原理相对容易一些,且适应性好,鲁棒性强。
因为其P、I、D各自独立,研究工作者可以根据自己的需求来进行组合,整定PID的参数又相对简单。
因此在众多领域里都有广泛的应用。
1 绪论1.1 课题背景,目的和意义随着社会不断发展,科技快速进步,以及恒温箱在诸多领域的应用,智能控制与经典控制相结合的控制方式已然成为温度控制系统的主流方向。
温度在诸多领域里都是极为重要的参数,但对其实现高精度的控制是有一定难度的,但温度又是一个和生活密不可分的实际问题。