南京航空航天大学
硕士学位论文
数控机床状态数据实时采集与监视系统的研究开发
姓名:肖士利
申请学位级别:硕士
专业:机械电子工程
指导教师:叶文华
20080501南京航空航天大学硕士学位论文
I摘 要
生产现场信息的实时采集、传输、处理和分析是现代制造企业进行快速决
策与响应的基础。随着制造自动化和企业信息化的发展,企业对自动采集制造
信息的需求越来越强烈,但常常因数控机床的多样性、异构性以及数控系统不
开放,使得企业难以实时采集数控机床的现场数据。因此,研究数控机床状态
数据的采集具有重要的现实意义。
论文首先从信息采集的角度分析了数控机床的机床本体、PLC和CNC之间
关系,研究了基于数控机床标准通信接口、基于机床PLC、基于机床电气电路
三种数据采集方法的实现技术与优缺点。然后,详细研究了一种基于机床电气
电路进行机床数据采集的实现技术——基于外接PLC的采集方法,分析了该方
法的实现过程,研究了可从不同OPC服务器读取数据的通用OPC客户端。
在此基础上,设计了具有基于数控机床串口和基于外接PLC两种采集功能
的机床数据采集与监视系统(NC-SCADA)总体结构,研究了系统实现的若干
关键技术,开发与实现了NC-SCADA系统,并在马钢车轮公司的数控生产线上
得到成功应用。该系统具有通用、可扩展和可重用的特点。
最后,对全文进行总结,并对进一步工作进行了展望。
关键词:数控机床,数据实时采集,OPC,电气电路,宏指令,可编程逻辑控制
器 数控机床状态数据实时采集与监视系统的研究开发
IIABSTRACT
The real-time acquisition, transmission, processing and analysis of shopfloor
field data are the foundation of rapid decision-making and response in modern
manufacturing enterprises. With the development of manufacture automation and
enterprise information, the requirement of automatically collecting production
information becomes more and more intense for enterprises. However, the variety,
heterogeneity and the closed CNC system of NC machine tools make it difficult for
enterprises to automatically collect information at manufacturing spots. Therefore, it
will be very meaningful to study the data acquisition of NC machine tool.
In this paper, the relations between main body, PLC and CNC of NC machine
tool in the perspective of information collecting are analyzed, and the realization
technology and the advantages and disadvantages of the three collecting methods are
researched, which are basing on standard communication interface、PLC、electrical
circuit of NC machine tools. Then one realization technology, the method based on
external PLC, which is based on the electrical circuit of NC machine tools is studied
in detail, the process realizing data real-time acquisition of processing states of NC
machine tools by this technique is analyzed, and general OPC client reading data
from different OPC server is researched.
Basing on this research, the general structure of Data Real-Time Acquisition and
Supervision System of NC Machine Tool (NC-SCADA) is designed in this paper,
which has two collecting function including the methods based on RS232 serial and
external PLC. Several key techniques in realizing the system are studied, and the
NC-SCADA system is developed, which was applied successfully on the production
line in Wheel and Tyre Plant of Maanshan Iron & Steel Co. Ltd. This system has
characteristics of universality, expansibility and reusability.
Finally, the whole paper is summed up and further work is looked forwared as
well.
Key Words: NC machine tool, Data Real-Time Acquisition, OPC, Electrical
Circuit, Macroinstruction, PLC 南京航空航天大学硕士学位论文
V
图 清 单
图1.1 集中采集集中控制方式...................................................................................3
图1.2 分布采集集中控制方式...................................................................................3
图2.1 数控系统的组成...............................................................................................9
图2.2 PLC、CNC和数控机床本体间的信号关系..................................................12
图2.3 PLC输入信号图示..........................................................................................16
图2.4 PLC输出信号图示..........................................................................................16
图2.5 直流输入信号典型电路.................................................................................18
图2.6 直流输出信号接口.........................................................................................18
图2.7 负载为指示灯的信号输出电路.....................................................................19
图2.8 负载为继电器线圈的信号输出电路.............................................................19
图2.9 NC-SCADA系统的总体设计.........................................................................22
图3.1 主轴正转控制梯形图.....................................................................................28
图3.2 中间电路.........................................................................................................29
图3.3 主轴电机.........................................................................................................29
图3.4 润滑系统电气控制原理图.............................................................................30
图3.5 润滑系统的的PLC控制梯形图....................................................................31
图3.6 OPC接口访问方式..........................................................................................33
图3.7 服务器、组、对象三者之间的关系.............................................................34
图3.8 OPC连接图......................................................................................................35
图3.9 SQL Server 2000和Oracle数据库写入数据性能比较.................................37
图3.10 三种方法的性能特性比较...........................................................................39
图4.1 基于外接PLC的数据采集方法的总体结构图............................................45
图4.2 PLC的现场组态..............................................................................................46
图4.3 DI16数字输入模块地址.................................................................................46
图4.4 数控机床继电器接线原理图.........................................................................47
图4.5 OPC服务器内部结构图..................................................................................48
图4.6 OPC服务器Item对象与数据源的关联........................................................49
图4.7 本地PC机和远程PC机之间的客户端和服务器基于COM的连接........51
图4.8 客户端程序工作流程.....................................................................................52