基于labview串口的现场实时多通道温度采集测量与实现本科学位论

2019-05-17 16:36

摘 要

温度是机械加工中最基本的参数之一,在生产过程中常需要对温度进行检测和监控。数控机床加工中,常需要对数控机床进行热误差计算并实现热误差补偿,通过热误差补偿技术来达到提高数控机床加工精度的目的。因此,研究一种基于串行通信的多路温度采集和实时监控系统,对提高工业控制性能、提高数控机床的加工精度以及提高生产效率有着重要的意义。

本文设计了一种数控机床多点温度采集电路,可以同时对四路温度进行实时的采集和显示,通过设定温度的报警范围对其进行预警,并且利用串口实现单片机和计算机的通信,使用上位机完成数据处理和温度的显示等。温度的测量精度低于0.5℃。

设计中使用STC89C52作为下位机的主控芯片,并使用LCD1602液晶屏进行温度的显示,采用温度传感器TC1047进行温度采集。将温度传感器输出的电压通过RC滤波电路以及运放OP07组成的放大电路,然后通过A/D转换,最后将A/D转换的数字量通过RS232串口发送到LABVIEW编写的上位机进行数据处理和显示。通过上位机设置温度的采集速率以及设定报警温度上限,将采集到的数据以TXT或XLS格式存储到电脑中。

硬件电路采用低成本的设计思想,软件设计采用模块化的设计方法,最后进行实物的制作和调试,验证了设计的设计稳定性和可行性,实现了设计的预期结果。

关键词:串口通信;LABVIEW;数控机床;热误差;多通道温度采集

Abstract

Temperature is one of the most basic parameters in the machining and temperature detection and monitoring is commonly found in the production. In CNC machining, thermal error of CNC machine need to be calculated, and thermal error compensation is implemented. Through the thermal error compensation techniques to achieve the purpose of the improvement of precision CNC machining. So the study of a multi-channel temperature acquisition and real-time monitoring system based on serial communication has an important significance to improve the performance of industrial control and production efficiency.

This article design a multi-channel temperature acquisition circuit of CNC machine. It can acquire four channel temperature data at the same time, also the display of these data is real-time. The method also can set temperature alarming range and if the data exceed the range the system will warn. And using the serial port to realize the single chip microcomputer and computer communication, using upper computer to complete data processing and display of temperature, etc. Temperature measuring precision less than 0.5 ℃.

STC89C52 is the main control chip of the design, and LCD1602 is used to display the temperature value, and temperature sensor TC1047 is used for temperature acquisition. Temperature sensor output voltage will by RC filter circuit and amplifier circuit which is composed of operational amplifier OP07, and then through the A/D conversion .finally, through the RS232 serial port sent the digital quantity to upper computer for data processing and display, and the upper computer is wrote by LABVIEW. Can set the temperature data acquisition rate, and can set temperature limit through upper computer, and the collected data can be stored your computer in TXT or XLS format.

The design of hardware circuit is based on stable, viable, low-cost design ideas. And the design of software uses modular method. And finally by finishing and debugging of the circuit, we verify the feasibility of the design and also we achieve to the expected results of the design.

Keywords: serial communication; LABVIEW; CNC machine; thermal error;

multi-channel temperature acquisition

目 录

引言 ........................................................... 1 1 系统综述 .................................................... 2

1.1 方案论证与选择 ........................................................ 2 1.2 系统整体框图 .......................................................... 3

2 硬件电路设计 ................................................ 4

2.1 51单片机主控电路 ..................................................... 4 2.1.1 单片机主控电路设计 .................................................. 4 2.1.2 C51程序语言 ........................................................ 5 2.2 TC1047温度采集电路 ................................................... 5 2.3 RC低通滤波电路 ....................................................... 6 2.4 OP07放大电路 ......................................................... 7 2.5 A/D转换电路 .......................................................... 8 2.6 LCD1602显示电路 ...................................................... 9 2.7 串口通信电路 ......................................................... 10 2.8 电源稳压电路 ......................................................... 11

3 下位机软件设计 ............................................. 12

3.1 主程序框架 ........................................................... 12 3.2 ADC0832驱动程序 ..................................................... 13 3.3 LCD1602显示驱动程序 ................................................. 15 3.4 串口通信程序 ......................................................... 17

4 上位机软件设计 ............................................. 18

4.1 上位机人机交互界面设计 ............................................... 18 4.2 上位机程序框图设计 ................................................... 19 4.2.1 主程序框图设计 ..................................................... 19 4.3.2 LABVIEW串口程序设计 ............................................... 20 4.3.3 串口数据帧解码 ..................................................... 21 4.3.4 数据处理和显示 ..................................................... 22 4.3.5 数据的存储和读取 ................................................... 23 4.3.6 采集速率和温度报警 ................................................. 24

5 原理图电路仿真 ............................................. 25 6 实物的组装调试及软件验证 ................................... 27

6.1 实物的制作流程 ....................................................... 27 6.2 硬件调试及软件验证 ................................................... 28

6.2.1 电源电路测试 ....................................................... 28 6.2.2 LCD1602显示测试 ................................................... 28 6.2.3 放大电路测试 ....................................................... 28 6.2.4 A/D转换测试 ....................................................... 29 6.2.5 下位机串口通信测试 ................................................. 29 6.2.6 上位机串口通信测试 ................................................. 29 6.2.7 下位机与上位机整体功能测试 ......................................... 29 6.3 数据测量及误差分析 ................................................... 30 6.3.1 温度传感器标定 ..................................................... 30 6.3.2 数据的测量 ......................................................... 34 6.3.3 误差计算及分析 ..................................................... 36 6.4 软硬件调试综述 ....................................................... 37

7 结论 ....................................................... 38

7.1 系统功能 ............................................................. 38 7.2 功能扩展 ............................................................. 38 7.3 前景展望 ............................................................. 39

谢 辞 ........................................................ 40 参考文献 ...................................................... 41 附录一 电路设计原理图 ........................................ 42 附录二 电路设计PCB图 ........................................ 43 附录三 电路设计实物图 ........................................ 43 附录四 上位机实时数据采集界面图 .............................. 44 附录五 上位机历史数据读取界面图 .............................. 45

桂林电子科技大学毕业设计(论文)报告用纸 第 1 页 共 45 页

引言

随着科学技术的不断发展,对现代设备精确度的要求不断增长,信息采集(即传感器技术)、信息传输(通信技术)和信息处理(计算机技术)为信息技术的前沿尖端技术,其应用非常广泛,已经渗透到社会的每一个领域[1-3]。

数据采集是指将温度、压力、流量、位移等物理量转换成数字量后,再由计算机进行存储、处理、显示或者打印的过程。在生产过程中应用数据采集,可对生产现场的工艺参数进行采集、监视和记录,为提高产品质量、降低成本提供信息和手段。

数控机床在加工过程中,热误差是因温度上升引起的加工误差。据统计,在精密加工和超精密加工中,由于热变形引起的加工误差占总加工误差的50%~70%[4-5]。目前,有两类方法可以用来减小机床的热误差。一是通过改进机床结构设计方法,直接减小热误差,但是会大大提高成本。二是通过建立热误差模型进行补偿的方法[15-16]。

LABVIEW软件是NI公司开发用于测控领域的图形化开发环境,它在数据采集、仪器控制、测量分析和数据显示方面有着明显的优势而得到广泛的应用[14]。它是一种方便的人机界面软件,其编程的方式相比于VC等比较复杂的上位机编程软件来说更加的简单和有针对性。利用NI的LABVIEW软件和数据采集卡可以实现数据的采集、存储、分析处理。或者通过其它接口可以很容易地将采集到的数据发送到LABVIE编写的上位机。

设计的主要目的和任务是,在生产车间中对数控机床的主要部件进行实时多点温度采集,采集硬件电路主要包括:温度传感器,放大滤波,A/D转换,下位机控制,串口通信等功能;采集通道数>=4,采集温度精度:0.5度,温度范围:0~40度。上位机对采集的温度数据进行受热分析,并显示温度随时间的变化趋势,并对加工的热变形误差进行计算和补偿。


基于labview串口的现场实时多通道温度采集测量与实现本科学位论.doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:广告策划书作业

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: