摘 要 随着计算机技术、测量仪器和控制技术的高速发展,在现代自动控制领域中,应用了越来越多的先进测量控制技术、设备和方法。其中,由于单片微处理器的性能日益提高、价格又不断降低,使其性能价格比的优势非常明显。因此,如何将单片微处理器应用到燃气热水器水温自动控制领域,为越来越多的燃气热水器生产厂家所重视。 本论文的研究正是适应了这种发展趋势,将单片机应用于燃气热水器水温自动控制系统中。 论文首先简要介绍了燃气热水器的有关情况,对燃气热水器温度控制系统软件功能进行了需求分析;然后,根据系统所要实现的功能进行了PID控制算法的研究;接下来,阐明了系统应用软件所要达到的技术要求,重点研究了系统软件的可*性问题,并且按照这些要求对基于单片机的燃气热水器温度控制系统软件进行了设计,最后编程实现并调试. 本论文软件的设计成功地实现了燃气热水器水温的单片机智能调节,具有很高的实用价值。 关键词:温度控制;单片机;软件设计;PID算法 ;可*性 ABSTRACT With the highly speedy development of computer technology, measurement apparatus, and control technology, more and more advanced technology, equipments and methods for measurement and control are applied in modern automation control realm. In all of these, because of the enhanced performance and reduced price of single chip microcomputer, making the advantage that its ratio of performance to price been obvious. Therefore, how to apply the single chip microcomputer to the temperature control of gas water heater , more and more producers of gas water heater concerned attach importance to it. The work of this monograph adapts to the development tendency, applying the single chip microcomputer to the temperature control of gas water heater. First of all, the monograph talks something about the gas water heater, analyzes the function demand of all modules of the control system; then , confirms the choice of the software arithmetic of PID according to the system function; finally, this monograph specifies the technique request., discusses about the reliability of the control system and list the main programs of the ware. In this monograph, we successfully take automation control of the temperature of gas water heater realm based on the single chip microcomputer into truth. It has a wide development space. Key Words:Temperature control; single chip microcomputer; software design; PID; reliability 目 录 第一章 绪论 1 1.1 论文提出的背景 1 1.1.1 燃气热水器概况 1 1.1.2 燃气热水器温度控制系统软件需求分析 2 1.2 程序设计语言概述 3 1.3 论文的主要研究内容 4 第二章 温度控制算法的研究 5 2.1 常用控制算法 5 2.2 PID控制算法 6 2.2.1 标准PID控制算法 6 2.2.2 PID控制算法的离散化 7 2.2.3 标准PID算法的改进 9 2.2.4 数字PID参数的整定 13 2.3 PID控制算法的应用 16 2.3.1 温控系统数学模型的建立 16 2.3.2 温控系统数字PID参数的整定 18 2.4 本章小结 21 第三章 系统软件设计 22 3.1 系统的功能设计 22 3.1.1 系统的设计要点 22 3.1.2 单片机系统设计原理 23 3.2 系统的硬件结构简介 23 3.3 系统软件总体结构设计 25 3.4 各部分程序结构设计 26 3.4.1 主程序结构设计 26 3.4.2 T0中断服务程序结构设计 28 3.5 本章小结 34 第四章 系统软件的实现 35 4.1 汇编语言 35 4.1.1 AT89S51单片机汇编语言 35 4.1.2 AT89S51单片机指令系统 35 4.2 系统软件可*性研究 39 4.2.1 软件设计抗干扰原则 39 4.2.2 软件抗干扰技术的实现 40 4.3 主程序的软件实现 41 4.4 T0中断服务子程序的实现 42 4.5 主要子程序的软件实现 43 4.5.1 键盘管理子程序的实现 43 4.5.2 测温芯片DS18B20驱动子程序 44 4.5.3 步进电机控制子程序 48 4.6 系统调试 50 4.7 系统研究的应用前景 50 4.8 本章小结 51 结论 53 参考文献 54 致谢 55 第一章 绪论 1.1 论文提出的背景 1.1.1 燃气热水器概况 所谓燃气热水器就是指以气体燃料燃烧为热源的热水器的统称,是一种小型的热力设备。它的工作原理大体是这样:燃气在燃烧室内完全燃烧,产生高温烟气。高温烟气流经换热器,把换热器中的冷水加热为所需的卫生热水。燃气热水器有这些分类方式:按使用气种可以分为使用天然气、人工煤气和液化石油气 3种;按结构可分为容积式和直流式;按给排气方式可分为直排式、烟道式、平衡式、强排式、强制给排气式等。 相对于其它类型热水器而言,燃气热水器具有这样一些优势:不需预热;节能;不结垢、寿命长;使用成本低;款式超薄纤细,外观时尚。 第一台燃气热水器诞生已经超过了 100 年。而燃气热水器技术的发展主要是二战之后 50 多年的时间内完成的。我国的燃气热水器生产也有近 30 年的历史。燃气热水器的发展迄今为止经历了三个阶段: (1)以实现简单功能为目的的第一阶段。作为第一阶段代表的燃气热水器是热水流量为 5L/min 的小型热水器。采用压电陶瓷点火方式,小火先着,水气联动控制阀控制点火,互相独立的气、水调节阀门,热电偶式的熄火保护装置。这种类型的热水器具有初步的安全性保证,满足基本功能,操作也不复杂。但很快显现出的问题在于:点火装置的可*性与寿命;熄火保护装置的寿命;操作的相对烦琐。特别是热电偶式熄火保护装置在点火初期的时间延迟操作,令使用者倍感不便。因此,这一阶段的后期,热水器在此基础上做了一些更新:点火装置由压 [1] [2] 下一页 |