硕士学位论文
基于BECKHOFF TwinCAT的开放式
数控系统软件开发
RESEARCH ON THE SOFTWARE OF OPEN CNC SYSTEM BASED ON
BECKHOFF TWINCAT
史小磊
哈尔滨工业大学
2011年6月
国内图书分类号:TH164                              学校代码:10213国际图书分类号:621                                    密级:公开
工学硕士学位论文
基于BECKHOFF TwinCAT的开放式
数控系统软件开发
硕士研究生:史小磊
导        师:付云忠 副教授
申请学位:工学硕士
学科:机械制造及其自动化
所在单位:机电工程学院
答辩日期:2011年6月
授予学位单位:哈尔滨工业大学
Classified Index:TH164 School code:10213 U.D.C:621                                    Classification:publicity
Dissertation for the Master Degree in Engineering
RESEARCH ON THE SOFTWARE OF OPEN CNC SYSTEM BASED ON
上位机软件开发培训
BECKHOFF TWINCAT
Candidate:Shi Xiaolei
Supervisor:Fu Yunzhong
Academic Degree Applied for:Master of Engineering Speciality:Mechanical Manufacturing and
Automation
Affiliation:School of Mechatronics Engineering Date of Defence:June, 2011
Degree-Conferring-Institution:Harbin Institute of Technology
哈尔滨工业大学工学硕士学位论文
摘要
开放式数控系统以其开放化、通用性以及彼此兼容等特点,解决了传统数控系统封闭性的问题,很好地适应了现代制造业中小批量生产的需求,已经成为现代数控系统发展的重要方向。
本文分析了基于PC的开放式数控系统的三种基本结构形式,并结合当前实验室的条件,采用了“PC+运动控制器”的结构方案。运动控制器采用德国BECKHOFF嵌入式计算机及其组件,在硬件结构基础上进行开放式数控系统软件开发。根据对实时性要求的不同,开放式数控软件可划分为两部分:上位机软件和下位机软件。
下位机软件部分实时性较强,实现实时控制功能,也称下位机控制软件,主要在TwinCAT环境下开发,包括模式选择模块、程序预处理模块、译码模块以及插补运算模块等。模式选择模块为本次软件开发的核心,根据需要共设计三种运行模式:自动插补模式、MDI模式和点动模式。
上位机软件部分实时性较弱,主要完成非实时控制功能,也成上位机管理软件,主要是利用VC++软件开发,包括初始化模块、程序编辑模块及通讯模块等。初始化模块主要负责完成通讯端口及通讯参数的初始化;程序编辑模块主要完成程序的编写、存储及下载等功能;通讯模块则借助于添加的动态链接库TcAdsDll 实现与下位机软件实时通讯。
软件开发基本完成后,可在TwinCAT System Manager提供的虚拟运行环境下进行测试,对不合理之处进行修改。由于虚拟环境与实际运行环境有一定偏差,因此有必要进行实验验证。实验部分主要是验证开放式数控软件的运动控制功能和轨迹控制功能,判断软件是否能够执行基本的插补控制。虚拟运行测试与实验相结合,共同验证软件控制的可行性。
关键词:开放式数控系统;上位机软件;下位机软件;TwinCAT;轨迹控制
- I -
哈尔滨工业大学工学硕士学位论文
Abstract
With 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 -