毕业设计基于单片机对精馏塔的温度控制系统设计_第1页
毕业设计基于单片机对精馏塔的温度控制系统设计_第2页
毕业设计基于单片机对精馏塔的温度控制系统设计_第3页
毕业设计基于单片机对精馏塔的温度控制系统设计_第4页
毕业设计基于单片机对精馏塔的温度控制系统设计_第5页
已阅读5页,还剩23页未读 继续免费阅读

下载本文档

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

文档简介

1、 课程设计题目:基于单片机对精馏塔温度的控制系统设计学 院: 贵州大学明德学院 专 业: 机械 设计 与制造 班 级: 机 电091 学 号: 092003111048 学生姓名: 杨 政 坤 指导教师: 王 许 2012年 7月 5日 贵州大学明德学院本科课程设计诚信责任书本人郑重声明:本人所呈交的课程设计,是在导师的指导下独立进行研究所完成。设计中凡引用他人已经发表或未发表的成果、数据、观点等,均已明确注明出处。特此声明。论文(设计)作者签名: 杨政坤 日 期: 2012.07.05 课程设计任务书 机电系 院系 学 号092003111048学生姓名杨政坤专业(班级)机电091设计题目基

2、于单片机对精馏塔温度的控制系统设计主要内容设计实时在线检测反应塔测量控制系统1单片机温度控制系统方案简介2单片机的内部模块3系统的硬件设计4系统的软件设计设计要求1:能进行在线检测; 2:要求采用闭环控制系统,提高系统的控制精度; 3:采用显示器实时显示检测值; 4:但检测参数越程时,系统自动报警功能。 5:测量误差为0.01工作量工作计划 1:确定设计思路 2:查阅资料 3:整理规划 4:开始设计 5:设计完成参考资料 单片机原理及接口技术清华大学出版社,段晨东 主编 数字电路与逻辑设计 林宏 编著 ead技术及应用实践 高有堂 编著 2012年7月 5日 第47题基于单片机对精馏塔的温度控

3、制系统设计摘 要精馏法是把混合物中各成分分离出来,并分别达到规定纯度的方法;精馏法是石油,化工等生产过程中最常用的方法。精馏 需要 在 精馏反应塔中 进行,反应塔中必然会产生温度,而且温度很高。温度是工业生产中常见的工艺参数之一,我们需要 对塔中 温度进行 严格的 监测 和 控制。由于温度很高,为了安全起见,我们需要采用单片机对他们进行远距离控制,单片机控制不仅具有控制方便,简单和灵活性大等优点,而且可以大幅度提高被控温度的技术指标,从而能够大大的提高产品的质量和数量。本设计采用无rom的8031作为主控制芯片。8031的接口电路有8155、2764。8155用于键盘/led显示器接口,276

4、4可作为8031的外部rom存储器。其中温度控制电路是通过可控硅调功器实现的。双向可控硅管和加热丝串联接在交流220v,50hz交流试点回路,在给定周期内,8031只要改变可控硅管的接通时间便可改变加热丝功率,以达到调节温度的目的。使用单片机作为核心进行控制。单片机具有集成度高,通用性好,功能强,特别是体积小,重量轻,耗能低,可靠性高,抗干扰能力强和使用方便等独特优点,在数字、智能化方面有广泛的用途。本系统所使用的单片机8031有128k的ram,使温度控制大为简便。关键字:温度控制;接口电路 ;mcs-51单片机8031。第一章 单片机温度控制系统方案简介单片机温度控制系统是以ms-5l单片

5、机为控制核心,辅以采样反馈电路,驱动电路,晶闸管主电路对电炉炉温进行控制的微机控制系统。其系统结构框图可表示为:系统采用单闭环形式,其基本控制原理为:将温度设定值(即输入控制量)和温度反馈值同时送入控制电路部分,然后经过调节器运算得到输出控制量,输出控制量控制驱动电路得到控制电压施加到被控对象上,反应塔内因此达到一定的温度。给定值采样电路输出温度被控对象8031控制电路驱动电路晶闸管主电路图1.1 控制电路的设计第二章 单片机 单片机是单片微型计算机简称,它包括中央处理器cpu、随机存储器ram、只读存储器rom、中断系统、定时器/计数器、串行口和i/o等。单片机主要应用于工业控制领域,用来实

6、现对信号的检测、数据的采集以及对应用对象的控制。它具有体积小、重量轻、价格低、可靠性高、耗电少和灵活机动等许多优点,单片微型计算机(简称单片机)是微型计算机的一个重要分支,也是一种非常活跃和颇具生命力的机种,特别适合用于智能控制系统。2.1 单片机内部模块在本设计中,从经济上以及性能上考虑,我选用8031作为cpu。8031是mcs51系列单片机的一种型号。mcs-51单片机的类型有:8051、8031、8751等。2.1 mcs-51单片机内部结构8031单片机内部结构见图2.1。它其中包含cpu、震荡器和时序电路、4kb的rom、256b的ram、两个16定时/计数器t0和t1、4个8位i

7、/o端口(p0、p1、p2、p3)、串行口等组成。其中震荡时序与时钟组成定时控制部件。图2.1 8031单片机的内部结构2.2 单片机外总线结构如图2.2所示,微型计算机大多数cpu外部都有单独的地址总线、数据总线和控制总线,而mcs51单片机由于受到芯片管脚的限制,数据线和地址线(低8位)是复用的,而且是i/o口兼用。为了将它们分离开来,以便同单片机之外的芯片正确地相连,常常在单片机外部加地址锁存器来构成与一般cpu相类似的三总线。图2.2三总线图2.3芯片的扩展设计71)程序存储器扩展设计;(a)程序存储器简介常见的eprom有:2716(容量2k8位)、2732(容量4k8位)、2764

8、(容量8k8位)、27128(容量16k8位)、27256(容量32k8位)、27512(容量64k8位)。2) 数据存储器设计由于算法的需要,在存储器中需要存储24个从a/d片出来的数据,即需要24单元的存储单元。在8031的内部数据存储区低128字节ram中30h7fh共80个存储单元使用户ram区,完全可以容纳下24个数据以及其运算过程中的临时数据,故不需要在另外扩展片外数据存储器。我选用的eprom芯片为2764。连接如图2.3所示图2.3 2764与8031连接图2.4 单片机温控模块温度检测元件和变送器的选择和被控温度及精度等级有关。本设计采用镍铬/镍铝热电偶,此电偶用于01000

9、的温度测量范围,相应的输出电压为0mv-41.32mv.变送器由毫伏变送器和电流/电压变送器组成:毫伏变送器用于把热电偶输出的0-41.32mv变换成0-10ma范围内的电流;电流/电压变送器用于把毫伏变送器输出的0-10ma电流变换成0-5v范围的电压。54001000,则热电偶输出为16.4mv-41.32mv,毫伏变送器零点迁移后输出0-10mv范围电流。这样,采用8位a/d转换器就可以使量化误差达到正负2.34度以内。第三章 系统硬件设计3.1 系统总体设计系统控制主电路是由8031及其外围芯片,及一些辅助的部分构成的。系统设计原理图如 图3.1 所示。 图3.1 系统设计原理图3.2

10、 8155接口电路图3.2所示,8155芯片内具有256个字节的ram,两个8位、一个16位的可编程i/o口和一个14位计数器。它与51型单片机接口简单,是单片机应用系统中广泛使用的芯片。图3.2 带有i/o接口和计时器的静态ram81558155用作键盘/led显示器接口电路,当io/为高电平时,8155选通片内的i/o端口。a,b,c三个口可以作为扩展的i/o口使用,mcs51单片机的po口与8155的ad0ad7相连。mcs51单片机可以和8155直接连接,不需要任何外加电路,给系统增加了256个字节的ram、22位i/o线及一个计数器。当p2.00且p2.1=0时,选中8155的ram

11、工作;在p2.0=1和p20=0时,8155选中片内三个i/o端口。相应地址分配为:20000h-00ffh 8155内部ram 0100h 命令/状态口 0101h a口 0102h b 口 0103h c 口 0104h 定时器低八位口 0105h 定时器高八位口3.3 a/d转换电路 图3.3 a/d转换电路图adc0809的in0上输入的0v-+5v范围的模拟电压经a/d转换后可由8031通过程序从p0口输入到它的内部ram单元。首先输入地址选择信号,在ale信号作用下,地址信号被锁存,产生译码信号,选中一路模拟量输入。然后输入启动转换控制信号start启动转换。3.4 可控硅控制电路

12、8031对温度的控制是通过可控硅调控器实现的。如图3.4所示,图3.4 可控硅功输出与通断时间关系双向可控硅管和加热丝串联接在交流220v,50hz交流试点回路。在给定的周期t内,8031只要改变可控硅管的接通时间便可改变加热丝功率,以达到调节温度的目的。图3.4示出了可控硅管在给定周期t内具有不同接通时间的情况。显然,可控硅在给定周期t的100%时间内接通的功率最大。可控硅接通时间可以通过可控硅控制板上控制脉冲控制。该触发脉冲由8031用软件在p1.3引脚上产生,受过零同步脉冲后经光偶管和驱动器输送到可控硅的控制极上。通常,电阻炉炉温控制采用偏差控制法。控制论告诉我们,pid控制的理想方程是

13、: (3.1)式中e 测量值与给定值之间的偏差;td 微分时间:t - 积分时间; 【3.2】kp 调节器的放大系数. 将上式离散化得到数字pid位置式算法式中在位置式算法的基础之上得到数字pid增量式算法: 【3.3】第四章 系统软件设计4.1 主程序主程序流程图如 图4.1 所示图4.1 主程序流程图主程序:org 0100hdism0 data 78hdism1 data 79hdism2 data 7ahdism3 data 7bhdism4 data 7chdism5 data 7dhmov sp, #50h; 50h送spclr 5eh ; 清本次越限标志clr 5fh ; 清上次

14、越限标志clr a ; 清累加器amov 2fh, amov 30h, amov 3bh, amov 3ch, a清暂存单元mov 3dh, amov 3eh, amov 44h, amov dism0, amov dism1, amov dism2, amov dism3, a清显示缓冲区mov dism4, amov dism5, amov tmod, #56hmov tl0, #06hmov th0, #06hclr pt0setb tr0setb et0setb ealoop acall disply ;调用显示程序acall scan ;调用扫描程序ajmp loop ;等待中断应当

15、注意:由于t0被设定为计数器方式2,初值为06h,故它的溢出中断时间为250个过零同步脉冲。为了系统正常工作,t1中断服务程序的执行时间必须满足t0的制一时间要求,因为t1的中断是嵌套在t0中断之中的。4.2 t0中断服务程序t0中断服务程序是温度控制系统的主程序,用于启动a/d转换器,读如数据采样,数字滤波,越权温度报警和处理,pid计算和输出可控硅的同步触发脉冲等。p1.3引脚上输出的该同步脉冲宽度由t1计数器的溢出中断控制,8031利用等待t1溢出中断空隙时间完成把本次采样数值转换成显示值而放入显示缓冲区和调用温度显示程序,8031从t1中断服务程序返回后便可以恢复现场和返回主程序,以等

16、待下次t0中断。t0中断服务程序框图如图4.2所示图4.2 t0中断服务程序流程图t0中断服务程序:org 000bh ajmp ct0 ct0: push acc ;push dpl ;保护现场push dph ;setb d5h ; 置标志acall sampacall filtercjne a,42h,tplwl: mov c,5ehmov 5fh,cclr 5ehacall uplpop dphpop dplpop accreti ;中断返回tpl: jnc tpl1clr 5fh ;清上次越限标志cjne a,43h,mtplhat: setb p1.1 ;若温度不越限,则绿灯亮ac

17、all pidmov a,2fhcpl a ;inc a ;对pid值求补,作为tl1值nm: setb p1.3mov tl1,amov th1,#0ffhsetb pt1setb tr1 ;启动t1setb et1 ;允许t1中断acall trastloop: acall disply ;显示温度jb d5h,loop ;等待t1中断pop dphpop dplpop accretimtpl: jnc hatsetb p1.0 ;否则,下限声光报警mov a,45hcpl ainc aajmp nmtpl1: setb 5ehjnb 5fh,wlinc 44h ;越限计数器加1mov a

18、,44hclr csubb a,#n ;越限n次吗?jnz wlsetb p1.2clr 5ehclr 5fhpop dphpop dplpop accreti4.3 采样子程序采样子程序samp:流程图如下图所示, 图4.3 采样子程序流程图ny选同in0启动adc延时a/d完成?所有采样结束?返 回n采样值始址送r0采样次数送r2 采样子程序:samp: mov r0,#2ch ;采样值始址送r0mov r2,#03hmov dptr,#03f8hsam1: movx dptr,a ;启动adc0809工作 mov r3,#20hdly: djnz r3,dly ;延时here: jb p

19、3.3,heremovx a,dptrmov r0,a ;存放采样值inc r0djnc r2,sam1ret4.4 数字滤波程序数字滤波程序filter:用于滤去来自控制现场对采样值的干扰。 本设计采用中值滤波,程序如下:filter: mov a,2ch cjne a,2dh,camp1ajmp cmp2cmp1: jnc cmp2 xch a,2dh xch a,2chcmp2 mov a,2dh cjne a,2eh,cmp3 mov 2ah,a retcmp3: jc cmp4 mov 2qh,a retcmp4: mov a,2eh cjne a,2ch,cmp5 mov 2ah,

20、aretcmp5: jc cmp6 xch a,2chcmp6: mov 2ah,a retynnyyyynyyn(2ch)送a (2ch)(2dh)?(2ch)(2dh)?(2ch)(2dh)(2dh)(2eh)?(2dh)(2eh)?(2ch)(2eh)?(2eh)(2ch)?(2ch) 送2ah返回(2eh)送2ah(2eh)送2ah(2dh) 送2ah(2dh) 送2ah n图4.4 数字滤波程序流程图总 结本设计使用无rom的8031作为主控芯片进行控制,单片机具有集成度高,通用性好,功能强,特别是体积小,重量轻,耗能低,可靠性高,抗干扰能力强和使用方便等独特优点,在数字、智能化方面

21、有广泛的用途。其中的温控系统采用镍铬/镍铝热电偶,此电偶用于01000的温度测量范围,相应的输出电压为0mv-41.32mv.温度是工业对象中的一个重要的被控参数,在本系统中,若采用模糊控制或者神经网络及遗传算法控制,这些控制技术会大大提高控制精度,不但使控制简捷,降低了产品的成本,提高了生产效率。我在以后的设计实验中会加以致用,取得更好的成绩。employment tribunals sort out disagreements between employers and employees.you may need to make a claim to an employment trib

22、unal if: you dont agree with the disciplinary action your employer has taken against you your employer dismisses you and you think that you have been dismissed unfairly.for more information about dismissal and unfair dismissal, seedismissal.you can make a claim to an employment tribunal, even if you

23、 haventappealedagainst the disciplinary action your employer has taken against you. however, if you win your case, the tribunal may reduce any compensation awarded to you as a result of your failure to appeal.remember that in most cases you must make an application to an employment tribunal within t

24、hree months of the date when the event you are complaining about happened. if your application is received after this time limit, the tribunal will not usually accept i.if you are worried about how the time limits apply to you, take advice from one of the organisations listed underfurther help.emplo

25、yment tribunals are less formal than some other courts, but it is still a legal process and you will need to give evidence under an oath or affirmation.most people find making a claim to an employment tribunal challenging. if you are thinking about making a claim to an employment tribunal, you shoul

26、d get help straight away from one of the organisations listed underfurther help.if you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee out of your compensation if you win the case. this is known as adamages-based agreement. in engla

27、nd and wales, your solicitor cant charge you more than 35% of your compensation if you win the case.if you are thinking about signing up for a damages-based agreement, you should make sure youre clear about the terms of the agreement. it might be best to get advice from an experienced adviser, for e

28、xample, at a citizens advice bureau. to find your nearest cab, including those that give advice by e-mail, click onnearest cab.for more information about making a claim to an employment tribunal, seeemployment tribunals.the (lack of) air up there watch mcayman islands-based webb, the head of fifas a

29、nti-racism taskforce, is in london for the football associations 150th anniversary celebrations and will attend citys premier league match at chelsea on sunday.i am going to be at the match tomorrow and i have asked to meet yaya toure, he told bbc sport.for me its about how he felt and i would like

30、to speak to him first to find out what his experience was.uefa hasopened disciplinary proceedings against cskafor the racist behaviour of their fans duringcitys 2-1 win.michel platini, president of european footballs governing body, has also ordered an immediate investigation into the referees actio

31、ns.cska said they were surprised and disappointed by toures complaint. in a statement the russian side added: we found no racist insults from fans of cska.age has reached the end of the beginning of a word. may be guilty in his seems to passing a lot of different life became the appearance of the sa

32、me day; may be back in the past, to oneself the paranoid weird belief disillusionment, these days, my mind has been very messy, in my mind constantly. always feel oneself should go to do something, or write something. twenty years of life trajectory deeply shallow, suddenly feel something, do it.一字开

33、头的年龄已经到了尾声。或许是愧疚于自己似乎把转瞬即逝的很多个不同的日子过成了同一天的样子;或许是追溯过去,对自己那些近乎偏执的怪异信念的醒悟,这些天以来,思绪一直很凌乱,在脑海中不断纠缠。总觉得自己自己似乎应该去做点什么,或者写点什么。二十年的人生轨迹深深浅浅,突然就感觉到有些事情,非做不可了。the end of our life, and can meet many things really do?而穷尽我们的一生,又能遇到多少事情是真正地非做不可?during my childhood, think lucky money and new clothes are necessary f

34、or new year, but as the advance of the age, will be more and more found that those things are optional; junior high school, thought to have a crush on just means that the real growth, but over the past three years later, his writing of alumni in peace, suddenly found that isnt really grow up, it see

35、ms is not so important; then in high school, think dont want to give vent to out your inner voice can be in the high school children of the feelings in a period, but was eventually infarction when graduation party in the throat, later again stood on the pitch he has sweat profusely, looked at his th

36、rown a basketball hoops, suddenly found himself has already cant remember his appearance.童年时,觉得压岁钱和新衣服是过年必备,但是随着年龄的推进,会越来越发现,那些东西根本就可有可无;初中时,以为要有一场暗恋才意味着真正的成长,但三年过去后,自己心平气和的写同学录的时候,突然就发现是不是真正的成长了,好像并没有那么重要了;然后到了高中,觉得非要吐露出自己的心声才能为高中生涯里的懵懂情愫划上一个句点,但毕业晚会的时候最终还是被梗塞在了咽喉,后来再次站在他曾经挥汗如雨的球场,看着他投过篮球的球框时,突然间发现

37、自己已经想不起他的容颜。originally, this world, can produce a chemical reaction to an event, in addition to resolutely, have to do, and time.原来,这个世界上,对某个事件能产生化学反应的,除了非做不可的坚决,还有,时间。a persons time, your ideas are always special to clear. want, want, line is clear, as if nothing could shake his. also once seemed t

38、o be determined to do something, but more often is he backed out at last. dislike his cowardice, finally found that there are a lot of love, there are a lot of miss, like shadow really have been doomed. those who do, just green years oneself give oneself an arm injection, or is a self-righteous spir

39、itual.一个人的时候,自己的想法总是特别地清晰。想要的,不想要的,界限明确,好像没有什么可以撼动自己。也曾经好像已经下定了决心去做某件事,但更多的时候是最后又打起了退堂鼓。嫌恶过自己的怯懦,最终却发现有很多缘分,有很多错过,好像冥冥之中真的已经注定。那些曾经所谓的非做不可,只是青葱年华里自己给自己注射的一支强心剂,或者说,是自以为是的精神寄托罢了。at the moment, the sky is dark, the air is fresh factor after just rained. suddenly thought of blue plaid shirt; those were

40、 broken into various shapes of stationery; from the corner at the beginning of deep friendship; have declared the end of the encounter that havent start planning. those years, those days of do, finally, like youth, will end in our life.此刻,天空是阴暗的,空气里有着刚下过雨之后的清新因子。突然想到那件蓝格子衬衫;那些被折成各种各样形状的信纸;那段从街角深巷伊始的

41、友谊;还有那场还没有开始就宣告了终结的邂逅计划那些年那些天的非做不可,终于和青春一样,都将在我们的人生中谢幕。baumgartner the disappointing news: mission aborted. r plays an important role in this mission. starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. the ballo

42、on, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. it will climb higher than the tip of mount everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. as he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.the supersonic descent could happen as early as sunda.the weatheth

温馨提示

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

评论

0/150

提交评论