雕刻機(jī)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯_第1頁
雕刻機(jī)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯_第2頁
雕刻機(jī)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯_第3頁
雕刻機(jī)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯_第4頁
雕刻機(jī)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

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#識(shí)別DXF文件的數(shù)控雕刻機(jī)系統(tǒng)Huibin Yang, Juan Yan摘要本文研究開放式

40、數(shù)控雕刻機(jī)的關(guān)鍵技術(shù),即DXF識(shí)別技術(shù)。圖形信息提取方法被提出。通過這種方法,在DXF文件中的圖形信息可以被識(shí)別和轉(zhuǎn)換為運(yùn)動(dòng)控制器底部的代碼。因此,雕刻機(jī)可以實(shí)現(xiàn)軌跡跟蹤。然后利用C#對(duì)放數(shù)控雕刻機(jī)系統(tǒng)進(jìn)行開發(fā),最后在一個(gè)三軸運(yùn)動(dòng)的實(shí)驗(yàn)平臺(tái)上對(duì)這個(gè)方法進(jìn)行驗(yàn)證。結(jié)果表明該方法可以有效地識(shí)別DXF文件中的線、圓、弧等圖形信息,并且數(shù)控雕刻機(jī)可以被控制得很好。關(guān)鍵字:DXF;數(shù)控雕刻機(jī);GALIL;C#1 介紹隨著模式識(shí)別技術(shù)的發(fā)展,現(xiàn)代數(shù)控雕刻機(jī)不必手動(dòng)編程。通過導(dǎo)入圖形文件,相應(yīng)的形狀就會(huì)被雕刻機(jī)立即雕刻出來.極大的簡化了雕刻機(jī)的操作過程,使得操作者不再需要豐富的編程知識(shí)。其中,DXF識(shí)別是數(shù)

41、控雕刻機(jī)的關(guān)鍵技術(shù)。通過閱讀和識(shí)別DXF文件,可以直接生成加工軌跡,實(shí)現(xiàn)對(duì)數(shù)控雕刻機(jī)的運(yùn)動(dòng)控制。2 研究現(xiàn)狀研究人員已經(jīng)做了大量研究如何將CAD軟件與NC代碼聯(lián)系起來。Omirou和Barouni提出一系列機(jī)器代碼,通過先進(jìn)的編程能力集成到現(xiàn)代數(shù)控銑床的控制系統(tǒng)中。Kovacic和 Brezocnik提出運(yùn)用遺傳算法去給基于CAD模型在制造環(huán)境下的數(shù)控機(jī)床編程的理論,但是用這種數(shù)控編程的方法也存在很多的問題(例如人工參與程度高但效率低)。中國研究人員的研究方向主要包括兩個(gè)方面,一個(gè)是DXF文件和數(shù)控加工的理論研究,另一個(gè)是讀取DXF文件的應(yīng)用程序。翟睿和張良提出一個(gè)用于讀取DXF文件的數(shù)據(jù)信息

42、和做一些基于跨平臺(tái)開源庫DXF的DXF文件結(jié)構(gòu)特點(diǎn)分析的預(yù)處理的程序結(jié)構(gòu)。黃潔瓊和元群編寫使用面向?qū)ο蟮亩伍_發(fā)工具來讀取存儲(chǔ)部分圖形信息的DXF文件的接口程序,以ARX和C+為對(duì)象來研究沖壓件的加工。沖壓件的幾何模型運(yùn)用封閉輪廓的自動(dòng)生成算法來自動(dòng)創(chuàng)建。3 DXF文件和圖形信息提取3.1 DXF文件DXF(圖紙交換文件)表示所有的被標(biāo)記的信息包含在AutoCAD的圖形文件和ASCII或二進(jìn)制格式文件中,它可以用作輸入/輸出接口和圖形文件在AutoCAD和其他圖形應(yīng)用程序之間轉(zhuǎn)換。一個(gè)完整的DXF文件由六個(gè)被稱作SECTION的段組成,這六段分HEADER,CLASSES,TABLES,BLO

43、CKS, ENTITIES和文件結(jié)束字符(組代碼為0,組值為EOF)。 DXF文件每一段的結(jié)構(gòu)和含義如圖1所示。記錄塊名稱、當(dāng)前層的名字、塊類型、塊插入基點(diǎn)和所有已經(jīng)定義的塊中的成員使用點(diǎn)、線、圓、弧,包括實(shí)體與塊的關(guān)聯(lián)數(shù)據(jù)來定義實(shí)際的3 D或2 D幾何實(shí)體,這是DXF識(shí)別的主要部分。DXF識(shí)別的主要部分包括四個(gè)表。每個(gè)表包含一個(gè)數(shù)量可變的條目。根據(jù)這些表在文件出現(xiàn)的順序,它們依次是線、表、層表、表字體樣式和表視圖。表、層表,表字體樣式表和視圖。它有時(shí)會(huì)忽略像標(biāo)題部分。包括所有應(yīng)用程序定義的類信息。大部分信息包含沒有價(jià)值非CAD應(yīng)用程序。非CAD應(yīng)用程序記錄在AutoCAD系統(tǒng)中所有的標(biāo)題變量

44、的、當(dāng)前值和當(dāng)前狀態(tài)。的大部分信息中包含沒有價(jià)值的非CAD應(yīng)用程序。非CAD應(yīng)用程序沒有價(jià)值圖1 DXF文件結(jié)構(gòu)3.2 圖形信息提取方法為了提取圖形中的有用信息,在文件中的許多地方可以忽略。只要獲得了表、塊、實(shí)體的部分就可以做出對(duì)應(yīng)的幾何描述。每個(gè)在DXF文件中的圖形元素都被存儲(chǔ)為一個(gè)固定的格式,所以它的數(shù)據(jù)交換非常的方便,這也被稱為它的可讀性。每個(gè)在DXF文件中的圖形元素的特征用配對(duì)組代碼和組值等參數(shù)來描述。因此,根據(jù)開放式數(shù)控雕刻機(jī)鎖定目標(biāo),它足以通過讀取DXF文件中的實(shí)體部分來描述目標(biāo)的幾何輪廓。其特定的識(shí)別過程是:首先搜索DXF文件,直到找到“ENTITLES”,然后構(gòu)建一個(gè)圖形元素對(duì)

45、象。然后搜索圖形元素類型(線、圓、弧)和緊隨其后的組織代碼的值。例如,如果程序發(fā)現(xiàn)ENTITLES部分并確認(rèn)第一個(gè)圖形元素是LINE (程序發(fā)現(xiàn)“LINE”在“ENTITLES”之后)。然后它將搜索組代碼代表的參數(shù)。組代碼后下一行的數(shù)字就是參數(shù)的值。(如:下一行的數(shù)字“10”代表這一行的起始點(diǎn)的X值,“20”代表起始點(diǎn)的Y值,“11”代表這一行終點(diǎn)的X值,“21”代表這一行終點(diǎn)的Y值等)。表1為ENTITIES部分的一個(gè)例子。通過這些參數(shù)和值,系統(tǒng)就能 “看到”圖形并“知道”所畫的AutoCAD圖的具體參數(shù)。表1 ENTITIES部分舉例 DXF文件的部分 解釋ENTITIES 段名稱0 組代

46、碼LINE 圖形元素類型1050.0 起始點(diǎn)X的值20100.0 起始點(diǎn)Y的值300.0 起始點(diǎn)Z的值11350.0 終點(diǎn)X的值21500.0 終點(diǎn)Y的值310.0 終點(diǎn)Z的值0ENDSEC 段結(jié)束符3.3 C#實(shí)現(xiàn)圖形信息提取為了存儲(chǔ)圖形數(shù)據(jù),較為方便的方法是使用數(shù)組來存儲(chǔ)數(shù)字變量,也便于調(diào)用和賦值操作。首先定義一個(gè)二維數(shù)組:si,j (i <= 100,j <= 20),定義一個(gè)100行和20個(gè)低點(diǎn)的初始化數(shù)組,每一行的i存儲(chǔ)一個(gè)圖形元素,在每一行的元素j代表組代碼的值。格式各意義如表2。然后,圖形元素存儲(chǔ)狀態(tài)是si,0,si,1,si,15 (I = 0,1,2,)。這種設(shè)計(jì)

47、的優(yōu)點(diǎn)是:對(duì)于每一個(gè)圖形元素,所有幾何元素與軌跡可以存儲(chǔ)在一個(gè)有固定的序列號(hào)的數(shù)組變量空間。在計(jì)算或邏輯判斷時(shí)既方便又不容易犯錯(cuò)誤。但對(duì)于整個(gè)圖形軌跡,直線或曲線的數(shù)量并不一致,所以重要的是要有足夠的變量內(nèi)存空間來適應(yīng)不同圖形軌跡的需求。部分閱讀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 數(shù)據(jù)存儲(chǔ)格式表數(shù)組變量的位置 數(shù)據(jù)的含義i, 0 屬性標(biāo)志:1代表線,2代表圓,3代表弧i, 1 起點(diǎn)的X軸坐標(biāo)值i, 2 起點(diǎn)的Y軸坐標(biāo)值 i, 3 起點(diǎn)的Z軸坐標(biāo)值i, 4 終點(diǎn)的X軸坐標(biāo)值i, 5 終點(diǎn)的Y軸坐標(biāo)值i, 6 終點(diǎn)的Z軸坐標(biāo)值i, 7 一個(gè)圓或弧的中心的X軸坐標(biāo)值i, 8 一個(gè)圓或弧的中心的Y軸坐標(biāo)值i, 9 一個(gè)圓或弧的中心的Z軸坐標(biāo)值i, 10 一個(gè)圓或弧的半徑值i, 11 弧的起始角i, 12 弧的終點(diǎn)角i, 13 后續(xù)數(shù)據(jù)識(shí)別序號(hào)的排序過程i, 14 給后續(xù)操作i, 15 給后續(xù)操作4 圖形軌跡生成要使數(shù)控雕刻機(jī)運(yùn)轉(zhuǎn)起來,關(guān)鍵是如何把D

49、XF文件中的圖形元素信息轉(zhuǎn)化為運(yùn)動(dòng)控制器代碼,以便根據(jù)運(yùn)動(dòng)軌跡來控制機(jī)器的運(yùn)動(dòng)。4.1 DXF分析原理所謂的DXF分析就是把每個(gè)已閱讀的圖形元素標(biāo)準(zhǔn)化為符合標(biāo)準(zhǔn)的運(yùn)動(dòng)控制器的指令??紤]圖形元素的基本類型是線,圓形和弧形,不同類型的圖形元素的標(biāo)準(zhǔn)化是不同的。具體原則如下:1) 線線只有開始和結(jié)束點(diǎn)坐標(biāo).實(shí)際有用的內(nèi)存空間si,0,si,1,si,6,其他部分都是零。2) 弧在DXF中弧的格式包括中心坐標(biāo)的值,半徑,開始角度和結(jié)束角度。中心坐標(biāo)的值,半徑,起始角度和結(jié)束角可以識(shí)別和存儲(chǔ)在si,7,si,8,si,12中。但對(duì)于用于開放式數(shù)控雕刻機(jī)的GALIL DMC2143運(yùn)動(dòng)控制器,弧指令需要開始和結(jié)束點(diǎn)的坐標(biāo)和弧的旋轉(zhuǎn)角度.所以弧的分析包括兩個(gè)方面:1)計(jì)算開始和結(jié)束點(diǎn)坐標(biāo)。2)計(jì)算旋轉(zhuǎn)角度并存儲(chǔ)在s i,15中。3) 循環(huán)因?yàn)閳A的旋轉(zhuǎn)角是360,它可以設(shè)置為一個(gè)固定值.為了方便,循環(huán)的起始位置設(shè)為左邊或者右邊的象限點(diǎn)。4.2 DXF分析方法根據(jù)3.1知,圖形元素分析最困難的是弧。盡管DXF文件中的信息可以確定幾何特性,跟

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論