当前位置:文档之家› 基于BECKHOFF+TwinCAT的开放式数控系统软件开发

基于BECKHOFF+TwinCAT的开放式数控系统软件开发

硕士学位论文基于BECKHOFF TwinCAT的开放式数控系统软件开发RESEARCH ON THE SOFTWARE OF OPEN CNC SYSTEM BASED ONBECKHOFF TWINCAT史小磊哈尔滨工业大学2011年6月国内图书分类号:TH164 学校代码:10213国际图书分类号:621 密级:公开工学硕士学位论文基于BECKHOFF TwinCAT的开放式数控系统软件开发硕士研究生:史小磊导 师:付云忠 副教授申请学位:工学硕士学科:机械制造及其自动化所在单位:机电工程学院答辩日期:2011年6月授予学位单位:哈尔滨工业大学Classified Index:TH164 School code:10213 U.D.C:621 Classification:publicityDissertation for the Master Degree in EngineeringRESEARCH ON THE SOFTWARE OF OPEN CNC SYSTEM BASED ONBECKHOFF TWINCATCandidate:Shi XiaoleiSupervisor:Fu YunzhongAcademic Degree Applied for:Master of Engineering Speciality:Mechanical Manufacturing andAutomationAffiliation:School of Mechatronics Engineering Date of Defence:June, 2011Degree-Conferring-Institution:Harbin Institute of Technology哈尔滨工业大学工学硕士学位论文摘要开放式数控系统以其开放化、通用性以及彼此兼容等特点,解决了传统数控系统封闭性的问题,很好地适应了现代制造业中小批量生产的需求,已经成为现代数控系统发展的重要方向。

本文分析了基于PC的开放式数控系统的三种基本结构形式,并结合当前实验室的条件,采用了“PC+运动控制器”的结构方案。

运动控制器采用德国BECKHOFF嵌入式计算机及其组件,在硬件结构基础上进行开放式数控系统软件开发。

根据对实时性要求的不同,开放式数控软件可划分为两部分:上位机软件和下位机软件。

下位机软件部分实时性较强,实现实时控制功能,也称下位机控制软件,主要在TwinCAT环境下开发,包括模式选择模块、程序预处理模块、译码模块以及插补运算模块等。

模式选择模块为本次软件开发的核心,根据需要共设计三种运行模式:自动插补模式、MDI模式和点动模式。

上位机软件部分实时性较弱,主要完成非实时控制功能,也成上位机管理软件,主要是利用VC++软件开发,包括初始化模块、程序编辑模块及通讯模块等。

初始化模块主要负责完成通讯端口及通讯参数的初始化;程序编辑模块主要完成程序的编写、存储及下载等功能;通讯模块则借助于添加的动态链接库TcAdsDll 实现与下位机软件实时通讯。

软件开发基本完成后,可在TwinCAT System Manager提供的虚拟运行环境下进行测试,对不合理之处进行修改。

由于虚拟环境与实际运行环境有一定偏差,因此有必要进行实验验证。

实验部分主要是验证开放式数控软件的运动控制功能和轨迹控制功能,判断软件是否能够执行基本的插补控制。

虚拟运行测试与实验相结合,共同验证软件控制的可行性。

关键词:开放式数控系统;上位机软件;下位机软件;TwinCAT;轨迹控制- I -哈尔滨工业大学工学硕士学位论文AbstractWith the characteristic of opening, universal and compatible with each other, the open CNC system has solved the closed issues of traditional CNC system, well adapted to the needs of medium and small batch in modern manufacturing and become an important direction of modern CNC system.This paper analyzed three basic structural forms of the open CNC system based on PC, and used the structure of “PC + the motion controller”. The software development of open CNC system was carried out based on Motion controller and other hardware components, which were Germany BECKHOFF embedded computer. According to the different requirements of real-time, the software of open CNC system can be divided into two parts: the PC software and the lower position machine software.The lower position machine software, also known as lower computer control software, had stronger real-time, achieved the real-time control functions and was developed by TwinCAT PLC. It consisted of the operation selection module, program preprocessing module, decoding module and interpolation operations module. The operation selection module was the core of software development, and was designed to three modes: Automatic interpolation mode, MDI mode and Jog mode.The PC software, also known as PC management software, had weaker real-time and mainly completed non-real-time control function. It was developed by VC++ software, which included the initialization module, program editing module and communication module. The initialization module mainly accomplished initialization of communication port and parameters. Program editing module achieved the programing, storage and downloading functions. Communication module completed communication function with lower software by adding the dynamic link library TcAdsDll.After the completion of software development, it can be tested in a virtual operating environment provided by TwinCAT System Manager and modified for unreasonable functions. As the deviation between the virtual environment and the actual operating environment, it was necessary to take experiments. The experiment mainly verified motion control function and trajectory control function of open CNC software, to determine whether the software can perform basic interpolation control. Virtual operation test and experiment were combined for verifying the feasibility of the software control.Keywords:open CNC system, the PC software, the lower position machine software, TwinCAT, trajectory control- II -哈尔滨工业大学工学硕士学位论文目录摘要 (I)Abstract (II)第1章绪论 (1)1.1 课题背景 (1)1.1.1 开放式数控系统的产生背景 (1)1.1.2 开放式数控系统的优势 (2)1.2 开放式数控系统的研究现状及发展趋势 (2)1.2.1 数控系统的发展历程 (2)1.2.2 开放式数控系统的研究现状 (3)1.2.3 开放式数控系统的发展趋势 (5)1.3 开放式数控系统体系结构的划分 (6)1.4 本文主要研究目的和研究内容 (7)第2章开放式数控软件开发的理论基础及总体设计 (9)2.1 开放式数控软件的功能要求 (9)2.2 开放式数控软件开发的总体思想 (9)2.2.1 软件开发的指导思想 (9)2.2.2 软件开发的基本原则 (10)2.3 基于TwinCAT环境的开放式数控软件开发的总体设计方案 (10)2.3.1 数控软件功能模块的划分 (10)2.3.2 基于TwinCAT环境的数控软件开发的设计方案 (11)2.4 本章小结 (13)第3章基于TwinCAT环境的下位机控制软件开发 (14)3.1 基于TwinCAT的下位机控制软件开发介绍 (14)3.1.1 下位机控制软件功能模块的划分 (14)3.1.2 下位机软件的开发平台 (15)3.2 基于TwinCAT的下位机软件基本功能开发 (17)3.2.1 自动插补模式开发 (17)- III -哈尔滨工业大学工学硕士学位论文3.2.2 MDI模式开发 (19)3.2.3 点动模式开发 (21)3.2.4 辅助控制功能开发 (23)3.3 基于TwinCAT的译码模块的功能完善 (24)3.3.1 译码模块介绍 (24)3.3.2 译码模块功能补充 (25)3.4 基于TwinCAT的下位机软件虚拟测试 (28)3.4.1 下位机软件虚拟运行环境的配置 (28)3.4.2 下位机控制软件运行调试 (29)3.5 本章小结 (30)第4章基于VC++的上位机管理软件开发 (31)4.1 基于VC++的上位机软件开发介绍 (31)4.1.1 上位机管理软件功能模块的划分 (31)4.1.2 上位机管理软件的开发工具 (32)4.2 VC++与TwinCAT自动化软件通讯接口的实现 (33)4.2.1 专用接口文件 (33)4.2.2 通讯接口实现 (33)4.3 基于VC++的上位机管理软件核心模块开发 (34)4.3.1 初始化模块开发 (34)4.3.2 上位机管理软件功能模块开发 (35)4.4 基于VC++的上位机软件运行调试 (36)4.4.1 上位机软件功能测试 (36)4.4.2 测试结果分析 (38)4.5 本章小结 (39)第5章基于TwinCAT的开放式数控软件实验研究 (40)5.1 实验方案 (40)5.2 运动控制实验 (40)5.2.1 实验硬件组件 (40)5.2.2 运动控制验证 (43)5.3 轨迹控制实验 (45)5.3.1 轨迹控制的实验设计 (45)- IV -哈尔滨工业大学工学硕士学位论文5.3.2 数据采集程序的设计 (46)5.3.3 数据采集与处理 (46)5.3.4 实验结果分析 (50)5.4 本章小结 (50)结论 (51)参考文献 (52)哈尔滨工业大学学位论文原创性声明及使用授权说明 (55)致谢 (56)- V -哈尔滨工业大学工学硕士学位论文第1章绪论1.1课题背景1.1.1开放式数控系统的产生背景随着制造业的不断发展,中小批量生产在现代生产中所占的比重不断上升,这就对机床的通用性和柔性提出了很高的要求,希望机床实现配置灵活、功能扩展简单并且基于一致的规范要求,能够满足用户多样化的需求,针对不同产品能够实现多种加工工艺。

相关主题