CN117311268A - Method for post-processing file and related device - Google Patents
Method for post-processing file and related device Download PDFInfo
- Publication number
- CN117311268A CN117311268A CN202311616194.3A CN202311616194A CN117311268A CN 117311268 A CN117311268 A CN 117311268A CN 202311616194 A CN202311616194 A CN 202311616194A CN 117311268 A CN117311268 A CN 117311268A
- Authority
- CN
- China
- Prior art keywords
- coordinate system
- matrix
- target
- preset
- post
- 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.)
- Granted
Links
- 238000012805 post-processing Methods 0.000 title claims abstract description 77
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000004519 manufacturing process Methods 0.000 claims abstract description 52
- 239000011159 matrix material Substances 0.000 claims description 179
- 238000004364 calculation method Methods 0.000 claims description 34
- 238000012545 processing Methods 0.000 claims description 32
- 238000006243 chemical reaction Methods 0.000 claims description 19
- 238000003754 machining Methods 0.000 claims description 16
- 238000000605 extraction Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 5
- 238000003860 storage Methods 0.000 claims description 5
- 230000000694 effects Effects 0.000 abstract description 5
- 239000000284 extract Substances 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 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/408—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 data handling or data format, e.g. reading, buffering or conversion of data
- G05B19/4086—Coordinate conversions; Other special calculations
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
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
The invention relates to a method for post-processing files and a related device, which comprise the steps of obtaining target files; extracting an initial coordinate system, a preset coordinate system and tool path data according to the target file; calculating a target coordinate system according to the initial coordinate system and a preset coordinate system; determining target tool path data according to the regular expression and the tool path data; and manufacturing a post-processing file according to the target coordinate system and the target tool path data. Converting an initial coordinate system and a preset coordinate system in a target file into a target coordinate system which can be identified by a 840D-SL numerical control system, and then manufacturing the target coordinate system and target tool path data extracted according to a regular expression into a post-processing file which can be identified by the 840D-SL numerical control system; the method solves the problem of high difficulty in manufacturing the post-processing file, and has the effect of efficiently manufacturing the post-processing file which can be identified by the numerical control system.
Description
Technical Field
The invention relates to the technical field of numerical control automation, in particular to a method for post-processing files during manufacturing and a related device.
Background
A numerical control machine is an automated machine equipped with a program control system, which is input via an information carrier (post-processing file) so that its control system can logically process a program prescribed by a control code or other symbolic instruction. For example, in the present numerical control machining industry, it is a common means to compile a machining tool path file by using a hypersill software, and when the machining tool path file compiled by the hypersill cannot be directly applied to the 840D-SL numerical control system, it is necessary to convert the machining tool path file into a program file (i.e., a post-processing file) recognizable by the numerical control system, and at this time, a professional is required to convert the post-processing file manufactured by the hypersill into a post-processing file recognizable by the 840D-SL numerical control system for various machine tools with different structures, which results in a large difficulty and trouble in manufacturing the post-processing file recognizable by the 840D-SL numerical control system.
Disclosure of Invention
The invention provides a method and a related device for manufacturing a post-processing file, which have the characteristic of efficiently manufacturing the post-processing file which can be identified by a numerical control system.
The first object of the present invention is achieved by the following technical solutions:
a method of post-processing a document, the method comprising:
acquiring a target file, wherein the target file is a tool path text file for processing a target part;
extracting an initial coordinate system, a preset coordinate system and tool path data according to the target file, wherein the preset coordinate system is a machining plane coordinate system of the target part;
calculating a target coordinate system according to the initial coordinate system and a preset coordinate system;
determining target tool path data according to the regular expression and the tool path data;
and manufacturing a post-processing file according to the target coordinate system and the target tool path data.
By adopting the above technical scheme, for example, an initial coordinate system and a preset coordinate system (the preset coordinate system is a processing plane coordinate system of the target part) in a tool path text file (target file) for processing the target part are converted into a target coordinate system which can be identified by a numerical control system; extracting target tool path data which can be identified by the numerical control system from the tool path data in the target file according to the regular expression; and finally, manufacturing the target coordinate system and the target tool path data which can be identified by the numerical control system into a post-processing file, so that the numerical control system can directly identify the post-processing file, and executing processing operation according to the post-processing file. The method solves the problem of high difficulty in manufacturing the post-processing file identifiable by the numerical control system, and has the effect of efficiently manufacturing the post-processing file identifiable by the numerical control system.
The present invention may be further configured in a preferred example to calculate a target coordinate system from the initial coordinate system and the preset coordinate system, including:
converting the initial coordinate system into a first matrix, and converting the preset coordinate system into a second matrix, wherein the first matrix is 4*4 matrix; the second matrix is a 4*4 matrix;
calculating a Z-axis rotation angle of a preset coordinate system rotating around the Z axis of the initial coordinate system according to the first matrix and the second matrix;
calculating a Y-axis rotation angle of a preset coordinate system rotating around the Y axis of the initial coordinate system according to the first matrix and the second matrix;
calculating an X-axis rotation angle of a preset coordinate system rotating around an X-axis of an initial coordinate system according to the first matrix and the second matrix;
and determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle, and converting the third matrix into a target coordinate system.
By adopting the technical scheme, the initial coordinate system and the preset coordinate system are converted into a first matrix and a second matrix, and the offset of the preset coordinate system and the initial coordinate system is calculated through the first matrix and the second matrix, namely the angles of the preset coordinate system relative to the rotation around the Z axis, the Y axis and the X axis of the initial coordinate system are calculated respectively; determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle, and converting the third matrix into a target coordinate system which can be identified by a numerical control system; the accuracy and efficiency of the coordinate system conversion into the coordinate system recognizable by the numerical control system are improved by using the matrix to represent the coordinate system and then determining the conversion of the coordinate system through matrix calculation.
The present invention may be further configured in a preferred example to determine target track path data from the regular expression and the track path data, including:
determining preset keywords according to the tool path data;
and extracting target tool path data according to the regular expression and the preset keywords.
By adopting the technical scheme, the regular expression is used for extracting the content with the preset keywords in the tool path data to be used as target tool path data, wherein the target tool path data is the tool path data which can be identified by the digital control system; extracting the target tool path data through the regular expression can enable the extracting of the target tool path data to have high efficiency.
The present invention may be further configured in a preferred example, in which the post-production processing file method further includes:
calculating a first angle of rotation of a rotating shaft of a preset machine tool and a second angle of rotation of a rotating shaft of the preset machine tool according to the first matrix and the second matrix;
and updating the attitude parameters of the target part in the post-processing file according to the first angle and the second angle.
By adopting the technical scheme, in order to enable the numerical control system to better control the numerical control machine tool to process, the target coordinate system is required to be overlapped with the processing coordinate system of the preset machine tool; firstly, calculating a first angle of rotation of a preset machine tool rotating shaft and a second angle of rotation of a revolving shaft (namely, the rotation angles of an A shaft and a C shaft of the machine tool) through a first matrix and a second matrix; and updating the attitude parameters of the target part in the post-processing file according to the first angle and the second angle to finish the superposition of the target coordinate system and the processing coordinate system of the preset machine tool.
The invention also aims to provide a device for manufacturing the post-processing file, which has the characteristic of efficiently manufacturing the post-processing file which can be identified by the numerical control system.
The second object of the present invention is achieved by the following technical solutions:
a post-production processing file device comprises,
the acquisition module is used for acquiring a target file, wherein the target file is a tool path text file for processing a target part;
the extraction module is used for extracting an initial coordinate system, a preset coordinate system and tool path data according to the target file, wherein the preset coordinate system is a machining plane coordinate system of the target part;
the first calculation module is used for calculating a target coordinate system according to the initial coordinate system and a preset coordinate system;
the determining module is used for determining target tool path data according to the regular expression and the tool path data;
and the manufacturing module is used for manufacturing a post-processing file according to the target coordinate system and the target tool path data.
The present invention may be further configured in a preferred example, that the first computing module includes a first converting unit, a first computing unit, a second computing unit, a third computing unit, and a second converting unit:
the first conversion unit is used for converting the initial coordinate system into a first matrix and converting the preset coordinate system into a second matrix, wherein the first matrix is a 4*4 matrix; the second matrix is a 4*4 matrix;
the first calculation unit is used for calculating a Z-axis rotation angle of the preset coordinate system rotating around the Z axis of the initial coordinate system according to the first matrix and the second matrix;
the second calculation unit is used for calculating a Y-axis rotation angle of a preset coordinate system rotating around the Y axis of the initial coordinate system according to the first matrix and the second matrix;
a third calculation unit for calculating an X-axis rotation angle by which the preset coordinate system rotates around the X-axis of the initial coordinate system according to the first matrix and the second matrix;
and the second conversion unit is used for determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle and converting the third matrix into a target coordinate system.
The present invention may be further configured in a preferred example, that the determination module includes a determination unit and an extraction unit:
the determining unit is used for determining preset keywords according to the tool path data;
and the extraction unit is used for extracting the target tool path data according to the regular expression and the preset keywords.
The present invention may be further configured in a preferred example, in which the post-production processing file device further includes a second calculation module, a third calculation module, a fourth calculation module, and an update module:
the second calculation module is used for calculating a first angle for presetting the rotation of the rotating shaft of the machine tool and a second angle for presetting the rotation of the rotating shaft of the machine tool according to the first matrix and the second matrix;
the updating module is used for updating the post-processing file according to the first angle, the second angle and the third angle;
the invention aims at providing a device for manufacturing post-processing files, which has the characteristic of efficiently manufacturing post-processing files which can be identified by a numerical control system.
The third object of the present invention is achieved by the following technical solutions:
a post-production process file device comprising a memory and a processor, the memory having stored thereon a computer program capable of being loaded by the processor and executing the post-production process file method described above.
The fourth object of the present invention is to provide a computer storage medium capable of storing a corresponding program, which has the characteristic of facilitating the efficient production of post-processing files identifiable by a numerical control system.
The fourth object of the present invention is achieved by the following technical solutions:
a computer readable storage medium storing a computer program loadable by a processor and performing any of the methods of creating a post-processing file described above.
In summary, the present invention includes at least one of the following beneficial technical effects:
1. converting an initial coordinate system and a preset coordinate system (the preset coordinate system is a machining plane coordinate system of the target part) in a tool path text file (target file) for machining the target part into a target coordinate system which can be identified by a numerical control system; extracting target tool path data which can be identified by the numerical control system from the tool path data in the target file according to the regular expression; and finally, manufacturing the target coordinate system and the target tool path data which can be identified by the numerical control system into a post-processing file, so that the numerical control system can directly identify the post-processing file, and executing processing operation according to the post-processing file. The method solves the problem of high difficulty in manufacturing the post-processing file identifiable by the numerical control system, and has the effect of efficiently manufacturing the post-processing file identifiable by the numerical control system;
2. converting the initial coordinate system and the preset coordinate system into a first matrix and a second matrix, and calculating offset of the preset coordinate system and the initial coordinate system through the first matrix and the second matrix, namely respectively calculating angles of the preset coordinate system relative to rotation around a Z axis, a Y axis and an X axis of the initial coordinate system; determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle, and converting the third matrix into a target coordinate system which can be identified by a numerical control system; the coordinate system is represented by using a matrix, and then the conversion of the coordinate system is determined by matrix calculation, so that the accuracy and the efficiency of the coordinate system conversion into the coordinate system which can be identified by the numerical control system are improved;
3. in order to enable the numerical control system to better control the numerical control machine tool to process, the target coordinate system is required to coincide with the processing coordinate system of the preset machine tool; firstly, calculating a first angle of rotation of a preset machine tool rotating shaft and a second angle of rotation of a revolving shaft (namely, the rotation angles of an A shaft and a C shaft of the machine tool) through a first matrix and a second matrix; and updating the post-processing file according to the first angle and the second angle to finish the superposition of the target coordinate system and the processing coordinate system of the preset machine tool.
Drawings
FIG. 1 is a flowchart of steps S101-S105 in a method for post-processing files according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a specific flow of step S103 in fig. 1;
FIG. 3 is a schematic diagram showing a specific flow of step S104 in FIG. 1;
fig. 4 is a flowchart illustrating steps S106 to S107 in a method for post-processing files according to an embodiment of the invention.
Description of the embodiments
The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to fig. 1 to 4 of the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The present invention will be described in further detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for post-processing files, which comprises the following steps:
referring to fig. 1, an embodiment of a method for post-processing files in accordance with an embodiment of the present application includes S101-S105.
S101, acquiring a target file, wherein the target file is a tool path text file for processing a target part;
in the embodiment of the application, the target file is a hypersill output tool path text file for processing the target part; the target part is a part to be processed. Before the target part is required to be processed, a target file is manufactured through Hypermill software, and the target file is stored in a local or cloud end; and when the target file needs to be used by the post-processing file device based on the Hypermill software, acquiring the target file from a local or cloud.
In this embodiment, the target file may be stored locally, may be stored in the cloud, or may be stored in any storage medium readable by the numerical control system, which is not specifically limited herein.
S102, extracting an initial coordinate system, a preset coordinate system and tool path data according to a target file, wherein the preset coordinate system is a machining plane coordinate system of a target part;
after the target file is acquired based on the Hypermill software post-processing file device, content analysis is carried out on the target file, and the initial coordinate system, the preset coordinate system and the tool path data of the Hypermill system in the target file are extracted; wherein the preset coordinate system is a machining plane coordinate system of the target part. For example:
the initial coordinate system extracted by the post-processing file device based on Hypermill software is as follows:
0:ncCs_x(1.00000000000000,0.00000000000000,0.00000000000000)
0:ncCs_y(0.00000000000000,1.00000000000000,0.00000000000000)
0:ncCs_z(0.00000000000000,0.00000000000000,1.00000000000000)
0:ncCs_o(0.00000000000000,0.00000000000000,0.00000000000000)
2: OPERATION 7
the extracted preset coordinate system is as follows:
0:frameCs_x (-0.2025980631599700,0.8705708320733300,-0.4483976484628200)
0:frameCs_y (-0.9112974766217100,0.0000000000000000,0.4117485993939900)
0:frameCs_z (0.3584563207794500,0.4920431143133200,0.7933490024888800)
0:frameCs_o (86.0354563212752623,42.8145851388109122,-9.5662604260062007)
s103, calculating a target coordinate system according to the initial coordinate system and a preset coordinate system;
after the initial coordinate system and the preset coordinate system of the Hypermill system are extracted based on the post-processing file device manufactured by Hypermill software, a target coordinate system is calculated through the initial coordinate system and the preset coordinate system, the target coordinate system can be identified by the numerical control system, and specifically, the target coordinate system is calculated by calculating the offset of the preset coordinate system relative to the initial coordinate system.
In one possible implementation, as shown in FIG. 2, step S103 in FIG. 1 includes S1031-S1035.
S1031, converting an initial coordinate system into a first matrix, and converting a preset coordinate system into a second matrix;
in this embodiment, the target coordinate system is calculated according to the initial coordinate system and the preset coordinate system, specifically, the initial coordinate system is firstly converted into a first matrix, and the preset coordinate system is converted into a second matrix.
The first matrix used to represent the initial coordinate system is:
wherein the last line is used for representing the coordinates of the origin in the initial coordinate system
The second matrix for representing the preset coordinate system is:
A=-0.2025980631599700;B=0.8705708320733300;C=-0.4483976484628200;D=-0.9112974766217100;E=0.0000000000000000;F=0.4117485993939900;
G=0.3584563207794500;H=0.4920431143133200;I=0.7933490024888800;J=86.0354563212752623;K=42.8145851388109122;L=-9.5662604260062007。
in this embodiment, the first matrix and the second matrix may be 3*3 matrices; a 4*4 matrix is also possible, and is not particularly limited herein.
S1032, calculating a Z-axis rotation angle of the preset coordinate system around the Z axis of the initial coordinate system according to the first matrix and the second matrix;
after the first matrix and the second matrix are determined, calculating a Z-axis rotation angle of the preset coordinate system around the initial coordinate system Z-axis according to the first matrix and the second matrix, wherein in the embodiment, the first matrix is taken as the unit matrix, and then the following steps are specific:
extracting B and A in the second matrix and calculating
Wherein the method comprises the steps ofThe Z-axis rotation angle, namely the Euler angle of the Z axis, of the preset coordinate system around the Z axis of the initial coordinate system.
S1033, calculating a Y-axis rotation angle of a preset coordinate system rotating around the Y axis of the initial coordinate system according to the first matrix and the second matrix;
after calculating the Z-axis rotation angle of the preset coordinate system around the Z-axis of the initial coordinate system, calculating the Y-axis rotation angle of the preset coordinate system around the Y-axis of the initial coordinate system according to the first matrix and the second matrix, specifically:
extracting C, F and I in the second matrix and calculating
Wherein,the Y-axis rotation angle of the Y-axis rotation of the preset coordinate system around the initial coordinate system, namely the Euler angle of the Y-axis.
S1034, calculating an X-axis rotation angle of the preset coordinate system around the X-axis of the initial coordinate system according to the first matrix and the second matrix;
after calculating the Y-axis rotation angle of the preset coordinate system rotating around the Y-axis of the initial coordinate system, calculating the X-axis rotation angle of the preset coordinate system rotating around the X-axis of the initial coordinate system according to the first matrix and the second matrix, specifically:
extracting F and I in the second matrix, and calculating
Wherein,the X-axis rotation angle, namely the Euler angle of the X-axis, of the preset coordinate system around the X-axis of the initial coordinate system.
S1035, determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle, and converting the third matrix into a target coordinate system.
After the Z-axis Euler angle, the Y-axis Euler angle and the X-axis Euler angle are calculated, the rotation offset of the preset coordinate system relative to the initial coordinate system can be determined; and further calculate a third matrix, specifically:
presetting a third matrix as a 2*3 matrix; the first row in the third matrix is used for representing the rotation offset, and the second row is used for representing the offset of the original points in the initial coordinate system and the preset coordinate system corresponding to the first matrix and the second matrix; namely, the third matrix is:
wherein,
after the third matrix is calculated, converting the third matrix into a target coordinate system according to a preset conversion condition; in this embodiment, the transformed target coordinate system is:
N24 TRANS X86.0355 Y42.8146 Z-9.5663
N25 AROT X27.4293 Y26.6409 Z103.1006
s104, determining target tool path data according to the regular expression and the tool path data;
when the target coordinate system is determined, the tool path data are already extracted from the target file; extracting target tool path data from the tool path data according to the regular expression, specifically: taking the content of the tool path data as a character string in the regular expression, and then extracting the target tool path data according to the requirement to determine a preset keyword; i.e. extracting the content of the preset keyword portion in the string.
In this embodiment, the function used to extract the content of the preset keyword portion according to the regular expression is:
key attribute value=regex. Match (data of a certain line point of the tool path @ "preset key
In one possible embodiment, as shown in FIG. 3, step S104 of FIG. 1 includes S1041-S1042.
S1041, determining preset keywords according to the tool path data;
in the embodiment, analyzing the target file and extracting the tool path data; traversing all tool path data, and determining preset keywords through the same keywords in the guide rail data; the preset keyword is used to provide a data base to step S1042. In this embodiment, the preset keywords are determined as a first keyword field, a second keyword field, a third keyword field, a fourth keyword field, a fifth keyword field, and a sixth keyword field, which are respectively:
first key field: (x [ /) (-;
second key field: (y [ /) (-;
third key field: (z [ /) (-;
fourth key field: (u [ /) (-;
fifth key field: (v [ /) (-;
sixth key field: (w [ /) (-.
S1042, extracting target tool path data according to the regular expression and a preset keyword;
and respectively placing the first keyword field, the second keyword field, the third keyword field, the fourth keyword field, the fifth keyword field and the sixth keyword field into a regular expression, extracting tool path data containing the first keyword field by the regular expression according to the first keyword field, and taking the tool path data as target tool path data.
In this embodiment, the extraction-related track data according to the second key field, the third key field, the fourth key field, the fifth key field, and the sixth key field is similar to the first key extraction-related track data.
S105, a post-processing file is manufactured according to the target coordinate system and the target tool path data.
After the production of the target coordinate system and the target tool path data is completed, inputting the target coordinate system and the target tool path data into a preset post-processing file template to produce a post-processing file; the target coordinate system and the target tool path data are respectively filled in a preset post-processing file template in a supplementary mode to form a post-processing file, and in the embodiment, the post-processing file is a G code file because the 840D-SL numerical control system can identify that the running file is the G code file.
In a possible embodiment, as shown in fig. 4, the method further comprises steps S106-S107.
S106, calculating a first angle of rotation of a rotating shaft of the preset machine tool and a second angle of rotation of a rotating shaft according to the first matrix and the second matrix;
after the post-processing file is manufactured according to the target coordinate system and the target tool path data, in order to enable the 840D-SL numerical control system to better control the numerical control machine tool to process according to the post-processing file, the target coordinate system is required to be overlapped with the processing coordinate system of the preset machine tool, the target coordinate system is enabled to be overlapped with the processing coordinate system of the preset machine tool, and a first angle for rotating a rotating shaft of the preset machine tool is calculated. In this embodiment, the first angle of rotation of the rotating shaft of the preset machine tool is the rotation angle of the a axis of the preset machine tool, and the second angle of rotation of the rotating shaft of the preset machine tool is the rotation angle of the C axis of the preset machine tool, specifically:
1. judging whether the value of A in the second matrix is smaller than 0;
if yes, presetting the C-axis rotation angle of the machine tool as
If not, presetting the C-axis rotation angle of the machine tool as
Wherein G and H are G and H in the second matrix respectively; PI is a constant。
2. Judging whether the value of H in the second matrix is larger than 0;
if yes, presetting the rotation angle of the A axis of the machine tool as
Presetting the C-axis rotation angle of the machine tool to be
If not, presetting the rotation angle of the A axis of the machine tool as
Presetting the C-axis rotation angle of the machine tool to be
Wherein I is I in the second matrix; PI is a constant。
3. Judging Euler angle of Z axis obtained by calculation according to first matrix and second matrixWhether or not is equal to 180 and presets the C-axis rotation angle of the machine tool +.>Whether or not it is equal to-180;
if so, the first and second data are not identical,
4. judging Euler angle of Z axis obtained by calculation according to first matrix and second matrixWhether or not is equal to-180 and presets the C-axis rotation angle of the machine tool +.>Whether or not it is equal to 180;
if so, the first and second data are not identical,
and S107, updating the attitude parameters of the target part in the post-processing file according to the first angle and the second angle.
After the first angle and the second angle are determined, in order to enable the coordinate system of the 840D-SL numerical control system for adjusting the preset machine tool to coincide with the target coordinate system (processing coordinate system), the data content of the first angle and the second angle is updated to the gesture parameters of the target part in the post-processing file, so that the 840D-SL numerical control system can identify the first angle and the second angle, and the coordinate system of the preset machine tool is adjusted according to the first angle and the second angle.
The implementation principle of the embodiment of the application is as follows:
firstly, acquiring a target file, which is used for processing a tool path text file of a target part, and extracting an initial coordinate system, a preset coordinate system and tool path data according to the target file; secondly, calculating a target coordinate system according to an initial coordinate system and a preset coordinate system, converting the initial coordinate system into a first matrix, converting the preset coordinate system into a second matrix, calculating a Z-axis rotation angle of the preset coordinate system rotating around a Z axis of the initial coordinate system according to the first matrix and the second matrix, calculating a Y-axis rotation angle of the preset coordinate system rotating around a Y axis of the initial coordinate system according to the first matrix and the second matrix, calculating an X-axis rotation angle of the preset coordinate system rotating around an X axis of the initial coordinate system according to the first matrix and the second matrix, determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle, and converting the third matrix into a target coordinate system to obtain the target coordinate system; then determining target tool path data according to the regular expression and the tool path data, wherein a preset keyword is determined according to the tool path data, and then the target tool path data is extracted according to the regular expression and the preset keyword; and finally, a post-processing file is manufactured according to the target coordinate system and the target tool path data.
In addition, a first angle of rotation of the rotating shaft of the preset machine tool and a second angle of rotation of the rotating shaft of the preset machine tool can be calculated according to the first matrix and the second matrix; and updating the attitude parameters of the target part in the post-processing file according to the first angle and the second angle.
The beneficial effects that this application embodiment can reach include:
1. converting an initial coordinate system and a preset coordinate system (the preset coordinate system is a machining plane coordinate system of the target part) in a tool path text file (target file) for machining the target part into a target coordinate system which can be identified by a numerical control system; extracting target tool path data which can be identified by the numerical control system from the tool path data in the target file according to the regular expression; and finally, manufacturing the target coordinate system and the target tool path data which can be identified by the numerical control system into a post-processing file, so that the numerical control system can directly identify the post-processing file, and executing processing operation according to the post-processing file. The method solves the problem of high difficulty in manufacturing the post-processing file identifiable by the numerical control system, and has the effect of efficiently manufacturing the post-processing file identifiable by the numerical control system.
2. Converting the initial coordinate system and the preset coordinate system into a first matrix and a second matrix, and calculating offset of the preset coordinate system and the initial coordinate system through the first matrix and the second matrix, namely respectively calculating angles of the preset coordinate system relative to rotation around a Z axis, a Y axis and an X axis of the initial coordinate system; determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle, and converting the third matrix into a target coordinate system which can be identified by a numerical control system; the accuracy and efficiency of the coordinate system conversion into the coordinate system recognizable by the numerical control system are improved by using the matrix to represent the coordinate system and then determining the conversion of the coordinate system through matrix calculation.
3. Extracting the content with preset keywords in the tool path data by using a regular expression to serve as target tool path data, wherein the target tool path data are tool path data which can be identified by a numerical control system; extracting the target tool path data through the regular expression can enable the extracting of the target tool path data to have high efficiency.
4. In order to enable the numerical control system to better control the numerical control machine tool to process, the target coordinate system is required to coincide with the processing coordinate system of the preset machine tool; firstly, calculating a first angle of rotation of a preset machine tool rotating shaft and a second angle of rotation of a revolving shaft (namely, the rotation angles of an A shaft and a C shaft of the machine tool) through a first matrix and a second matrix; and updating the post-processing file according to the first angle and the second angle to finish the superposition of the target coordinate system and the processing coordinate system of the preset machine tool.
The embodiment of the application also provides a post-production processing file device, which comprises an acquisition module, an extraction module, a first calculation module, a determination module and a production module.
The acquisition module is used for acquiring a target file, wherein the target file is a tool path text file for processing a target part; the extraction module is used for extracting an initial coordinate system, a preset coordinate system and tool path data according to the target file, wherein the preset coordinate system is a machining plane coordinate system of the target part; the first calculation module is used for calculating a target coordinate system according to the initial coordinate system and a preset coordinate system; the determining module is used for determining target tool path data according to the regular expression and the tool path data; the making module is used for making a post-processing file according to the target coordinate system and the target tool path data.
In this embodiment, the acquiring module may acquire a target file, and send the target file to the extracting module, where the target file is a tool path text file for processing a target part. The extraction module extracts an initial coordinate system, a preset coordinate system and tool path data according to the target file, and sends the initial coordinate system, the preset coordinate system and the tool path data to the first calculation module; the preset coordinate system is a machining plane coordinate system of the target part. The first calculation module calculates a target coordinate system according to the initial coordinate system and the preset coordinate system, and sends the target coordinate system to the determination module and the manufacturing module. The determining module determines target tool path data according to the regular expression and the tool path data; and transmitting the target tool path data to the making module. And the making module makes a post-processing file according to the target coordinate system and the target tool path data.
In one possible implementation manner, the post-production processing file device further comprises a second calculation module, a third calculation module, a fourth calculation module and an updating module.
The second calculation module is used for calculating a first angle of rotation of a rotating shaft of a preset machine tool according to the first matrix and the second matrix; the third calculation module is used for calculating a third angle of rotation of a preset machine tool rotating shaft according to the first matrix and the second matrix; and the updating module is used for updating the attitude parameters of the target part in the post-processing file according to the first angle and the second angle.
The first computing module comprises a first converting unit, a first computing unit, a second computing unit, a third computing unit and a second converting unit; the determining module includes a determining unit and an extracting unit.
The first conversion unit is used for converting the initial coordinate system into a first matrix and converting the preset coordinate system into a second matrix; the first calculation unit is used for calculating a Z-axis rotation angle of the preset coordinate system rotating around the Z axis of the initial coordinate system according to the first matrix and the second matrix; the second calculation unit is used for calculating a Y-axis rotation angle of the preset coordinate system rotating around the Y axis of the initial coordinate system according to the first matrix and the second matrix; the third calculation unit is used for calculating an X-axis rotation angle of the preset coordinate system rotating around the X-axis of the initial coordinate system according to the first matrix and the second matrix; the second conversion unit is used for determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle and converting the third matrix into a target coordinate system.
The determining unit is used for determining preset keywords according to the tool path data; the extraction unit is used for extracting target tool path data according to the regular expression and the preset keywords.
In this embodiment, the acquiring module may acquire a target file, and send the target file to the extracting module, where the target file is a tool path text file for processing a target part. The extraction module extracts an initial coordinate system, a preset coordinate system and tool path data according to the target file, sends the initial coordinate system and the preset coordinate system to the first conversion unit, and sends the tool path data to the determination unit.
The first conversion unit converts the initial coordinate system into a first matrix and converts the preset coordinate system into a second matrix; and transmitting the first matrix and the second matrix to a first computing unit, a second computing unit, a third computing unit and a second computing module.
The first calculation unit calculates a Z-axis rotation angle of a preset coordinate system rotating around the Z axis of the initial coordinate system according to the first matrix and the second matrix, and sends the Z-axis rotation angle to the second conversion unit; the second calculation unit calculates a Y-axis rotation angle of a preset coordinate system rotating around the Y axis of the initial coordinate system according to the first matrix and the second matrix, and sends the Y-axis rotation angle to the second conversion unit; the third calculation unit calculates an X-axis rotation angle by which the preset coordinate system rotates around the X-axis of the initial coordinate system according to the first matrix and the second matrix, and sends the X-axis rotation angle to the second conversion unit.
The second conversion unit determines a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle, and converts the third matrix into a target coordinate system; and finally, sending the target coordinate system to a manufacturing module.
The determining unit determines preset keywords according to the tool path data and sends the preset keywords to the extracting unit; the extraction unit extracts target tool path data according to the regular expression and the preset keywords, and sends the target tool path data to the manufacturing module. The making module makes a post-processing file according to the target coordinate system and the target tool path data, and sends the post-processing file to the updating module.
The second calculation module calculates a first angle of rotation of a preset machine tool rotating shaft and a second angle of rotation of a preset machine tool tilting shaft according to the first matrix and the second matrix, and sends the first angle and the second angle to the updating module; and the updating module updates the attitude parameters of the target part in the post-processing file according to the first angle and the second angle.
It should be noted that: in the device provided in the above embodiment, when implementing the functions thereof, only the division of the above functional modules is used as an example, in practical application, the above functional allocation may be implemented by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the embodiments of the apparatus and the method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the embodiments of the method are detailed in the method embodiments, which are not repeated herein.
The embodiment of the application provides a post-production file processing device. The post-production processing file device may include: at least one processor, at least one network interface, a user interface, a memory, at least one communication bus.
The processor is configured to invoke the method of post-processing files stored in the memory, which when executed by the one or more processors, causes the post-processing file device to perform the method as described in one or more of the embodiments above.
The embodiment of the present application further provides a computer readable storage medium, on which a computer program is stored, where the computer program when executed by a processor implements the method for creating a post-processing file according to the foregoing embodiment, and in order to avoid repetition, details are not repeated here.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
The present embodiment is only for explanation of the present invention and is not to be construed as limiting the present invention, and modifications to the present embodiment, which may not creatively contribute to the present invention as required by those skilled in the art after reading the present specification, are all protected by patent laws within the scope of claims of the present invention.
Claims (10)
1. A method of post-production processing a document, the method comprising:
acquiring a target file, wherein the target file is a tool path text file for processing a target part;
extracting an initial coordinate system, a preset coordinate system and tool path data according to the target file, wherein the preset coordinate system is a machining plane coordinate system of the target part;
calculating a target coordinate system according to the initial coordinate system and the preset coordinate system;
determining target tool path data according to the regular expression and the tool path data;
and manufacturing a post-processing file according to the target coordinate system and the target tool path data.
2. The post-production process file method according to claim 1, wherein the calculating a target coordinate system from the initial coordinate system and the preset coordinate system comprises:
converting the initial coordinate system into a first matrix, and converting the preset coordinate system into a second matrix;
calculating a Z-axis rotation angle of the preset coordinate system rotating around the Z axis of the initial coordinate system according to the first matrix and the second matrix;
calculating a Y-axis rotation angle of the preset coordinate system rotating around the Y axis of the initial coordinate system according to the first matrix and the second matrix;
calculating an X-axis rotation angle of the preset coordinate system rotating around the X-axis of the initial coordinate system according to the first matrix and the second matrix;
and determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle, and converting the third matrix into a target coordinate system.
3. The post-production process file method of claim 1, wherein the determining target track path data from the regular expression and the track path data comprises:
determining a preset keyword according to the tool path data;
and extracting target tool path data according to the regular expression and the preset keywords.
4. The post-production process file method according to claim 2, characterized in that the post-production process file method further comprises:
calculating a first angle of rotation of a preset machine tool rotating shaft and a second angle of rotation of a preset machine tool rotating shaft according to the first matrix and the second matrix;
and updating the attitude parameters of the target part in the post-processing file according to the first angle and the second angle.
5. The post-production process file method according to any one of claims 2 or 4, wherein the first matrix is a 4*4 matrix; the second matrix is a 4*4 matrix.
6. A post-production process document device, comprising:
the acquisition module is used for acquiring a target file, wherein the target file is a tool path text file for processing a target part;
the extraction module is used for extracting an initial coordinate system, a preset coordinate system and tool path data according to the target file, wherein the preset coordinate system is a machining plane coordinate system of the target part;
the first calculation module is used for calculating a target coordinate system according to the initial coordinate system and the preset coordinate system;
the determining module is used for determining target tool path data according to the regular expression and the tool path data;
and the manufacturing module is used for manufacturing a post-processing file according to the target coordinate system and the target tool path data.
7. The post-production process file device of claim 6, wherein said first computing module comprises:
the first conversion unit is used for converting the initial coordinate system into a first matrix and converting the preset coordinate system into a second matrix;
a first calculation unit, configured to calculate a Z-axis rotation angle of the preset coordinate system around the initial coordinate system Z-axis according to the first matrix and the second matrix;
a second calculation unit, configured to calculate a Y-axis rotation angle of the preset coordinate system around the initial coordinate system Y-axis according to the first matrix and the second matrix;
a third calculation unit for calculating an X-axis rotation angle by which the preset coordinate system rotates around the initial coordinate system X-axis according to the first matrix and the second matrix;
and the second conversion unit is used for determining a third matrix according to the Z-axis rotation angle, the Y-axis rotation angle and the X-axis rotation angle and converting the third matrix into a target coordinate system.
8. The post-production process file device of claim 6, wherein said determining module comprises:
the determining unit is used for determining preset keywords according to the tool path data;
and the extraction unit is used for extracting the target tool path data according to the regular expression and the preset keywords.
9. The post-production process file device of claim 7, further comprising:
the second calculation module is used for calculating a first angle of rotation of a preset machine tool rotating shaft and a second angle of rotation of a preset machine tool rotating shaft according to the first matrix and the second matrix;
the updating module is used for updating the post-processing file according to the first angle and the second angle;
and the execution/generation module is used for executing the post-processing file and generating an execution result.
10. A computer readable storage medium, characterized in that a computer program is stored which can be loaded by a processor and which performs the method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311616194.3A CN117311268B (en) | 2023-11-30 | 2023-11-30 | Method for post-processing file and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311616194.3A CN117311268B (en) | 2023-11-30 | 2023-11-30 | Method for post-processing file and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117311268A true CN117311268A (en) | 2023-12-29 |
CN117311268B CN117311268B (en) | 2024-02-23 |
Family
ID=89287004
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311616194.3A Active CN117311268B (en) | 2023-11-30 | 2023-11-30 | Method for post-processing file and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117311268B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060058907A1 (en) * | 2004-09-14 | 2006-03-16 | Ugs Corp. | System, method, and computer program product for machine tool programming |
CN101763072A (en) * | 2009-12-31 | 2010-06-30 | 北京数码大方科技有限公司 | Conversion method and device of numerical control machining code |
CN105242638A (en) * | 2015-10-28 | 2016-01-13 | 中国南方航空工业(集团)有限公司 | Blade five-axis machining programming processing method and device |
CN108549319A (en) * | 2018-04-02 | 2018-09-18 | 西南交通大学 | A kind of double general post-processing approach of turntable five-axle number control machine tool |
CN110096033A (en) * | 2019-05-09 | 2019-08-06 | 江苏南高智能装备创新中心有限公司 | A method of check and correction numerical control program precision |
WO2022054703A1 (en) * | 2020-09-09 | 2022-03-17 | ファナック株式会社 | Tool path correction device |
CN114518726A (en) * | 2020-11-20 | 2022-05-20 | 航天科工惯性技术有限公司 | Post-processing development method and device of four-axis semi-numerical control machine tool and numerical control machine tool equipment |
CN116540638A (en) * | 2023-07-05 | 2023-08-04 | 成都瑞雪丰泰精密电子股份有限公司 | Method, device and storage medium for post-processing CAM numerical control machining program |
-
2023
- 2023-11-30 CN CN202311616194.3A patent/CN117311268B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060058907A1 (en) * | 2004-09-14 | 2006-03-16 | Ugs Corp. | System, method, and computer program product for machine tool programming |
CN101763072A (en) * | 2009-12-31 | 2010-06-30 | 北京数码大方科技有限公司 | Conversion method and device of numerical control machining code |
CN105242638A (en) * | 2015-10-28 | 2016-01-13 | 中国南方航空工业(集团)有限公司 | Blade five-axis machining programming processing method and device |
CN108549319A (en) * | 2018-04-02 | 2018-09-18 | 西南交通大学 | A kind of double general post-processing approach of turntable five-axle number control machine tool |
CN110096033A (en) * | 2019-05-09 | 2019-08-06 | 江苏南高智能装备创新中心有限公司 | A method of check and correction numerical control program precision |
WO2022054703A1 (en) * | 2020-09-09 | 2022-03-17 | ファナック株式会社 | Tool path correction device |
CN114518726A (en) * | 2020-11-20 | 2022-05-20 | 航天科工惯性技术有限公司 | Post-processing development method and device of four-axis semi-numerical control machine tool and numerical control machine tool equipment |
CN116540638A (en) * | 2023-07-05 | 2023-08-04 | 成都瑞雪丰泰精密电子股份有限公司 | Method, device and storage medium for post-processing CAM numerical control machining program |
Non-Patent Citations (5)
Title |
---|
任涛: "基于hyperpost 平台Siemens 数控***后处理的应用", 《智能制造》, no. 9 * |
孙耀恒 等: "基于五轴联动机床后处理的开发与验证", 《机械研究与应用》, vol. 33, no. 166 * |
王科健: "基于UG 不同数控***后处理程序定制研究", 《内燃机与配件》 * |
董凤娟: "整体叶轮五坐标数控加工及其仿真研究_", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》, no. 8 * |
顾欢军: "基于UGNX的数控后置处理***设计与实现", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》, no. 3 * |
Also Published As
Publication number | Publication date |
---|---|
CN117311268B (en) | 2024-02-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108984155B (en) | Data processing flow setting method and device | |
CN111857470B (en) | Unattended control method and device for production equipment and controller | |
CN108536745B (en) | Shell-based data table extraction method, terminal, equipment and storage medium | |
CN112435297B (en) | Target object pose determining method and device, storage medium and electronic equipment | |
CN112988873A (en) | Data processing method and device | |
CN101201833A (en) | System and method for filling PDF document data | |
CN117311268B (en) | Method for post-processing file and related device | |
CN106815010B (en) | Method and device for operating database | |
CN107436883B (en) | Data extraction method, device and system based on remainder | |
CN112380239A (en) | Script generation method, device, equipment and storage medium | |
CN111475159A (en) | Method, device and storage medium for automatically generating program | |
CN111240681A (en) | Method and device for converting different programming languages | |
CN111026796A (en) | Multi-source heterogeneous data acquisition method, device, system, medium and equipment | |
CN109298686A (en) | System and method for using business intelligence for rule-based design and manufacture technology | |
CN105607957B (en) | A kind of data acquisition analysis system based on OPC DA | |
CN112987653B (en) | Method and device for converting Chinese program into G code | |
CN112685041A (en) | Front-end modular grammar conversion method, system and storage medium | |
CN107861725B (en) | iOS data reverse automatic analysis strategy | |
CN110704625A (en) | CAD (computer-aided design) -based drawing information batch automatic processing method | |
CN116705171B (en) | Batch biological data processing method, device and medium | |
CN111221821A (en) | AI model iterative updating method, electronic equipment and storage medium | |
CN112597220B (en) | Data file reading method, device, electronic equipment and medium | |
CN112767516B (en) | Method and device for determining dot diagram of nuclear power test procedure and computer equipment | |
CN115878083A (en) | Data dictionary generation method and device, storage medium and electronic equipment | |
US11435721B2 (en) | Parameter setting device and parameter setting system for machine tool |
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 |