微型计算机控制技术课程设计说明书炉温控制系统的设计内容摘要:

lude include struct PID { unsigned int SetPoint。 // 设定目标 Desired Value unsigned int Proportion。 // 比例常数 Proportional Const unsigned int Integral。 // 积分常数 Integral Const unsigned int Derivative。 // 微分常数 Derivative Const unsigned int LastError。 // Error[1] unsigned int PrevError。 // Error[2] unsigned int SumError。 // Sums of Errors } struct PID spid。 // PID Control Structure unsigned int rout。 // PID Response (Output) unsigned int rin。 // PID Feedback (Input) sbit output=P3^4。 unsigned char high_time,low_time,count=0。 //占空比调节参数 unsigned char set_temper=33。 void PIDInit (struct PID *pp) { memset ( pp,0,sizeof(struct PID))。 } unsigned int PIDCalc( struct PID *pp, unsigned int NextPoint ) 武汉理工大学《微型计算机控制技术》课程设计说明书 10 { unsigned int dError,Error。 Error = ppSetPoint NextPoint。 // 偏差 ppSumError += Error。 // 积分 dError = ppLastError ppPrevError。 // 当前微分 ppPrevError = ppLastError。 ppLastError = Error。 return (ppProportion * Error//比例 + ppIntegral * ppSumError //积分项 + ppDerivative * dError)。 // 微分项 } /*********************************************************** 温度比较处理子程序 ***********************************************************/ pare_temper() { unsigned char i。 //EA=0。 if(set_tempertemper) { if(set_tempertemper1) { high_time=100。 low_time=0。 } else { for(i=0。 i10。 i++) { get_temper()。 rin = s。 // Read Input rout = PIDCalc ( amp。 spid,rin )。 // Perform PID Interation } if (high_time=100) high_time=(unsigned char)(rout/800)。 else high_time=100。 low_time= (100high_time)。 武汉理工大学《微型计算机控制技术》课程设计说明书 11 } } else if(set_temper=temper) { if(temperset_temper0) { high_time=0。 low_time=100。 } else { for(i=0。 i10。 i++) { get_temper()。 rin = s。 // Read Input rout = PIDCalc ( amp。 spid,rin )。 // Perform PID Interation } if (high_time100) high_time=(unsigned char)(rout/10000)。 else high_time=0。 low_time= (100high_time)。 //EA=1。 } } } 武汉理工大学《微型计算机控制技术》课程设计说明书 12 心得体会 最初拿到这个题目时觉得非常容易,因为涉及到 51 单片机,我觉得相比其他题目还是比较容易的,但是当我仔细阅读题目,看题目要求时发现对控制的要求非常多。 于是我跑到图书馆查阅相关资料,又参考我手中的单片机课本,以及我的计控课本,渐渐的整理了一些思路。 总之,完成这个课设是非常艰难的,因为对于一些知识的缺乏而且缺乏实战经验,最后纠结了很久才把仿真这个大难题 攻克。 对于我这次的课程设计,在硬件上我用了 AT89C52 加上集成温度传感器 DS18B 20以及键盘数码管等外设搭建,硬件电路相对来说比较容易,因为使用集成温度传感器比较省事,而且只占用了一个 IO 口,然后其它模块 都是比较常见的模块,所以连接也相对简单。 但是在软件编程方面我就遇到了很。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。