单片机温度控制: 一个跨学科的本科生工程设计项目外文翻译资料

 2022-08-17 03:08

Temperature Control Using a Microcontroller:

An Interdisciplinary Undergraduate Engineering Design Project

James S. McDonald

Department of Engineering Science

Trinity University

San Antonio, TX 78212

Abstract

This paper describes an interdisciplinary design project which was done under the authorrsquo;s supervision by a group of four senior students in the Department of Engineering Science at Trinity University. The objective of the project was to develop a temperature control system for an air-filled chamber. The system was to allow entry of a desired chamber temperature in a prescribed range and to exhibit overshoot and steady-state temperature error of less than 1 degree Kelvin in the actual chamber temperature step response. The details of the design developed by this group of students, based on a Motorola MC68HC05 family microcontroller, are described. The pedagogical value of the problem is also discussed through a description of some of the key steps in the design process. It is shown that the solution requires broad knowledge drawn from several engineering disciplines including electrical, mechanical, and control systems engineering.

1 Introduction

The design project which is the subject of this paper originated from a real-world application. A prototype of a microscope slide dryer had been developed around an OmegaTM model CN-390 temperature controller, and the objective was to develop a custom temperature control system to replace the Omega system. The motivation was that a custom controller targeted specifically for the application should be able to achieve the same functionality at a much lower cost, as the Omega system is unnecessarily versatile and equipped to handle a wide variety of applications.

The mechanical layout of the slide dryer prototype is shown in Figure 1. The main element of the dryer is a large, insulated, air-filled chamber in which microscope slides, each with a tissue sample encased in paraffin, can be set on caddies. In order that the paraffin maintain the proper consistency, the temperature in the slide chamber must be maintained at a desired (constant) temperature. A second chamber (the electronics enclosure) houses a resistive heater and the temperature controller, and a fan mounted on the end of the dryer blows air across the heater, carrying heat into the slide chamber. This design project was carried out during academic year 1996–97 by four students under the authorrsquo;s supervision as a Senior Design project in the Department of Engineering Science at Trinity University. The purpose of this paper is

to describe the problem and the studentsrsquo; solution in some detail, and to discuss some of the pedagogical opportunities offered by an interdisciplinary design project of this type. The studentsrsquo; own report was presented at the 1997 National Conference on Undergraduate Research [1]. Section 2 gives a more detailed statement of the problem, including performance specifications, and Section 3 describes the studentsrsquo; design. Section 4 makes up the bulk of the paper, and discusses in some detail several aspects of the design process which offer unique pedagogical opportunities. Finally, Section 5 offers some conclusions.

2 Problem Statement

The basic idea of the project is to replace the relevant parts of the functionality of an Omega CN-390 temperature controller using a custom-designed system. The application dictates that temperature settings are usually kept constant for long periods of time, but itrsquo;s nonetheless important that step changes be tracked in a “reasonable” manner. Thus the main requirements boil down to

·allowing a chamber temperature set-point to be entered,

·displaying both set-point and actual temperatures, and

·tracking step changes in set-point temperature with acceptable rise time, steady-state error, and overshoot.

Although not explicitly a part of the specifications in Table 1, it was clear that the customer desired digital displays of set-point and actual temperatures, and that set-point temperature entry should be digital as well (as opposed to, say, through a potentiometer setting).

3 System Design

The requirements for digital temperature displays and setpoint entry alone are enough to dictate that a microcontrollerbased design is likely the most appropriate. Figure 2 shows a block diagram of the studentsrsquo; design.

The microcontroller, a MotorolaMC68HC705B16 (6805 for short), is the heart of the system. It accepts inputs from a simple four-key keypad which allow specification of the set-point temperature, and it displays both set-point and measured chamber temperatures using two-digit seven-segment LED displays controlled by a display driver. All these inputs and outputs are accommodated by parallel ports on the 6805. Chamber temperature is sensed using a pre-calibrated thermistor and input via one of the 6805rsquo;s analog-to-digital inputs. Finally, a pulse-width modulation (PWM) output on the 6805 is used to drive a relay which switches line power to the resistive heater off and on.

Figure 3 shows a more detailed schematic of the electronics and their interfacing to the 6805. The keypad, a Storm 3K041103, has four keys which are interfaced to pins PA0{ PA3 of Port A, configured as inputs. One key functions as a mode switch. Two modes are supported: set mode and run mode. In set mode two of the other keys are used to specify the set-point temperature: one increments it and one decrements. The fourth key is unused at present. The LED displays are driven by a Harris Semiconductor ICM7212 display driver interfaced to pins PB0{PB6 of Port B, configured as outputs. The temperature-sensing thermistor drives, through a voltage divider, pin AN0 (one of eight analog inputs). Finally, pin PLMA (one of two PWM outputs) drive

剩余内容已隐藏,支付完成后下载完整资料


单片机温度控制:

一个跨学科的本科生工程设计项目

JamesS.McDonald

工程科学系三一大学德克萨斯州

圣安东尼奥市78212

摘要

本文所描述的是作者领导由四个三一大学高年级学生组成的团队进行的一个跨学科工程项目的设计。该项目的目标是设计一个气室内温度控制系统。该系统的要求是:当实际气室的温度阶跃响应时,规定范围内的温度进入气室后,稳定时的温度误差和超调量必须少于一个绝对温度。本组学生开发设计是基于摩托罗拉MC68HC05系列单片机。该问题的教学价值也通过某些步骤的关键描述在本文说明。研究结果表明,解决该方案需要具有广泛的工程学科知识,包括相关电子、机械和控制系统工程的知识。

1 引言

该设计项目来自一个实际应用问题,一个关于显微镜载玻片干燥剂温控器——欧米茄CN-390温度控制器,而这个设计的目标是研发一个自定义的通用温度控制系统取代欧米茄系统、一个以更低的成本实现相同功能的自定义控制器,就像欧米茄系统一样,并不需要能够全方位的处理各种问题。

该载玻片干燥机的机械布局如图1所示。干燥机的主体是一个足够大的绝缘充气室,里面依次存放着薄纸包着的石蜡。为了使石蜡保持适当稳定性,载玻片气室的温度必须维持稳定。第二个气筒(电子围绕元件)设有一个电阻加热器、一个温度控制器以及一个安装在干燥机上的风扇,是为了把风吹过加热器,把热量带到载玻片气室。

图1-1 载玻片干燥机的机械布局

自1996-97学年来,本文作者带领四位三一大学工程科学系的高年级学生开展此项目的研究。本文的目的说明了提出一些问题并详细阐述学生的一些解决方案,而且讨论了这种类型的跨学科设计项目在教学方面应用的问题。这份学生报告曾经在1997年全国本科毕业生研讨会上提出过并讨论过。第2节给出该设计的更多详细情况,包括性能规格。第3节具体 学生的设计。第4节是论文的主体,讨论该设计在教学应用方面的实施问题。最后,第5节全文总结。

2 问题阐述

该项目基本的思想是设计一个自定义温度控制系统来取代相关的欧米茄CN-390温度控制器。温度时通常保持在一个稳定的常数,但重要的是阶跃变化可以被“合理”的跟踪。因此主要要求如下:

·可以对空气室的温度进行设定,

·同时显示设定值和实际温度,

·以及在设定温度值情况下,可接受范围内的跟踪阶跃变化,稳态误差,超调量。

设定温度接口

设定温度显示

室内温度显示

范围

精度

准确度

60-99

1°C

plusmn;1°C

室内温度阶梯响应

范围(稳定状态)

精度(稳定状态)

最大超调

设定时间(到plusmn;1°)

60-99

plusmn;1°C

1°C

120s

表1 精确的规格说明

尽管表1部分说明并不明确,但是它清楚的反映了人们对数字显示器在设定值和实际温度的要求和温度应该通过数值输入来设定(而不是,通过电位器设置)。

3.系统设计

根据微控设计,数字温度显示和单点输入的要求可能是最合适的。图2为学生的设计框图。

图2-2 温度控制器硬件结构图

摩托罗拉MC68HC705B16(简称6805),是系统的核心。它通过一个简单的4键小键盘对温度进行设定,同时使用两个显示驱动控制7段LED数码管来显示定值和气室温度的测量值。所有这些,输入和输出信号与6805的并行口相连。气室的温度值使用预校准热敏电阻测量,并通过6805的数模转换输入。最后,6085的脉冲宽度调制(PWM)输出用来驱动一个继电器,以控制线性电阻加热器的闭合和断开。

图3更详细的显示了6805的接口和电子器件。使用暴风3K041103型号四键键盘,通过PA0-PA3端口进行数据输入。其中一个重要的功能是进行模式切换。两种模式:固定模式和运行模式。在固定模式下,其他两个键用于设定温度,一个增加,一个减少,第四个按键暂无作用。LED显示屏由哈里斯半导体ICM7212进行驱动,通过PB0-PB6端口与芯片相连,作为输出。热敏电阻由电压分频器驱动,通过AN0针脚(八个模拟输入端口中的一个)相连。最后,PLMA针脚(两个PWM输出端口中的一个)驱动加热继电器。

图2-3 单片机原理图

图3单片机原理图是关于用软件实现温度控制算法、保持温度显示以及改变键盘输入响应,这将不会在本文详细讨论,因为这并不是本文的重点,也没有编译完成。软件部分还没有确定控制算法,但很可能是一个简单的比例控制,比PID算法简单。一些控制设计的问题将在第四节讨论。

  1. 设计过程

虽然该项目的本质是建立一个恒温器,但它有许多很好的契机可以供教学借鉴。高级工程本科教育的知识只是能够让学生们具有解决问题的能力。然而,很多情况下,实际情况却和理论有些不同。不过,这些不是问题,参与这个项目的设计,将获得很多设计方面的宝贵经验。本节的其余部分着眼于其他的几个方面:4.1节讨论系统的一些特征,简化系统热性能的数学模型,以及一些简单理论的证明。4.2节介绍确定实际控制算法。4.3节指出控制设计程序的一些不足,并通过模拟环境,指出怎样克服问题。4.4节给出单片机的一些设计相关概述,以及出现问题和值得借鉴之处。

4.1数学模型

集总元件热系统符合线性控制,适用于载玻片干燥机的问题。图4显示了二阶集总元件热量模型的载玻片干燥机。状态变量是温度,Ta是箱内空气的温度,Tb是箱子本身的温度。该系统输入功率等于q(t)的热量和环境温度T的和。ma,mb分别对应空气和箱子的质量。

Ca和Cb则分别是其对应热量。m1和m2分别是空气与箱子间以及箱子与外界间的传热系数。

图4-1 集总元件热模型

由图4可以推出(线性)状态方程

拉普拉斯变换(1)和(2)等式,并整理Ta(s)。有趣的是,可以推出一个开环的热系统方程。

其中K是一个常数,D(s)是一个二阶的多项式。K,tz,以及系数D(s)和在(1)和(2)等式中出现的系数功能相近。当然,在(1)和(2)等式中各种参数在未知的情况下,不难证明D(s)与其他参数的值无关,具有两个零点。因此传递函数可以写成(我们假设环境温度为常数)

此外,可以推出1/tp1lt;1/tzlt;1/tp2,即,零点在两极之间。开环零极点如图5所示。

图4-2 Gaq(s)的零极点

为了获取完整的热模型,从(3)式中除去常数K和3个未知的时间常数。四个未知参数并不少,但由简单的实验表明,1/tp1lt;lt;1/tz,1/tp2统基本上是一阶函数,且tz,tp2近似为0。因此,开环系可以写成:

(下标p1已经被去掉了)

过初始温度和热量值大范围内的设置,简单的开环阶跃响应实验结果表明,Kasymp;0.14o/W,tau;asymp;295S。

4.2 控制系统设计

使用(4)式的一阶开环传递函数Gaq(s),并且假定加热器的输出函数q(t)为线性,图6是系统框图代表闭环系统。Td(s)是设定温度的函数,C(s)是传递函数,Q(s)是热量输出,单位是瓦特。

图6简化的闭环系统框图鉴于这种简单情况,前面所指的线性控制设置,例如,根轨迹法设计法可以使C(s)中符合要求的阶跃响应对应的上升时间、稳态误差和超调量符合表格1所示。当然,一个有足够增益的比例控制器就可以满足各种要求。超调量改变是不可能既增加增益又减少稳态误差和上升时间的。不幸的是,如果要获得足够增益,需要生产超过实际生产能力的大容量加热器。这是本系统的实际问题,将会致使上升时间不符合要求。这要求学生们如何利用这个经过仔细计算的简化模型,在整体性能上达到最佳控制。

    1. 模型仿真

该设计的大部分性能和限制功能,应该可以使用图6简化模型来完成。但有一个数据对闭环系统其他方面的影响并非能够如此简单的仿真。其中最主要的是:

·量化误差的模拟和数模转换,

·测量温度和使用PWM控制加热器。

这两种都是非线性的、时变的。所以唯一切实可行的方法就是通过仿真(或实验)加以研究。

图7Simulink仿真闭环系统框图显示了Simulink情况下的闭环系统框图,其中包括A/D转换和使用标准Simulink量化饱和块建立的饱和量化模型。建立PWM调制模型比较复杂,需要一个自定义的S函数来表示。

这种仿真模型已经被证明在衡量不同的PWM基本参数对设计的影响以及适当参数的选择中特别有用。(即时间越长,PWM调制会产生更多温度误差。另一方面,时间越长,继电器抖动机率越小。)PWM调制方法往往很难让学生掌握,并且仿真模型允许研究测试运行和明显的影响。

4.4单片机

简单的闭环控制、键盘输入和显示控制是经典单片机应用技术,这个设计项目包含上述三个方面。因此这是一个优秀的全面的单片机应用练习。

此外,由于该项目是来源于现实,它不会是一个简单的输入输出设计就能完成的。相反,这个项目需要制定一个完整的嵌入式应用。这需要从大量的单片机型号中选取适当的芯片并学着使用一个相当复杂的开发环境。最后,必须设计和选取印刷电路板和单片机,以及外接元件。

单片机选择

从现有的实际经验来看,经常选用摩托罗拉公司的单片机。不过,芯片的选择不应该局限于此。研究表明,系统要求符合工作需求的单片机。这对学生很困难,因为他们缺乏良好的经验与判断能力,只能通过制造商的产品选择指南决定单片机的选择。部分问题是各种外围设备(例如,应该使用哪种显示驱动程序?)连接方法的选择。摩托罗拉的相关应用研究[2,3,4]中的证明是非常有用的,基本阐述了可实用性的连接方法以及单片机和外围连接的组合方式。在最终要求的基础上,选择MC68HC705B16,其现有A/D输入和PWM输出以及24个数字I/O线。这样选择是有必要的,因为此项目需要一个A/D通道、一个PWM通道和11个I/O引脚(见图3)。该决定为了安全方面,因为选择一个完整的开发系统是有必要的,该项目预算中没有足够的资金再次购买元件。

单片机应用开发

外围设备的电路硬件、软件的开发、最终调试、单片机的自定的印刷电路板和外设都需要某种形式的发展环境。

如同单片机本身,一个开发环境的选择是令人困惑并需要一些教师的专业知识。摩托罗拉三级发展环境,包括从简单的评估板(在约100美元)到全面的实时在线仿真器(在大约7500元)。中间选项被选为本项目的MMEVS,其中包括:

·平台板(支持所有6805-family部分),

· 模拟器模块(具体到B系列部分),和

· 电缆头和目标适配器(简明包装)。

总体而言,该系统的成本为900美元,并且在一定局限下,提供了在线仿真能力。它还配备了简单但足够的软件开发环境RAPID[5]。

学生发现学习使用这类系统的挑战。但他们在现实世界的微控制器应用获得的经验大大超过了第一使用典型的简单评估板的经验。

印刷电路板

一个简单的(虽然布局绝对不平凡)印刷电路板是这个工程提供的另一个现实学习的机会。图8显示最后的板布局与包轮廓(50%实际大小)。相对简单的电路使手工安置和路由实践方面更实际,它有可能提供更好的结果比一个这样的应用程的自动性。学生因此接触到基本印刷电路布局问题和基本的设计规则。本排版软件使用的是非常漂亮的包装印刷电路板,板制作是在内部电子技术员的帮助下完成的。

图4-4 单片机印刷版布局

5 结论

本文的目的是描述一个跨学科的本科工程设计项目:一个基于单片机的温度控制系统,包括设定点输入数字与设定值/实际温度显示。本文已描述了这样系统的一个设计,并且讨论了许多来自工程的问题。这些问题的解决通常需要入门课程要求的知识,尤其是在老师的建议和监督下,实际上可以促进大学生发展。

从教学方法观点看,问题的理想特征包括微控制器和外围设备的简单使用,有效地运用导论水平的物理系统建模和设计闭环控制。并需要相对简单的实验和模拟(详细的性能

预测)。并可取的是一些技术相关方面的问题,包括热敏电阻和温度传感器(分别需要知识

脉宽调制和校准技术)的实际使用、单片机选择和开发系统的使用以及并印制电路设计。

鸣谢

作者要感谢参与这个项目的学生,马克朗·斯道夫,马特洛尔和戴维bull;舒克曼,表现出辛勤工作、奉献和能力。这个工程和工程成功全赖他们。

参考文献

[1]朗斯道夫,M.拉尔,D.舒克曼,和P.莱因哈特,“显微镜载玻片干燥剂温控器,”1997届全国大学生研究,(奥斯汀,德克萨斯州),四月1997。海报介绍。

[ 2 ]摩托罗拉公司,凤凰城,亚利桑那,温度测量和使用它的显示mc68hc05b4和mc14489,

1990。摩托罗拉semiconductorapplicationnote an431。

[ 3 ]摩托罗拉公司,凤凰城,亚利桑那,hc05单片机驱动技术使用mc68hc705j1a,1995。摩托

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[504555],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。