毕业论文基于AT89C51单片机的PID温度控制系统设计27353.doc

上传人:土8路 文档编号:10502085 上传时间:2021-05-20 格式:DOC 页数:19 大小:592KB
返回 下载 相关 举报
毕业论文基于AT89C51单片机的PID温度控制系统设计27353.doc_第1页
第1页 / 共19页
毕业论文基于AT89C51单片机的PID温度控制系统设计27353.doc_第2页
第2页 / 共19页
毕业论文基于AT89C51单片机的PID温度控制系统设计27353.doc_第3页
第3页 / 共19页
毕业论文基于AT89C51单片机的PID温度控制系统设计27353.doc_第4页
第4页 / 共19页
毕业论文基于AT89C51单片机的PID温度控制系统设计27353.doc_第5页
第5页 / 共19页
点击查看更多>>
资源描述

《毕业论文基于AT89C51单片机的PID温度控制系统设计27353.doc》由会员分享,可在线阅读,更多相关《毕业论文基于AT89C51单片机的PID温度控制系统设计27353.doc(19页珍藏版)》请在三一文库上搜索。

1、 集美大学诚毅学院 控制系统综合设计专业班级 姓 名 学号 姓 名 学号 指导教师 日 期 一、 引言进入21世纪后,自动控制正朝着高精度、多功能、标准化、高可靠性及安全性发展。温度控制也正朝着开发虚拟温度控制器和网络温度控制器、研制单片测温控温系统等高科技的方向迅速发展。温度已成为工业对象控制中一种重要的参数,在科学研究和生产实践的诸多领域中,温度控制占有着极为重要的地位, 温度控制技术是一种比较重要的工业技术,不仅在化工,航天,航空,医疗等高科技领域,在食品、机械、冶金、化工、建材、石油等工业领域,占据着具有举足轻重的作用。在我们日常的生活中,我们也是经常应用到的。随着工业技术的不断发展,

2、传统的控制方式已经不能满足高精度、高速度的控制要求。如接触器温度控制仪表,其主要缺点是温度波动范围大,由于它主要通过控制接触器的通断时间比例来达到改变加热功率的目的,受仪表本身误差和交流接触器的寿命限制,通断频率很低。近几年来快速发展了多种先进的温度控制方式,如:直接数字控制(DDC),推断控制,预测控制,模糊控制(Fuzzy),专家控制(Expert Control),鲁棒控制(Robust Control),推理控制等,PID控制,神经网络及遗传算法控制等1。这些控制技术大大的提高了控制精度,不但使控制变得简便,而且使产品的质量更好,降低了产品的成本,提高了生产效率。仿真技术的优良特性和巨

3、大效益,可能将成为今后人们特别重视和大力发展的综合技术。仿真系统将应用于人类生产实践的全过程,这样可以避免决策失误,可以预测可能发生的问题,达到避免故障、安全控制的目的。有关专家预言,在2l世纪,仿真技术的发展必将对经济、社会以及人们的观念产生巨大影响。MATLAB具有以下几个特点: 1.功能强大的数值运算功能 2.强大的图形处理能力 3.高级但简单的程序环境 4.是一种丰富的工具箱。单片微型计算机的功能不断的增强,为先进的控制算法提供的载体,许多高性能的新型机种应运而生。单片机以其功能强、体积小、可靠性高、造价低和开发周期短等优点,成为自动化领域和其他测控领域中广泛应用的器件,在工业生产中成

4、为必不可少的器件。在温度控制系统中,单片机更是起到了不可替代的核心作用。像用于热处理的加热炉、用于融化金属的坩锅电阻炉等类似工业用加热炉中都可以广泛应用,随着生产的发展,在工业中,一些设备对温度的控制要求越来越高。在温度控制技术在温度控制当中,PID控制技术应用相对来说比较广泛,PID控制器算法简单,计算量小,恒温效果稳定。本文则以单片机(C 51)为核心、PID算法为控制方式、MATLAB仿真、串口通讯而设计的温度控制系统。二、 本控制系统的综述此次课程设计的温度控制系统,以单片机AT89C51为控制核心。主要内容是通过Pt100温度传感器,将水壶的温度值转化成电阻值。再通过自设计的温度变送

5、器进行放大输出电压量,由AD模块(ADC0809芯片)将电压信号采集进单片机。与我们系统的给定值rk进行比较得到误差量ek,采用PID控制算法得到控制量。将控制量经DA模块(DAC0832芯片)产生电压信号驱动功率模块实现对水壶的温度控制。此次课程设计采用的控制算法采用的是Bang-Bang PID算法,当温度低于设定范围以下,可以使温度较低时能够快速的升温。水壶的温度控制也可采用模糊控制算法等智能控制算法,并且温度系统存在较大的滞后,也可以增加Smith预估算法。 本次课程设计的目的在于,在对水壶温度控制系统的设计中,了解温度控制系统基本的控制方案。将理论应用与实际,对过程控制技术、自动控制

6、技术的应用得到一定的提升。三、 温度控制系统硬件设计4.1、温度变送器模块Pt100的电阻受温度的变化而变化,其计算公式:Rt=R0(1+aT)=100(1+0.00392T),其中T为温度,Rt的单位为欧姆,Rt与温度呈有一个零点的线性关系。在变送器模块设计中为了将温度的变化转化成电压的变化,需设计一个恒流电路,使电阻的变化转化成电压的变化。根据公式:Vt=RtIs=100Is+0.392TIs,故需要设计一个恒压抬高电路,抵消100Is,使温度与电压呈线性关系。最后,由于Pt100的电路产生的电压变化比较小,所以还需要设计放大电路。 图2 温度变送器原理图由图2可知:(1) 系统前级电路由

7、三极管、二极管和稳压管组成的电路产生恒定的电流Is,使Vi随温度的变化而变化;(2) Vi为铂电阻的转换电压,U1和U2组成二级放大器,Vi1为一级放大电压,V11抬高电压,Vo为最终输出电压(010V),Vo1输出05V;(3) U3是射极跟随器,产生稳定的抬高电压V11。图3温度变送器实物图温度变送器设计完成后,对各电位器进行调节,使得传感器输入为0100,输出为05V。对水壶的水温进行测量,将得到的温度及对应的电压值用Excel进行绘图并拟合。温度()122030405060708090100电压(V)1.091.742.232.833.423.834.264.755.145.38 表1

8、 温度与采集电压数据表图4 温度与采集电压曲线图拟合公式为:y=0.0488x+0.7746 (1)其中y表示水温,x表示输出电压。经过调试后,基本上能够满足线性要求。4.2、功率可调模块功率可调模块选用EUV-10A-,该模块采用单片机设计,可实现软启动、软停车功能,广泛应用于交直流电机调速,单相220VAC、380VAC变压器初级原边调压、电磁铁振动、调光、焊机、电镀等功率调节场合。技术参数l 工作电压 220VAC、380VACl 有效值电流 10Al 偏置电压Vb 12VDCl 偏置电流 30mADC maxl 输入控制信号 1-5VDC或4-20mA或10k电位器l 输出电压变化范围

9、 0-220VDC、0-380VACl 引出端与底板间、输入与输出电路间介质耐压 2500VAC min/50Hz功率调控模块EUV-10A-的接线方式如下图2所示。左图为触发电路的接线图,右图为交流电的输入和输出的连接图。连接图4-20mA调节时的接法图5 功率模块的接法4.3、被控对象本设计使用电热水壶为被控对象,该对象具有大滞后、非线性、时变性等特点,通过单闭环控制方式,实现对水壶温度的恒温控制。若想使系统控制更加完善可加入Smith预估等控制算法,在此不作介绍。4.4、单片机实验系统单片机系统采用STAR ES598PIC实验箱以及星研集成开发软件。包括A/D、D/A、串口通信等一系列

10、模块。图6 系统连接实物图四、 控制器设计5.1、PID控制器的设计PID控制器广泛的应用于各种工业控制。 其主要的优点在于:原理简单,使用方便;适应性强;鲁棒性好;对模型依赖少。它是将给定值与实际输入值进行偏差计算得到e(t),然后进行比例、积分、微分计算,通过线性组合构成控制器,实现对被控对象的控制。对于增量型的PID控制规律为:Uk=kp*ek+ki*ek+kd*(ek-ek-1) (2)Uk为PID控制的输出信号5.2、PID控制器流程图对PID的三个比例系数赋初始值,然后将采集的信号与给定值进行比较,得到偏差量,代入控制规律(2)式,求得控制信号。图8 Bang-Bang PID算法

11、流程图算法流程详解:ek、ek-1、ei初始值都为0,当A/D转化的数值与给定的80的偏差大于10时,uk=255,控制电压为5V,即最大电压进行加热。当温度介于70和80之间时,进入Bang-Bang PID控制。由于算法计算出来的控制量可能大于D/A转化的范围,所以当uk255时,令其输出为255.;uk0时,输出为0。5.3、PID参数整定本设计通过仿真图的温度控制效果进行PID各参数的调节,以使得控制系统的调节时间、超调量以及抗干扰能力达到比较良好的效果。还可以采用临界比例度法、衰减曲线法等。五、 PID参数的整定将两台PC机进行通信,并进行MATLAB对控制曲线进行仿真。以下是对PI

12、D各参数进行调节得到的响应曲线。只对放大系数KP进行调节 Kp=10 Ki=0.1 Kd=0 Kp=20 Ki=0.1 Kd=0Kp=30 Ki=0.1 Kd=0如上图所示,在只调节比例参数的情况下,系统均有不同程度的超调,随着Kp的增加系统的上升时间逐渐缩短。随着比例Kp的变大,系统的稳定性也变差,稳态误差也随之增大,总体控制精度不高。所以只控制系统的Kp是不够的,故进一步对积分Ki进行整定。只对积分系数Ki进行调节 Kp=30 Ki=0.2 Kd=0 Kp=30 Ki=0.05 Kd=0如上图所示,选取使系统超调较小较之稳定的Kp,在比例Kp不变的情况下,积分可以消除或者减小系统的稳态误差

13、。但过大的积分作用使得系统的稳定性有所下降,抗干扰能力下降并使得系统的动态响应变慢了,所以积分Ki不是越大越好。只对积分系数Ki进行调节Kp=50 Ki=0.2 Kd=0如上图所示,系统在干扰作用下能够较为迅速进行自我调节并逐步恢复到稳定状态,说明系统具有较强的自我调节能力和抗干扰能力。 系统PID参数总体分析:从上述图形我们可以清楚的看到,加入比例可以使得系统加快调节,减小误差,但是过大的比例使得系统稳定性下降。加入积分使得系统能够较小甚至消除稳态误差,但是过强的积分作用会使得系统稳定性下降,动态响应变慢。由于没有微分调节所以不做微分对系统作用的概述。六、 结论与心得本次为期2周的课程设计,

14、让我们从中受益匪浅,通过它我们对控制系统及PID控制以及PID参数整定方法在工程应用中的设计和分析有了进一步的认识把握。在本次课程设计当中,从下发任务书起,我们小组团结一致,分工合作。具体流程如下1.选用C51软件平台设计A/D,D/A转换电路。2. 制作并调试温度变送器电路板。3. 设计PID控制器,对PID参数进行整定以及MATLAB实现温度电压数据的采集和仿真。4.整理实验数据,写报告和总结。5.小组汇报和质疑。期间,不乏遇到各种问题,比如,温度变送器电路板上的元件,当用万用测的参数与要求不符合,或者电路短路和断路,这都需要我们细心的排查。然后在参数整定方面,根据自动控制原理,需要通过编

15、程的方法,对比例,积分,微分进行反复的选择,尝试,和矫正,再加扰动观测系统的稳定性变化,最终选择一个相对合理的PID控制参数,以完成预定的目标。总之,通过动手亲自操作这个设计,提升了我们的能力,巩固了对专业知识的掌握,对PID控制的用用和参数整定有了深刻的体会和相对全面的认识。当然还要感谢期间还有老师的其他小组的指点和帮助。参考文献1 周正林 . 基于单片机的电炉温度控制系统设计J . 信息技术,2005:115附录1:系统设计元件清单12V开关电源 1个 电热水杯1个功率模块1个 Pt100一个电源插座1个 万能板1块小螺钉4套 烙铁1把焊锡若干 电源线1根万用表1个 小螺丝刀1把温度计1个

16、 黑色绝缘胶1卷串口线 1 根 剥线钳 1把插座和插头:三芯 1个(+12V、VCC、-12V)、两芯2个(A/D和地、Pt100)二极管:CR1(LN4148) 1个、CR2(稳压管6.2V) 1个、CR3(稳压管9.2V) 1个 、三极管:1个运放:741 3个、芯片插座芯(运放)3个电阻:R1(47K) 、R2(2K)、R3(电位器 1K)、R4(10K)、R5(10K)、R6(100K)、R7(10K)、R8(100K)、R9(10K)、R10(100K)、R11(100K)、R12(2.2K)、R13(电位器1K)、R14(3.32K)、R15(10K)附录2:课程设计程序(1)调试

17、程序及其结论如下AD、DA转换调试程序:#include#define uchar unsigned charuchar xdata *ad;uchar data adtab;uchar j=0;main()ad=0x0f000;while(1)*ad=0;for(j=0;j=100;j+);adtab=*ad;P1=adtab;return 0;结论: 5 V时候LED灯全亮,0 V的时候 LED灯全灭(2)发送机程序: (3)接收机程序:Employment tribunals sort out disagreements between employers and employees.Y

18、ou may need to make a claim to an employment tribunal 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 ma

19、ke a claim to an employment tribunal, even if you 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

20、an application to an employment tribunal within three 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 it.If you are worried about how the time limits apply to you, take advice from one o

21、f the organisations listed underFurther help.Employment 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 m

22、aking a claim to an employment tribunal, you should 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. T

23、his is known as adamages-based agreement. In England 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 bes

24、t to get advice from an experienced adviser, for example, 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 Wat

25、ch mCayman Islands-based Webb, the head of Fifas anti-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 Sp

26、ort.For me its about how he felt and I would like 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

27、an immediate investigation into the referees actions.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

28、 of different life became the appearance of the same 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

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

30、 think lucky money and new clothes are necessary for 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 peac

31、e, suddenly found that isnt really grow up, it seems 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

32、the pitch he has sweat profusely, looked at his thrown a basketball hoops, suddenly found himself has already cant remember his appearance.童年时,觉得压岁钱和新衣服是过年必备,但是随着年龄的推进,会越来越发现,那些东西根本就可有可无;初中时,以为要有一场暗恋才意味着真正的成长,但三年过去后,自己心平气和的写同学录的时候,突然就发现是不是真正的成长了,好像并没有那么重要了;然后到了高中,觉得非要吐露出自己的心声才能为高中生涯里的懵懂情愫划上一个句点,但毕业晚

33、会的时候最终还是被梗塞在了咽喉,后来再次站在他曾经挥汗如雨的球场,看着他投过篮球的球框时,突然间发现自己已经想不起他的容颜。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,

34、 as if nothing could shake his. Also once seemed to 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 one

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

36、. Suddenly thought of blue plaid shirt; Those were 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.此刻,天空是阴暗的,空气里有

37、着刚下过雨之后的清新因子。突然想到那件蓝格子衬衫;那些被折成各种各样形状的信纸;那段从街角深巷伊始的友谊;还有那场还没有开始就宣告了终结的邂逅计划那些年那些天的非做不可,终于和青春一样,都将在我们的人生中谢幕。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 precipitat

38、ion or humidity and limited cloud cover. The balloon, 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 cruisin

39、g 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.aThe supersonic descent could happen as early as Sunda.The weatheThe balloon will slowly drift to the edge of space at 1

40、20,000 feet ( Then, I would assume, he will slowly step out onto something resembling an Olympic diving platform.Below, the Earth becomes the concrete bottom of a swimming pool that he wants to land on, but not too hard. Still, hell be traveling fast, so despite the distance, it will not be like div

41、ing into the deep end of a pool. It will be like he is diving into the shallow end. Skydiver preps for the big jumpWhen he jumps, he is expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40 seconds. Like hitting the top of the water, he will begin to slow as he approaches the

42、more dense air closer to Earth. But this will not be enough to stop him completely.If he goes too fast or spins out of control, he has a stabilization parachute that can be deployed to slow him down. His team hopes its not needed. Instead, he plans to deploy his 270-square-foot (25-square-meter) mai

43、n chute at an altitude of around 5,000 feet (1,524 meters).In order to deploy this chute successfully, he will have to slow to 172 mph (277 kph). He will have a reserve parachute that will open automatically if he loses consciousness at mach speeds.Even if everything goes as planned, it wont. Baumgartner still will free fall at a speed that would cause you and me to pass out, and no parachute is guaranteed to work higher than 25,000 feet (7,620 meters).cause there

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1