盐城工学院毕业设计摘要在控制领域中,经常需要进行各种位移量的测量。在实际的工业位置控制领域中,为了提高控制精度,准确地对控制对象进行检测是十分重要的。传统的机械测量位移装置已远远不能满足现代生产的需要,而数字式传感器光电编码器,能将角位移量转换为与之对应的电脉冲输出,主要用于机械位置和旋转速度的检测,具有精度高,体积小等特点,因此本设计决定采用光电编码器进行位移检测。本设计为采用光电编码器来实现位移测量及其仿真,实现测量来自外部的不同的位移值及显示。具体应用AT89C51单片机为核心,光电编码器进行位移测量,同时以LCD液晶显示模块显示。本设计采用的光电编码器输出电压为5V,输出信号经四倍频电路处理后送入单片机进行计数处理,最后送入LCD模块显示。本文从位移测量原理入手,详细阐述了位移测量系统的工作过程,以及硬件电路的设计、显示效果。本文吸收了硬件软件化的思想,实现了题目要求的功能。关键词:位移测量,光电编码器,单片机,LCD显示模块盐城工学院毕业设计AbstractInthecontrolfield,avarietyofdisplacementmeasurementsoftenneedtobecarriedout.Inactualindustrypositioncontroldomain,toincreasethecontrolprecision,carriesontheexaminationtothecontrolledmemberisaccuratelyveryimportant.Thetraditionalmachinerysurveydisplacementinstallshasnotbeenabletosatisfythemodernproductionbyfartheneed,butthedigitalsensorelectro-opticencoder,cantransformtheangulardisplacementintowithitcorrespondenceelectricitypulseoutput,mainlyusesinthemechanicalpositionandthevelocityofwhirlexamination,hastheprecisiontobehigh,volumesmallandsooncharacteristics,thereforethisdesigndecidedthatusestheelectro-opticalencodertocarryonthedisplacementtoexamine.Thisdesigntousetheelectro-opticalencodertorealizethedisplacementsurveyandthesimulation,realizesthesurveyfromtheexteriordifferentdisplacementvalueandthedemonstration.Makesconcreteusingat89C51monolithicintegratedcircuitisthecore,theelectro-opticalencodercarriesonthedisplacementtosurvey,simultaneouslybyLCDliquidcrystaldisplaymoduledemonstration.Thisdesignusestheelectro-opticalencoderoutputvoltageis5V,theoutputsignalafterfourdoublingcircuitprocessingsendsinthemonolithicintegratedcircuittocarryoncountingprocessing,finallysendsintheLCDmoduledemonstration.Inthispaper,detailedworkingprocessofdisplacementmeasurementsystemisstartedwithprincipleofdisplacementmeasurement,andhardwarecircuitdesignanddisplay.Thispaperhasabsorbedtheideaofhardwareandsoftwaretoachievewiththesubjectrequiredfunctionality.Keywords:Thedisplacementsurveys,electro-opticalencoder,microcontroller,LCDdisplaymodule盐城工学院毕业设计目录第一章绪论·················································1.1位移测量及其传感器简介··································1.2国内外位移测量技术简介··································第二章原理说明及方案选择···································2.1位移测量理论的简要介绍··································2.2方案选择及原理··········································2.2.1鉴相原理·············································2.2.2用软件实现脉冲的鉴相和计数···························2.2.3用硬件实现脉冲的鉴相和计数···························2.2.4用单片机内部计数器实现可逆计数·······················2.3位移测量参数及电路参数分析······························2.3.1MCS-51的定时器/计数器简介····························2.3.2定时器模式选择位·····································第三章系统电路的设计········································3.1硬件电路的设计···········································3.1.1单片机的选择·········································3.1.2AT89C51的介绍········································3.1.3光电编码器的选择·····································3.1.41XP8001-1简介········································3.2软件的设计···············································第四章显示部分···············································4.1LED显示器················································4.2LCD显示器················································4.2.1LCD的分类及特点······································4.2.1笔段式LCD液晶显示器的驱动·····························4.2.2LCD显示模块LCDM(LIQUIDCRYSTALDISPLAYMODULE)······4.3LCD显示器的驱动接口······································第五章仿真实现················································5.1PROTEUS仿真软件简介·······································5.2KEIL与PROYEUS的联合使用··································结论······························································谢辞······························································参考文献··························································附录一系统电路原理图············································附录二程序清单··················································附录三仿真电路图················································盐城工学院毕业设计第一章绪论1.1位移测量及其传感器简介位移是线位移和角位移的统称。位移测量在机械工程中应用很广,在机械工程中不仅经常要求精确地测量零部件的位移和位置,而且力、扭矩、速度、加速度、流量等许多参数的测量,也是以位移测量为基础的。位移是向量,除了确定其大小之外,还应确定其方向。一般情况下,应使测量方向与位移方向重合,这样才能真实地测量出位移量的大小。如测量方向和位移方向不重合,则测量结果仅是该位移在测量方向的分量。位移测量时,应当根据不同的测量对象,选择适当的测量点、测量方向和测量系统。位移测量系统是由位移传感器、相应的测量放大电路和终端显示装置组成。位移传感器的选择恰当与否,对测量精度影响很大,必须特别注意。针对位移测量的应用场合,可采用不同用途的位移传感器。表1.1-1中列出了较常见的位移传感器的主要特点和使用性能。表1.1-1常用位移传感器一览表型式测量范围精确度直线性特点电阻式滑线式线位移1~300mm±0.1%±0.1%分辨力较好,可静态或动态测量。机械结构不牢固角位移0~360°±0.1%±0.1%变阻器式线位移1~1000mm±0.5%±0.5%结构牢固,寿命长,但分辨力差,电噪声大角位移0~60r±0.5%±0.5%应变式非粘贴的±0.15%应变±0.1%±1%不牢固粘贴的±0.3%应变±2%~3%使用方便,需温度补偿半导体的±0.25%应变±2%~3%满刻度±20%输出幅值大,温度灵敏性高电感式自感式变气隙型±0.2mm±1%±3%只宜用于微小位移测量螺管型1.5~2mm测量范围较前者宽,使用方便可靠,动态性能较差特大型300~2000mm0.15%~1%差动变压器±0.08~75mm±0.5%±0.5%分辨力好,受到磁场干扰时需屏蔽盐城工学院毕业设计涡电流式±2.5~±250mm±1%~3%<3%分辨力好,受被测物体材料、形状、加工质量影响同步机360°±0.1°~±7°±0.5%可在1200r/min转速工作,坚固,对温度和湿度不敏感微动同步器±10°±1%±0.05%非线性误差与变压比和测量范围有关旋转变压器±60°±0.1%电容式变面积10-3~103mm±0.005%±1%受介电常数因环境温度、湿度而变化的影响变间距10-3~10mm0.1%分辨力很好,但测量范围很小,只能在小范围内近似地保存线性霍尔元件±1.5mm0.5%结构简单,动态特性好感应同步器直线式10-3~104mm2.5μm~250mm模拟和数字混合测量系统,数字显示(直线式感应同步器的分辨力可达1μm)旋转式0o~360°±0.5°计量光栅长光栅10-3~103mm3μm~1m同上(长光栅分辨