(完整版)基于单片机的_空调机的温度控制系统设计40含完整程序41毕业设计
- 格式:doc
- 大小:334.50 KB
- 文档页数:65
成都理工大学工程技术学院毕业论文空调机的温度控制系统设计空调机的温度控制系统设计摘要本设计以AT89S51单片机为核心的温度控制系统的工作原理和设计方法。
温度信号由温度芯片DS18B20采集,并以数字信号的方式传送给单片机。
文中介绍了该控制系统的硬件部分,包括:温度检测电路、温度控制电路、PC机与单片机串口通讯电路和一些接口电路。
单片机通过对信号进行相应处理,从而实现温度控制的目的。
文中还着重介绍了软件设计部分,在这里采用模块化结构,主要模块有:数码管显示程序、键盘扫描及按键处理程序、温度信号处理程序、继电器控制程序、超温报警程序。
空调机的温度控制对于工业和日常生活等工程都具有广阔的应用前景。
本文将传统控制理论与智能控制理论相结合应用于温度控制的实际工程中。
首先,设计出系统的硬件构成,然后,从热力学的角度对温度对象的特性做了较深入的分析,从理论上推导出温度对象的常用的一阶带纯滞后的近似数学模型,并给出了数学模型中各参数的含义。
在此基拙上,本文分析了现有空调机控制方法的利弊,并针对它们各自的优、缺点,对具有纯滞后特性的温度对象提出一种改进的模糊控制方法。
该方法将模糊控制、PID控制结合起来。
通过数字仿真表明该方法对空调机温度的控制具有超调小(可达到无超调)、调节时间短、鲁棒性好等优点。
在此基拙上,用阶跃信号做激励,辨识出系统的数学模型。
本文的最后,通过对实物实验结果可以看出,本文所提出的改进的模糊控制算法对非线性、具纯滞后环节对象的控制是很有效的。
温度控制系统的软件采用汇编语言编制,控制算法部分采用C与汇编混合编程。
该软件基于Windows20000/xp平台,人机界面友好,易于用户操作。
具有在线修改采样时间、控制算法、控制参数、图形显示及数据保存和打印功能。
设计的空调机温度控制的精确性,使用方便,功能齐全。
空调机的温度控制系统关键词:PWM控制模型辨识模糊控制 PID控制AbstractThe thesis studies the Plant of temperature. Firstly,the systeml5 designed and realized. Then the characteristics of temperature of Plant are analyzed inall details from thermodynamics. The approximate mathematics model of temperature plant with one order and dead time is reduced and the meaning of every parameter of this model are expressed, Which is used often and practically in the paper. In addition tot his, we identify the model of the system and the result demonstrated the method is effective for it.Secondly we analyzed advantages and disadvantages of present control method of temperature. One kind of improved Fuzz-Dahlin control method is presented for Temperature Plant with long dead time and non-linearity. The Dahlin control method, The fuzzy control method are combined in this improved method It is demon strated By digital simulation that the improved Fuzzy-Dahlin makes the extra-regulation more small(even zero), the regulation time more short, and the robustness better for the temperature controlled Plant. It is demonstrated by physical experimentation that improved Fuzzy-Dahlin method presented in this Paper is effective for temperature plant with dead time and non-linearity.The control software is compiled with visualc++ and matlab .It's easy to use and friendly to the interface of person and machine on the basis of window2000/xpplatform.There are some functions as modify sample time or modify controller's parameters online, display and copy data of temperature curve, and so on. The control hardware is easy to use and its functions are self contained.Keywords:Intelligent control, model identify, Dahlin control, Fuzzy control, PID control目录摘要 (I)Abstract................................................................................................... - 3 - 目录........................................................................................................... - 4 - 前言........................................................................................................... - 5 - 1MCS-51单片机简介.............................................................................. - 8 -1.1芯片的引脚描述.......................................................................... - 8 -1.2 MSC-51单片机中央处理器..................................................... - 15 -2 温度控制系统的实现......................................................................... - 17 -2.1总体设计.................................................................................... - 17 -2.2信号采样电路设计.................................................................... - 18 -2.2.1温度采样电路设计.......................................................... - 18 -2.2.2单片机最小系统的设计.................................................. - 20 -2.3 A/D转换电路设计.................................................................... - 22 -2.3.1 A/D转换的常用方法...................................................... - 22 -2.3.2 A/D转换器的主要技术指标........................................... - 23 -2.3.3 ADC0809的主要特性和内部结构.................................. - 23 -2.3.4 ADC0809管脚功能及定义.............................................. - 24 -2.3.5 ADC0809与8031的接口电路........................................ - 26 -2.4软件系统的初始化程序............................................................ - 26 -2.5软件程序的主循环框架............................................................ - 27 -2.6校准程序.................................................................................... - 29 -3 控制算法的研究................................................................................. - 31 -3.1 PID算法的研究......................................................................... - 31 -3.2模糊控制系统设计.................................................................... - 31 -3.2.1模糊控制算法.................................................................. - 32 -3.2.2模糊控制的基本概念...................................................... - 33 -3.2.3模糊控制过程.................................................................. - 34 - 总结......................................................................................................... - 39 - 致谢......................................................................................................... - 52 - 参考文献................................................................................................. - 53 -空调机的温度控制系统前言控制菌种生长环境的设施和设备由功能简单、单一的气候箱发展成现在控制复的人工气候室,这对于研究在人工模拟自然生态环境中生长因素对菌种生长的提供了必要的条件和能够继续深入研究的基础。
基于单片机的温度控制系统设计毕业论文目录摘要 (I)Abstract (I)目录 (II)第一章绪论 (1)1.1课题研究背景及意义 (1)1.2国外研究现状 (1)1.2.1国外研究现状 (1)1.2.2国研究现状 (1)1.2.3总的发展阶段 (2)1.3课题研究的容 (2)第二章硬件系统总体方案设计 (3)2.1硬件系统总体设计方案一 (3)2.2硬件系统总体设计方案二 (4)2.3硬件系统的方案选择 (4)第三章控制系统硬件设计 (6)3.1单片机 (6)3.2 数字温度计DS18B20 (9)3.2.1 DS18S20数字温度计的主要特性 (9)3.3 4X4键盘 (9)3.4数码管 (10)3.5光电耦合器 (12)3.6 双向晶闸管 (13)3.7 PTC加热器 (14)3.8 反相器7406 (15)3.9双四输入与门74LS21 (16)3.9蜂鸣器 (16)第四章控制系统软件设计 (17)4.1 主程序模块设计 (17)4.1.1主程序流程图 (17)4.2温度采集模块程序设计 (18)4.2.1 DS18B20的时序 (18)4.2.3 读温度子程序流程图 (20)4.3温度设定模块程序设计 (21)4.3.1中断服务子程序 (21)4.3.2 键盘扫描子程序 (21)4.4温度显示模块设计 (23)4.4.1设定值显示子程序 (23)4.4.2 实际值显示子程序 (24)4.5温度控制模块设计 (25)4.5.1双位控制算法设计 (25)4.5.2温度控制子程序流程图 (25)4.6报警模块程序设计 (26)第五章结果分析 (27)5.1 PROTEUS仿真 (27)5.1.1 键盘设定温度仿真 (27)5.1.2 温度采集仿真 (28)5.1.3 整体仿真 (28)5.2实际运行结果 (29)第六章总结与展望 (31)6.1总结 (31)6.2展望 (31)致谢 (32)附录程序 (33)参考文献 (42)第一章绪论1.1课题研究背景及意义温度是表征物体冷热程度的物理量,是工农业生产过程中一个很重要而普遍的参数。
毕业设计论文-基于单片机的温度控制系统设计基于单片机的温度控制系统设计高云2007080104专业名称通信工程申请学士学位所属学科工科指导教师姓名、职称刘磊讲师2011年 05月 30日摘要摘要温度是工业生产和科学实验中至关重要的一个因素, 在医药,冶金,航空和化工中都起着相当大的作用,温度的高低可以影响着许多产品的质量和使用的寿命!因此, 研究高性能的温度控制系统是现今的主要任务, 本文基于单片机的温度控制系统的开发与应用做出了相应的探讨,并且介绍了一种基于AT89C51单片机的温度检测及控制系统的设计与实现。
本设计主要从硬件和部分软件介绍了AT89C51单片机温度控制系统的设计思路,简单说明如何实现对温度的控制,并对硬件原理图和程序框图作了简洁的描述。
还介绍了在单片机控制系统的软硬件设计中的一些主要技术关键环节,该系统主要以AT89C51单片机为核心,由温度检测电路,模、数转换电路,过零检测电路, 报警指示电路,光电隔离与功率放大电路等组成。
关键词:单片机;温度传感器;温度检测;温度控制IAbstractABSTRACTTemperature in industrial production and scientific experiment as a factor crucial in the pharmaceutical and chemical metallurgy aviation plays a relevant role in temperature can affect the level of product quality and use of many of the life! Therefore, the study high-performance temperature control system is the main task of the present paper, based on a Temperature Control System to make the appropriate development and application of, and introduces the AT89C51microcontroller based temperature measurement and control system design and implementation.The design of the main parts from the hardware and softwareintroduces the AT89C51Temperature Control system design, a brief description of how to achieve temperature control, and hardware schematics and made a concise description of the block diagram. Also introduced in the SCM software and hardware design of some keytechnology areas, the system mainly in AT89C51 as the core, the temperature detection circuit, analog, digital conversion circuit, the zero detection circuit, the alarm indicating circuit, optical isolation and power amplifier circuit etc.Keywords: microcontroller; temperature sensor; temperature detection; temperature controlII目录目录1. 引言 ..................................................................... ........................................................................ . (2)1.1 绪论 ..................................................................... (2)1.2 课题展望 ..................................................................... . (2)1.3课题举例简介...................................................................... ................................................... 3 2 设计思想及系统结构 ..................................................................... .. (5)2.1 系统的设计思想 ..................................................................... . (5)2.2 具体设计 ..................................................................... . (5)2.3元器件介绍...................................................................... . (6)2.3.1温度传感器DS18B20 ................................................................ (6)2.3.2AT89C51 ................................................................ (7)2.3.3ADC0809 ................................................................ .. (9)2.3.4DAC0832 ................................................................ (10)2.4 光电隔离电路...................................................................... (11)2.5 PID控制算法 ..................................................................... .................................................. 11 3 各元器件设计...................................................................... .. (13)3.1键盘单元 ..................................................................... (13)3.2 温度控制及超温和超温警报单元 ..................................................................... .. (14)3.3温度控制器件电路...................................................................... .. (14)3.4 显示单元 ..................................................................... .. (15)3.5接口通信单元...................................................................... ................................................. 15 4 电源输入 ..................................................................... ................................................................. 18 5 程序设计...................................................................... (19)5.1 程序结构分析...................................................................... (19)5.2 主程序 ..................................................................... ............................................................ 19 结束语 ............................................................................................................................................. ... 21 参考文献 ..................................................................... .......................................................................22 致谢 ..................................................................... ........................................................................ (23)III泰山学院本科毕业论文1 引言1.1 绪论温度在工业自动化、家用电器、环境保护、安全生产和汽车工业中, 都是最基本的检测参数之一。
摘要近年来随着计算机在社会领域的渗透, 单片机的应用正在不断地走向深入,同时带动传统控制检测日新月益更新。
在实时检测和自动控制的单片机应用系统中,单片机往往是作为一个核心部件来使用,仅单片机方面知识是不够的,还应根据具体硬件结构,以及具体应用对象特点的软件结合,以作完善。
本文从硬件和软件两方面来讲述水温自动控制过程,在控制过程中主要应用AT89C51、ADC0809、LED显示器、LM324比较器,而主要是通过DS18B20数字温度传感器采集环境温度,以单片机为核心控制部件,并通过四位数码管显示实时温度的一种数字温度计。
软件方面采用汇编语言来进行程序设计,使指令的执行速度快,节省存储空间。
为了便于扩展和更改,软件的设计采用模块化结构,使程序设计的逻辑关系更加简洁明了,使硬件在软件的控制下协调运作。
而系统的过程则是:首先,通过设置按键,设定恒温运行时的温度值,,在运行过程中将采样的温度模拟量送入A/D转换器中进行模拟-数字转换,再将转换后的数字量用数码管进行显示,最后用单片机来控制加热器,进行加热或停止加热,直到能在规定的温度下恒温加热。
关键词:单片机系统;传感器;数据采集;模数转换器;温度AbstractIn recent years, with the computer penetration in the social field, the application of SCM is to keep at the same time, traditional control testing update on Crescent benefits. In real-time detection and automatic control system of single-chip applications, often as a single-chip core component to use only single-chip is not enough knowledge, but also the specific hardware structure and the specific features of application software objects combine to make perfect.In this paper, both hardware and software for automatic control of water temperature on the process, in the control of the main application of the process of AT89C51, ADC0809, LED display, LM324 comparator, but mainly through the digital temperature sensor DS18B20 collecting ambient temperature to single-chip microcomputer as the core control components, and through four real-time digital display of a digital thermometer temperature. Software using assembly language for programming, so that the implementation of Directive speed, to save storage space. In order to facilitate the expansion and changes to the design of modular software structure, so that the logic of the relationship between program design more concise,Hardware software co-operation under the control of it.And systematic process is: First of all, by setting the button, set the thermostat temperature at the time of operation, and digital display of the temperature. Then, in the running temperature of the process of sampling analog into the A / D converter in the simulation - digital converter, and then converted digital control with digital display, the last single-chip microcomputer to control the heater used for heating or stop heating until the temperature in the provisions under the constant temperature heating.Key words:Single-chip microcomputer system ;Sensor;Data Acquisition;ADC;Temperature目录第1章绪论 (1) (1) (1) (3)第2章设计理论基础 (6) (6)AT89C51系列单片机介绍 (7)AT89C51系列基本组成及特性 (7)AT89C51系列引脚功能 (8)AT89C51系列单片机的功能单元 (11)ADC0809模数转换器 (14) (16) (18) (19) (20)第3章硬件电路设计 (21) (21) (21) (23) (23) (24) (24) (25)第4章软件设计 (26) (26) (27) (28) (29)第5章系统调试及结论分析 (30) (30) (30) (31) (31) (31) (32) (33)第6章总结与展望 (34) (34) (35)参考文献 (36)致谢 (37)附录 (40)1.系统总程序清单 (40)2.系统的原理图 (49)3.外文资料原文 (50)4.外文资料译文 (53)第1章绪论二十一世纪是科技高速发展的信息时代,电子技术、微型单片机技术的应用更是空前广泛,伴随着科学技术和生产的不断发展,需要对各种参数进行温度测量。
前言温度是表征物体冷热程度的物理量。
在很多生产过程中,特别是在冶金、化工、建材、食品、机械、石油等工业中,温度的测量和控制都直接和安全生产、提高生产效率、保证产品质量、节约能源等重大技术经济指标相联系。
因此,温度的测量与控制在国民经济各个领域中均受到了相当程度的重视。
单片机系统的开发应用给现代工业测控领域带来了一次新的技术革命,自动化、智能化均离不开单片机的应用。
将单片机控制方法运用到温度控制系统中,可以克服温度控制系统中存在的严重滞后现象,同时在提高采样频率的基础上可以很大程度的提高控制效果和控制精度。
现代自动控制越来越朝着智能化发展,在很多自动控制系统中都用到了工控机,小型机、甚至是巨型机处理机等,当然这些处理机有一个很大的特点,那就是很高的运行速度,很大的内存,大量的数据存储器。
但随之而来的是巨额的成本。
在很多的小型系统中,处理机的成本占了系统成本的比例高达20%,而对于这些小型的系统来说,配置一个如此高速的处理机没有任何必要,因为这些小系统追求经济效益,而不是最在乎系统的快速性,所以用成本低廉的单片机控制小型的,而又不是很复杂,不需要大量复杂运算的系统中是非常适合的。
随着电子技术以及应用需求的发展,单片机技术得到了迅速的发展,在高集成度,高速度,低功耗以及高性能方面取得了很大的进展。
现在完全可以运用单片机和电子温度传感器对某处进行温度检测,而且可以很容易地做到多点的温度检测,如果对此原理图稍加改进,还可以进行不同地点的实时温度检测和控制。
1绪论1.1研究的目的和意义温度是工业生产中主要被控参数之一,温度控制自然是生产的重要控制过程。
工业生产中温度很难控制,对于要求严格的的场合,温度过高或过低将严重影响工业生产的产质量及生产效率,降低生产效益。
这就需要设计一个良好温度控制器,随时向用户显示温度,而且能够较好控制。
单片机具有和普通计算机类似的强大数据处理能力,结合PID,程序控制可大大提高控制效力,提高生产效益[9]。
基于单片机的智能中央空调控制系统毕业设计目录摘要..................................................... 错误!未定义书签。
Abstract .................................................. 错误!未定义书签。
前言. (1)1绪论 (2)1.1空调的概述 (2)1.2空调的发展历史 (2)1.3空调的发展趋势 (4)1.4系统总体方案及硬件设计 (4)1.4.1中央空调制冷循环工作原理 (4)1.4.2中央空调系统的设计 (6)2系统硬件的选择及其功能特性 (12)2.1 AT89C51单片机的结构及其功能 (12)2.1.1 AT89C51单片机的结构 (12)2.1.2AT89C51单片机的引脚及其功能 (13)2.1.3时钟震荡器 (16)2.1.4闲散节电模式 (16)2.1.5掉电模式 (18)2.1.6程序存储器的加密 (18)2.2 DS18B20温度传感器 (18)2.2.1常用的测温方法 (19)2.2.2温度传感器的选择 (20)2.2.3DS18B20概述 (22)2.2.4 DS18B20测温操作 (23)2.2.5报警操作信号 (24)2.3 LED数码管 (24)2.4 总体方案的确定 (26)3硬件电路的设计 (27)3.1时钟电路 (27)3.2显示电路的设计 (28)3.3按键电路设计 (29)3.4温度传感器电路 (29)3.5复位电路的设计 (30)3.6系统总电路 (31)4软件系统设计 (33)4.1概述 (33)4.2主程序流程图 (33)4.3程序源代码 (33)总结 (43)致谢 (44)参考文献 (45)基于单片机的智能中央空调控制系统设计前言随着集成电路技术的发展,单片微型计算机的功能也不断增强,许多高性能的新型机种不断涌现出来。
单片机以其功能强、体积小、可靠性高、造价低和开发周期短等优点,成为自动化和各个测控领域中广泛应用的器件,在工业生产中成为必不可少的器件,尤其是在日常生活中发挥的作用也越来越大。
成都理工大学工程技术学院毕业论文基于单片机的空调温度控制系统设计作者姓名:杨耀武专业名称:信息工程指导教师:黄宇讲师基于单片机的空调温度控制系统设计摘要在自动控制领域中,温度检测与控制占有很重要地位。
温度测控系统在工农业生产、科学研究和在人们的生活领域,也得到了广泛应用。
因此,温度传感器的应用数量居各种传感器之首。
目前,温度传感器正从模拟式向数字集成式方向飞速发展。
本论文概述了温控器的发展及基本原理,介绍了温度传感器的原理及特性。
分析了DS18B20温度传感器的优劣。
在此基础上描述了系统研制的理论基础,温度采集等部分的电路设计,并对测温系统的一些主要参数进行了讨论。
同时在介绍温度控制系统功能的基础上,提出了系统的总体构成。
针对测温系统温度采集、接收、处理、显示部分的总体设计方案进行了论证,进一步介绍了单片机在系统中的应用,分析了系统各部分的硬件及软件实现。
利用Proteus7.6进行了可行性的仿真,利用单片机开发板验证在实际电路中能起到的效果。
试验证明,这套温度控制器具有较强的可操作性,很好的可拓展性,控制简单方便。
课题初步计划是在普通环境下的测温,系统的设计及器件的选择也正是在这个基础上进行的。
关键词:DS18B20 单片机温度控制1602液晶显示AbstractIn the automatic control area,temperature monitoring and controling have a very important position. The temperature monitoring system has a wildly applying in industry, agriculture, science reasearching and daily life of people. Therefore, the number of applying of the temperature monitoring comes first of all kinds of sensor. At present, the temperature monitoring is transformed from analog type to digital integrated type with a very fast speed.This paper introduces the developing and fundamental of the temperature monitoring, including the character of this kind of sensor. It also analyses the advantage and disadvantage of the temperature monitoring which named DS18B20. On that basis, the paper also has a further analysis of the theoretical basis of the system developing and the circuit design of temperature monitoring. Besides, some discussions about the important parameters also took on desk. At the same time, the auther of this paper also puts forward the composition of totality about this system, which including the different function of the thermometer system. Then a detailed analysis which is about the applying of Microcontrollers and the applying of different parts made by different hardwares and softwares in the system. In order to check the maneuverability and the expansibility of the Microcontrollers system, the auther used Proteus 7.6 to do the testing and got a pretty good result.This system puts the temperature measured in normal situation as a confirm condition. All design and selection of component is also based on this suppose.keywords: DS18B20, Microcontrollers, Temeperature Controling, 1602 Liquid Crystal Display目录摘要 (I)Abstract (II)目录 (III)前言 (1)1 系统总体设计方案及功能 (2)1.1 温度传感器产品分类与选择 (2)1.1.1 常用的测温方法 (2)1.1.2 温度传感器产品分类 (2)1.1.3 温度传感器的选择 (4)1.2 总体方案的确定 (6)1.3 系统实现框图 (6)2 系统单元电路设计 (7)2.1 系统工作原理 (7)2.2 系统相关硬件及模块介绍 (7)2.2.1 温度采集电路 (7)2.2.2 信号处理与控制电路 (8)2.2.3 温度显示电路 (9)2.2.4 按键功能设置电路 (10)2.2.5 继电器控制电路 (11)2.2.6 存储数据电路 (11)2.2.7 报警、音乐电路 (12)2.2.8 电动机电路 (12)3 仿真软件介绍 (14)3.1 Keil uVision2软件 (14)3.2Proteus软件 (15)4 系统硬件设计 (17)5 系统软件设计 (19)5.1 DS18B20数据通信概述 (19)5.2 LCD1602液晶数据显示概述 (21)5.2.1 接口信号说明 (21)5.2.2 控制器接口说明 (21)5.2.3 控制接口时序说明 (23)5.3 存储器24C02数据存储概述 (24)5.3.1 I2C 总线的定义 (24)5.3.2 I2C 总线的时序 (24)5.3.3 数据传送 (25)5.4 软件程序设计 (25)6 仿真及实验结果 (28)6.1 程序调试过程中遇到的问题及解决办法 (28)6.2 调试结果 (28)总结 (30)致谢 (31)参考文献 (32)附件1系统硬件电路图 (33)附件2 系统软件程序 (34)前言现代信息技术的三大基础是信息采集控制(即温度控制器技术)、信息传输(通信技术)和信息处理(计算机技术)。
基于单片机的空调温度控制器设计The design of air conditioning temperature controller based on MCU学院:信息科学与工程专业班级:测控技术与仪器1003班学号:100401316学生姓名:刘和平指导教师:颜华(教授)2014 年 6 月摘要随着经济的发展和人们生活水平的提高,空调机受到了广泛的应用。
空调机的温度控制器主要是由温度传感器感受室内温度变化,将采集到的温度信号处理后与设定的温度值进行比较,控制继电器的通断,使温度被控制在设定值左右,使空调器的工作状态随着人们要求和环境状态而自动变化,迅速准确的达到人们的要求,并使空调器的工作状态保持在最合理的状态下。
在工农业生产、科学研究和在人们的生活领域中,温度测控系统占有很重要的地位,得到了广泛的应用。
因此,温度传感器的应用数量居各种传感器之首。
目前,温度传感器正从模拟式向数字集成式方向飞速发展。
本文主要从硬件和软件两方面介绍了单片机温度控制系统的设计。
该系统以STC12C5608AD单片机为核心,主要由温度检测电路、按键与显示电路、继电器控制电路等构成。
在本系统中,主要是同过DS18B20采集被测温度并转换成数字信号送单片机,以单片机为核心数据处理系统,通过两位数码管,显示设定温度,通过继电器来控制压缩机、四通阀从而控制空调制冷或制热。
本论文概述了温控器的发展及基本原理,介绍了温度传感器的原理及特性,分析了DS18B20温度传感器的优劣。
在此基础上描述了系统研制的理论基础,对测温系统的一些主要参数进行了讨论。
同时在介绍温度控制系统功能的基础上,提出了系统的总体构成。
针对测温系统温度采集、接收、处理、显示部分的总体设计方案进行了论证,进一步介绍了单片机在系统中的应用,分析了系统各部分的硬件及软件实现。
关键词:DS18B20;单片机;温度控制;空调AbstractWith the development of economy and the improvement of people's living standard, the air conditioner has been widely applied. Temperature controller of air conditioner is mainly composed of sensors to monitor indoor temperature, the temperature signal processing the collected with the set temperature value, to control the on-off relay, the temperature is controlled in the set value, the air conditioner working condition with people demand and the state of the environment changes rapidly and automatically, accurate to the requirements of the people, and make the air conditioner working state is maintained in a reasonable state. In the industrial and agricultural production, scientific research and in people's lives, temperature measurement and control system plays a very important role, has been widely applied. Therefore, the number of temperature sensor applications of various sensors of the first home. At present, the temperature sensor from analog to digital integrated development.This paper mainly describes the hardware and software aspects of the design of single-chip temperature control system. The system STC12C5608AD microcontroller core, mainly by the temperature detection circuit, buttons and display circuit, relay control circuit, etc.. In this system, mainly through the DS18B20 collection with the measured temperature and converted into a digital signal sent to the microcontroller, microcontroller as the core data processing system, through two digital tube display set temperature, the compressor is controlled by relays, Stone valve to control the air conditioning, refrigeration or heating. This paper outlines the development and the basic principles of the thermostat, introduced the principle and characteristics of the temperature sensor. Analysis of the merits of the DS18B20 temperature sensor. Based on this description of the theoretical basis for the development of the system, some of the key parameters of the measurement system were discussed. While the introduction of a temperature control system functions is proposed based on the overall structure of the system. Temperature measurement system for collecting,IIreceiving, processing, display part of the overall design has been demonstrated, further describes the SCM applications in the system, and analyzes the various parts of the system hardware and software.IIIKeywords: DS18B20; single chip microcomputer; temperature control; airconditioningIII目录摘要 (I)Abstract (II)第1章绪论 (1)1.1 课题研究目的 (1)1.2 课题研究意义 (1)第2章系统总体方案设计 (3)2.1 温度传感器产品分类与选择 (3)2.1.1 常用的测温方法 (3)2.1.2 温度传感器产品分类 (3)2.1.3 温度传感器的选择 (5)2.2 总体方案的确定 (6)2.3 系统实现框图 (7)第3章系统单元电路设计 (8)3.1 系统相关硬件及模块介绍 (8)3.1.1 温度采集电路 (8)3.1.2 STC12C5608AD介绍 (9)3.1.3 时钟电路 (11)3.1.4 复位电路 (11)3.1.5 温度显示电路 (12)3.1.6 按键功能设置电路 (13)3.1.7 继电器驱动电路 (14)3.1.8 继电器控制电路 (14)3.1.9 压缩机、四通阀 (15)3.1.10 电动机电路 (15)第4章系统软件设计 (17)4.1 DS18B20数据通信概述 (17)4.2 控制接口时序说明 (19)4.3 软件程序设计 (20)4.3.1 主程序模块流程图 (21)4.3.2 DS18B20测温程序及流程图 (22)4.3.3 按键扫描程序及流程图 (25)4.4程序调试 (26)4.4.1 Keil uVision2软件 (26)4.4.2程序调试过程中遇到的问题及解决办法 (27)第5章结论 (28)参考文献 (29)致谢 (31)附录1 系统硬件电路图 (32)附录2 系统软件程序 (33)第1章绪论1.1 课题研究目的利用单片机设计一个具有制冷和制热两种工作模式的空调温度控制器。
优秀论文审核通过未经允许切勿外传基于单片机的水温控制系统设计摘要温度控制系统可以说是无所不在,热水器系统、空调系统、冰箱、电饭煲、电风扇等家电产品以至手持式高速高效的计算机和电子设备,均需要提供温度控制功能。
本系统的设计可以用于热水器温度控制系统和饮水机等各种电器电路中。
它以单片机AT80C51为核心,通过3个数码管显示温度和4个按键实现人机对话,使用单总线温度转换芯片DS18B20实时采集温度并通过数码管显示,并提供各种运行指示灯用来指示系统现在所处状态,如:温度设置、加热、停止加热等,整个系统通过四个按键来设置加热温度和控制运行模式。
关键词:单片机、数码管显示、单总线、DS18B20.Based Temperature Control SystemAbstractTemperature control system can be said to be ubiquitous, water can be used for drinking water -machine dialogue, the use of single-chip bus temperature conversion temperature DS18B20 real-time acquisition and through the digital display and offers a variety of operating light to indicate system now live in the state, such as: temperature setting, ,共同点。
输出控制接点的共同接点。
●NC:Normal Close常闭点。
以Com为共同点,NC与COM在平时是呈导通状态的。
●NO:Normal Open常开点。
NO与COM在平时是呈开路状态的,当继电器动作时,NO与COM导通,NC与COM则呈开路状态。
目录第一章绪论11.1 课题研究背景11.1.1 空调的工作原理11.1.2 空调的功能21.2 控制技术介绍21.3 总体方案设计3第二章空调温度控制系统硬件设计52.1 单片机的选择52.1.1 AT89S52单片机简介52.1.2 AT89S52单片机引脚介绍52.1.3 AT89S52单片机的外围电路62.2 温度传感器的选择72.3 键盘的设计82.3.1 行列式键盘和独立键盘的接口设计82.3.2 矩阵键盘和独立键盘的工作原理92.4 液晶显示的设计92.4.1液晶1602的接口电路92.4.2 液晶1602工作原理92.4.3 液晶1602的其他参数102.5 DA转换电路设计112.5.1 DA转换器的选择112.5.2 DAC0832简介122.5.3 DAC0832结构12第三章空调温度控制设计133.1 PID调节器控制原理133.2 位置式PID算法143.3 数字PID参数的整定143.3.1 采样周期选择的原则153.3.2 PID参数对系统性能的影响153.3.3 PID计算程序17第四章空调温度控制系统软件设计204.1 系统部件的软件设计方案204.2 系统软件设计框图204.3 主程序和子程序流程图设计214.3.1 主程序流程图214.3.2 液晶1602流程图224.3.3 温度转换子程序流程图224.3.4 键盘处理子程序流程图23结束语24 参考文献26第一章绪论1.1 课题研究背景温度是一个和人们生活环境有着密切关系的物理量,也是一种在生产、科研、生活中需要测量和控制的重要物理量,是国际单位制七个基本量之一。
温度的变化会给我们的生活、工作、生产等带来重大影响,因此对温度的测量至关重要。
其测量控制一般使用各式各样形态的温度传感器。
随着现代计算机和自动化技术的发展,作为各种信息的感知、采集、转换、传输相处理的功能器件,温度传感器的作用日显突出,已成为自动检测、自动控制系统和计量测试中不可缺少的重要技术工具,其应用已遍与工农业生产和日常生活的各个领域。
空调机的温度控制系统设计摘要本设计以AT89S51单片机为核心的温度控制系统的工作原理和设计方法。
温度信号由温度芯片DS18B20采集,并以数字信号的方式传送给单片机。
文中介绍了该控制系统的硬件部分,包括:温度检测电路、温度控制电路、PC机与单片机串口通讯电路和一些接口电路。
单片机通过对信号进行相应处理,从而实现温度控制的目的。
文中还着重介绍了软件设计部分,在这里采用模块化结构,主要模块有:数码管显示程序、键盘扫描及按键处理程序、温度信号处理程序、继电器控制程序、超温报警程序。
空调机的温度控制对于工业和日常生活等工程都具有广阔的应用前景。
本文将传统控制理论与智能控制理论相结合应用于温度控制的实际工程中。
首先,设计出系统的硬件构成,然后,从热力学的角度对温度对象的特性做了较深入的分析,从理论上推导出温度对象的常用的一阶带纯滞后的近似数学模型,并给出了数学模型中各参数的含义。
在此基拙上,本文分析了现有空调机控制方法的利弊,并针对它们各自的优、缺点,对具有纯滞后特性的温度对象提出一种改进的模糊控制方法。
该方法将模糊控制、PID控制结合起来。
通过数字仿真表明该方法对空调机温度的控制具有超调小(可达到无超调)、调节时间短、鲁棒性好等优点。
在此基拙上,用阶跃信号做激励,辨识出系统的数学模型。
本文的最后,通过对实物实验结果可以看出,本文所提出的改进的模糊控制算法对非线性、具纯滞后环节对象的控制是很有效的。
温度控制系统的软件采用汇编语言编制,控制算法部分采用C与汇编混合编程。
该软件基于Windows20000xp平台,人机界面友好,易于用户操作。
具有在线修改采样时间、控制算法、控制参数、图形显示及数据保存和打印功能。
设计的空调机温度控制的精确性,使用方便,功能齐全。
关键词:PWM控制模型辨识模糊控制 PID控制AbstractThe thesis studies the Plant of temperature. Firstly,the systeml5 designed and realized. Then the characteristics of temperature of Plant are analyzed inall details from thermodynamics. The approximate mathematics model of temperature plant with one order and dead time is reduced and the meaning of every parameter of this model are expressed, Which is used often and practically in the paper. In addition tot control method is presented for Temperature Plant with long dead time and non-linearity. The Dahlin control method, The fuzzy control method are combined in this improved method It is demon strated By digital simulation that the improved Fuzzy-Dahlin makes the extra-regulation more small(even zero), the regulation time more short, and the robustness better for the temperature controlled Plant. It is demonstrated by physical experimentation that improved Fuzzy-Dahlin method presented in this Paper is effective for temperature plant with dead time and non-linearity.The control software is compiled with visualc++ and matlab .It's easy to use and friendly to the interface of person and machine onthe basis of window2000xpplatform.There are somefunctions as modify sample time or modify controller'sparameters online, display and copy data of temperaturecurve, and so on. The control control, Fuzzy control, PIDcontrol目录摘要 (I)Abstract.................................................................................................... - 3 - 目录............................................................................................................ - 5 - 前言............................................................................................................ - 6 - 1MCS-51单片机简介 ............................................................................ - 10 -1.1芯片的引脚描述......................................................................... - 10 -1.2 MSC-51单片机中央处理器 ..................................................... - 18 -2 温度控制系统的实现 ......................................................................... - 21 -2.1总体设计..................................................................................... - 21 -2.2信号采样电路设计..................................................................... - 22 -2.2.1温度采样电路设计.......................................................... - 22 -2.2.2单片机最小系统的设计 ................................................. - 25 -2.3 AD转换电路设计 ...................................................................... - 27 -2.3.1 AD转换的常用方法 ....................................................... - 27 -2.3.2 AD转换器的主要技术指标 ............................................ - 28 -2.3.3 ADC0809的主要特性和内部结构 ................................. - 28 -2.3.4 ADC0809管脚功能及定义 ............................................. - 30 -2.3.5 ADC0809与8031的接口电路 ....................................... - 32 -2.4软件系统的初始化程序 ............................................................ - 32 -2.5软件程序的主循环框架 ............................................................ - 33 -2.6校准程序..................................................................................... - 36 -3 控制算法的研究.................................................................................. - 38 -3.1 PID算法的研究......................................................................... - 38 -3.2模糊控制系统设计..................................................................... - 39 -3.2.1模糊控制算法.................................................................. - 39 -3.2.2模糊控制的基本概念 ..................................................... - 41 -3.2.3模糊控制过程.................................................................. - 42 - 总结.......................................................................................................... - 50 - 致谢.......................................................................................................... - 63 - 参考文献.................................................................................................. - 64 -前言控制菌种生长环境的设施和设备由功能简单、单一的气候箱发展成现在控制复的人工气候室,这对于研究在人工模拟自然生态环境中生长因素对菌种生长的提供了必要的条件和能够继续深入研究的基础。