还剩18页未读,继续阅读
本资源只提供10页预览,全部文档请下载后查看!喜欢就下载吧,查找使用更方便
文本内容:
附录外文翻译-原文部分1DXF FileIdentification withC#for CNC Engraving MachineSystemHuibin Yang,Juan YanAbstract.KeywordsDXF,CNCEngravingMachine,GALIL,C#
1.IntroductionWit.th.developmen.o.patter.recognitio.techniques.moder.CN.engravin.machin.needn.b.programme.manually.B.importin.graphic.file.th.correspondin.shap.wil.b.engrave.b.th.machin.immediately.Th.operatin.proces.o.th.machin.i.simplifie.enormously.an.th.ric.programmin.knowledg.i.n.longe.nee.fo.operators.Amon.them.DX.identificatio.i..ke.technolog.o.CN.engravin.machine.B.readin.an.recognitio.o.th.DX.file.th.machinin.trac.ca.b.direct!.generated.s.th.motio.contro.o.th.CN.engravin.machin.ca.b.achieved.Researcher.hav.don..lo.o.researche.o.ho.t.contac.CA.softwar.t.N.code.Omiro.an.Barounipropose...millin.machin.syste.[l].Kovaci.an.Brezocni.propose.th.concep.o.whic.usin.th.geneti.algorith.Lprogra.th.CN.machin.base.o.th.CA.mode.unde.manufacturin.environmen.[2J.Bu.som.problem.ar.stil.existe.i.thi.kin.o.CN.programmin.suc.a.th.artificia.participatio.degre.i.highe.an.th.efficienc.i.lower.于跨平台开源库文件结构特点分析预处理程序结构黄洁琼和元群编写使用面向对DXFDXF象二次开发工具来读取存放部分图形信息文件接口程序,以和为对象来研究DXF ARXC++冲压件加工冲压件几何模型利用封闭轮廓自动生成算法来自动创建文件和图形信息提取3DXF文件
3.1DXF(图纸交换文件)表示全部被标识信息包含在图形文件和或二进制DXF AutoCADASCII格式文件中,它能够用作输入/输出接口和图形文件在和其它图形应用程序之间转AutoCAD换一个完整文件由六个被称作段组成,这六段分DXF SECTIONHEADER,CLASSES,和文件结束字符(组代码为,组值为)文件每一TABLES,BLOCKS,ENTITIES EOFDXF段结构和含义图所表示1SECTION统计在系统中全部标题AutoCAD2HEADER•••变量、目前值和目前状态大部分0ENDSEC--------------隹自由右令沿右价值非山田rAn0—1SECTION包含全部应用程序定义类信息大2CLASSES部分信息包含没有价值非应CADENDSEC0SECTION2包含四个表每个表包含一个数量可变条目依据这些表在文件出现次序,TABLES它们依次是线、ENDSEC--------------0—SECTION2BLOCKS统计块名称、目前层名字、块类型、块插入•••0基点和全部已经定义块中组员ENDSEC--------------0—SECTION2使用点、线、圆、弧,包含实体和块关联数ENTITIES据来定义实际或几何实体,这是3D2D0ENDSEC—I图文件结构1DXF图形信息提取方法
3.2为了提取图形中有用信息,在文件中很多地方能够忽略只要取得了表、块、实体部分就能够做出对应几何描述每个在文件中图形元素全部被存放为一个固定格式,所DXF以它数据交换很方便,这也被称为它可读性每个在文件中图形元素特征用配对组代码DXF和组值等参数来描述所以,依据开放式数控雕刻机锁定目标,它足以经过读取文件DXF中实体部分来描述目标几何轮廓其特定识别过程是首先搜索文件,直到找到DXF,然后构建一个图形元素对象然后搜索图形元素类型(线、圆、弧)和紧随其“ENTITLES”后组织代码值比如,假如程序发觉部分并确定第一个图形元素是(程序ENTITLES LINE发觉在以后)然后它将搜索组代码代表参数组代码后下一行数字就“LINE”“ENTITLES”是参数值(如下一行数字代表这一行起始点值,代表起始点值,代表“10”X“20”Y“11”这一行终点值,代表这一行终点值等)表为部分一个例子X“21”Y1ENTITIES经过这些参数和值,系统就能“看到”图形并“知道”所画图具体参数AutoCAD表部分举例1ENTITIES文件部分解释DXFENTITIES段名称组代码图形元素类型LINE10起始点值
50.0X20起始点值
100.0Y30起始点值
0.0Z11终点值
350.0X21终点值
500.0Y31终点值
0.0Z段结束符ENDSEC实现图形信息提取
3.3C#为了存放图形数据,较为方便方法是使用数组来存放数字变量,也便于调用和赋值操作首先定义一个二维数组定义一个行和个低点初始化数组,每一行存放一个图形s[i,j]i=100,j=20,10020i元素,在每一行元素代表组代码值格式各意义如表j2然后,图形元素存放状态是••闻…i,15]I=0,1,2,这种设计优点是对于每一个图形元素,全部几何元素和轨迹能够存放在一个有固定序列号数组变量空间在计算或逻辑判定时既方便又不轻易犯错误但对于整个图形轨迹,直线或曲线数量并不一致,所以关键是要有足够变量内存空间来适应不一样图形轨迹需求部分阅读文件中图形元素程如DXF C#doLin..mysr.ReadLin.;if Line==ENTITIES if Line==10”Line=mysr.ReadLine;string m;m=Line;double n;n=Convert.ToDoublem;s[i,j]=n;j++;}while Line!=null表数据存放格式表2数组变量位置数据含义属性标志代表线,代表圆,代表弧123起点轴坐标值[i,1]X起点轴坐标值[i,2]Y起点轴坐标值[i,3]Z终点轴坐标值[i,4]X终点轴坐标值[i,5]Y终点轴坐标值[i,6]Z一个圆或弧中心轴坐标值[i,7]X口,一个圆或弧中心轴坐标值Y8]一个圆或弧中心轴坐标值[i,9]Z一个圆或弧半径值[i,10]弧起始角[i,⑵弧终点角后续数据识别序号排序过程[i,13]给后续操作[1,14]给后续操作[i,15]图形轨迹生成4要使数控雕刻机运转起来,关键是怎样把文件中图形元素信息转化为运动控制器代DXF码,方便依据运动轨迹来控制机器运动分析原理
4.1DXF所谓分析就是把每个已阅读图形元素标准化为符合标准运动控制器指令考虑DXF图形元素基础类型是线,圆形和弧形,不一样类型图形元素标准化是不一样具体标准以下线1线只有开始和结束点坐标.实际有用内存空间其它部分全部是零s[i,0],s[i,l],...,s[i,6],弧2在中弧格式包含中心坐标值,半径,开始角度和结束角度中心坐标值,半径,起始角DXF度和结束角能够识别和存放在中但对于用于开放式数控雕刻机s[i,7],s[i,8],…,s[i,12]GALIL运动控制器,弧指令需要开始和结束点坐标和弧旋转角度.所以弧分析包含两个方DMC2143面计算开始和结束点坐标计算旋转角度并存放在中12s[i,15]循环3因为圆旋转角是它能够设置为一个固定值.为了方便,循环起始位置设为左边或右360°,边象限点分析方法
4.2DXF依据知,图形元素分析最困难是弧尽管文件中信息能够确定几何特征,跟踪测序,取
3.1DXF得需要开始和结束点坐标和运动控制器程序,但需要改变格式来直接连接中心、半径、开始角度和结束角度这四种元素能够利用简单三角函数来计算,开始和结束点位置和弧旋转角度就能够确定比如假如弧中心是半径为开始角是和结束角是ox0,yO,r,00090°3依据圆参数方程,起点终点和旋转角能够使用方程⑴到方程⑶0090°,axl,yl,bx2,y2,e来计算X]=%+r・cos0y\=x+rSine{1“2=%+「•cos b⑵⑶建立开放式数控雕刻机系统5开放式数控雕刻机系统硬件包含一个运动控制器和一个上位机数控雕刻机实时动作控制是由运动控制器来完成运动控制器关键任务是伺服电机控制和逻辑控制电脑运行IO分析算法,人机界面发送从分析算法得到运动指令到运动控制器,这么雕刻机就能DXF DXF够被控制系统软件包含电脑程序和运动控制器程序电脑程序
5.1电脑程序包含人机界面和在后台运行分析程序分析程序编写关键是基于DXF DXF分析标准和第三节方法DXF运动控制器程序设计
5.2在这个设计中,线性和环形插值子程序在运动控制器中编依据在电脑中分GALIL DXF析结果,把不一样子程序按正确次序排列和赋值变量,实现连续跟踪轨迹运动控制器线性插值程序以下GALIL#LINEARMT2,2VMABVS5000VA100000VD100000VP X,YVEBGS EN测试运行结果6经过操作者首先完成了文件识别和图形元素信息提取和存放也实现了图形元素排c#,DXF序操作最终,图形轨迹经过调用底部软件指令生成图形轨迹和实现运动这个测试GALIL采取三轴运动试验平台进行,雕刻刀具换成了钢笔,笔固定在试验平台,测试使用AutoCAD轨迹图绘制最终止果表明,发展开放式数控雕刻机系统能够正确地完成文件识别,它DXF行走路径和文件是一致CAD参考文件[l]Omiro.Sotiris,L«an.Baroun.Antigoni,K..Integratio.o.Ne.Programmin.Capabilitie.int..CN.Milli n.System.Robotic.an.Computer-Integrate.Manufacturing,21,518-
527.
[2]Kovacic.M..Brezocnik.M..PaholeJ..Balic.J.an.Kecelj,BEvolutionar.Programmin.o.CN.Machines.Journal ofMaterials ProcessingTechnology,164-165,1379-
1387.
[3]Zhai.R.an.Zhang,L..Readin.Fram.Desig.Base.o.th.DX.Fil.Format.Fujia.Computer,4,107-
109.
[4]Huang.J.Q.an.Yuan,Q..Automati.Inpu.an.Identificatio.fo.Stampin.Grap.Base.o.AutoCAD.Machiner.Desig..Manufacture,2,82-
84.
[5]Bai.X.C.an.Chen,Y.M..Automati.Programmin.o.Bridg.Cuttin.Machin.Base.o.th.DX.File.Equipmen.Manufacturin.Technology,2,110-
112..Th.researc.directio.o.Chines.researcher.mainl.include.tw.aspects.On.i.th.theoretica.stud.o.DX.fiLan.N.machining.th.othe.i.th.applicatio.o.DX.fil.reading.ZhaiRu.an.Zhan.Lian.propose..progra.structure.whic.i.use.t.rea.dat.informatio.o.DX.fil.an.d.som.preproces.base.o.th.cros.platfor.ope.sourc.librar.DX.Li.b.th.analysi.o.DX.fil.structur.characteristi.
[3].Huan.Jieqion.an.Yua.Qu.wrot.th.interfac.progra.t.rea.th.store.part.graphi.informatio.i.DX.fil.b.us.o.th.object-oriente.secondar.developmen.tools.Objec.AR.an.C++.i.th.researc.o.stampin.part.machining.Th.stampin.part.geometri.mode.i.automaticall.create.b.th.automati.generatio.algorith.o.close.contou.[4J.DX.Drawin.Exchang.File.i..representatio.o.al.informatio.labele.dat.containe.i.th.AutoCA.graphie.file.an.th.!.exchang.betwee.AutoCA.an.othe.graphic.application.
[5]..complet.DX.fil.i.compose.o.si.segment.calle.SECTION.Thes.segment.wer.HEADER,din.characte.grou.cod.i.O,grou.valu.i.EOF.Records thecurrent valueor thecurrent slateSECTIONof all titlesvariable inthe AutoCAD2system.Most of the informationincludedHEADERhas novalue fornon CADapplications.0tNDSEC0Includes allapplication-defined classSECTIONInibrniation.Most ofthe infbmiationincluded2has novalue fornon CADapplications.CLASSES•・♦0tNDSECIncludes fourtables.Each tablecontains a0variable numberentries.According tothe orderSECTIONofthese tablesappear mthe file,they arelinear2table,layer cable,torn styletable andview cable,TABLEStt cansometimes beignored likeHEADERsection.、E DSE0Recordsthe blockname,currentlayer name,SECTION blocktype,blockinsertion basepointandallmembersofeach blockwhentheblock isBLOCKSdefined.・•♦0ENDSEC0Definestheactual3D or2D geometnlsohdbySECTION usingpoints,lines,circlesand arcs,includingthe2connection dataofsolid layersand blocks.Itisthe mainsectionofDXF identification.tNTITIES••♦0Figure
1.DXF filestructure.tNDSECmetri.descriptio.ca.b.complete.a.lon.a.th.section.o.TABLES,BLOCK.ENTITIE.ar.obtained.Eac.graphi.elemen.i.th.DX.fiLar.store.wit..fixe.format.s.i.i.convenien.fo.dat.exchange.an.als.calle.itreadability.Th.characteristic.o.eac.individua.graphi.elemen.i.DX.fil.i.describe.b.th.paramete.group.consiste.b.paire.grou.cod.an.grou.value.Therefore.accordin.t.th.targe.o.ope.CN.engravin.machine.i.i.enoug.t.describ.th.targe.geometr.contou.b.readin.th.ENTITIE.sectio.i.DX.file.only.Th.particula.identificatio.proces.is.Firs.searc.th.DX.fil.unti.th.h.ENTITLE.sectio.an.confir.th.firs.graphi.elemen.i.LIN.Th.progra.foun.LINE.afte.u ENTITLES.The.i.wil.searc.th.grou.cod.whic.represent.th.parameter.o.th.line.Th.numbe.a.th.nex.lin.afte.th.grou.cod.i.th,valu.o.th.parameter.e.g.Th.numbe.a.th.nex.lin.afte.“
10.represen.th..valu.o.star.poin.o.thi.line.an.
20.fo..valu.o.star.point,
11.fo..valu.o.en.point,“
21.fo..valu.o.en.point.etc..Tabl..show.a.exampl.o.a.ENTITIE.section.Tabl..show.a.exampl.o.a.ENTITIE.section.B.gettin.thes.parameter.an.values.syste.the.sees.th.grap.an.“knows.th.specifi.parameter.o.th.grap.whic.i.dre.b.AutoCAD.Figur..i.th.flo.diagra.o.extractio.o.graphi.information.TabL.show.a.exampl.o.a.ENTITIE.section.Table
1.An exampleof anENTITIES section.Parts ofDXFFile ExplanationENTITIESSectSioencteionndnsaymmebol0Group codeLINEGraphic elementtype
1050.0The Xvalue of start point
20100.0The Yvalue of start point
300.0The Zvalue ofstart point
11350.0The Xvalue of end point
21500.0The Yvalue of end point
310.0The Zvalue ofend point0ENDSEC
3.
3.C.Realizatio.o.Graphi.Informatio.Extractio.Lorde.Lstor.th.grap.data.th.convenien.metho.i.t.stor.numeri.variable.b.usin.array.an.i.i.als.ver.convenien.fo.cal.an.assignmen.operation.Firs.defin..
2.array:.Then.th.graphi.elemen.storag.stat.i.s[i,0]s[i,l],,s[i,
15...0,1,2,,9doLin.,my sr.ReadLin.;ifLine==ENTmES ifLine==10”Line=mysr.ReadLine;string m;二m Line;double n;n=Con vert.ToDoublem;s[i,j]=n;;J++}二}while Line!nullTable
2.Data storageformat tabic.Array VariablePosition DataMeaningn.wit.th.standar.instruction.o.motio.controller.Considerinlh.basi.typ.o.graphi.elemen.i.line.circl.o.arc.th.standardizatio.requirement.o.differen.graphi.elemen.typ.ar.different.Th.specifi.principle.ar.a.follows:Property mark:1is line,2is circle,3is arcTheX axis coordinate value ofstart pointThe Y axis coordinate value ofstartpointThe Z axis coordinate value ofstartpointU,4J TheX axis coordinate value ofend pointThe Yaxiscoordinate value ofend pointU,6J TheZ axiscoordinatevalueofendpointThe Xaxiscoordinatevalueofthe centre of a circle or an arcTheYaxiscoordinatevalueofthe centreofa circle or an arcU,刃TheZaxiscoordinatevalueofthecentreofacircleoranarc[i,10]The radiusvalueofacircleoranareArc startangle,U12J Arcend angleTheidentiilcation numberof subsequentdata sortingprocessi,14]For subsequentoperationsFor subsequentoperationsTo openCNC engravingmachine,the keypoint ishow toconvert thegraphic elementinformationin DXFfile intomotion controllercode,so asto controlthe machinesmotionaccording tothe machiningtrajectory.1LINELin.ha.onLstar.an.en.poin.coordinate.th.actua.usefu.memor.spac.i.s[i,0],s[i,l],•••,s[i,6],othe.part.ar.al.zero.2ARCA.th.forma.o.ar.i.th.DX.i.includ.th.cente.coordinate.value.radius.star.angl.an.en.angle.S.th.cente.coordinate.value.radius.star.angLan.en.angLca.b.recognize.an.store.i.s[i,7],s[i,8],,s[i,
12..Bu.fo.th.GALLDMC
214.motio.controlle.whic.i.use.i.th.ope.CN.engravin.machine,th.ar.instructio.require.star.an.en.poin.coordinat.an.rotatio.angLo.th.arc.So.th.analysi.o.ar.include.tw.aspects.a.Calculat.th.star.an.en.poin.coordinate.b.Calculat.th.rotatio.angl.an.stor.i..[i,15].3CIRCLE0,i.ca.b.se.a..fixe.value.Fo.th.sak.o.convenience.th.startin.positio.o.circl.i.se.t.th.lef.o.righ.quadranta.points.Accordin.t.
3.
1.th.difficult.o.graphi.elemen.analysi.i.arc.Althoug.th.informatio.i.DX.fiLca.confir.geometr.feature.fo.th.trac.sequencing.th.star.an.en.poin.coordinate.ar.needed.an.fo.th.motio.controlle.programs.i.als.nee.t.chang.th.forma.fo.direc.connection.B.fou.element.o.center.radius.star.angLan.en.angLa.wel.a.simpLtrigonometri.functio.calculation.th.star.an.en.poin.positio.a.wel.a.th.rotatio.angl.o.th.ar.ca.b.determined.Fo.exarnple.i.cente.o.th.ar.i.ox0,y0,radiu.i.r.star.angl.i......
900.an.en.angl.i......90°,accordin.t.th.parametri.equatio.o.the circle,the startpoint axlyl,endpointbx2,y2,and rotationangle£can becalculated using9Equation1to Equation3:X]=%+厂・cos0必=Po+r・sin1x=x+r・co$S y=Vo+r・sinby Q2£=6⑵3Th.hardwar.o.th.ope.CN.engravin.machin.syste.include..motio.controlle.an.a.uppe.compute.PC.Th.real-tim.contro.o.th.CN.engravin.machirrbod.i.don.b.th.motio.controller.Th.mai.tas.o.th.motio.controlled.serv.moto.contro.an.Llogi.control.Th.P.run.Th.DX.analysi.algorithm.Human-Machin.Interfac.HMLan.send.th.motio.contro.instruction.go.fro.th.DX.analysi.algorith.t.th.motio.controller.s.th.engravin.machin.ca.b.controlled.Th.softwar.o.th.syste.include.P.progra.an.motio.controne.program.
5.
1.P.ProgramTh.P.progra.include.HM.an.DX.analysi.progra.runnin.i.th.background.DX.analysi.progra.ar.mainLprogramme.base.o.DX.analysi.principle.an.method.o.
3.
5.
2.Lthi.design.th.subprogram.o.linea.an.circula.interpolatio.ar.programme.i.GALLmotio.controller.Accordin.t.th.result.o.DX.analysi.i.PC.cal.differen.subprogra.i.prope.orde.an.assig.variable.th.continuou.trackin.trajector.ca.b.realized.Th.linea.interpolatio.progra.o.GALLmotio.controlle.i.a.follows:#LINEARMT2,2VMABVS5000VA100000VD100000VP X,YVEBGSENB.C#.th.author.firs.finishe.th.DX.fil.identificatio.a.wel.a.th.extractio.an.storag.o.graphi.elemen.information.Th.graphi.elemen.orderin.operation.wer.als.achieved.A.last,th.graphic.trajectorie.wer.generate.b.callin.th.botto.GALI.softwar.instruction.an.achieve.motio.tacking.Th.tes.wa.carrie.ou.o..thre.axe.motio.experimen.platform.th.carvin.cutte.wa.replace.wit.pen.Pe.wa.fixe.o.th.experimen.platform.Th.tes.use...engravin.machin.syste.ca.accuratel.complet.th.identificatio.o.DX.file.an.th.wal.pat.i.consisten.wit.th.CA.file.References[
1.Omiro.Sotiris,L-an.Baroun.Antigoni,K..Integratio.o.Ne.Programmin.Capabilitie.int..CN.Millin.System.Robotic,an.Computer-Integrate.Manufacturing,21,518-
527.[
2.;Kovacic,M.,Brezocnik,M.,Pahole,L,Balic,J.an.Kecelj,B..Evolutional Programmin.o.CN.Machines.Journa.o.Material.Processin.TechnologyJ64-165,1379-
1387.[
3.Zhai,R.an.Zhang,L..Readin.Fram.Desig.Base.o.th.DX.Fil.Format.Fujia.Computer,4J07-
109.[
4.Huang J.Q.an.Yuan,Q..Automati.Inpu.an Jdentificatio.fo.Stampin.Grap.Base.o.AutoCAD.Machiner.Desig..Manufacture^,82-
84.[
5.Bai,X.C.an.Chen,Y.M..Automati.Programmin.o.Bridg.Cuttin.Machin.Base.o.th.DX.File.Equipmen.Manufacturin.Technology,2,110-
112.附录外文翻译-汉字部分2利用识另文件数控雕刻机系统C#IJ DXFHuibinYang,Juan Yan摘要本文研究开放式数控雕刻机关键技术,即识别技术图形信息提取方法被提出经过这DXF种方法,在文件中图形信息能够被识别和转换为运动控制器底部代码所以,雕刻机能DXF够实现轨迹跟踪然后利用对放数控雕刻机系统进行开发,最终在一个三轴运动试验平台C#上对这个方法进行验证结果表明该方法能够有效地识别文件中线、圆、弧等图形信息,DXF而且数控雕刻机能够被控制得很好关键字:;数控雕刻机;;DXF GALILC#介绍1伴随模式识别技术发展,现代数控雕刻机无须手动编程经过导入图形文件,对应形状就会被雕刻机立即雕刻出来.极大简化了雕刻机操作过程,使得操作者不再需要丰富编程知识其中,识别是数控雕刻机关键技术经过阅读和识别文件,能够直接生成加工轨迹,DXF DXF实现对数控雕刻机运动控制研究现实状况2研究人员已经做了大量研究怎样将软件和代码联络起来和提出一CAD NCOmirou Barouni系列机器代码,经过优异编程能力集成到现代数控铳床控制系统中和提Kovacic Brezocnik出利用遗传算法去给基于模型在制造环境下数控机床编程理论,不过用这种数控编程CAD方法也存在很多问题(比如人工参与程度高但效率低)中国研究人员研究方向关键包含两个方面,一个是文件和数控加工理论研究,另一个是DXF读取文件应用程序翟睿和张良提出一个用于读取文件数据信息和做部分基DXF DXF。
个人认证
优秀文档
获得点赞 0