Part marking method and device based on DXF file and storable medium

文档序号:1963976 发布日期:2021-12-14 浏览:13次 中文

阅读说明:本技术 一种基于dxf文件的零件打标方法、装置及可存储介质 (Part marking method and device based on DXF file and storable medium ) 是由 代良春 于 2021-09-17 设计创作,主要内容包括:本发明公开了一种基于DXF文件的零件打标方法、装置及可存储介质,其中方法包括:(1)解析DXF文件,对所述DXF文件中包含的零件进行读取;(2)对读取的零件与预设零件库进行比对,得到每个零件对应的打标信息,并存储到文档中;(3)确定打标区域的位置信息;(4)激光打标机根据所述文档存储的数据进行打标;本发明能够对待打标板材上的零件进行准确标记,并提供了必要的种类和位置信息。(The invention discloses a part marking method based on a DXF file, a device and a storable medium, wherein the method comprises the following steps: (1) analyzing the DXF file, and reading parts contained in the DXF file; (2) comparing the read parts with a preset part library to obtain marking information corresponding to each part, and storing the marking information into a document; (3) determining position information of a marking area; (4) marking by the laser marking machine according to the data stored in the document; the invention can accurately mark the parts on the plate to be marked and provides necessary types and position information.)

1. A method for marking a part based on a DXF file, comprising:

(1) analyzing the DXF file, and reading parts contained in the DXF file;

(2) comparing the read parts with a preset part library to obtain marking information corresponding to each part, and storing the marking information into a document;

(3) determining position information of a marking area;

(4) and marking by the laser marking machine according to the data stored in the document.

2. The DXF file-based part marking method of claim 1, wherein step (2) specifically comprises:

(21) comparing the identified part with a preset part library, and giving an ID value to the identified part when the parts with the same shape exist;

(22) and extracting the process information of the part from a preset process database according to the ID value, and storing the process information into a document.

3. The DXF file-based part marking method of claim 1, wherein step (4) specifically comprises:

(41) obtaining corresponding center position coordinates according to the position information of the marking area;

(42) and converting the central position coordinate to obtain a working coordinate of the laser marking machine.

4. Method for marking parts according to claim 3, characterized in that step (42) comprises in particular:

(421) selecting the coordinates of the lower left corner end point of a plate to be marked, wherein the plate to be marked is rectangular;

(422) and converting the endpoint coordinates by using a laser edge finding method to obtain working coordinates.

5. Method for marking parts according to claim 4, characterized in that the step (422) of coordinate transformation comprises in particular:

assuming that P ' (x ', y ') is an original center position coordinate, and a coordinate obtained after conversion is P (x, y), the conversion is realized by the following expression, wherein the specific expression is as follows:

in the formula, theta is the rotation angle of the plate to be marked, and T (a, b) is the endpoint coordinate of the lower left corner of the plate.

6. The DXF file-based part marking method of claim 1, wherein step (4) specifically comprises: and through reading the batch marking of the document, returning a finishing signal after each marking is finished, performing reciprocating circulation until all parts are marked, finishing the work, and controlling the laser marking machine to return to the original point.

7. A part marking device based on DXF file, characterized in that includes:

the analysis module is used for acquiring the DXF file, analyzing the DXF file and reading a part identification result;

the identification module is used for processing the part identification result to obtain corresponding marking information and position information;

and the marking module is used for receiving the marking information and the position information to mark.

8. A computer-readable storage medium having computer instructions stored thereon which, when executed, implement the method of claims 1-6.

Technical Field

The invention relates to the technical field of computer graphics and panel processing, in particular to a part marking method and device based on DXF files and a storable medium.

Background

At present, software on a marking assembly line is basically a marking system based on a PC platform, a new generation of laser marking system is developing towards the direction of small volume, high efficiency and higher cost performance, and the reconstruction of a vector graph is realized by using AutoCAD with powerful graph image processing and analysis design functions, so that the performance of the laser marking system is greatly improved.

However, in the laser cutting process of large metal plates, because a large number of parts are planned to be laid on one large plate and the shapes of the parts are different, in order to improve the utilization rate of the metal plates as much as possible, the parts are arranged in available spaces as much as possible, and therefore, the distribution positions of the parts on the large plate are also irregular. Although in the process of cutting the sheet material by laser, different shapes of sheet metal parts can be distinguished and marked by depending on production personnel, the reading and identification of files cannot be automatically realized by depending on manual execution of the process, and meanwhile, the automatic acquisition of the shapes and positions of parts cannot be realized, and the automation degree is low.

Therefore, how to provide a solution to the above problems is a problem that needs to be solved by those skilled in the art.

Disclosure of Invention

In view of the above, the invention provides a part marking method, a part marking device and a storable medium based on a DXF file, which can identify and locate irregular sheet metal parts on metal plates and provide necessary types and position information for subsequent marking on the sheet metal parts.

In order to achieve the purpose, the invention adopts the following technical scheme:

a DXF file based part marking method comprising:

(1) analyzing the DXF file, and reading parts contained in the DXF file;

(2) comparing the read parts with a preset part library to obtain marking information corresponding to each part, and storing the marking information into a document;

(3) determining position information of a marking area;

(4) and marking by the laser marking machine according to the data stored in the document.

Preferably, the step (2) specifically comprises:

(21) comparing the identified part with a preset part library, and giving an ID value to the identified part when the parts with the same shape exist;

(22) and extracting the process information of the part from a preset process database according to the ID value, and storing the process information into a document.

Preferably, the step (4) specifically comprises:

(41) obtaining corresponding center position coordinates according to the position information of the marking area;

(42) and converting the central position coordinate to obtain a working coordinate of the laser marking machine.

Preferably, step (42) specifically comprises:

(421) selecting the coordinates of the lower left corner end point of a plate to be marked, wherein the plate to be marked is rectangular;

(422) and converting the endpoint coordinates by using a laser edge finding method to obtain working coordinates.

Preferably, the coordinate transformation process of step (422) specifically includes:

assuming that P ' (x ', y ') is an original center position coordinate, and a coordinate obtained after conversion is P (x, y), the conversion is realized by the following expression, wherein the specific expression is as follows:

in the formula, theta is the rotation angle of the plate to be marked, and T (a, b) is the endpoint coordinate of the lower left corner of the plate.

Preferably, the step (4) specifically comprises: and through reading the batch marking of the document, returning a finishing signal after each marking is finished, performing reciprocating circulation until all parts are marked, finishing the work, and controlling the laser marking machine to return to the original point.

Further, the invention also provides a part marking device based on the DXF file, which comprises:

the analysis module is used for acquiring the DXF file, analyzing the DXF file and reading a part identification result;

the identification module is used for processing the part identification result to obtain corresponding marking information and position information;

and the marking module is used for receiving the marking information and the position information to mark.

Further, the present invention also provides a computer readable storage medium, on which computer instructions are stored, and when executed, the computer instructions implement the method described above.

According to the technical scheme, compared with the prior art, the part marking method, the part marking device and the storable medium based on the DXF file are disclosed and provided, the shape of the part is identified and the part is positioned on a complete plate before the process of laser cutting of the sheet metal, different marks are respectively marked on different parts, and thus the sheet metal parts obtained after laser cutting have the unique identity codes, the management efficiency of products can be improved, the production time is reduced, and the economic benefit is improved; the invention can identify and position the irregular sheet metal part on the sheet metal part to be processed, and provides necessary type and position information for marking the sheet metal part subsequently.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

FIG. 1 is a flow chart of a DXF file-based part marking method according to the present invention;

FIG. 2 is a schematic block diagram illustrating a structure of a DXF file-based part marking apparatus according to the present invention;

FIG. 3 is a schematic diagram of coordinate transformation provided by an embodiment of the present invention;

fig. 4 is a schematic diagram of coordinate transformation of two-dimensional rotational displacement according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Referring to the attached drawing 1, the embodiment of the invention discloses a part marking method based on a DXF file, which comprises the following steps:

(1) analyzing the DXF file, and reading parts contained in the DXF file;

wherein the DXF format is a representation of tagged data for all information contained in the AutoCAD graphic file.

(2) Comparing the read parts with a preset part library to obtain marking information corresponding to each part, and storing the marking information into a document;

(3) determining position information of a marking area;

(4) and marking by the laser marking machine according to the data stored in the document.

In a specific embodiment, step (2) specifically includes:

(21) comparing the identified part with a preset part library, and giving an ID value to the identified part when the parts with the same shape exist;

(22) and extracting the process information of the part from a preset process database according to the ID value, and storing the process information into a document.

In a specific embodiment, the step (4) specifically includes:

(41) obtaining corresponding center position coordinates according to the position information of the marking area;

(42) and converting the central position coordinate to obtain a working coordinate of the laser marking machine.

In a specific embodiment, step (42) specifically comprises:

(421) selecting the coordinates of the lower left corner end point of a plate to be marked, wherein the plate to be marked is rectangular;

(422) and converting the endpoint coordinates by using a laser edge finding method to obtain working coordinates.

Specifically, referring to fig. 2, the center position of the marking area is the position to which the laser head of the laser marking machine needs to move, but the currently obtained coordinates of the center position of the marking area are coordinates in the drawing, i.e., coordinates of the workpiece coordinate system.

In the actual marking process, the coordinate of the laser head which needs to be moved to a certain position is the coordinate of the machine tool coordinate system, so the coordinate of the workpiece coordinate system needs to be converted into the coordinate of the machine tool coordinate system. Before coordinate system conversion is carried out, the position of a workpiece in a machine tool coordinate system needs to be determined, so that the lower left corner (namely the intersection point of a long edge and a short edge) of a plate to be marked is selected as a coordinate conversion bridge.

In the embodiment of the invention, a laser edge finding method is selected to obtain the coordinate of the left lower corner endpoint of the plate to be marked in a machine tool coordinate system, the endpoint is the intersection point of the long edge and the short edge of the plate, in order to obtain the intersection point, a linear equation of the two edges is obtained firstly, the linear equation of the two edges is determined by adopting a three-point method, and the specific process is as follows:

1) firstly, selecting two points as far as possible on a long edge, and calculating a linear equation of the long edge;

2) after obtaining the straight line equation of the long side, because the short side is perpendicular to the long side, we can know the slope of the straight line equation of the short side (the slope of the straight line of the short side is the negative inverse of the slope of the straight line of the long side);

3) then selecting a point on the short edge, and naturally obtaining a linear equation of the short edge according to the point on the straight line and the slope of the point;

4) and solving the intersection point of the long-side linear equation and the short-side linear equation to obtain the coordinate value of the lower left corner endpoint of the plate in the machine tool coordinate system.

The laser edge searching method is used for obtaining two points on the long edge and one point on the short edge, the automatic flow of the laser edge searching is mainly controlled by a PLC program of a lower computer, and the upper computer program is matched with the lower computer program to complete the circular action.

The upper computer program is mainly used for sending a starting command to the lower computer and controlling the cycle of the edge searching action. The lower computer program is mainly responsible for controlling the click-in and interpolation of the motor to realize an automatic edge searching process, and the automatic edge searching process can be generally divided into the following steps:

1) the laser head moves up to a safe height (Z-axis positioning);

2) interpolating the long edge to a first edge searching starting point (XY positioning) by the laser head;

3) the laser head moves down to a working height (Z-axis positioning), which is determined by the effective working range of the laser displacement sensor;

4) the laser head slowly moves from inside to outside along the direction vertical to the long edge until the laser head crosses the edge of the plate, the laser displacement sensor triggers an interruption program to stop moving, and the program reads the position coordinate of the laser head when the interruption is performed.

5) And (4) circulating the steps to obtain the second point on the long edge and the point on the short edge in sequence, and ending the edge searching program.

In a specific embodiment, referring to fig. 3-4, the coordinate transformation process of step (422) specifically includes:

the plate rotates and displaces in the machine tool coordinate system, so the coordinate of the marking point in the workpiece coordinate system can be converted into the coordinate in the machine tool coordinate system according to the two-dimensional coordinate conversion matrix of the rotational displacement, the coordinate conversion schematic diagram of the two-dimensional rotational displacement is shown in the attached figures 3-4, the point P ' (x ', y ') is the coordinate of the marking point in the workpiece coordinate system, theta is the rotation angle of the plate relative to the machine tool coordinate system and can be determined by the slope of the long side, T (a, b) is the coordinate of the end point of the lower left corner of the plate in the machine tool coordinate system,

assuming that P ' (x ', y ') is an original center position coordinate, and a coordinate obtained after conversion is P (x, y), the conversion is realized by the following expression, wherein the specific expression is as follows:

in a specific embodiment, the step (4) specifically includes: and through reading the batch marking of the document, returning a finishing signal after each marking is finished, performing reciprocating circulation until all parts are marked, finishing the work, and controlling the laser marking machine to return to the original point.

Referring to fig. 2, a part marking device based on DXF files according to an embodiment of the present invention includes:

the analysis module is used for acquiring the DXF file, analyzing the DXF file and reading a part identification result;

the identification module is used for processing the part identification result to obtain corresponding marking information and position information;

and the marking module is used for receiving the marking information and the position information to mark.

The embodiment of the present invention further provides a computer-readable storage medium, where computer instructions are stored on the computer-readable storage medium, and when the computer instructions are executed, the method described in the above embodiment is implemented.

The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种机械设计方案分步推荐方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类