摘 要 单片机系统的开发应用给现代工业测控领域带来了一次新的技术革命,自动化、智能化均离不开单片机的应用。单片机由于其微小的体积和极低的成本,广泛的应用于家用电器、工业控制等领域中。在工业生产中,电流、电压、温度、压力和流量也都是常用的被控参数。 本论文介绍了“基于单片机的温度控制系统”的设计及其相关内容。系统属于典型的基于单片机的大惯性环节的PID闭环控制装置,通用性很强,在工业过程控制中有着广泛的应用。控制系统中引入单片机,可以充分利用单片机在对采集数据加以分析并根据所得结果做出逻辑判断等方面的能力,编制出符合某种技术要求的控制程序、管理程序,实现对被控参数的控制与管理。 本论文介绍了基于单片机的温度控制系统的硬件设计和软件开发的过程。共分五章:第一章介绍了背景和总体的设计思路;第二章介绍了AT89C51单片机的基本知识;第三章对系统设计中所涉及的一些主要的芯片做了简单的介绍;第四章介绍了系统硬件电路的设计;第五章介绍了系统的软件设计过程。 关键词: 单片机;温度控制;PID Abstract The development and application of MCU (Micro Control Unit) have made a great change in many fields of modern industrial detect and control. Because of the small scale, low price and high efficiency of MCU, it is widely used in home appliances and industrial control. in the process of producing. Current, voltage, temperature and pressure are usually the parameter to be monitored. The design of “The temperature control system based on MCU of is introduced in this paper. As a typical design in large inertia control system, the design needs the knowledge of automation theories, analog and digital electronics. A digital PID controller is used in the system, which is called DDC(direct digital control)system. The DDC system can not only replace the analog system, but also can realize the more complicated rules of control through changing the program of software, not even changing a component in the electro circuit. It can improve reliability of whole system. This paper mainly includes the introduces of AT89C51 and the general chips which are used in the system, the design of hardware and software. There are seven parts in this paper: Chapter 1 describes the background knowledge of the system and the general design of the system. Part 2 and Part3 introduces the basic knowledge of AT89C51 and the chips which are used in the system. Chapter 4 introduces the design of hardware of the system and Chapter 5 introduces the software design. There is a general conclusion in the end of the paper. Key words: MCU; Temperature Control;PID 目 录 第1章 绪论 1 1.1概述 1 1.2课题的总体设计及思路 3 1.2.1根据系统要求画出方框图 3 1.2.2各环节的功能 3 1.2.3各环节的实现 4 第2章 单片机AT89C51的结构和原理 5 2.1 AT89C51单片机的结构 5 2.2引脚功能说明 6 2.3 AT89C51存储器配置 9 2.3.1程序存储器 10 2.3.2数据存储器 11 2.4复位及其复位电路 11 2.4.1复位操作 11 2.4.2复位电路 11 2.5 小结 13 第3章 温度控制系统的器件介绍 15 3.1 CPU监控器X5045 15 3.1.1一般说明 15 3.1.2引脚排列及说明 15 3.1.3工作原理 16 3.2模数转换器ADC0809 18 3.2.1一般说明 18 3.2.2结构及引脚特性 19 3.3 数模转换器DAC0832 20 3.3.1 一般说明 20 3.3.2 引脚特性 20 3.4 键盘/显示器接口芯片8279 21 3.5 晶闸管移相触发器TCA785 24 3.5.1 一般说明 24 3.5.2引脚排列及引脚说明 25 3.5.3工作原理 26 3.6 小结 26 第4章 温度控制系统的硬件设计 27 4.1 温度控制系统的系统结构图 27 4.2 单片机监控电路的设计 28 4.3 前向通道的设计 29 4.4 后向通道的设计 32 4.5 小结 34 第5章 温度控制系统的软件设计 35 5.1 键盘/显示程序的设计 35 5.2 数字PID控制器 37 5.2.1数字PID控制器的基本概念 37 5.2.2 PID算法的程序流程 39 5.3数字PID参数的选择 41 5.3.1采样周期的选择 41 5.3.2数字PID参数的选择 43 5.4 主程序的设计 46 5.5 小结 47 结论 49 参考文献 50 致谢 51 第1章 绪论 1.1 概述 传统的控制系统主要由测量电路和控制电路组成,所具备的功能较少,也比较弱,而且结构很复杂。 计算机技术的迅速发展,使得传统的控制系统发生了根本性的变革,即采用微机作为控制系统的核心,代替传统的控制系统的传统的电子线路,从而成为新一代的微机化控制系统。将微机技术引入控制系统中,不仅可以解决传统控制系统不能解决的问题,而且还能简化电路、增加或增强功能、提高控制精度和可*性,显著增强测控系统的自动化、智能化程度,而且可以缩短系统研制周期、降低成本、易于升级和维护。因此,现代控制系统设计,特别是高精度、高性能的控制系统,目前已很少不采用计算机技术的了。 计算机技术的引入,可以为控制系统带来以下一些新特点和新功能。 |