




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、附录1 外文翻译-原文部分DXF File Identification with C# for CNC Engraving Machine SystemHuibin Yang, Juan YanAbstractThis paper researches the main technology of open CNC engraving machine,the DXF identification technology. Agraphic information extraction method is proposed. By this method,the graphic informat
2、ion in DXF file can be identified and transformed into bottom motion controllers code. So the engraving machine can achieve trajectory tracking. Then the open CNC engraving machine system is developed with C#. At last, the method is validated on a three axes motion experiment platform. The result sh
3、ows that this method can efficiently identify the graphic information including line, circle, arc etc. in DXF file and the CNC engraving machine can be controlled well. Keywords DXF, CNC Engraving Machine , GALIL,C#1. IntroductionWith the development of pattern recognition techniques, modern CNC eng
4、raving machine neednt be programmed manually. By importing graphics file, the corresponding shape will be engraved by the machine immediately. The operating process of the machine is simplified enormously, and the rich programming knowledge is no longer need for operators. Among them, DXF identifica
5、tion is a key technology of CNC engraving machine. By reading and recognition of the DXF file, the machining track can be directly generated, so the motion control of the CNC engraving machine can be achieved. 2. Research StatusResearchers have done a lot of researches on how to contact CAD software
6、 to NC code. Omirou and Barouniproposed a series of machine codes, with which the advanced programming ability is integrated into the control of modern CNC milling machine system 1. Kovacic and Brezocnik proposed the concept of which using the genetic algorithm to program the CNC machine based on th
7、e CAD model under manufacturing environment 2.But some problems are still existed in this kind of CNC programming (such as the artificial participation degree is higher and the efficiency is lower). The research direction of Chinese researchers mainly includes two aspects. One is the theoretical stu
8、dy of DXF file and NC machining, the other is the application of DXF file reading. ZhaiRui and Zhang Liang proposed a program structure, which is used to read data information of DXF file and do some preprocess based on the cross platform open source library DXF Lib by the analysis of DXF file struc
9、ture characteristic 3. Huang Jieqiong and Yuan Qun wrote the interface program to read the stored parts graphic information in DXF file by use of the object-oriented secondary development tools, Object ARX and C+, in the research of stamping parts machining. The stamping parts geometric model is aut
10、omatically created by the automatic generation algorithm of closed contour 4.3. DXF File and Graphic Information Extraction3.1. DXF FileDXF (Drawing Exchange File) is a representation of all information labeled data contained in the AutoCAD graphics file, and the ASCII or binary file format of AutoC
11、AD file. It can be used as input/output interface and graphics file exchange between AutoCAD and other graphics applications 5.A complete DXF file is composed of six segments called SECTION. These segments were HEADER,CLASSES, TABLES, BLOCKS, ENTITIES and file ending character (group code is 0,group
12、 value is EOF) 3.2. Graphic Information Extraction MethodIn order to extract useful information of the graphic, many parts in the file can be ignored. The corresponding geometric description can be completed as long as the sections of TABLES,BLOCK, ENTITIES are obtained. Each graphic element in the
13、DXF file are stored with a fixed format, so it is convenient for data exchange, and also called its readability. The characteristics of each individual graphic element in DXF file is described by the parameter (group) consisted by paired group code and group value. Therefore, according to the target
14、 of open CNC engraving machine, it is enough to describe the target geometry contour by reading the ENTITIES section in DXF files only. The particular identification process is: First search the DXF file until the “ENTITLES” is found, then build a graphic element object. Then search the graphic elem
15、ent type (LINE, CIRCLE, ARC),and search the corresponding value followed by the group code. For example, if the program has found the ENTITLES section and confirm the first graphic element is LINE (The program found “LINE” after “ENTITLES”). Then it will search the group code which represents the pa
16、rameters of the line. The number at the next line after the group code is the value of the parameter.(e.g. The number at the next line after “10” represent the X value of start point of this line, and “20” for Y value of start point,“11” for X value of end point,“21” for Y value of end point, etc.).
17、 Table 1 shows an example of an ENTITIES section. Table 1 shows an example of an ENTITIES section. By getting these parameters and values, system then “sees” the graph and “knows” the specific parameters of the graph which is drew by AutoCAD. Figure 1 is the flow diagram of extraction of graphic inf
18、ormation. Table 1 shows an example of an ENTITIES section.3.3. C# Realization of Graphic Information Extraction In order to store the graph data, the convenient method is to store numeric variables by using array, and it is also very convenient for call and assignment operation. First define a 2D ar
19、ray: si,j (i <= 100,j <= 20),define a 100 lines and 20 lows array at initialization, in which, every line i stores a graphic element, every element j in a line stands for the value after the group code. The format and meaning are shown in Table 2 Then, the graphic element storage state is si,0
20、,si,1,si,15 (I = 0,1,2,).The advantage of this design is: For each graphic element, all the geometric elements associated with the trajectory can be stored in an array variable space which has a fixed serial number. It is convenient and not easy to make mistakes in the calculation or logical judgmen
21、t. But to any entire graphics trajectory, the number of lines or curves is not consistent, so it is important to apply for enough variable memory space to adapt to different requirements of graphics trajectory. Part of the C# program of reading arc graphic element in DXF are as follows:doLine = mysr
22、. ReadLine ();if (Line = “ENTITIES”)if (Line = “10”)Line = mysr.ReadLine();string m;m = Line;double n;n = Convert.ToDouble(m);si,j = n;j+; while (Line! = null)4. Graphics Trajectory GenerationTo open CNC engraving machine,the key point is how to convert the graphic element information in DXF file in
23、to motion controller code, so as to control the machines motion according to the machining trajectory.4.1. DXF Analysis PrincipleThe so-called DXF analysis is the standardization of each graphic element which has been read in order to according with the standard instructions of motion controller. Co
24、nsidering the basic type of graphic element is line, circle or arc, the standardization requirements of different graphic element type are different. The specific principles are as follows:1) LINELine has only start and end point coordinate. the actual useful memory space is si,0,si,1,si,6,other par
25、ts are all zero.2) ARCAs the format of arc in the DXF is include the center coordinates value, radius, start angle and end angle. So the center coordinates value, radius, start angle and end angle can be recognized and stored in si,7,si,8,si,12 .But for the GALIL DMC2143 motion controller which is u
26、sed in the open CNC engraving machine,the arc instruction requires start and end point coordinate and rotation angle of the arc. So, the analysis of arc includes two aspects: a) Calculate the start and end point coordinate. b) Calculate the rotation angle and store in s i,15.3) CIRCLEBecause the rot
27、ation angle of circle is 360,it can be set as a fixed value. For the sake of convenience, the starting position of circle is set to the left or right quadrantal points.4.2. DXF Analysis MethodAccording to 3.1, the difficulty of graphic element analysis is arc. Although the information in DXF file ca
28、n confirm geometry feature, for the track sequencing, the start and end point coordinates are needed; and for the motion controller programs, it also need to change the format for direct connection. By four elements of center, radius, start angle and end angle as well as simple trigonometric functio
29、n calculation, the start and end point position as well as the rotation angle of the arc can be determined. For example, if center of the arc is o(x0,y0),radius is r, start angle is (0 < < 90) and end angle is (0 < < 90),according to the parametric equation of the circle, the start point
30、 a(x1,y1),end point b(x2,y2),and rotation angle can be calculated using Equation (1) to Equation (3):5. Development of Open CNC Engraving Machine SystemThe hardware of the open CNC engraving machine system includes a motion controller and an upper computer (PC). The real-time control of the CNC engr
31、aving machine body is done by the motion controller. The main task of the motion controller is servo motor control and IO logic control. The PC runs The DXF analysis algorithm, Human-Machine Interface (HMI) and sends the motion control instructions got from the DXF analysis algorithm to the motion c
32、ontroller, so the engraving machine can be controlled. The software of the system includes PC program and motion controller program.5.1. PC ProgramThe PC program includes HMI and DXF analysis program running in the background. DXF analysis program are mainly programmed based on DXF analysis principl
33、es and methods on 3. 5.2. Program Design of Motion ControllerIn this design, the subprograms of linear and circular interpolation are programmed in GALIL motion controller. According to the results of DXF analysis in PC, call different subprogram in proper order and assign variable, the continuous t
34、racking trajectory can be realized. The linear interpolation program of GALIL motion controller is as follows:#LINEAR MT 2,2 VMAB VS 5000 VA 100000 VD 100000 VP X,Y VE BGS EN 6. Test Running ResultBy C#, the authors first finished the DXF file identification as well as the extraction and storage of
35、graphic element information. The graphic element ordering operations were also achieved. At last,the graphics trajectories were generated by calling the bottom GALIL software instructions and achieved motion tacking. The test was carried out on a three axes motion experiment platform, the carving cu
36、tter was replaced with pen. Pen was fixed on the experiment platform. The test used a trajectory graph drawn by AutoCAD. The final result shows that the developed open CNC engraving machine system can accurately complete the identification of DXF file, and the walk path is consistent with the CAD fi
37、le.References1 Omirou Sotiris,L. and Barouni Antigoni,K. (2005) Integration of New Programming Capabilities into a CNC Milling System. Robotics and Computer-Integrated Manufacturing,21,518-527./10.1016/j.rcim.2004.10.0022 Kovacic,M.,Brezocnik,M.,Pahole,I.,Balic,J. and Kecelj,B. (2005) Evoluti
38、onary Programming of CNC Machines. Journal of Materials Processing Technology,164-165,1379-1387./10.1016/j.jmatprotec.2005.02.0473 Zhai,R. and Zhang,L. (2011) Reading Frame Design Based on the DXF File Format. Fujian Computer,4,107-109.4 Huang,J.Q. and Yuan,Q. (2012) Automatic Input and Ident
39、ification for Stamping Graph Based on AutoCAD. Machinery Design & Manufacture,2,82-84.5 Bai,X.C. and Chen,Y.M. (2010) Automatic Programming of Bridge Cutting Machine Based on the DXF File. Equipment Manufacturing Technology,2,110-112.附录2 外文翻译-中文部分利用C#识别DXF文件的数控雕刻机系统Huibin Yang, Juan Yan摘要本文研究开放式
40、数控雕刻机的关键技术,即DXF识别技术。图形信息提取方法被提出。通过这种方法,在DXF文件中的图形信息可以被识别和转换为运动控制器底部的代码。因此,雕刻机可以实现轨迹跟踪。然后利用C#对放数控雕刻机系统进行开发,最后在一个三轴运动的实验平台上对这个方法进行验证。结果表明该方法可以有效地识别DXF文件中的线、圆、弧等图形信息,并且数控雕刻机可以被控制得很好。关键字:DXF;数控雕刻机;GALIL;C#1 介绍随着模式识别技术的发展,现代数控雕刻机不必手动编程。通过导入图形文件,相应的形状就会被雕刻机立即雕刻出来.极大的简化了雕刻机的操作过程,使得操作者不再需要丰富的编程知识。其中,DXF识别是数
41、控雕刻机的关键技术。通过阅读和识别DXF文件,可以直接生成加工轨迹,实现对数控雕刻机的运动控制。2 研究现状研究人员已经做了大量研究如何将CAD软件与NC代码联系起来。Omirou和Barouni提出一系列机器代码,通过先进的编程能力集成到现代数控铣床的控制系统中。Kovacic和 Brezocnik提出运用遗传算法去给基于CAD模型在制造环境下的数控机床编程的理论,但是用这种数控编程的方法也存在很多的问题(例如人工参与程度高但效率低)。中国研究人员的研究方向主要包括两个方面,一个是DXF文件和数控加工的理论研究,另一个是读取DXF文件的应用程序。翟睿和张良提出一个用于读取DXF文件的数据信息
42、和做一些基于跨平台开源库DXF的DXF文件结构特点分析的预处理的程序结构。黄洁琼和元群编写使用面向对象的二次开发工具来读取存储部分图形信息的DXF文件的接口程序,以ARX和C+为对象来研究冲压件的加工。冲压件的几何模型运用封闭轮廓的自动生成算法来自动创建。3 DXF文件和图形信息提取3.1 DXF文件DXF(图纸交换文件)表示所有的被标记的信息包含在AutoCAD的图形文件和ASCII或二进制格式文件中,它可以用作输入/输出接口和图形文件在AutoCAD和其他图形应用程序之间转换。一个完整的DXF文件由六个被称作SECTION的段组成,这六段分HEADER,CLASSES,TABLES,BLO
43、CKS, ENTITIES和文件结束字符(组代码为0,组值为EOF)。 DXF文件每一段的结构和含义如图1所示。记录块名称、当前层的名字、块类型、块插入基点和所有已经定义的块中的成员使用点、线、圆、弧,包括实体与块的关联数据来定义实际的3 D或2 D几何实体,这是DXF识别的主要部分。DXF识别的主要部分包括四个表。每个表包含一个数量可变的条目。根据这些表在文件出现的顺序,它们依次是线、表、层表、表字体样式和表视图。表、层表,表字体样式表和视图。它有时会忽略像标题部分。包括所有应用程序定义的类信息。大部分信息包含没有价值非CAD应用程序。非CAD应用程序记录在AutoCAD系统中所有的标题变量
44、的、当前值和当前状态。的大部分信息中包含没有价值的非CAD应用程序。非CAD应用程序没有价值图1 DXF文件结构3.2 图形信息提取方法为了提取图形中的有用信息,在文件中的许多地方可以忽略。只要获得了表、块、实体的部分就可以做出对应的几何描述。每个在DXF文件中的图形元素都被存储为一个固定的格式,所以它的数据交换非常的方便,这也被称为它的可读性。每个在DXF文件中的图形元素的特征用配对组代码和组值等参数来描述。因此,根据开放式数控雕刻机锁定目标,它足以通过读取DXF文件中的实体部分来描述目标的几何轮廓。其特定的识别过程是:首先搜索DXF文件,直到找到“ENTITLES”,然后构建一个图形元素对
45、象。然后搜索图形元素类型(线、圆、弧)和紧随其后的组织代码的值。例如,如果程序发现ENTITLES部分并确认第一个图形元素是LINE (程序发现“LINE”在“ENTITLES”之后)。然后它将搜索组代码代表的参数。组代码后下一行的数字就是参数的值。(如:下一行的数字“10”代表这一行的起始点的X值,“20”代表起始点的Y值,“11”代表这一行终点的X值,“21”代表这一行终点的Y值等)。表1为ENTITIES部分的一个例子。通过这些参数和值,系统就能 “看到”图形并“知道”所画的AutoCAD图的具体参数。表1 ENTITIES部分举例 DXF文件的部分 解释ENTITIES 段名称0 组代
46、码LINE 图形元素类型1050.0 起始点X的值20100.0 起始点Y的值300.0 起始点Z的值11350.0 终点X的值21500.0 终点Y的值310.0 终点Z的值0ENDSEC 段结束符3.3 C#实现图形信息提取为了存储图形数据,较为方便的方法是使用数组来存储数字变量,也便于调用和赋值操作。首先定义一个二维数组:si,j (i <= 100,j <= 20),定义一个100行和20个低点的初始化数组,每一行的i存储一个图形元素,在每一行的元素j代表组代码的值。格式各意义如表2。然后,图形元素存储状态是si,0,si,1,si,15 (I = 0,1,2,)。这种设计
47、的优点是:对于每一个图形元素,所有几何元素与轨迹可以存储在一个有固定的序列号的数组变量空间。在计算或逻辑判断时既方便又不容易犯错误。但对于整个图形轨迹,直线或曲线的数量并不一致,所以重要的是要有足够的变量内存空间来适应不同图形轨迹的需求。部分阅读DXF文件中的图形元素的C#程如:doLine = mysr. ReadLine ();if (Line = “ENTITIES”)if (Line = “10”)Line = mysr.ReadLine();string m;m = Line;double n;n = Convert.ToDouble(m);si,j = n;j+; while (L
48、ine! = null)表2 数据存储格式表数组变量的位置 数据的含义i, 0 属性标志:1代表线,2代表圆,3代表弧i, 1 起点的X轴坐标值i, 2 起点的Y轴坐标值 i, 3 起点的Z轴坐标值i, 4 终点的X轴坐标值i, 5 终点的Y轴坐标值i, 6 终点的Z轴坐标值i, 7 一个圆或弧的中心的X轴坐标值i, 8 一个圆或弧的中心的Y轴坐标值i, 9 一个圆或弧的中心的Z轴坐标值i, 10 一个圆或弧的半径值i, 11 弧的起始角i, 12 弧的终点角i, 13 后续数据识别序号的排序过程i, 14 给后续操作i, 15 给后续操作4 图形轨迹生成要使数控雕刻机运转起来,关键是如何把D
49、XF文件中的图形元素信息转化为运动控制器代码,以便根据运动轨迹来控制机器的运动。4.1 DXF分析原理所谓的DXF分析就是把每个已阅读的图形元素标准化为符合标准的运动控制器的指令。考虑图形元素的基本类型是线,圆形和弧形,不同类型的图形元素的标准化是不同的。具体原则如下:1) 线线只有开始和结束点坐标.实际有用的内存空间si,0,si,1,si,6,其他部分都是零。2) 弧在DXF中弧的格式包括中心坐标的值,半径,开始角度和结束角度。中心坐标的值,半径,起始角度和结束角可以识别和存储在si,7,si,8,si,12中。但对于用于开放式数控雕刻机的GALIL DMC2143运动控制器,弧指令需要开始和结束点的坐标和弧的旋转角度.所以弧的分析包括两个方面:1)计算开始和结束点坐标。2)计算旋转角度并存储在s i,15中。3) 循环因为圆的旋转角是360,它可以设置为一个固定值.为了方便,循环的起始位置设为左边或者右边的象限点。4.2 DXF分析方法根据3.1知,图形元素分析最困难的是弧。尽管DXF文件中的信息可以确定几何特性,跟
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 中级质量工程师综合知识精益企业模拟试题(附答案)
- 伦理委员会考核试题(附答案)
- 三级营销员模拟题库与答案
- 中外服装史知到智慧树答案
- 特殊药品培训试卷及答案
- 冷藏药品培训考试题及答案
- 2025年度房地产抵押贷款经纪服务协议
- 2025版土石方运输合同绿色运输能力评估合同
- 2025电梯保养服务与智能监控系统集成合同
- 2025版尿素原料采购及仓储物流服务合同
- 《液压与气动控制》课件
- 语言学概论-第三章-语义
- 2024-2025学年广东省深圳实验学校初中部九年级上学期开学考英语试题及答案
- 邮政快递员技能大赛理论考试题库(含答案)
- 《电动航空器电推进系统技术规范》
- 结肠造瘘还纳术手术配合
- 2024年山东省建筑施工企业主要负责人A类考试题库及答案(典型题)
- 特种设备目录新旧对照表
- 2024年初一英语阅读理解专项练习及答案
- 陪诊师与公司签订协议书范文
- 喀什德力克油田科技有限公司30万立方米-日油田伴生放空天然气回收利用项目
评论
0/150
提交评论