电加热炉温度控制系统设计.doc_第1页
电加热炉温度控制系统设计.doc_第2页
电加热炉温度控制系统设计.doc_第3页
电加热炉温度控制系统设计.doc_第4页
电加热炉温度控制系统设计.doc_第5页
已阅读5页,还剩25页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

difficult, not hating; blueprints, not rhetoric; words and simple, but full of love, truth, passion, entrepreneurial passion. Take this opportunity, my inspirational quotes Li Dazhaos classic iron specialise in uplifting blend with the article gave everyone, with a view on how to do well under the new situation of township and village leaders inspire and help, and also share with you. A good play to create iron shoulders strong arms, to assume the burden be passed; only specific qualities, will it be possible in specific areas to create a world. In my view, village chiefs in the new situation, we must first have five basic quality. One ambition is to pioneer. Who is handsome. People only high-minded can stimulate the flow of momentum to become brave and persistent, become quiet and powerful. Township and village party leaders, within their respective jurisdictions, political stability and economic and social development issues, decisions and orientation depends to a large extent because of your. Everybody in village chiefs and the positions, both the trust of the masses, the Organizations trust, more ability to you, fully affirmed the moral and other qualities. Therefore, we must always maintain the historical mission and social responsibility, and our ideal tree rooted in the hard work of the soil, with indomitable spirit, indomitable courage to open up a new situation of villages and towns. To have a feeling of closeness to the second. The people and country. Our business foundation in the peoples blood in the people power people. Advanced decisions of the party cadres to the feelings of the people is an eternal theme. Fan Zhong-yan, called first, and enjoy comfort about others, Zheng Banqiaos also wrote a Ya Chai lay listening to the rustling of bamboo, the suspect is suffering. Cao County officials, little my, a total turn off. Old of feudal official even has so feelings, alone we is to serving for purposes of people servant does? we more should always hold with on people of deep feelings, heart Department masses of leading visited tea, care masses of emotions thoughts complained, always insisted put masses of interests put in first, consciously from itself do up, from small do up, from masses most care, and most directly, and most reality of interests problem grabbed, real do love for people by Department, and right for people by with, and Lee for people by conspiracy to. Three with the fame of mind. Non-indifferent not insist your dream, without serenity not go far. Ascension to fame is morality, is the sublimation of the soul. As Township and village, be sure to maintain a normal state of mind, establish a correct viewpoint on power, position and values and Outlook, as fame is light like water, depending . 50 km, also red and like hundreds of thousands of the KMT military combat, but he went on to collect a variety of newspapers and magazines, and then race against time to pore over. As long as the study of mind, it is not necessary to come to the library, workshops, into the villages, people learned farming techniques, problem-solving methods, participation in计算机控制技术课程设计 题目 电加热炉温度测控系统设计 学院 机械电子工程学院 专业 机械设计制造及其自动化 学生姓名 吴崇灯(21) 陈治祥(27) 谢立杰(26)冷态启动为脱硝氨区系统的初次启动或脱硝氨区系统检修后的重新启动。在冷态启动前,脱硝氨区系统内的全部机械设备处于停运状态conferences, learned superiors policies; reports, you can learn to deal with problems, art, just wanted to learn, to learn at any time. To continuously expand the scope of the study. The complexity and comprehensiveness of our work, decided to not only do we want to be professionals, or if generalists, to dabble in different areas of knowledge. Mastery of knowledge not only to have knowledge to rational analysis. This on requirements we, not only to learning national of route, and approach, and policy, also to learning national of legal, and regulations; not only to with political theory armed mind, also to with economic theory guide work; not only to read history, also to read history; not only to absorption SM of mirror, also to gets is of road; not only to from local learn, also to to outside learn; not only to to books learn, also to field study learn. Therefore, I would encourage you, and more to the outside world when I have time to take a look at, take a stroll, outside developments, learn other peoples development approach, and then come back to guide our work. Second, we must think. Learning without thought to overshadow, thinking without learning is perilous. We want to foster the character of advancing with the times, forge ahead, often reflect themselves in adapting to the new situation on whether there are delays, have anything to fear in the reform and innovation, whether in terms of accelerating the development of a relaxation, keep promising State of mind. In order to do investigations, investigations is the road to heaven, God disposes of the base. To wants to real heard truth, and justice to truth, and get truth, received effectiveness, on must in-depth actual, and outreach, and in-depth masses, worship masses for Division, and masses heart, with masses with discussion everyone care of problem, listening they of calls, understand they of mood, feel they of suffering, summary they of experience, concentrated they of wisdom, especially on masses most hope, and most urgent, and most worries, and most complained of hot, and difficulties and focus problem, more to active research, caught not put. Dare to innovate, in our work, often remain the old way doesnt work, the new approach would not situation, the reason, the key is that many people know that copying other peoples ideas, mechanically, using someone elses old ways. To change this predicament, requires us to break the shackles of traditional concepts to overcome conservative, conformist, good at finding new problems and to accept new things, summarize new experience, new ideas, developing new programmes and Maverick, a new approach to solve problems, speed up development. Especially in implement superior policy spirit of process in the, both implementation, and cannot mechanically, to to extraordinary of courage and develop enterprising of spirit, put flexibility and principle combined up, put superior of spirit and local reality combined up, Yong conspiracy to breakthrough of policy, and exercise innovation of lift, developed out development works of, and grass-roots welcomes of27目录1 意义与要求11.1 实际意义11.2 技术要求12 设计内容及步骤12.1 方案设计12.2 详细设计22.2.1 主要硬件介绍22.2.2 电路设计方法32.2.3 绘制流程图62.2.4 程序设计72.3 调试和仿真73 结果分析84 课程设计心得体会9参考文献10附录11电加热炉温度控制系统设计1 意义与要求1.1 实际意义在现实生活当中,很多场合需要对温度进行智能控制,日常生活中最常见的要算空调和冰箱了,他们都能根据环境实时情况,结合人为的设定,对温度进行智能控制。工业生产中的电加热炉温度监控系统和培养基的温度监控系统都是计算机控制系统的典型应用。通过这次课程设计,我们将自己动手设计一个小型的计算机控制系统,目的在于将理论结合实践以加深我们对课本知识的理解。1.2 技术要求要求利用所学过的知识设计一个温度控制系统,并用软件仿真。功能要求如下:(1)能够利用温度传感器检测环境中的实时温度;(2)能对所要求的温度进行设定;(3)将传感器检测到得实时温度与设定值相比较,当环境中的温度高于或低于所设定的温度时,系统会自动做出相应的动作来改变这一状况,使系统温度始终保持在设定的温度值。2 设计内容及步骤2.1 方案设计要想达到技术要求的内容,少不了以下几种器件:单片机、温度传感器、LCD显示屏、直流电动机等。其中单片机用作主控制器,控制其他器件的工作和处理数据;温度传感器用来检测环境中的实时温度,并将检测值送到单片机中进行数值对比;LCD显示屏用来显示温度、时间的数字值;直流电动机用来表示电加热炉的工作情况,转动表示电加热炉通电加热,停止转动表示电加热炉断电停止加热。整体思路是这样的:首先我们通过按键设定所需要的温度值,然后利用温度传感器检测电加热炉的实时加热温度,并送至单片机与设定值进行比较。若检测值小于设定值,则无任何动作,电加热炉继续导通加热;若检测值大于设定值,则单片机控制光电耦合器导通,继电器动作,电加热炉断电停止加热。一旦炉温低于设定值,单片机又控制光电耦合器断开,继电器开关分离,电加热炉开始导通加热。这个过程中所设定的温度值和传感器检测到得温度值都要在LCD显示屏上显示出来,以方便操作人员观察。另外,还可以加上时钟模块,以方便计时。这个设计思路相对比较简单,利用所学过的知识容易实现,加上光电耦合器用于隔离强电和弱电,比较安全,正好符合我们自动化专业用弱电控制强电的目的,正所谓学以致用。2.2 详细设计2.2.1 主要硬件介绍1单片机这里选用AT89C51单片机作为控制系统的处理器。AT89C51是一种带4K字节闪存可编程可擦除只读存储器的低电压、高性能CMOS 8位微处理器。2温度传感器温度传感器有很多种型号,这里我选用DS18B20温度传感器。数字温度传感器DS18B20具有独特的单总线接口方式,支持多节点,使分布式温度传感器设计大为简化。测温时无需任何外围原件,可以通过数据线直接供电,具有超低功耗工作方式。测温范围为-55到+125摄氏度,可直接将温度转换值以16位二进制数字码的方式串行输出,因此特别适合单线多点温度测量系统。由于传输的是串行数据,可以不需要放大器和A/D转换器,因而这种测温方式大大提高了各种温度测控系统的可靠性,降低了成本,缩小了体积。3开关器件由于单片机与电动机之间需要用开关器件连接,并且前者用弱电控制,后者由强电控制,这就尤其需要注意安全问题。于是我想到了在课本中学过的高性能安全开关器件光电耦合器。光电耦合器是由一个发光器件和和一个光电转换器件组成,这里所用的光电耦合器OPTOCOUPLER-NPN是由一个发光二极管和一个光敏晶体管所组成。当发光二极管发光,就会使得光敏晶体管导通,继电器通电动作,将开关吸合,电动机回路断开。2.2.2 电路设计方法1显示部分电路显示电路截图如下图所示。图2.1 显示部分电路图这里我选用LCDLM016L液晶显示屏作为系统的显示器件,如图所示,LCDLM016L采用标准的16脚接口,仿真时隐藏了背光正极和背光负极两个引脚。它通过D0-D78位数据端来与单片机进行数据和指令传输,这里我们将它与单片机的P0口连接。在显示屏上显示的内容包括设定的温度值SET、传感器检测到的环境温度SA以及时钟,这个时钟是可以调整的,这样方便工作人员在对系统进行操作时有一个时间概念。2温度检测电路温度传感器与单片机的连接情况如下图所示。图2.2 温度检测电路图温度传感器18B20将检测到的环境实时温度进行A/D转换和放大,然后串行送入单片机P1.7口,便于单片机将此数值与设定的温度值进行比较,然后先做出相应反应。在仿真时,我们只能通过按18B20上的加减按钮来调节实时温度,是一个模拟的过程。3键盘电路键盘电路如下图所示。图2.3 键盘电路图这里减排设计得比较简单,“MS”键是切换调整对象的,调整对象包括时、分、温度设定值三项,“+”键是向上加调整对象的值,“”键是向下减调整对象的值,“ON/OFF”键是打开和关闭系统自动调节功能的开关键。4电气开关及工作电路电器开关及工作电路如下图所示。图2.4 电气开关及工作电路图如图所示,光电耦合器1脚接电源,2脚接单片机P3.7脚。工作过程用以下三个阶段来描述:(1)单片机将温度传感器送入的值与设定值进行比较,若送入值小于设定值,则P3.7脚保持高电平,这样发光二极管不发光,光敏晶体管保持高阻态,继电器也不会工作,电动机和灯泡维持导通,相当于电炉继续加热,指示灯亮;(2)一旦送入值比设定值大,单片机将会控制P3.7脚变为低电平,发光二极管导通发光,光敏晶体管受光照影响导通,继而继电器工作,电磁铁将单刀双掷开关吸向左端,使电动机和灯泡同时停止工作,这就相当于电炉断电,停止加热;(3)电炉短路一段时间后,必然导致炉温降低,而温度传感器DS18B20在不间断地检测炉温,当检测值低于设定值后,单片机又控制P3.7脚恢复高电平,光电耦合器恢复高阻态,继电器断电,单刀双掷开关被弹回右端,电动机和灯泡又开始工作,这相当于电炉从新开始加热。 2.2.3 绘制流程图NNYY将P3.7口置1设定值=采集值?送入单片机进行温度值比较按键扫描、温度采集时钟定时器0初始化,DS18B20初始化延时500ms启动初始化P1口,初始化24C02LCD初始化读出24C02保存的数据赋于K开始2.2.4 程序设计由于整个程序工程量比较大,我采用模块化设计方法来设计这个程序。首先定义在后面将会用到的变量,不可能一次定义准确,所以边定义边补充。然后编写子函数,包括LCM初始化子函数、显示指定坐标的一个字符子函数、ds18b20初始化函数、ds18b20延迟子函数、读取ds18b20当前温度子函数、液晶显示子函数、键盘扫描子函数、设定工作模式子函数、按键加法子函数、按键减法子函数、24C02读写驱动程序、定时器t0中断子函数等子程序,最后是主函数。2.3 调试和仿真在Keil软件中编写完程序后,编译生成.Hex文件,单片机可以执行.Hex文件。在Protues软件中,给单片机加载所生成的.Hex文件,按下运行按钮,系统开始仿真。系统仿真截图如下图所示。图2.5系统仿真图(一)上一张是当温度采样值小于设定值,电热炉处于工作状态时的仿真截图。以下这张是当温度采样值高于设定值后,系统自动做出反应,使电热炉断电停止工作的仿真截图。图2.6系统仿真图(二)3 结果分析由以上仿真结果可以知道,此次的设计基本成功。当采样温度低于设定值的时候,系统不会对电热炉做出相应动作,电热炉保持加热。一旦采样温度高于设定值,系统就会做出反应,使电加热炉断电停止加热。当温度降下来后,系统又会自动控制电加热炉重新开始加热。系统的反应速度也是十分精确的,会在很短的时间内作出相应动作。另外,由于在电路中加入了EPROM24C02,使得该系统具有掉电保护功能,来电后自动恢复正常工作。除此之外,该系统还有一个比较实用的小功能电子钟,这样的话工作人员可以利用它准确掌握系统已经工作的时间,也就是说可以把它当做一个定时器来用。在安全保护方面,该系统也有相当不错的表现,由于使用了光电耦合器和就电磁继电器,将强电部分和弱电部分充分隔离,十分安全。综合以上分析,该系统的设计十分成功。4 课程设计心得体会本次课程设计,我们的题目是电加热炉温度控制系统设计。说到电加热炉,我们都比较熟悉,在日常生活中我们经常用到,特别是冬天用它来煮火锅。我们也会发现这样一个问题,一般的电加热炉是没有温度自动控制的,当温度上升到我们需要的程度时,它仍然继续加热,这不仅会影响到加热效果,还会造成电能的浪费。那么就有必要设计一种能自动调节炉温的系统,把它应用到日常生活中,将会给人们带来极大的方便。在设计的过程中,也遇到一些麻烦,比如说怎样来实现电动机回路的自动通断调节、怎样来实现时钟的调整等等,这些问题都令我们十分棘手。通过去图书馆查阅相关资料和上网搜索各硬件的原理以及应用,我们最终都一一解决了这些问题。由于我们是三个同学做同一个题目,在设计过程中,我们遇到困难的时候也经常相互讨论,相互请教,最终一起完成任务。 参考文献1 于海生微型计算机控制技术清华大学出版社,20042 谭浩强C程序设计(第三版). 清华大学出版社,20063 戴焯. 传感与检测技术. 武汉理工大学出版社,20064 张毅刚. 单片机原理及应用. 高等教育出版社,20035 柯节成. 简明电子元件器件手册. 高等教育出版社,2005附录系统的完整程序如下:/*电加热炉温度控制系统问题描述:当温控开关打开时,若测得环境温度大于设定温度,则继电器吸合,电加热炉停止工作;若测得环境温度小于设定温度,则继电器释放,电加热炉继续工作。*/#include#include#include #define uchar unsigned char#define uint unsigned int#define BUSY 0x80 /lcd忙检测标志 #define DATAPORT P0 /定义P0口为LCD通讯端口 #define PLAYE_ADDR XBYTE0XBFFF /语音报警地址 sbit RED_ALARM=P10; /红色指示灯sbit WRITE_ALARM=P11; /白色指示灯sbit GREEN_ALARM=P12; /绿色指示灯sbit BLUE_ALARM=P13;sbit P1_4=P14; /时钟调整sbit P1_5=P15; /时钟加sbit P1_6=P16; /时钟减sbit DQ = P17; /定义ds18b20通信端口 sbit LCM_RS=P20; /数据/命令端sbit LCM_RW=P21; /读/写选择端sbit LCM_EN=P22;sbit sda=P23; /IO口定义sbit scl=P24; /LCD使能信号sbit ad_busy=P32; /adc中断方式接口sbit RECLED_EOC=P35; /ISD1420放音结束查询标志sbit OUT=P37;uchar ad_data; /ad采样值存储uchar seconde; /定义并初始化时钟变量uchar minite;uchar hour;uchar mstcnt=0;uchar temp1,temp2,temp; /温度显示变量uchar t,set;uchar K;bit ON_OFF=0;bit outflag;bit write=0;uchar code str0=- : : - ;uchar code str1=SET: C SA: . C;void delay_LCM(uint); /LCD延时子程序void initLCM( void); /LCD初始化子程序void lcd_wait(void); /LCD检测忙子程序void WriteCommandLCM(uchar WCLCM,uchar BusyC); /写指令到ICM子函数void WriteDataLCM(uchar WDLCM); /写数据到LCM子函数void DisplayOneChar(uchar X,uchar Y,uchar DData) /显示指定坐标的一个字符子函数void DisplayListChar(uchar X,uchar Y,uchar code *DData);/显示指定坐标的一串字符子函数void init_timer0(void); /定时器初始化void displayfun1(void);void displayfun2(void);void displayfun3(void);void displayfun4(void);void keyscan(void ); /键盘扫描子程序void set_adj(void);void inc_key(void);void dec_key(void);void delay_18B20(unsigned int i);void Init_DS18B20(void) ;uchar ReadOneChar(void);void WriteOneChar(unsigned char dat);void ReadTemperature(void);void ad0809(void);void playalarm(void); /*延时K*1ms,12.000mhz*/void delay_LCM(uint k) uint i,j; for(i=0;ik;i+) for(j=0;j60;j+) ; /*写指令到LCM子函数*/void WriteCommandLCM(uchar WCLCM,uchar BusyC) if(BusyC)lcd_wait();DATAPORT=WCLCM; LCM_RS=0; / 选中指令寄存器 LCM_RW=0; / 写模式 LCM_EN=1; _nop_(); _nop_();_nop_(); LCM_EN=0; /*写数据到LCM子函数*/void WriteDataLCM(uchar WDLCM) lcd_wait( ); /检测忙信号 DATAPORT=WDLCM; LCM_RS=1; / 选中数据寄存器 LCM_RW=0; / 写模式 LCM_EN=1; _nop_();_nop_();_nop_(); LCM_EN=0;/*lcm内部等待函数*/void lcd_wait(void) DATAPORT=0xff; LCM_EN=1; LCM_RS=0; LCM_RW=1; _nop_(); while(DATAPORT&BUSY) LCM_EN=0; _nop_(); _nop_(); LCM_EN=1; _nop_(); _nop_(); LCM_EN=0;/*LCM初始化子函数*/void initLCM( ) DATAPORT=0;delay_LCM(15);WriteCommandLCM(0x38,0); /三次显示模式设置,不检测忙信号 delay_LCM(5); WriteCommandLCM(0x38,0); delay_LCM(5); WriteCommandLCM(0x38,0); delay_LCM(5); WriteCommandLCM(0x38,1);/8bit数据传送,2行显示,5*7字型,检测忙信号 WriteCommandLCM(0x08,1); /关闭显示,检测忙信号 WriteCommandLCM(0x01,1); /清屏,检测忙信号 WriteCommandLCM(0x06,1); /显示光标右移设置,检测忙信号 WriteCommandLCM(0x0c,1); /显示屏打开,光标不显示,不闪烁,检测忙信号/*显示指定坐标的一个字符子函数*/void DisplayOneChar(uchar X,uchar Y,uchar DData) Y&=1; X&=15; if(Y)X|=0x40; /若y为1(显示第二行),地址码+0X40 X|=0x80; /指令码为地址码+0X80 WriteCommandLCM(X,0); WriteDataLCM(DData);/*显示指定坐标的一串字符子函数*/void DisplayListChar(uchar X,uchar Y,uchar code *DData) uchar ListLength=0; Y&=0x01; X&=0x0f; while(X0;i-) DQ = 0; / 给脉冲信号 dat=1; DQ = 1; / 给脉冲信号 if(DQ) dat|=0x80; delay_18B20(4); return(dat);/*ds18b20写一个字节*/ void WriteOneChar(uchar dat) unsigned char i=0; for (i=8; i0; i-) DQ = 0; DQ = dat&0x01; delay_18B20(5); DQ = 1; dat=1; /*读取ds18b20当前温度*/void ReadTemperature(void)unsigned char a=0;unsigned char b=0;unsigned char t=0;Init_DS18B20();WriteOneChar(0xCC); / 跳过读序号列号的操作WriteOneChar(0x44); / 启动温度转换delay_18B20(100); / this message is wery importantInit_DS18B20();WriteOneChar(0xCC); /跳过读序号列号的操作WriteOneChar(0xBE); /读取温度寄存器等(共可读9个寄存器) 前两个就是温度delay_18B20(100);a=ReadOneChar(); /读取温度值低位b=ReadOneChar(); /读取温度值高位temp1=b4;temp2=a&0x0f;temp=(b*256+a)4); /当前采集温度值除16得实际温度值/*液晶显示子函数1正常显示*/void displayfun1(void)WriteCommandLCM(0x0c,1); /显示屏打开,光标不显示,不闪烁,检测忙信号DisplayListChar(0,0,str0);DisplayListChar(0,1,str1); DisplayOneChar(3,0,hour/10+0x30); /液晶上显示小时DisplayOneChar(4,0,hour%10+0x30);DisplayOneChar(6,0,minite/10+0x30);/液晶上显示分DisplayOneChar(7,0,minite%10+0x30);DisplayOneChar(9,0,seconde/10+0x30); /液晶上显示秒DisplayOneChar(10,0,seconde%10+0x30);DisplayOneChar(4,1,K/10+0x30); /液晶上显示设定的温度DisplayOneChar(5,1,K%10+0x30); DisplayOneChar(11,1,temp1/10+0x30); /液晶上显示测得的温度 DisplayOneChar(12,1,temp1%10+0x30);DisplayOneChar(14,1,temp2/10+0x30);if(ON_OFF=0) /若温控标志为0DisplayOneChar(14,0,0x4f); / 液晶上显示不控温的标志DisplayOneChar(15,0,0x46);elseDisplayOneChar(14,0,0x4f); / 液晶上显示控温的标志DisplayOneChar(15,0,0x4e);if(outflag=1) DisplayOneChar(0,0,0x7c); elseDisplayOneChar(0,0,0xef);/*液晶显示子函数2*/void displayfun2(void)WriteCommandLCM(0x0c,1); /显

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论