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 author’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 airfilled chamber The system was to allow entry of a desired chamber temperature in a prescribed range and to exhibit overshoot and steadystate 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 realworld application A prototype of a microscope slide dryer had been developed around an OmegaTM model CN390 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 airfilled 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 author’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 students’ solution in some detail and to discuss some of the pedagogical opportunities offered by an interdisciplinary design project of this type The students’ 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 students’ 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 CN390 temperature controller using a customdesigned system The application dictates that temperature settings are usually kept constant for long periods of time but it’s nonetheless important that step changes be tracked in a reasonable manner Thus the main requirements boil down to
·allowing a chamber temperature setpoint to be entered
·displaying both setpoint and actual temperatures and
·tracking step changes in setpoint temperature with acceptable rise time steadystate error and overshoot
Although not explicitly a part of the specifications in Table 1 it was clear that the customer desired digital displays of setpoint and actual temperatures and that setpoint 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 students’ design
The microcontroller a MotorolaMC68HC705B16 (6805 for short) is the heart of the system It accepts inputs from a simple fourkey keypad which allow specification of the setpoint temperature and it displays both setpoint and measured chamber temperatures using twodigit sevensegment 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 precalibrated thermistor and input via one of the 6805’s analogtodigital inputs Finally a pulsewidth 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 setpoint 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 temperaturesensing thermistor drives through a voltage divider pin AN0 (one of eight analog inputs) Finally pin PLMA (one of two PWM outputs) drives the heater relay
Software on the 6805 implements the temperature control algorithm maintains the temperature displays and alters the setpoint in response to keypad inputs Because it is not complete at this writing software will not be discussed in detail in this paper The control algorithm in particular has not been determined but it is likely to be a simple proportional controller and certainly not more complex than a PID Some control design issues will be discussed in Section 4 however
4 The Design Process
Although essentially the project is just to build a thermostat it presents many nice pedagogical opportunities The knowledge and experience base of a senior engineering undergraduate are just enough to bring him or her to the brink of a solution to various aspects of the problem Yet in each case realworld considerations complicate the situation significantly
Fortunately these complications are not insurmountable and the result is a very beneficial design experience The remainder of this section looks at a few aspects of the problem which present the type of learning opportunity just described Section 41 discusses some of the features of a simplified mathematical model of the thermal properties of the system and how it can be easily validated experimentally Section 42 describes how realistic control algorithm designs can be arrived at using introductory concepts in control design Section 43 points out some important deficiencies of such a simplified modelingcontrol design process and how they can be overcome through simulation Finally Section 44 gives an overview of some of the microcontrollerrelated design issues which arise and learning opportunities offered
41 MathematicalModel
Lumpedelement thermal systems are described in almost any introductory linear control systems text and just this sort of model is applicable to the slide dryer problem Figure 4 shows a secondorder lumpedelement thermal model of the slide dryer The state variables are the temperatures Ta of the air in the box and Tb of the box itself The inputs to the system are the power output q(t) of the heater and the ambient temperature T¥ ma and mb are the masses of the air and the box respectively and Ca and Cb their specific heats μ1 and μ2 are heat transfer coefficients from the air to the box and from the box to the external world respectively
It’s not hard to show that the (linearized) state equationscorresponding to Figure 4 are
Taking Laplace transforms of (1) and (2) and solving for Ta(s) which is the output of interest gives the following openloop model of the thermal system
where K is a constant and D(s) is a secondorder polynomialK tz and the coefficients of D(s) are functions of the variousparameters appearing in (1) and (2)Of course the various parameters in (1) and (2) are completely unknown but it’s not hard to show that regardless of their values D(s) has two real zeros Therefore the main transfer function of interest (which is the one from Q(s) since we’ll assume constant ambient temperature) can be written
Moreover it’s not too hard to show that 1tp1 <1tz <1tp2 ie that the zero lies between the two poles Both of these are excellent exercises for the student and the result is the openloop polezero diagram of Figure 5
Obtaining a complete thermal model then is reduced to identifying the constant K and the three unknown time constants in (3) Four unknown parameters is quite a few but simple experiments show that 1tp1 _ 1tz1tp2 so that tztp2 _ 0 are good approximations Thus the openloop system is essentially firstorder and can therefore be written
(where the subscript p1 has been dropped)
Simple openloop step response experiments show thatfor a wide range of initial temperatures and heat inputs K _014 _W and t _ 295 s1
42 Control System Design
Using the firstorder model of (4) for the openloop transfer function Gaq(s) and assuming for the moment that linear control of the heater power output q(t) is possible the block diagram of Figure 6 represents the closedloop system Td(s) is the desired or setpoint temperatureC(s) is the compensator transfer function and Q(s) is the heater output in watts
Given this simple situation introductory linear control design tools such as the root locus method can be used to arrive at a C(s) which meets the step response requirements on rise time steadystate error and overshoot specified in Table 1 The upshot of course is that a proportional controller with sufficient gain can meet all specifications Overshoot is impossible and increasing gains decreases both steadystate error and rise time
Unfortunately sufficient gain to meet the specifications may require larger heat outputs than the heater is capable of producing This was indeed the case for this system and the result is that the rise time specification cannot be met It is quite revealing to the student how useful such an oversimplified model carefully arrived at can be in determining overall performance limitations
43 Simulation Model
Gross performance and its limitations can be determined using the simplified model of Figure 6 but there are a number of other aspects of the closedloop system whose effects on performance are not so simply modeled Chief among these are
·quantization error in analogtodigital conversion of the measured temperature and
· the use of PWM to control the heater
Both of these are nonlinear and timevarying effects and the only practical way to study them is through simulation (or experiment of course)
Figure 7 shows a SimulinkTM block diagram of the closedloop system which incorporates these effects AD converter quantization and saturation are modeled using standard Simulink quantizer and saturation blocks Modeling PWM is more complicated and requires a custom Sfunction to represent it
This simulation model has proven particularly useful in gauging the effects of varying the basic PWM parameters and hence selecting them appropriately (Ie the longer the period the larger the temperature error PWM introduces On the other hand a long period is desirable to avoid excessive relay chatter among other things) PWM is often difficult for students to grasp and the simulation model allows an exploration of its operation and effects which is quite revealing
44 The Microcontroller
Simple closedloop control keypad reading and display control are some of the classic applications of microcontrollers and this project incorporates all three It is therefore an excellent allaround exercise in microcontroller applications In addition because the project is to produce an actual packaged prototype it won’t do to use a simple evaluation board with the IO pins jumpered to the target system Instead it’s necessary to develop a complete embedded application This entails the choice of an appropriate part from the broad range offered in a typical microcontroller family and learning to use a fairly sophisticated development environment Finally a custom printedcircuit board for the microcontroller and peripherals must be designed and fabricated
Microcontroller Selection In view of existing local expertise the Motorola line of microcontrollers was chosen for this project Still this does not narrow the choice down much A fairly disciplined study of system requirements is necessary to specify which microcontroller out of scores of variants is required for the job This is difficult for students as they generally lack the experience and intuition needed as well as the perseverance to wade through manufacturers’ selection guides
Part of the problem is in choosing methods for interfacing the various peripherals (eg what kind of display driver should be used) A study of relevant Motorola application notes [2 3 4] proved very helpful in understandingwhat basic approaches are available and what microcontrollerperipheral combinations should be considered
The MC68HC705B16 was finally chosen on the basis of its availableAD inputs and PWMoutputs as well as 24 digital IO lines In retrospect this is probably overkill as only one AD channel one PWM channel and 11 IO pins are actually required (see Figure 3) The decision was made to err on the safe side because a complete development system specific to the chosen part was necessary and the project budget did not permit a second such system to be purchased should the first
prove inadequate
Microcontroller Application Development Breadboarding of the peripheral hardware development of microcontroller software and final debugging and testing of a custom printedcircuit board for the microcontroller and peripherals all require a development environment of some kind The choice of a development environment like that of the microcontroller itself can be bewildering and requires some faculty expertise Motorola makes three grades of development environment ranging from simple evaluation boards (at around 100) to fullblown realtime incircuit emulators (at more like 7500) The middle option was chosen for this project the MMEVS which consists of _ a platform board (which supports all 6805family parts) _ an emulator module (specific to Bseries parts) and _ a cable and target head adapter (packagespecific) Overall the system costs about 900 and provides with some limitations incircuit emulation capability It also comes with the simple but sufficient software development environment RAPID [5]
Students find learning to use this type of system challenging but the experience they gain in realworld microcontroller application development greatly exceeds the typical firstcourse experience using simple evaluation boards
PrintedCircuit Board The layout of a simple (though definitely not trivial) printedcircuit board is another practical learning opportunity presented by this project The final board layout with package outlines is shown (at 50 of actual size) in Figure 8 The relative simplicity of the circuit makes manual placement and routing practical—in fact it likely gives better results than automatic in an application like this—and the student is therefore exposed to fundamental issues of printedcircuit layout and basic design rules The layout software used was the very nice package pcb2 and the board was fabricated inhouse with the aid of our staff electronics technician
中文翻译:
单片机温度控制:
跨学科科生工程设计项目
JamesSMcDonald
工程科学系三学德克萨斯州
圣安东尼奥市78212
摘:文描述作者领导四三学高年级学生组成团队进行跨学科工程项目设计该项目目标设计气室温度控制系统该系统求:实际气室温度阶跃响应时规定范围温度进入气室稳定时温度误差超调量必须少绝温度组学生开发设计基摩托罗拉MC68HC05系列单片机该问题教学价值通某步骤关键描述文说明研究结果表明解决该方案需具广泛工程学科知识包括相关电子机械控制系统工程知识
1 引言
该设计项目实际应问题关显微镜载玻片干燥剂温控器——欧米茄CN390温度控制器设计目标研发定义通温度控制系统取代欧米茄系统更低成实现相功定义控制器欧米茄系统样需够全方位处理种问题
该载玻片干燥机机械布局图1示干燥机体足够绝缘充气室里面次存放着薄纸包着石蜡石蜡保持适稳定性载玻片气室温度必须维持稳定第二气筒(电子围绕元件)设电阻加热器温度控制器安装干燥机风扇风吹加热器热量带载玻片气室
图11 载玻片干燥机机械布局
199697学年文作者带领四位三学工程科学系高年级学生开展项目研究文目说明提出问题详细阐述学生解决方案讨种类型跨学科设计项目教学方面应问题份学生报告1997年全国科毕业生研讨会提出讨第2节出该设计更详细情况包括性规格第3节具体 学生设计第4节文体讨该设计教学应方面实施问题第5节全文总结
2 问题阐述
该项目基思想设计定义温度控制系统取代相关欧米茄CN390温度控制器温度时通常保持稳定常数重阶跃变化合理踪求:
·空气室温度进行设定
·时显示设定值实际温度
·设定温度值情况接受范围踪阶跃变化稳态误差超调量
设定温度接口
设定温度显示
室温度显示
范围
精度
准确度
6099
1°C
±1°C
室温度阶梯响应
范围(稳定状态)
精度(稳定状态)
超调
设定时间(±1°)
6099
±1°C
1°C
120s
表1 精确规格说明
表1部分说明明确清楚反映数字显示器设定值实际温度求温度应该通数值输入设定(通电位器设置)
3系统设计
根微控设计数字温度显示单点输入求合适图2学生设计框图
图22 温度控制器硬件结构图
摩托罗拉MC68HC705B16(简称6805)系统核心通简单4键键盘温度进行设定时两显示驱动控制7段LED数码显示定值气室温度测量值输入输出信号6805行口相连气室温度值预校准热敏电阻测量通6805数模转换输入6085脉宽度调制(PWM)输出驱动继电器控制线性电阻加热器闭合断开
图3更详细显示6805接口电子器件暴风3K041103型号四键键盘通PA0PA3端口进行数输入中重功进行模式切换两种模式:固定模式运行模式固定模式两键设定温度增加减少第四键暂作LED显示屏哈里斯半导体ICM7212进行驱动通PB0PB6端口芯片相连作输出热敏电阻电压分频器驱动通AN0针脚(八模拟输入端口中)相连PLMA针脚(两PWM输出端口中)驱动加热继电器
图23 单片机原理图
图3单片机原理图关软件实现温度控制算法保持温度显示改变键盘输入响应会文详细讨文重点没编译完成软件部分没确定控制算法简单例控制PID算法简单控制设计问题第四节讨
4 设计程
然该项目质建立恒温器许契机供教学鉴高级工程科教育知识够学生具解决问题力然情况实际情况理问题参项目设计获设计方面宝贵验节余部分着眼方面:41节讨系统特征简化系统热性数学模型简单理证明42节介绍确定实际控制算法43节指出控制设计程序足通模拟环境指出样克服问题44节出单片机设计相关概述出现问题值鉴处
41数学模型
集总元件热系统符合线性控制适载玻片干燥机问题图4显示二阶集总元件热量模型载玻片干燥机状态变量温度Ta箱空气温度Tb箱子身温度该系统输入功率等q(t)热量环境温度Tmamb分应空气箱子质量
CaCb分应热量m1m2分空气箱子间箱子外界间传热系数
图41 集总元件热模型
图4推出(线性)状态方程
拉普拉斯变换(1)(2)等式整理Ta(s)趣推出开环热系统方程
中K常数D(s)二阶项式Ktz系数D(s)(1)(2)等式中出现系数功相然(1)(2)等式中种参数未知情况难证明D(s)参数值关具两零点传递函数写成(假设环境温度常数)
外推出1tp1<1tz<1tp2零点两极间开环零极点图5示
图42 Gaq(s)零极点
获取完整热模型(3)式中常数K3未知时间常数四未知参数少简单实验表明1tp1<<1tz1tp2统基阶函数tztp2似0开环系写成:
(标p1已掉)
初始温度热量值范围设置简单开环阶跃响应实验结果表明K≈014oWτ≈295S
42 控制系统设计
(4)式阶开环传递函数Gaq(s)假定加热器输出函数q(t)线性图6系统框图代表闭环系统Td(s)设定温度函数C(s)传递函数Q(s)热量输出单位瓦特
图6简化闭环系统框图鉴种简单情况前面指线性控制设置例根轨迹法设计法C(s)中符合求阶跃响应应升时间稳态误差超调量符合表格1示然足够增益例控制器满足种求超调量改变增加增益减少稳态误差升时间幸果获足够增益需生产超实际生产力容量加热器系统实际问题会致升时间符合求求学生利仔细计算简化模型整体性达佳控制
43 模型仿真
该设计部分性限制功应该图6简化模型完成数闭环系统方面影响非够简单仿真中:
·量化误差模拟数模转换
·测量温度PWM控制加热器
两种非线性时变唯切实行方法通仿真(实验)加研究
图7Simulink仿真闭环系统框图显示Simulink情况闭环系统框图中包括AD转换标准Simulink量化饱块建立饱量化模型建立PWM调制模型较复杂需定义S函数表示
图43 仿真闭环系统框图
种仿真模型已证明衡量PWM基参数设计影响适参数选择中特(时间越长PWM调制会产生更温度误差方面时间越长继电器抖动机率越)PWM调制方法难学生掌握仿真模型允许研究测试运行明显影响
44单片机
简单闭环控制键盘输入显示控制典单片机应技术设计项目包含述三方面优秀全面单片机应练
外该项目源现实会简单输入输出设计完成相反项目需制定完整嵌入式应需量单片机型号中选取适芯片学着相复杂开发环境必须设计选取印刷电路板单片机外接元件
441单片机选择
现实际验常选摩托罗拉公司单片机芯片选择应该局限研究表明系统求符合工作需求单片机学生困难缺乏良验判断力通制造商产品选择指南决定单片机选择部分问题种外围设备(例应该种显示驱动程序?)连接方法选择摩托罗拉相关应研究[234]中证明非常基阐述实性连接方法单片机外围连接组合方式终求基础选择MC68HC705B16现AD输入PWM输出24数字IO线样选择必项目需AD通道PWM通道11IO引脚(见图3)该决定安全方面选择完整开发系统必该项目预算中没足够资金次购买元件
442单片机应开发
外围设备电路硬件软件开发终调试单片机定印刷电路板外设需某种形式发展环境
单片机身开发环境选择令困惑需教师专业知识摩托罗拉三级发展环境包括简单评估板(约100美元)全面实时线仿真器(约7500元)中间选项选项目MMEVS中包括:
·台板(支持6805family部分)
· 模拟器模块(具体B系列部分)
· 电缆头目标适配器(简明包装)
总体言该系统成900美元定局限提供线仿真力配备简单足够软件开发环境RAPID[5]
学生发现学类系统挑战现实世界微控制器应获验超第典型简单评估板验
443印刷电路板
简单(然布局绝)印刷电路板工程提供现实学机会图8显示板布局包轮廓(50实际)相简单电路手工安置路实践方面更实际提供更结果样应程动性学生接触基印刷电路布局问题基设计规排版软件非常漂亮包装印刷电路板板制作部电子技术员帮助完成
图44 单片机印刷版布局
文档香网(httpswwwxiangdangnet)户传
《香当网》用户分享的内容,不代表《香当网》观点或立场,请自行判断内容的真实性和可靠性!
该内容是文档的文本内容,更好的格式请下载文档