资源目录
压缩包内文档预览:
编号:1898663
类型:共享资源
大小:5.55MB
格式:RAR
上传时间:2017-10-12
上传人:机****料
认证信息
个人认证
高**(实名认证)
河南
IP属地:河南
50
积分
- 关 键 词:
-
发电
系统
监控
装置
设计
- 资源描述:
-
![`KTQH{WJ]2N4G@AL}@BNDSW.png](https://www.renrendoc.com/ueditor_s/net/upload/2017-10/12/6364343710296234674814760_1.png)
- 内容简介:
-
Temperature Control Using a Microcontroller:An Interdisciplinary Undergraduate Engineering Design ProjectJames S. McDonaldDepartment of Engineering ScienceTrinity UniversitySan Antonio, TX 78212Abstract. This paper describes an interdisciplinary designproject which was done under the authors supervision by agroup of four senior students in the Department of Engineer-ing Science at Trinity University. The objective of the projectwas to develop a temperature control system for an air-filledchamber. The system was to allow entry of a desired cham-ber temperature in a prescribed range and to exhibit over-shoot and steady-state temperature error of less than 1 de-gree 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, aredescribed. The pedagogical value of the problem is also dis-cussed through a description of some of the key steps in thedesign process. It is shown that the solution requires broadknowledgedrawnfromseveralengineeringdisciplinesinclud-ing electrical, mechanical, and control systems engineering.1IntroductionThe design project which is the subject of this paper origi-nated from a real-world application. A prototype of a micro-scope slide dryer had been developed around an OmegaTMmodel CN-390 temperature controller, and the objective wasto develop a custom temperature control system to replacethe Omega system. The motivation was that a custom con-troller targeted specifically for the application should be ableto achieve the same functionality at a much lower cost, as theOmega system is unnecessarily versatile and equippedto han-dle a wide variety of applications.The mechanical layout of the slide dryer prototype isshown in Figure 1. The main element of the dryer is a large,insulated, air-filled chamber in which microscope slides, eachwith a tissue sampleencasedinparaffin,canbe set oncaddies.In order that the paraffin maintain the proper consistency, thetemperature in the slide chamber must be maintained at a de-sired (constant)temperature. A secondchamber(the electron-ics enclosure) houses a resistive heater and the temperaturecontroller, and a fan mounted on the end of the dryer blowsair across the heater, carrying heat into the slide chamber.This design project was carried out during academic year199697 by four students under the authors supervision as aSenior Design project in the Department of Engineering Sci-ence at Trinity University. The purpose of this paper is toSlide ChamberSlide Chamber161.756.2510.254.5HeaterFanElectronics enclosureTop View8888Temperature controllerFront View4.5Figure 1. Slide dryer mechanical layoutdescribe the problem and the students solution in some de-tail, and to discuss some of the pedagogical opportunities of-fered by an interdisciplinary design project of this type. Thestudents own report was presented at the 1997 National Con-ference on UndergraduateResearch 1.Section 2 givesa more detailed statement of the problem,including performancespecifications, and Section 3 describesthe studentsdesign. Section4 makesupthe bulkof thepaper,and discusses in some detail several aspects of the design pro-cess which offer unique pedagogical opportunities. Finally,Section 5 offers some conclusions.2Problem StatementThe basic idea of the project is to replace the relevant parts ofthe functionality of an Omega CN-390 temperature controllerusing a custom-designedsystem. The applicationdictatesthattemperature settings are usually kept constant for long peri-ods of time, but its nonetheless important that step changesbe tracked in a “reasonable” manner. Thus the main require-ments 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 ac-ceptable rise time, steady-state error, and overshoot.Table 1 gives a more precise statement of specifications.Table 1. Temperature controller specificationsSet-point temperature entryRange6099?CPrecision1?CSet-point temperature displayRange6099?CPrecision1?CChamber temperature displayRange6099?CPrecision1?CAccuracy?1?CChamber temperature step responseRange (steady state)6099?CAccuracy (steady state)?1?CMaximum overshoot1?CSettling time (to?1?C)120 sAlthough not explicitly a part of the specifications in Ta-ble 1, it was clear that the customer desired digital displaysof set-point and actual temperatures, and that set-point tem-perature entry should be digital as well (as opposed to, say,through a potentiometer setting).3System DesignThe requirements for digital temperature displays and set-point entry alone are enough to dictate that a microcontroller-based design is likely the most appropriate. Figure 2 shows ablock diagram of the students design.RelayHeaterTemperatureSensorSlide ChamberMicrocontrollerKeypadDisplays& DriversElectronics EnclosureFigure 2. Temperature controller hardware block diagramThe microcontroller,a Motorola MC68HC705B16(6805for short), is the heart of the system. It accepts inputs froma simple four-key keypad which allow specification of theset-point temperature, and it displays both set-point and mea-sured chamber temperatures using two-digit seven-segmentLED displays controlled by a display driver. All these in-puts and outputs are accommodated by parallel ports on the6805. Chamber temperature is sensed using a pre-calibratedthermistor and input via one of the 6805s analog-to-digitalinputs. Finally, a pulse-width modulation (PWM) output onthe 6805 is used to drive a relay which switches line power tothe resistive heater off and on.Figure 3 shows a more detailed schematic of the elec-tronics and their interfacing to the 6805. The keypad, a Storm3K041103, has four keys which are interfaced to pinsPA?PA?of Port A, configured as inputs. One key functions as amode switch. Two modes are supported: set mode and runmode. In set mode two of the other keys are used to specifythe set-point temperature: one increments it and one decre-ments. The fourthkey is unused at present. The LED displaysare drivenbya HarrisSemiconductorICM7212display driverinterfaced to pinsPB?PB?of Port B, configured as outputs.The temperature-sensing thermistor drives, through a voltagedivider, pinAN?(one of eight analog inputs). Finally, pinPLMA(one of two PWM outputs) drives the heater relay.7-seg LED display2 x 2-digitABCDA1A2E1ICM7212RelaylineHeaterVddKeypadVdd28ThermistorMC68HC705B16PA0PA1PA2PA3PB1PB2PB3PB4PB5PB6PLMAAN0PB0Figure 3. Schematic of microcontroller boardSoftware on the 6805 implements the temperature con-trol algorithm, maintains the temperature displays, and altersthe set-point in response to keypad inputs. Because it is notcomplete at this writing, software will not be discussed in de-tail in this paper. The control algorithm in particular has notbeen determined, but it is likely to be a simple proportionalcontroller and certainly not more complex than a PID. Somecontrol design issues will be discussed in Section 4, however.4The Design ProcessAlthough essentially the project is just to build a thermostat,it presents many nice pedagogical opportunities. The knowl-edge and experience base of a senior engineering undergrad-uate are just enough to bring him or her to the brink of a solu-tion to various aspects of the problem. Yet, in each case, real-world considerations complicate the situation significantly.Fortunately these complications are not insurmountable, andthe result is a very beneficial design experience.The remainder of this section looks at a few aspects ofthe problem which present the type of learning opportunityjust described. Section 4.1 discusses some of the features ofa simplified mathematical model of the thermal properties ofthe system and how it can be easily validated experimentally.Section 4.2 describes how realistic control algorithm designscan be arrived at using introductory concepts in control de-sign. Section 4.3 points out some important deficiencies ofsuch a simplified modeling/control design process and howtheycan beovercomethroughsimulation. Finally, Section4.4gives an overview of some of the microcontroller-related de-sign issues which arise and learning opportunities offered.4.1Mathematical ModelLumped-elementthermal systems are described in almost anyintroductory linear control systems text, and just this sort ofmodel is applicable to the slide dryer problem.Figure 4 shows a second-order lumped-element thermalmodel of the slide dryer. The state variables are the temper-atures Taof the air in the box and Tbof the box itself. Theinputs to the system are the power output q?t?of the heaterand the ambient temperature T. maand mbare the masses ofthe air and the box, respectively, and Caand Cbtheir specificheats. 1and 2are heat transfer coefficients from the air tothe box and from the box to the external world, respectively.Ta?ma?CaT1?Ta?Tb?2?Tb?T?q?t?Tb?mb?CbFigure 4. Lumped-element thermal modelIts not hard to show that the (linearized) state equationscorresponding to Figure 4 aremaCaTa?1?Ta?Tb?(1)mbCbTb?1?Ta?Tb?Tb?T?(2)Taking Laplace transforms of (1) and (2) and solving forTa?s?, which is the output of interest, gives the followingopen-loop model of the thermal system:Ta?s?K?zs?1?s?Q?s?1?s?T?where K is a constant and ?s?is a second-order polynomial.K, z, and the coefficients of ?s?are functions of the variousparameters appearing in (1) and (2).Of course the various parameters in (1) and (2) are com-pletely unknown, but its not hard to show that, regardlessof their values, ?s?has two real zeros. Therefore the maintransferfunctionof interest (which is the one fromQ?s?, sincewell assume constant ambient temperature) can be writtenGaq?s?Ta?s?Q?s?K?zs?1?p1s?1?p2s?1?(3)Moreover,its nottoohardtoshow that1?p1?1?z?1?p2,i.e., that the zero lies between the two poles. Both of these areexcellent exercises for the student, and the result is the open-loop pole-zero diagram of Figure 5.?1?p1ImRe?1?p2?1?zFigure 5. Pole-zero diagram of Gaq?s?Obtaining a complete thermal model, then, is reduced toidentifying the constant K and the three unknown time con-stants in (3). Four unknown parameters is quite a few, butsimple experiments show that 1?p1?1?z?1?p2so thatz?p2?0 are good approximations. Thus the open-loop sys-tem is essentially first-order and can therefore be writtenGaq?s?Ks?1(4)(where the subscript p1 has been dropped).Simple open-loop step response experiments show that,for a wide range of initial temperatures and heat inputs, K?0?14?W and ?295 s.14.2Control System DesignUsing the first-order model of (4) for the open-loop transferfunction Gaq?s?and assuming for the moment that linear con-trol of the heater power output q?t?is possible, the block dia-gram of Figure 6 represents the closed-loop system. Td?s?is1Of course the system is not actually linear, so the apparent parametervalues vary with initial conditions and input magnitude. The effect on closed-loop performance is not too serious, but it gives the student a good idea ofwhat nonlinearity means and how feedback tends to mitigate its effects.the desired, or set-point, temperature,C?s?is the compensatortransfer function, and Q?s?is the heater output in watts.Td?s?C?s?Ks?1Ta?s?Q?s?Figure 6. Simplified block diagram of the closed-loop systemGiven this simple situation, introductory linear controldesign tools such as the root locus method can be used toarrive at a C?s?which meets the step response requirementson rise time, steady-state error, and overshoot specified in Ta-ble 1. The upshot, of course, is that a proportional controllerwith sufficient gain can meet all specifications. Overshoot isimpossible, and increasing gains decreases both steady-stateerror and rise time.Unfortunately, sufficient gain to meet the specificationsmay require larger heat outputs than the heater is capable ofproducing. This was indeed the case for this system, andthe result is that the rise time specification cannot be met.It is quite revealing to the student how useful such an over-simplified model, carefully arrived at, can be in determiningoverall performance limitations.4.3Simulation ModelGross performance and its limitations can be determined us-ing the simplified model of Figure 6, but there are a numberof other aspects of the closed-loop system whose effects onperformance are not so simply modeled. Chief among theseare?quantization error in analog-to-digital conversion of themeasured temperature and?the use of PWM to control the heater.Both of these are nonlinear and time-varying effects, and theonly practical way to study them is through simulation (orexperiment, of course).Figure 7 shows a SimulinkTMblock diagram of theclosed-loop system which incorporates these effects.A/Dconverter quantization and saturation are modeled using stan-dard Simulink quantizer and saturation blocks.ModelingPWM is more complicated and requires a custom S-functionto represent it.A/D Converter 0.392Scale Factor+Sum80SetpointTemperaturePIDCompensator0.05Thermistor0.137295.2s+1G_aq(s)pwm.mPWMSFunctionSaturation/HeaterFigure 7. Simulink block diagram of closed-loop systemThis simulation model has proven particularly useful ingauging the effects of varying the basic PWM parameters andhence selecting them appropriately. (I.e., the longer the pe-riod, the larger the temperature error PWM introduces. Onthe other hand, a long period is desirable to avoid excessiverelay “chatter,” among other things.) PWM is often difficultfor students to grasp, and the simulation model allows an ex-ploration of its operation and effects which is quite revealing.4.4The MicrocontrollerSimple closed-loop control, keypad reading, and display con-trol are some of the classic applications of microcontrollers,and this project incorporatesall three. It is therefore an excel-lent all-around exercise in microcontroller applications.In addition, because the project is to produce an actualpackaged prototype, it wont do to use a simple evaluationboardwiththeI/Opinsjumperedto thetargetsystem. Instead,its necessary to develop a complete embedded application.This entails the choice of an appropriate part from the broadrange offered in a typical microcontroller family and learningto use a fairly sophisticated development environment. Fi-nally, a custom printed-circuit board for the microcontrollerand peripherals must be designed and fabricated.Microcontroller Selection.In view of existing local exper-tise, the Motorola line of microcontrollerswas chosen for thisproject. Still, this does not narrow the choice down much.A fairly disciplined study of system requirements is neces-sary to specify which microcontroller, out of scores of vari-ants, is required for the job. This is difficult for students, astheygenerallylacktheexperienceandintuitionneededaswellas the perseverance to wade through manufacturers selectionguides.Part of the problem is in choosing methods for interfac-ing the various peripherals (e.g., what kind of display drivershould be used?). A study of relevant Motorola applicationnotes2, 3,4provedveryhelpfulinunderstandingwhatbasicapproachesare available, and what microcontroller/peripheralcombinations should be considered.The MC68HC705B16 was finally chosen on the basis ofitsavailableA/D inputsandPWM outputsaswell as24digitalI/O lines. In retrospect this is probably overkill, as only oneA/D channel, one PWM channel, and 11 I/O pins are actuallyrequired (see Figure 3). The decision was made to err on thesafe side because a complete development system specific tothe chosen part was necessary, and the project budget did notpermit a second such system to be purchased should the firstprove inadequate.Microcontroller Application Development.Breadboard-ing of the peripheral hardware, development of microcon-troller software, and final debugging and testing of a customprinted-circuit board for the microcontroller and peripheralsall require a development environment of some kind.Thechoiceof a developmentenvironment,like that of themicrocontroller itself, can be bewildering and requires somefaculty expertise. Motorola makes three grades of develop-ment environment ranging from simple evaluation boards (ataround $100) to full-blown real-time in-circuit emulators (atmore like $7500). The middle option was chosen for thisproject: the MMEVS, which consists of?a platform board (which supports all 6805-family parts),?an emulator module (specific to B-series parts), and?a cable and target head adapter (package-specific).Overall, the system costs about $900 and provides, with somelimitations, in-circuit emulation capability. It also comes withthe simple but sufficient software development environmentRAPID 5.Students find learning to use this type of system chal-lenging, but the experience they gain in real-world micro-controllerapplicationdevelopmentgreatlyexceedsthetypicalfirst-course experience using simple evaluation boards.Printed-Circuit Board.The layout of a simple (thoughdefinitely not trivial) printed-circuit board is another practi-cal learning opportunity presented by this project. The fi-nal board layout, with package outlines, is shown (at 50% ofactual size) in Figure 8. The relative simplicity of the cir-cuit makes manual placement and routing practicalin fact,it likely gives better results than automatic in an applicationlike thisand the student is therefore exposed to fundamen-tal issues of printed-circuit layout and basic design rules. Thelayout software used was the very nice packagepcb,2and theboard was fabricated in-house with the aid of our staff elec-tronics technician.Figure 8. Printed-circuit layout for microcontroller board5ConclusionTheaimofthispaperhasbeentodescribeaninterdisciplinary,undergraduate engineering design project: a microcontroller-2pcbis freely distributable software for UNIX/X11.It is written byThomas Nau, Assistant Director of Computing at Universit at Ulm, Germany.He can be contacted at URLmailto?Thomas?Nau?rz?uni?ulm?de, thesoftware is available atftp?ftp?uni?ulm?de?pub?pcb, and an emaillist can be subscribed to atmailto?pcb?majordomo?uni?ulm?de.based temperature control system with digital set-point en-try and set-point/actual temperature display. A particular de-sign of such a system has been described,
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。