CN113867259B - Reconstruction method of cutter track transverse information based on space grid - Google Patents
Reconstruction method of cutter track transverse information based on space grid Download PDFInfo
- Publication number
- CN113867259B CN113867259B CN202111126866.3A CN202111126866A CN113867259B CN 113867259 B CN113867259 B CN 113867259B CN 202111126866 A CN202111126866 A CN 202111126866A CN 113867259 B CN113867259 B CN 113867259B
- Authority
- CN
- China
- Prior art keywords
- tool
- grids
- tool position
- point
- position point
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title abstract description 19
- 238000005520 cutting process Methods 0.000 abstract description 11
- 238000003754 machining Methods 0.000 abstract description 8
- 238000004364 calculation method Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 8
- 238000009826 distribution Methods 0.000 description 4
- 238000005457 optimization Methods 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/18—Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
- G05B19/19—Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by positioning or contouring control systems, e.g. to control position from one programmed point to another or to control movement along a programmed continuous path
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/30—Nc systems
- G05B2219/35—Nc in input of data, input till input file format
- G05B2219/35349—Display part, programmed locus and tool path, traject, dynamic locus
Landscapes
- Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Manufacturing & Machinery (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Numerical Control (AREA)
Abstract
本发明属于数控加工相关技术领域,并公开了一种基于空间网格的刀具轨迹横向信息的重构方法。该方法包括下列步骤:S1确定加工轨迹上每个刀位点的坐标及沿坐标轴方向的极限坐标,将该极限坐标包括的区域进行网格划分;S2确定与相邻刀位点连接形成的直线相交的网格,并对相交的网格进行标记,遍历所有刀位点以此获得刀位点与网格的对应关系;S3对于任意刀位点,构建搜索范围,计算每个网格对应的刀位点与所述刀位点的距离,距离最近的刀位点作为刀位点的横向点,以此方式获得所有刀位点的横向点,即获得刀具轨迹的横向信息。通过本发明,解决行切轨迹中沿刀路轨迹访问点、直线段以及跨刀路行横向访问邻近刀位点间时效率低,耗时长的问题。
The present invention belongs to the technical field related to numerical control machining, and discloses a method for reconstructing the lateral information of a tool trajectory based on a spatial grid. The method includes the following steps: S1 determines the coordinates of each tool position point on the machining trajectory and the limit coordinates along the coordinate axis direction, and divides the area included in the limit coordinates into grids; S2 determines the grids intersecting with the straight lines formed by connecting adjacent tool positions, and marks the intersecting grids, traversing all tool positions to obtain the corresponding relationship between the tool positions and the grids; S3 constructs a search range for any tool position point, calculates the distance between the tool position point corresponding to each grid and the tool position point, and uses the tool position point with the closest distance as the lateral point of the tool position point, so as to obtain the lateral points of all tool positions in this way, that is, to obtain the lateral information of the tool trajectory. Through the present invention, the problems of low efficiency and long time consumption when accessing points and straight line segments along the tool path trajectory and lateral access between adjacent tool positions across the tool path in the line cutting trajectory are solved.
Description
技术领域Technical Field
本发明属于数控加工相关技术领域,更具体地,涉及一种基于空间网格的刀具轨迹横向信息的重构方法。The present invention belongs to the technical field related to numerical control machining, and more specifically, relates to a method for reconstructing lateral information of tool paths based on space grids.
背景技术Background technique
在数控加工中,由CAM软件生成的G代码,通常在离散时,点的分布极不均匀,有的区域点分布的密集,有的地方点分布的稀疏。稀疏的点云只能依靠生成时的顺序,有序访问,这种前后次序的点的访问效率不高,在点云点数较多时,严重影响了对刀路轨迹上点的访问,制约了程序或算法对其进行的其他计算或优化等其他操作。这种传统的访问方式,导致了在对复杂曲面零件的加工优化过程中,搜索查找点的过程非常的耗时。In CNC machining, the G code generated by CAM software usually has extremely uneven distribution of points when it is discretized. Some areas have dense distribution of points, while others have sparse distribution of points. Sparse point clouds can only be accessed in an orderly manner based on the order in which they are generated. This order of point access is not efficient. When the number of point clouds is large, it seriously affects the access to points on the tool path, restricting other operations such as calculation or optimization performed by the program or algorithm. This traditional access method makes the process of searching for points very time-consuming during the optimization of machining complex curved parts.
对G代码点的操作,如图2所示,通常下都是以点的顺序从前往后,沿刀路轨迹方向的访问,但有时需要沿刀路横向的快速访问,如图3所示。基于速度区间的速度规划方法,在识别出速度区间边界特征点后,需要对速度区间边界特征点进行横向一致的优化,优化的一般通过样条曲线的方式。由于样条曲线在刀路横向比较光顺,对刀路横向呈“锯齿形”速度边界特征点进行平滑,使其横向一致。但由于样条曲线向刀路轨迹映射时,是沿刀路横向的,需要跨刀路行对刀路轨迹进行访问,传统的基于点构建的刀路横向关系因为点的分布不均匀,导致这种跨刀路行的访问变得非常的不可靠。As shown in Figure 2, the operation of G code points is usually accessed in the order of points from front to back along the tool path trajectory, but sometimes it is necessary to quickly access along the horizontal direction of the tool path, as shown in Figure 3. Based on the speed planning method of speed interval, after identifying the boundary feature points of the speed interval, it is necessary to optimize the boundary feature points of the speed interval in a horizontal direction, and the optimization is generally carried out through the spline curve. Since the spline curve is relatively smooth in the horizontal direction of the tool path, the "sawtooth" speed boundary feature points in the horizontal direction of the tool path are smoothed to make them consistent in the horizontal direction. However, since the spline curve is mapped to the tool path trajectory along the horizontal direction of the tool path, it is necessary to access the tool path trajectory across the tool path line. The traditional point-based construction of the horizontal relationship of the tool path becomes very unreliable due to the uneven distribution of points.
发明内容Summary of the invention
针对现有技术的以上缺陷或改进需求,本发明提供了一种基于空间网格的刀具轨迹横向信息的重构方法,解决行切轨迹中沿刀路轨迹访问点、直线段以及跨刀路行横向访问邻近刀位点间时效率低,耗时长的问题。In response to the above defects or improvement needs of the prior art, the present invention provides a method for reconstructing the lateral information of the tool trajectory based on a spatial grid, which solves the problems of low efficiency and long time consumption when accessing points and straight line segments along the tool path trajectory and when accessing adjacent tool position points across the tool path in the cutting trajectory.
为实现上述目的,按照本发明,提供了一种基于空间网格的刀具轨迹横向信息的重构方法,该方法包括下列步骤:To achieve the above object, according to the present invention, a method for reconstructing lateral information of tool paths based on a spatial grid is provided, the method comprising the following steps:
S1根据加工轨迹上的G代码,确定加工轨迹上每个刀位点的坐标,确定所有刀位点中沿坐标轴方向的极限坐标,将该极限坐标包括的区域进行网格划分,以此获得多个细分的网格;S1 determines the coordinates of each tool position point on the machining trajectory according to the G code on the machining trajectory, determines the limit coordinates of all tool position points along the coordinate axis direction, and divides the area included in the limit coordinates into grids to obtain multiple subdivided grids;
S2对于所述G代码中对应的每组相邻的刀位点,确定与该组相邻刀位点连接形成的直线相交的网格,并对相交的网格进行标记,遍历所有刀位点以此获得刀位点与网格的对应关系;S2, for each group of adjacent tool position points corresponding to the G code, determining the grids intersecting with the straight lines formed by connecting the group of adjacent tool position points, marking the intersecting grids, and traversing all tool position points to obtain the corresponding relationship between the tool position points and the grids;
S3对于任意刀位点ps,构建搜索范围,根据步骤S2中建立的刀位点与网格的对应关系,计算每个网格对应的刀位点与所述刀位点ps的距离,距离最近的刀位点作为刀位点ps的横向点,以此方式获得所有刀位点的横向点,即获得刀具轨迹的横向信息。S3 constructs a search range for any tool position point ps , and calculates the distance between the tool position point corresponding to each grid and the tool position point ps according to the correspondence between the tool position point and the grid established in step S2. The tool position point with the closest distance is taken as the lateral point of the tool position point ps . In this way, the lateral points of all tool position points are obtained, that is, the lateral information of the tool trajectory is obtained.
进一步优选地,在S1中,所述加工轨迹为行切轨迹,该加工轨迹中具有多条平行的刀路。Further preferably, in S1, the processing trajectory is a line cutting trajectory, and the processing trajectory has a plurality of parallel tool paths.
进一步优选地,在步骤S2之前,还需对每个刀位点按照顺序赋予与该顺序大小一致的索引号。Further preferably, before step S2, each tool position point needs to be assigned an index number that is consistent with the order in sequence.
进一步优选地,在步骤S2中,所述对相交的网格进行标记按照下列方式进行:Further preferably, in step S2, the marking of the intersecting grids is performed in the following manner:
当相邻的刀位点相连形成的直线在同一个网格中时,同时采用该相邻的刀位点标记所述网格;当相邻的刀位点pi和pi+1相连形成的直线不在同一个网格中时,对于刀位点pi所在的网格,采用刀位点pi的索引号进行标记,其他与直线相交的网格以及所述刀位点pi+1的网格均采用刀位点pi+1的索引号进行标记。When the straight line formed by adjacent tool point locations is in the same grid, the adjacent tool point locations are used to mark the grids at the same time; when the straight line formed by adjacent tool point locations p i and p i+1 are not in the same grid, the grid where tool point location p i is located is marked with the index number of tool point location p i , and the other grids intersecting with the straight line and the grid of the tool point location p i+1 are marked with the index number of tool point location p i+1 .
进一步优选地,在步骤S3中,所述构建搜索范围按照下列步骤进行:Further preferably, in step S3, the building of the search scope is performed according to the following steps:
S31确定刀位点ps处的偏置方向以及行切轨迹之间的刀路间隔,其中偏置方向为垂直于刀路行切方向并于XOY面平行的方向,按照偏置方向将所述刀位点ps进行偏置,以此获得偏置点;S31 determines the offset direction of the tool position point ps and the tool path interval between the cutting trajectories, wherein the offset direction is a direction perpendicular to the tool path cutting direction and parallel to the XOY plane, and the tool position point ps is offset according to the offset direction to obtain an offset point;
S32以偏置点所在的网格为中心,预设搜索半径,以此确定搜索范围。S32 takes the grid where the offset point is located as the center and presets the search radius to determine the search range.
进一步优选地,在所述搜索范围中的网格,将网格对应的索引号大于和小于所述刀位点ps对应的索引号的网格分别建立集合V+和V-,剔除集合V+和V-中索引号在该刀位点ps所在的单条刀具轨迹首尾边界点索引号之间的网格点,剩余的网格形成的集合作为新的搜索范围。Further preferably, for the grids in the search range, grids corresponding to index numbers greater than and less than the index number corresponding to the tool position point ps are respectively established into sets V + and V- , and grid points in sets V + and V- with index numbers between the index numbers of the first and last boundary points of the single tool trajectory where the tool position point ps is located are eliminated, and the set formed by the remaining grids is used as the new search range.
进一步优选地,所述该刀位点ps所在的单条刀具轨迹首尾边界点按照下列方式确定:Further preferably, the first and last boundary points of the single tool trajectory where the tool position point ps is located are determined in the following manner:
根据所述刀位点ps的索引号,在该ps所在的单条刀具轨迹上,沿索引号大于和小于所述刀位点ps的索引号的两个方向搜索,当该单条刀具轨迹上的两个相邻刀位点连线形成的直线不平行于该单条刀具轨迹的方向,该两个相邻刀位点中靠近所述ps的刀位点为所述单条刀具轨迹的首尾边界点之一。According to the index number of the tool position point ps , on the single tool trajectory where ps is located, search is performed in two directions with index numbers greater than and less than the index number of the tool position point ps ; when a straight line formed by connecting two adjacent tool position points on the single tool trajectory is not parallel to the direction of the single tool trajectory, the tool position point closer to ps among the two adjacent tool position points is one of the head and tail boundary points of the single tool trajectory.
进一步优选地,所述预设搜索半径为3×3×n,在X,Y轴方向,搜索步距为3个网格,n是Z方向的步距,其根据实际情况设定。Further preferably, the preset search radius is 3×3×n, in the X and Y axis directions, the search step is 3 grids, and n is the step in the Z direction, which is set according to actual conditions.
进一步优选地,根据步骤S2中建立的刀位点与网格的对应关系,计算每个网格对应的刀位点与所述刀位点ps的距离,具体为:根据每个网格对应的索引号获得与该索引号对应的刀位点,计算该索引号对应的刀位点到所述刀位点ps的距离。Further preferably, according to the correspondence between the tool position point and the grid established in step S2, the distance between the tool position point corresponding to each grid and the tool position point ps is calculated, specifically: according to the index number corresponding to each grid, the tool position point corresponding to the index number is obtained, and the distance from the tool position point corresponding to the index number to the tool position point ps is calculated.
进一步优选地,在步骤S1中,所述网格划分时,网格之间的间距设定为[d/8,d/4],d是平行刀路之间的间距。Further preferably, in step S1, when the grid is divided, the spacing between grids is set to [d/8, d/4], where d is the spacing between parallel tool paths.
总体而言,通过本发明所构思的以上技术方案与现有技术相比,具备下列有益效果:In general, the above technical solutions conceived by the present invention have the following beneficial effects compared with the prior art:
1.本发明中通过构建网格与刀位点的拓扑关系,搜索邻近刀路上的网格,以网格表示刀位点,构建刀路刀位点跨行邻近的横向关系,实现对刀路横向的快速访问,提高横向刀位点的访问效率;1. In the present invention, by constructing a topological relationship between a grid and a tool point, searching for grids on adjacent tool paths, using grids to represent tool points, and constructing a lateral relationship between tool path and tool point locations adjacent across rows, rapid lateral access to tool paths is achieved, thereby improving the access efficiency of lateral tool points;
2.本发明中在构建网络与刀位点的拓扑关系中,在网格中引入刀位点的索引号,一方面保留了刀位点的信息,另一方面使得在计算横向刀位点的时候通过索引号快速找到刀位点,减小计算过程中的计算量,降低计算复杂度;2. In the present invention, when constructing the topological relationship between the network and the tool point, the index number of the tool point is introduced into the grid, which, on the one hand, retains the information of the tool point, and on the other hand, enables the tool point to be quickly found by the index number when calculating the horizontal tool point, thereby reducing the amount of calculation in the calculation process and reducing the calculation complexity;
3.本发明中在搜索刀位点的横向点是,首先通过加工轨迹的间距获得刀位点的偏置点,将偏置点作为搜索中心,搜索偏置点附近的点,将搜索范围内提出搜索范围内的边界外的网格点,进一步缩小搜索范围,避免了大面积的搜索,缩小搜索范围,提高搜索精度,简化计算。3. In the present invention, when searching for the lateral points of the tool position point, firstly, the offset point of the tool position point is obtained by the spacing of the machining trajectory, the offset point is used as the search center, and the points near the offset point are searched. The grid points outside the boundary of the search range are extracted within the search range, and the search range is further narrowed, thereby avoiding large-area searches, narrowing the search range, improving the search accuracy, and simplifying the calculation.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是按照本发明的优选实施例所构建的基于空间网格的刀具轨迹横向信息的重构方法的流程图;FIG1 is a flow chart of a method for reconstructing lateral information of a tool trajectory based on a space grid according to a preferred embodiment of the present invention;
图2是按照本发明的优选实施例所构建的行切刀路轨迹示意图;FIG2 is a schematic diagram of a line cutting tool path trajectory constructed according to a preferred embodiment of the present invention;
图3是按照本发明的优选实施例所构建的行切刀路中刀位点的示意图;FIG3 is a schematic diagram of a knife position point in a row cutting path constructed according to a preferred embodiment of the present invention;
图4是按照本发明的优选实施例所构建的求解刀位点坐标轴方向极限坐标的示意图;4 is a schematic diagram of solving the limit coordinates of the tool position coordinate axis direction constructed according to the preferred embodiment of the present invention;
图5是按照本发明的优选实施例所构建的刀路轨迹网格化的示意图;FIG5 is a schematic diagram of a meshed tool path constructed according to a preferred embodiment of the present invention;
图6是按照本发明的优选实施例所构建的相邻刀位点与网格相交获得刀位点与网格关系的示意图;6 is a schematic diagram of the relationship between the tool position points and the grid obtained by intersecting adjacent tool position points with the grid constructed according to the preferred embodiment of the present invention;
图7是按照本发明的优选实施例所构建的获取刀位点横向点的流程图;7 is a flow chart of obtaining the lateral point of the tool position point constructed according to the preferred embodiment of the present invention;
图8是按照本发明的优选实施例所构建的当前点求解边界点的示意图;FIG8 is a schematic diagram of solving boundary points of a current point constructed according to a preferred embodiment of the present invention;
图9是按照本发明的优选实施例所构建的求解刀位点横向点的原理示意图;FIG9 is a schematic diagram showing the principle of solving the lateral point of the cutter position constructed according to the preferred embodiment of the present invention;
图10是按照本发明的优选实施例所构建的从刀位点到横向点快速访问的示意图。FIG. 10 is a schematic diagram of a rapid access from a knife position point to a lateral point constructed according to a preferred embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
针对本发明解决的技术问题,本发明可以在解决G代码点,直线段快速访问和刀路轨迹横向操作直线段间的快速访问两个问题的场景中应用,为了更详细的说明本发明方法,下面结合具体的场景和实施例阐述本发明的技术方案,具体地,如图1所示:In view of the technical problem solved by the present invention, the present invention can be applied in the scenario of solving two problems: fast access to G code points and straight line segments and fast access between straight line segments of tool path lateral operation. In order to explain the method of the present invention in more detail, the technical solution of the present invention is described below in combination with specific scenarios and embodiments. Specifically, as shown in FIG1:
S1:计算刀位点在xyz三个方向的极限坐标,并以此范围划分网格。具体方法如下:S1: Calculate the limit coordinates of the tool position point in the three directions of x, y and z, and divide the grid into these ranges. The specific method is as follows:
①导入G代码文件,顺序记录每一个刀位点坐标。①Import the G-code file and record the coordinates of each tool position point in sequence.
G代码文件是由一系列离散点坐标及控制指令组成的,点位置是有序的,相邻两点构成一个直线段,有序点间连线构成刀路轨迹。通过记录点,直线段的索引,可以方便快速的访问刀路轨迹上的点和直线段。The G code file is composed of a series of discrete point coordinates and control instructions. The point positions are ordered. Two adjacent points form a straight line segment. The lines between the ordered points form the tool path. By recording the index of points and straight lines, you can quickly and easily access the points and straight lines on the tool path.
②如图4所示,遍历刀位点,找到x、y、z方向的最大和最小值x_min,x_max,y_min,y_max,z_min,z_max;② As shown in Figure 4, traverse the tool position points and find the maximum and minimum values x_min, x_max, y_min, y_max, z_min, z_max in the x, y, and z directions;
设置空间网格步长x_step,y_step,z_step,计算出xyz三个方向的划分数目,即x_num=[x_max+x_offset-(x_min-x_offset)]/x_step,Set the spatial grid step size x_step, y_step, z_step, and calculate the number of divisions in the three directions of xyz, that is, x_num = [x_max + x_offset - (x_min - x_offset)] / x_step,
y_num=[y_max+y_offset-(y_min-y_offset)]/y_step,y_num = [y_max + y_offset - (y_min - y_offset)] / y_step,
z_num=[z_max+z_offset-(z_min-z_offset)]/z_step,z_num=[z_max+z_offset-(z_min-z_offset)]/z_step,
其中x_offset,y_pffset,z_offset为边界放大的尺寸,为了简单起见令x_offset=y_offset=z_offset=x_step/2=y_step/2=z_step/2Among them, x_offset, y_pffset, z_offset are the sizes of the border enlargement. For simplicity, let x_offset = y_offset = z_offset = x_step/2 = y_step/2 = z_step/2
为了更好地呈现G代码轨迹空间网格化算法,采用的XOY平面网格化进行说明,空间网格化则添加上z坐标即可。如图4所示,在外边框的上下左右四条线之间进行网格划分,x方向网格数目为x_num=[x_max+x_offset-(x_min-x_offset)]/x_step,同理y方向网格数目为y_num=[y_max+y_offset-(y_min-y_offset)]/y_step。任意一个pi(xi,yi)所在的x方向的索引为:In order to better present the spatial gridding algorithm of G-code trajectory, the XOY plane gridding is used for illustration, and the spatial gridding can be added with the z coordinate. As shown in Figure 4, the grid is divided between the four lines of the upper, lower, left and right of the outer frame. The number of grids in the x direction is x_num = [x_max + x_offset - (x_min - x_offset)] / x_step, and the number of grids in the y direction is y_num = [y_max + y_offset - (y_min - y_offset)] / y_step. The index of any p i (x i , y i ) in the x direction is:
intx=[xi+x_offset-(x_min-x_offset)]/x_step,intx=[ xi +x_offset-(x_min-x_offset)]/x_step,
y方向的索引为:The index in the y direction is:
inty=[yi+y_offset-(y_min-y_offset)]/y_step。inty = [ yi + y_offset - (y_min - y_offset)] / y_step.
S2:如图5所示,将编程轨迹中所有刀位点的索引号添加到网格内,。具体方法如下:S2: As shown in Figure 5, add the index numbers of all tool positions in the programming trajectory to the grid. The specific method is as follows:
①遍历所有的直线段blki=pi(xi,yi,zi)pi+1(xi+1,yi+1,zi+1),计算出直线段所经过的网格集合{cubei}。计算方法如下:① Traverse all straight line segments blk i = p i ( xi , yi , z i ) p i+1 (xi +1 , yi +1 , z i+1 ) and calculate the grid set {cube i } that the straight line segment passes through. The calculation method is as follows:
首先,根据如下公式计算出刀位点pi,pi+1所在的网格索引号xNumi,yNumi,zNumi,xNumi+1,yNumi+1,zNumi+1。First, the grid index numbers xNum i , yNum i , zNum i , xNum i+1 , yNum i+1 , zNum i+1 where the tool positions p i , p i+1 are located are calculated according to the following formula.
然后判断pi,pi+1是否在同一个网格中,如果是,则只需要在{cube}中添加该网格。若pi,pi+1不在同一个网格中,则以step/4的步长离散直线段pi,pi+1为点集{P},计算{P}中每一点所在的网格,并不重复地将每个网格添加到{cubei}中。Then determine whether p i , p i+1 are in the same grid. If so, just add the grid to {cube}. If p i , p i+1 are not in the same grid, discretize the straight line segments p i , p i+1 as the point set {P} with a step size of step/4, calculate the grid where each point in {P} is located, and do not repeatedly add each grid to {cube i }.
②向{cubei}中的网格添加相应的刀位点索引号,如图6所示。首先判断{cubei}是否只有一个网格,若是则将pi,pi+1添加入该网格中。添加前要判断网格内是否已有pi,若是则只添加pi+1。若{cube}内的网格数大于1,添加刀位点的规则如下:第一个网格不重复地添加pi,后面每个网格不重复地添加pi+1。② Add the corresponding knife point index number to the grid in {cube i }, as shown in Figure 6. First, determine whether {cube i } has only one grid. If so, add p i and p i+1 to the grid. Before adding, determine whether p i already exists in the grid. If so, only add p i+1 . If the number of grids in {cube} is greater than 1, the rule for adding knife points is as follows: p i is added to the first grid without duplication, and p i+1 is added to each subsequent grid without duplication.
S3:如图7所示,寻找每一个刀位点的邻近刀路上的横向刀位点,构建刀位点的横向邻近关系。具体方法如下:S3: As shown in FIG7 , find the lateral tool position points on the adjacent tool paths of each tool position point and construct the lateral adjacent relationship of the tool position points. The specific method is as follows:
①如图8所示,计算该当前点Ps所属行切刀路的边界点Pb1,Pb2。从所选刀位点开始向前后两向搜索,若搜索到的直线段方向与行切方向不平行,则取该直线段靠近所选刀位点的端点作为当前行切刀路的边界点Pb1,Pb2,其索引号为Nb1,Nb2。若所选点Ps为边界点,则不进行后续操作;否则,继续后续横向搜索。① As shown in Figure 8, calculate the boundary points P b1 and P b2 of the line cutting path to which the current point P s belongs. Start searching forward and backward from the selected tool position point. If the direction of the searched straight line segment is not parallel to the line cutting direction, take the endpoint of the straight line segment close to the selected tool position point as the boundary points P b1 and P b2 of the current line cutting path, and their index numbers are N b1 and N b2 . If the selected point P s is a boundary point, no subsequent operation is performed; otherwise, continue the subsequent lateral search.
②计算当前刀位点Ps在相邻刀路上的横向刀位点的预估点Pt1,Pt2。以垂直于刀路行切方向为投影方向/>计算横向上距离当前刀位点一个刀路间隔d的位置坐标即为Pt1,Pt2。② Calculate the estimated points Pt1 and Pt2 of the lateral tool positions of the current tool position Ps on the adjacent tool path. is the projection direction/> The position coordinates calculated to be one tool path interval d in the lateral direction from the current tool position point are P t1 , P t2 .
③确定横向点搜索范围。计算预估点Pt1,Pt2坐标所属的网格索引号ct1,ct2,将以此网格为中心的3×3×n(n由用户根据不同的编程轨迹设定)网格设为搜索范围ct1,ct2。③ Determine the horizontal point search range. Calculate the grid index numbers c t1 , c t2 to which the estimated points P t1 , P t2 coordinates belong, and set the 3×3×n (n is set by the user according to different programming trajectories) grid centered on this grid as the search range c t1 , c t2 .
④在ct1,ct2中寻找Ps的横向刀位点。Ct1,Ct2中的所有刀位点及其每个刀位点的前后点(不重复)为集合V,将这些点按索引号大于所选点索引号和小于所选点索引号分别存储在容器V+,V-中。剔除V+,V-中行号在[Nb1,Nb2]的刀位点(这些点是当前行切刀路上的点而非邻近刀路上点),避免对后续计算最近点造成影响。分别计算V+,V-中距离当前点最近的刀位点,即分别为所选刀位点在邻近刀路上的横向刀位点Pfront,Pnext。④ Find the transverse tool position point of Ps in c t1 , c t2 . All tool positions in C t1 , C t2 and the front and back points of each tool position point (no duplication) are set V. These points are stored in containers V + , V - according to the index number greater than the selected point index number and less than the selected point index number. Eliminate the tool positions with row numbers [N b1 , N b2 ] in V + , V - (these points are points on the current line cutting path rather than points on the adjacent tool path) to avoid affecting the subsequent calculation of the nearest point. Calculate the tool position point closest to the current point in V + , V - respectively, which are the transverse tool positions P front , P next of the selected tool position point on the adjacent tool path.
S4:应用已建立的横向关系,如图9和10所示,可以快速获取当前刀位点对应的横向刀位点:例如,选择编程轨迹上任意刀位点,根据已建立的横向关系直接获取所选刀位点的左右横向点,再以获取的横向点为基础继续向左向右获取下一横向点,循环往复直至找不到下一横向点,最终得到一条“横向特征线”。S4: Applying the established transverse relationship, as shown in Figures 9 and 10, the transverse tool position point corresponding to the current tool position point can be quickly obtained: for example, select any tool position point on the programming trajectory, directly obtain the left and right transverse points of the selected tool position point according to the established transverse relationship, and then continue to obtain the next transverse point to the left and right based on the obtained transverse point, and repeat the cycle until the next transverse point cannot be found, and finally a "transverse feature line" is obtained.
本发明方法中,采用的是一种基于网格构建刀路轨迹横向信息的方法,在不改变原始G代码的前提下,通过网格的空间拓扑关系构建刀位点与其邻近刀路上刀位点的横向关系,可以解决对刀路轨迹横向计算或优化过程中需要跨行访问邻近刀路刀位点的问题,只需要提前建立一次横向关系,就可以提高后续横向邻近点访问的效率,降低运行时间消耗。In the method of the present invention, a method for constructing lateral information of tool path trajectory based on grid is adopted. Under the premise of not changing the original G code, the lateral relationship between the tool position point and the tool position point on its adjacent tool path is constructed through the spatial topological relationship of the grid. This can solve the problem of needing to access adjacent tool path tool position points across rows during the lateral calculation or optimization of the tool path trajectory. It only needs to establish the lateral relationship once in advance to improve the efficiency of subsequent lateral adjacent point access and reduce the running time consumption.
注意:Notice:
(1)为了保证横向关系建立的效果,S1②中的网格步长通常设定一般不大于(d为刀路间距);同时,为了保证横向关系建立时的效率,网格步长通常设定一般不小于/> (1) In order to ensure the effectiveness of establishing horizontal relationships, the grid step size in S1② is usually set to be no greater than (d is the tool path spacing); at the same time, in order to ensure the efficiency of establishing lateral relationships, the grid step size is usually set to be no less than / >
(2)S3③中3×3×n以此为x,y,z方向的网格数,z方向的网格数取决于G代码轨迹的具体情况,保证不会遗漏应搜索刀位点。(2) In S3③, 3×3×n is the number of grids in the x, y, and z directions. The number of grids in the z direction depends on the specific situation of the G code trajectory to ensure that the tool position points to be searched are not missed.
本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111126866.3A CN113867259B (en) | 2021-09-26 | 2021-09-26 | Reconstruction method of cutter track transverse information based on space grid |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111126866.3A CN113867259B (en) | 2021-09-26 | 2021-09-26 | Reconstruction method of cutter track transverse information based on space grid |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113867259A CN113867259A (en) | 2021-12-31 |
CN113867259B true CN113867259B (en) | 2024-05-24 |
Family
ID=78994201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111126866.3A Active CN113867259B (en) | 2021-09-26 | 2021-09-26 | Reconstruction method of cutter track transverse information based on space grid |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113867259B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101403907A (en) * | 2008-11-12 | 2009-04-08 | 山东理工大学 | Five-coordinate NC tool track fast generation method for scattered point cloud data |
CN101403909A (en) * | 2008-11-12 | 2009-04-08 | 山东理工大学 | Triangular gridding subdivision curved surface NC tool track fast generation method |
CN102033513A (en) * | 2010-11-05 | 2011-04-27 | 江俊逢 | Computer-assisted discrete geometric programming method and system |
CN110096034A (en) * | 2019-04-26 | 2019-08-06 | 华中科技大学 | The reconstructing method of the three axis cutter path curved surface transverse direction information based on projection algorithm |
CN113365784A (en) * | 2019-01-28 | 2021-09-07 | 西门子股份公司 | Computer-aided optimization of numerical control machining of workpieces |
-
2021
- 2021-09-26 CN CN202111126866.3A patent/CN113867259B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101403907A (en) * | 2008-11-12 | 2009-04-08 | 山东理工大学 | Five-coordinate NC tool track fast generation method for scattered point cloud data |
CN101403909A (en) * | 2008-11-12 | 2009-04-08 | 山东理工大学 | Triangular gridding subdivision curved surface NC tool track fast generation method |
CN102033513A (en) * | 2010-11-05 | 2011-04-27 | 江俊逢 | Computer-assisted discrete geometric programming method and system |
CN113365784A (en) * | 2019-01-28 | 2021-09-07 | 西门子股份公司 | Computer-aided optimization of numerical control machining of workpieces |
CN110096034A (en) * | 2019-04-26 | 2019-08-06 | 华中科技大学 | The reconstructing method of the three axis cutter path curved surface transverse direction information based on projection algorithm |
Also Published As
Publication number | Publication date |
---|---|
CN113867259A (en) | 2021-12-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210173966A1 (en) | Method for constructing curve of robot processing path of part with small curvature based on point cloud boundary | |
CN112699623B (en) | High-precision heat flow calculation method based on unstructured grid regularized reconstruction technology | |
CN107451378B (en) | Three-coordinate measuring blade section sampling point extraction method | |
CN113703391B (en) | Machining path planning method based on random pheromone optimization elite ant colony algorithm | |
CN111639811A (en) | Multi-agricultural-machine cooperative work remote management scheduling method based on improved ant colony algorithm | |
CN109214462A (en) | A kind of spatial data on-line talking method based on distributed incremental DBSCAN algorithm | |
CN103336485B (en) | Rapid generating method of milling path of web of airplane structural member | |
CN102193998B (en) | Arc scanning type construction scheme of triangular irregular network containing edge topological information | |
CN115014362A (en) | A method and device for cattle farming type full coverage path planning based on synthetic unit | |
CN108470081A (en) | A kind of supersonic boundary layer multi-Block Grid positioning and quick flow field interpolation method | |
CN111895999B (en) | Path planning method based on structured data | |
CN108121863A (en) | Creation method, device, equipment and the computer readable storage medium of pipeline label | |
CN113867259B (en) | Reconstruction method of cutter track transverse information based on space grid | |
CN109460564B (en) | Power grid tidal current graph wiring method | |
CN106156245B (en) | Line element merging method and device in electronic map | |
CN106373192B (en) | A kind of non-topological coherence three-dimensional grid block tracing algorithm | |
CN118779939B (en) | A mesh quality adjustment method and system based on geometry optimization and topology optimization | |
CN106020194A (en) | Heat transfer analysis-based industrial robot path optimization method and system | |
CN110955934A (en) | Realization method of cutting simulation for real-time monitoring of machining | |
CN111274660A (en) | Circuit layout method based on multi-disturbance alternative simulated annealing algorithm | |
CN103337084A (en) | A ground object pattern spot automatic generation method based on artificial ground object characteristics | |
CN106780747B (en) | A Fast Method of Segmenting CFD Computational Grids | |
CN110162903B (en) | A method and system for calculating the windward surface density of urban buildings based on grid parallelism | |
CN102930108A (en) | Plane structural part rib characteristic identification method | |
CN102360387A (en) | Method for outputting geometric data of facet element of vector data transfer format of topology 1 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |