Automatic conversion method of NC machining codes for 5-axis machine tools with different structures based on Java platform

Through the automatic conversion method based on the Java platform, the coordinate system correspondence between the 5-axis linkage machine tools of different structures is established, which solves the problem that code cannot be automatically converted, and efficient and reliable code conversion is achieved, which improves the conversion efficiency and reliability of the processing process.

CN115167286BActive Publication Date: 2025-04-15AEROSPACE SCI & IND HARBIN FENGHUA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210962088.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-11
Publication Date
2025-04-15
Estimated Expiration
2042-08-11

AI Technical Summary

Technical Problem

The CNC machining code between 5-axis linkage machine tools with different structures cannot be automatically converted, resulting in low manual conversion efficiency and prone to quality and safety hazards.

Method used

The automatic conversion method based on the Java platform is adopted, and the coordinate system correspondence between machine tools is established by reading the CNC machining code information of the model, and the conversion logic table is generated. Java's replaceAll() and custom cTran() functions are used for code replacement and numerical operations to realize automatic code conversion.

Benefits of technology

Automatic conversion of 5-axis linkage code is realized, which eliminates confusion and error risks in manual operations, improves the reliability and conversion efficiency of the processing process, and reduces the time to complete tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115167286B_ABST
    Figure CN115167286B_ABST
Patent Text Reader

Abstract

The invention discloses an automatic conversion method of numerical control machining codes of 5-axis linkage machine tools with different structures based on Java platform, which belongs to the field of numerical control technology. The invention solves the problem that the numerical control machining codes of 5-axis linkage machine tools with different structures cannot be automatically converted. The invention reads the numerical control machining code information of the model to be processed, determines the model of the 5-axis linkage machine tool before conversion and the model of the 5-axis linkage machine tool to be converted; establishes a relationship between the machine tools before conversion and to be converted through the directions of the linear axis and the rotation axis in the coordinate system: draws the coordinate systems of the two machine tools and the angles of the rotation axis in a drawing manner, and keeps the origins of the two coordinate systems coincident; draws the corresponding relationship diagram, lists the conversion corresponding table, and obtains the conversion logic; extracts the substring of the numerical control machining code information, and then converts it into a numerical value, converts the converted numerical value according to the conversion logic, and obtains the converted numerical control machining code information of the picture to be processed. The invention improves the reliability of the processing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of numerical control, and in particular relates to an automatic conversion method for numerical control machining codes of 5-axis linkage machine tools with different structures based on a Java platform. Background Art

[0002] In CNC machining, we often encounter the situation that some codes used for machining cannot find the digital model used when they were originally compiled; or even if there is a digital model, there is no tool path trajectory used to generate the code. When the code needs to be adjusted from one machine tool to a machine tool with another structure, it cannot be achieved by regenerating the code through programming software. Therefore, studying the conversion rules of codes between machine tools with different structures has become the best way to solve this problem.

[0003] Of course, in some cases, it is also possible not to use code. When the processing requirements are mastered and the model is relatively simple, the processing task can be completed by remodeling and re-coding. However, this method has certain limitations. If the model is relatively complex, the modeling process is not easy to copy 100%; and it is difficult to ensure that the regenerated tool path trajectory is exactly the same as the one used before, and the impact of this change is unknown. When processing important products, a little change will become a factor affecting quality. Therefore, for these products, the best way is not to reprogram, but to convert through code.

[0004] CIMCO software, which is more commonly used in the CNC industry, provides workshop DNC solutions and also has certain CNC machining code editing functions, which can realize batch replacement and insertion of strings that meet custom rules; however, it cannot provide a complete conversion solution for the automatic conversion of 5-axis linkage machining codes to suitable forms for machine tools with different structures. Moreover, when using CIMCO software for conversion, manual repeated operations are required, and only one rule can be converted each time. To successfully convert the CNC program to a state that can be used by different devices, multiple different conversion operations need to be completed, and the conversion efficiency is very low; and once a punctuation mark is entered incorrectly, there will be imperceptible quality and safety risks. Summary of the invention

[0005] The problem to be solved by the present invention is that the numerical control machining codes of 5-axis linkage machine tools with different structures cannot be automatically converted. An automatic conversion method for the numerical control machining codes of 5-axis linkage machine tools with different structures based on a Java platform is proposed.

[0006] To achieve the above object, the present invention is implemented through the following technical solutions:

[0007] The automatic conversion method of numerical control machining codes of 5-axis linkage machine tools with different structures based on Java platform includes the following steps:

[0008] S1, reading the CNC machining code information of the model to be processed, and determining the model of the 5-axis linkage machine tool before conversion and the model of the 5-axis linkage machine tool to be converted;

[0009] S2. Establish a relationship between the 5-axis linkage machine tools before and after the conversion in step S1 through the directions of the linear axes and the rotation axes in the coordinate system: Draw the coordinate systems of the two machine tools in correspondence with the angles of the rotation axes by drawing, and keep the origins of the two coordinate systems coincident. If the rotation axes are different, the rotation axes of the two coordinate systems before and after are made coincident with each other by rotating the coordinate systems when drawing, and obtain a corresponding relationship diagram;

[0010] S3, according to the corresponding relationship diagram drawn in step S2, a conversion corresponding table is listed to obtain the conversion logic;

[0011] S4. Extract a substring from the CNC machining code information of the image to be processed in step S1, and then convert it into a numerical value. Convert the converted numerical value according to the conversion logic obtained in step S3. The replacement operation in the conversion process is completed by the replaceAll() function of Java, and the self-increment or self-decrement operation is completed by the custom cTran() function to obtain the converted CNC machining code information of the image to be processed.

[0012] Furthermore, the 5-axis linkage machine tools with different structures are any two of the AC-axis vertical cradle structure machine tools, BC-axis vertical cradle structure machine tools and other customized vertical rotary axis structure machine tools applicable to the M114 mode or the M128 mode.

[0013] Furthermore, based on the Java platform, in a main class, an instance of the JTabbedPane type is established, which includes two JPanel type tab objects, simplePanel and customPanel. In the simplePanel tab, basic components such as labels, scroll bars, buttons, and check boxes are created, and the size and position attributes are set respectively, and the names and contents of the basic components are initialized; two variables are created, the first variable is an int type noExpM114 object, whose value is initialized to 0, and the range value is 1 to 6, which is used to record and judge the selection result of the M114 model 5-axis linkage machine tool mode under the simplePanel tab object; the second variable is an int type noExpM114 object, whose value is initialized to 0, and the range value is 1 to 6, which is used to record and judge the selection result of the button in the M128 model 5-axis linkage machine tool mode under the simplePanel tab object.

[0014] Furthermore, the selection results in the 5-axis linkage machine tool mode of the M114 model under the simplePanel tab object include: the first solution of AC to BC in M114 mode, the second solution of AC to BC in M114 mode, the first solution of BC to AC in M114 mode, the second solution of BC to AC in M114 mode, the C-axis turntable of the AC-axis machine tool rotates 180 degrees in M114 mode, and the C-axis turntable of the BC-axis machine tool rotates 180 degrees in M114 mode.

[0015] Furthermore, the selection results in the 5-axis linkage machine tool mode of the M128 model under the simplePanel tab object include: the first solution of AC to BC in M128 mode, the second solution of AC to BC in M128 mode, the first solution of BC to AC in M128 mode, the second solution of BC to AC in M128 mode, the C-axis turntable of the AC-axis machine tool rotates 180 degrees in M128 mode, and the C-axis turntable of the BC-axis machine tool rotates 180 degrees in M128 mode.

[0016] Furthermore, under the two variables noExpM114 and noExpM128 under the simplePanel tab object, a conversion window is created. Each time an instance of a window with the Stringstr0 attribute is created, the conversion logic of step S3 is recorded in the attributes of Stringstr0.

[0017] Furthermore, under the customPanel tab object, a custom conversion window is created. In the custom conversion window, four String[] array objects are created, which are used to store the selectable options in the four drop-down list boxes respectively.

[0018] Furthermore, the conversion method of step S4 includes the following steps:

[0019] S4.1. When text replacement is involved, use the replaceAll() method to complete the replacement of substrings in the code according to the conversion logic obtained in step S3;

[0020] S4.2. When numerical calculations are involved, use the custom cTran() method to complete the corresponding numerical calculations in the code according to the conversion logic obtained in step S3.

[0021] Furthermore, step S4.2 of customizing the cTran() method includes the following steps:

[0022] S4.2.1. Using a regular expression, extract the substrings of the coordinate values ​​that need to be incremented or decremented from the NC machining code information of the image to be processed in step S1 in turn according to the conversion logic obtained in step S3;

[0023] S4.2.2, using two int arrays to record the start and end index positions of each extracted substring, and using two String arrays to store COUNT extracted substrings and COUNT+1 intermittent substrings remaining after the strings are taken out;

[0024] S4.2.3, then create a string array mediumstrs with the number of elements = COUNT×2+1, fill the element positions 0, 2, 4...(COUNT×2) of the array with the discontinuous substrings obtained in step S4.2.2, and fill the element positions 1, 3, 5...(COUNT×2-1) of the array with the extracted substrings obtained in step S4.2.2;

[0025] S4.2.4. Finally, through the string concatenation method concat(), all elements in the mediumstrs array are concatenated into a complete string and its value is returned to obtain the converted CNC machining code information of the image to be processed.

[0026] The beneficial effects of the present invention are:

[0027] Compared with the prior art, the automatic conversion method of the numerical control machining code of the 5-axis linkage machine tools with different structures based on the Java platform of the present invention has the following advantages:

[0028] 1. It eliminates the hidden dangers of confusion and mistakes caused by manual code replacement;

[0029] 2. Solved the problem that the spatial position of the 5-axis linkage code conversion is difficult to imagine and the safety is difficult to judge;

[0030] 3. When the model is lost and the program cannot be regenerated, the results of repeated debugging and confirmation can be restored to the greatest extent, improving the reliability of the processing process;

[0031] 4. Simplify the complex code conversion process into "one-click conversion", replacing manual logic deduction and tedious verification process;

[0032] 5. High conversion efficiency can greatly shorten the time to complete the given task. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a logical structure diagram of the method for automatically converting the numerical control machining codes of 5-axis linkage machine tools with different structures based on the Java platform according to the present invention;

[0034] Figure 2 This is a basic principle diagram of the first solution of AC to BC conversion in the M114 mode of the present invention;

[0035] Figure 3 This is a basic principle diagram of the second solution of AC to BC conversion in the M114 mode of the present invention;

[0036] Figure 4 This is a basic principle diagram of the first solution of BC to AC conversion in the M114 mode of the present invention;

[0037] Figure 5 This is a basic principle diagram of the second solution of BC to AC conversion in the M114 mode of the present invention;

[0038] Figure 6 It is a basic principle diagram of the C-axis turntable of the AC-axis machine tool rotating 180 degrees in the M114 mode of the present invention;

[0039] Figure 7 It is a basic principle diagram of the C-axis turntable of the BC-axis machine tool rotating 180 degrees in the M114 mode of the present invention;

[0040] Figure 8 This is a basic principle diagram of the first solution of AC to BC conversion in M128 mode of the present invention;

[0041] Fig. 9 This is a basic principle diagram of the second solution of AC to BC in the M128 mode of the present invention;

[0042] Fig.10 This is a basic principle diagram of the first solution of BC to AC conversion in the M128 mode of the present invention;

[0043] Fig.11 This is a basic principle diagram of the second solution of BC to AC conversion in the M128 mode of the present invention;

[0044] Fig.12 It is a basic principle diagram of the C-axis turntable of the AC-axis machine tool rotating 180 degrees in the M128 mode of the present invention;

[0045] Fig.13 It is a basic principle diagram of the C-axis turntable of the BC-axis machine tool rotating 180 degrees in the M128 mode of the present invention;

[0046] Fig.14 This is a basic operation interface diagram of the method for automatically converting numerical control machining codes of 5-axis linkage machine tools with different structures based on the Java platform according to the present invention;

[0047] Fig.15 This is a simplePanel tab interface diagram of the method for automatically converting numerical control machining codes of 5-axis linkage machine tools with different structures based on the Java platform of the present invention;

[0048] Fig.16This is a diagram of the customPanel tab interface for operating the method for automatically converting CNC machining codes for 5-axis linkage machine tools with different structures based on a Java platform according to the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present invention more clear, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the specific embodiments described are only part of the embodiments of the present invention, rather than all of the specific embodiments. The components of the specific embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations, and the present invention can also have other embodiments.

[0050] Therefore, the following detailed description of the specific embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected specific embodiments of the present invention. Based on the specific embodiments of the present invention, all other specific embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0051] In order to further understand the content, features and effects of the present invention, the following specific implementation modes are given as examples and described in detail with reference to the accompanying drawings: Specific implementation method one:

[0053] The automatic conversion method of numerical control machining codes of 5-axis linkage machine tools with different structures based on Java platform includes the following steps:

[0054] S1, reading the CNC machining code information of the model to be processed, and determining the model of the 5-axis linkage machine tool before conversion and the model of the 5-axis linkage machine tool to be converted;

[0055] S2. Establish a relationship between the 5-axis linkage machine tools before and after the conversion in step S1 through the directions of the linear axes and the rotation axes in the coordinate system: Draw the coordinate systems of the two machine tools in correspondence with the angles of the rotation axes by drawing, and keep the origins of the two coordinate systems coincident. If the rotation axes are different, the rotation axes of the two coordinate systems before and after are made coincident with each other by rotating the coordinate systems when drawing, and obtain a corresponding relationship diagram;

[0056] S3, according to the corresponding relationship diagram drawn in step S2, a conversion corresponding table is listed to obtain the conversion logic;

[0057] Further, in this embodiment, the basic principle diagram of the first solution of converting the AC axis vertical cradle structure machine tool into the BC axis vertical cradle structure machine tool in the M114 mode is as follows: Figure 2 As shown, the conversion logic of step S3 is:

[0058] The first step is to replace all the "Y+" characters in the code with "&-" characters;

[0059] The second step is to replace all the "Y" characters in the code with "&-" characters;

[0060] The third step is to replace all the "&--" characters in the code with "&+" characters;

[0061] Step 4: Replace all "X" characters in the code with "Y" characters;

[0062] Step 5: Replace all "&" characters in the code with "X" characters;

[0063] Step 6. Replace all "A" characters in the code with "B" characters.

[0064] S4, extracting a substring from the NC machining code information of the image to be processed in step S1, and then converting it into a numerical value, converting the converted numerical value according to the conversion logic obtained in step S3, the replacement operation in the conversion process is completed by the replaceAll() function of Java, and the self-increment or self-decrement operation is completed by the custom cTran() function, so as to obtain the converted NC machining code information of the image to be processed;

[0065] Furthermore, the function calculation method of step S4 includes the following steps:

[0066] S4.1. When text replacement is involved, use the replaceAll() method to complete the replacement of substrings in the code according to the conversion logic obtained in step S3;

[0067] S4.2. When numerical calculations are involved, use the custom cTran() method to complete the corresponding numerical calculations in the code according to the conversion logic obtained in step S3.

[0068] Furthermore, step S4.2 of customizing the cTran() method includes the following steps:

[0069] S4.2.1. Using a regular expression, extract the substrings of the coordinate values ​​that need to be incremented or decremented from the NC machining code information of the image to be processed in step S1 in turn according to the conversion logic obtained in step S3;

[0070] S4.2.2, using two int arrays to record the start and end index positions of each extracted substring, and using two String arrays to store COUNT extracted substrings and COUNT+1 intermittent substrings remaining after the strings are taken out;

[0071] S4.2.3, then create a string array mediumstrs with the number of elements = COUNT×2+1, fill the element positions 0, 2, 4...(COUNT×2) of the array with the discontinuous substrings obtained in step S4.2.2, and fill the element positions 1, 3, 5...(COUNT×2-1) of the array with the extracted substrings obtained in step S4.2.2;

[0072] S4.2.4. Finally, through the string concatenation method concat(), all elements in the mediumstrs array are concatenated into a complete string and its value is returned to obtain the converted CNC machining code information of the image to be processed.

[0073] Furthermore, the 5-axis linkage machine tools with different structures are any two of the AC-axis vertical cradle structure machine tools, BC-axis vertical cradle structure machine tools and other customized vertical rotary axis structure machine tools applicable to the M114 mode or the M128 mode.

[0074] Furthermore, based on the Java platform, in a main class, an instance of the JTabbedPane type is established, which includes two JPanel type tab objects, simplePanel and customPanel. In the simplePanel tab, basic components such as labels, scroll bars, buttons, and check boxes are created, and the size and position attributes are set respectively, and the names and contents of the basic components are initialized; two variables are created, the first variable is an int type noExpM114 object, whose value is initialized to 0, and the range value is 1 to 6, which is used to record and judge the selection result of the M114 model 5-axis linkage machine tool mode under the simplePanel tab object; the second variable is an int type noExpM114 object, whose value is initialized to 0, and the range value is 1 to 6, which is used to record and judge the selection result of the button in the M128 model 5-axis linkage machine tool mode under the simplePanel tab object.

[0075] Furthermore, the selection results in the 5-axis linkage machine tool mode of the M114 model under the simplePanel tab object include: the first solution of AC to BC in M114 mode, the second solution of AC to BC in M114 mode, the first solution of BC to AC in M114 mode, the second solution of BC to AC in M114 mode, the C-axis turntable of the AC-axis machine tool rotates 180 degrees in M114 mode, and the C-axis turntable of the BC-axis machine tool rotates 180 degrees in M114 mode.

[0076] Furthermore, the selection results in the 5-axis linkage machine tool mode of the M128 model under the simplePanel tab object include: the first solution of AC to BC in M128 mode, the second solution of AC to BC in M128 mode, the first solution of BC to AC in M128 mode, the second solution of BC to AC in M128 mode, the C-axis turntable of the AC-axis machine tool rotates 180 degrees in M128 mode, and the C-axis turntable of the BC-axis machine tool rotates 180 degrees in M128 mode.

[0077] Furthermore, under the two variables noExpM114 and noExpM128 under the simplePanel tab object, a conversion window is created. Each time an instance of a window with the Stringstr0 attribute is created, the conversion logic of step S3 is recorded in the attributes of Stringstr0.

[0078] Furthermore, under the customPanel tab object, a custom conversion window is created. In the custom conversion window, four String[] array objects are created, which are used to store the selectable options in the four drop-down list boxes respectively.

[0079] Furthermore, three groups of objects are created for each drop-down list box, resulting in 12 drop-down list boxes, corresponding to "the first linear axis before conversion" (beginOption_1), "the second linear axis before conversion" (beginOption_2), "the first three linear axes before conversion" (beginOption_3), "the first linear axis after conversion" (finalOption_1), "the second linear axis after conversion" (finalOption_2), "the third linear axis after conversion" (finalOption_3), "the first rotational axis before conversion" (beginOption_4), "the second rotational axis before conversion" (beginOption_5), "the third rotational axis before conversion" (beginOption_6), "the first rotational axis after conversion" (finalOption_4), "the second rotational axis after conversion" (finalOption_5), and "the third rotational axis after conversion" (finalOption_6).

[0080] By default, only "First linear axis before conversion" (beginOption_1) and "First linear axis after conversion" (finalOption_1) are in the "available" (setEnabled(true)) state, and other drop-down list boxes are in the "unavailable" (setEnabled(false)) state; when the "simultaneous" button on the left end of other drop-down list boxes is checked, the corresponding two drop-down list boxes are switched to the "available" (setEnabled(true)) state. Specific implementation method 2:

[0082] The difference from the first specific implementation mode is that the basic principle diagram of the second solution of the AC axis vertical cradle structure machine tool to the BC axis vertical cradle structure machine tool in the M114 mode is as follows: Figure 3 As shown, the conversion logic of step S3 is:

[0083] The first step is to replace all "X+" characters in the code with "&-" characters;

[0084] The second step is to replace all the "X" characters in the code with "&-" characters;

[0085] The third step is to replace all the "&--" characters in the code with "&+" characters;

[0086] Step 4: Replace all "Y" characters in the code with "X" characters;

[0087] Step 5: Replace all "&" characters in the code with "Y" characters;

[0088] Step 6: Replace all "A+" characters in the code with "B-" characters;

[0089] Step 7: Replace all "A" characters in the code with "B-" characters;

[0090] Step 8. Replace all "B--" characters in the code with "B+". Specific implementation method three:

[0092] The difference from the first specific implementation mode is that the basic principle diagram of the first solution of the BC-axis vertical cradle structure machine tool to the AC-axis vertical cradle structure machine tool in the M114 mode is as follows: Figure 4 As shown, the conversion logic of step S3 is:

[0093] The first step is to replace all "X+" characters in the code with "&-" characters;

[0094] The second step is to replace all the "X" characters in the code with "&-" characters;

[0095] The third step is to replace all the "&--" characters in the code with "&+" characters;

[0096] Step 4: Replace all "Y" characters in the code with "X" characters;

[0097] Step 5: Replace all "&" characters in the code with "Y" characters;

[0098] Step 6. Replace all "B" characters in the code with "A" characters. Specific implementation method four:

[0100] The difference from the first specific implementation mode is that the basic principle diagram of the second solution of the BC-axis vertical cradle structure machine tool to the AC-axis vertical cradle structure machine tool in the M114 mode is as follows: Figure 5 As shown, the conversion logic of step S3 is:

[0101] The first step is to replace all the "Y+" characters in the code with "&-" characters;

[0102] The second step is to replace all the "Y" characters in the code with "&-" characters;

[0103] The third step is to replace all the "&--" characters in the code with "&+" characters;

[0104] Step 4: Replace all "X" characters in the code with "Y" characters;

[0105] Step 5: Replace all "&" characters in the code with "X" characters;

[0106] Step 6: Replace all "B+" characters in the code with "A-" characters;

[0107] Step 7: Replace all "B" characters in the code with "A-" characters;

[0108] Step 8. Replace all "A--" characters in the code with "A+". Specific implementation method five:

[0110] The difference from the first embodiment is that in this embodiment, the basic principle diagram of the C-axis turntable of the AC-axis vertical cradle structure machine tool rotating 180 degrees in the M114 mode is as follows: Figure 6 As shown, the conversion logic of step S3 is:

[0111] The first step is to replace all "X+" characters in the code with "&-" characters;

[0112] The second step is to replace all the "X" characters in the code with "&-" characters;

[0113] The third step is to replace all the "&--" characters in the code with "X+" characters;

[0114] Step 4: Replace all "&" characters in the code with "X" characters;

[0115] Step 5: Replace all "Y+" characters in the code with "&-" characters;

[0116] Step 6: Replace all "Y" characters in the code with "&-" characters;

[0117] Step 7. Replace all "&--" characters in the code with "Y+" characters;

[0118] Step 8. Replace all "&" characters in the code with "Y" characters;

[0119] Step 9: Replace all "A+" characters in the code with "&-" characters;

[0120] Step 10. Replace all "A" characters in the code with "&-" characters.

[0121] Step 11: Replace all "&--" characters in the code with "A+" characters;

[0122] Step 12: Replace all "&" characters in the code with "A" characters;

[0123] Step 13: Increase the number following the "C" character in all codes by 180. Specific implementation method six:

[0125] The difference from the first embodiment is that in this embodiment, the basic principle diagram of the BC axis vertical cradle structure machine tool C axis turntable rotating 180 degrees in M114 mode is as follows: Figure 7 As shown, the conversion logic of step S3 is:

[0126] The first step is to replace all "X+" characters in the code with "&-" characters;

[0127] The second step is to replace all the "X" characters in the code with "&-" characters;

[0128] The third step is to replace all the "&--" characters in the code with "X+" characters;

[0129] Step 4: Replace all "&" characters in the code with "X" characters;

[0130] Step 5: Replace all "Y+" characters in the code with "&-" characters;

[0131] Step 6: Replace all "Y" characters in the code with "&-" characters;

[0132] Step 7. Replace all "&--" characters in the code with "Y+" characters;

[0133] Step 8. Replace all "&" characters in the code with "Y" characters;

[0134] Step 9: Replace all "B+" characters in the code with "&-" characters;

[0135] Step 10. Replace all "B" characters in the code with "&-" characters.

[0136] Step 11: Replace all "&--" characters in the code with "B+" characters;

[0137] Step 12: Replace all “&” characters in the code with “B” characters.

[0138] Step 13: Increase the number after all the "C" characters in the code by 180. Specific implementation method seven:

[0140] The difference from the first specific implementation mode is that the basic principle diagram of the first solution of the AC axis vertical cradle structure machine tool to the BC axis vertical cradle structure machine tool in the M128 mode is as follows: Figure 8 As shown, the conversion logic of step S3 is:

[0141] The first step is to replace all "A" characters in the code with "B" characters;

[0142] The second step is to decrement 90 from all the numbers following the "C" character in the code. Specific implementation eight:

[0144] The difference from the first specific implementation mode is that the basic principle diagram of the second solution of the AC axis vertical cradle structure machine tool to the BC axis vertical cradle structure machine tool in the M128 mode is as follows: Fig. 9 As shown, the conversion logic of step S3 is:

[0145] The first step is to replace all "A+" characters in the code with "B-" characters;

[0146] The second step is to replace all "A" characters in the code with "B-" characters;

[0147] The third step is to replace all "B--" characters in the code with "B+" characters.

[0148] Step 4: Increase the number after all the "C" characters in the code by 90. Specific implementation method nine:

[0150] The difference from the first specific implementation mode is that the basic principle diagram of the first solution of the BC-axis vertical cradle structure machine tool to the AC-axis vertical cradle structure machine tool in the M128 mode is as follows: Fig.10 As shown, the conversion logic of step S3 is:

[0151] The first step is to replace all "B" characters in the code with "A" characters;

[0152] The second step is to increase the number after all the "C" characters in the code by 90. Specific implementation method ten:

[0154] The difference from the first specific implementation mode is that the basic principle diagram of the second solution of the BC axis vertical cradle structure machine tool to the AC axis vertical cradle structure machine tool in the M128 mode is as follows: Fig.11 As shown, the conversion logic of step S3 is:

[0155] The first step is to replace all "B+" characters in the code with "A-" characters;

[0156] The second step is to replace all the "B" characters in the code with "A-" characters;

[0157] The third step is to replace all "A--" characters in the code with "A+".

[0158] Step 4: Subtract 90 from all the numbers after the "C" character in the code. Specific implementation method eleven:

[0160] The difference from the first embodiment is that in this embodiment, the basic principle diagram of the C-axis turntable of the AC-axis vertical cradle structure machine tool rotating 180 degrees in the M128 mode is as follows: Fig.12 As shown, the conversion logic of step S3 is:

[0161] The first step is to replace all "A+" characters in the code with "&-" characters;

[0162] The second step is to replace all "A" characters in the code with "&-" characters;

[0163] The third step is to replace all the "&--" characters in the code with "A+" characters;

[0164] Step 4: Replace all "&" characters in the code with "A" characters;

[0165] Step 5: Increase the number following the "C" character in the code by 180. Specific implementation twelve:

[0167] The difference from the first embodiment is that in this embodiment, the basic principle diagram of the BC axis vertical cradle structure machine tool C axis turntable rotating 180 degrees in M128 mode is as follows: Fig.13 As shown, the conversion logic of step S3 is:

[0168] The first step is to replace all "B+" characters in the code with "&-" characters;

[0169] The second step is to replace all the "B" characters in the code with "&-" characters;

[0170] The third step is to replace all the "&--" characters in the code with "B+" characters;

[0171] Step 4: Replace all "&" characters in the code with "B" characters;

[0172] Step 5: Increase the number following the "C" character in the code by 180.

[0173] The key points and protection points of this patent are:

[0174] 1. Establish a connection between 5-axis linkage machine tools of different structures through the directions of the linear axis and the rotation axis in the coordinate system. By capturing the corresponding relationship between the axes in the two cases, the specific conversion steps are derived in the form of formulas, and the verified conversion steps are written into a computer language that can realize automatic conversion, so as to obtain the corresponding conversion tool;

[0175] 2. By using the method of drawing coordinate system, the complex conversion process is simplified into a limited number of logical substitutions or numerical operations in sequence, and the substitution and operation process is built into the Windows application software through the development function of the Java platform;

[0176] 3. In one implementation, an array is used to store the index of the substring position, and another array is constructed to complete the splicing of scattered substrings, so as to realize the conversion function that the ReplaceAll() method in the String tool class cannot realize (i.e., the function of "extracting substrings → converting to numerical values ​​→ calculating → sending the numerical values ​​back to the original position");

[0177] 4. In one embodiment, the coordinate axis information before conversion is stored through different variables. When all the information is stored, the conversion is performed centrally, so as to achieve the expected effect of delayed assignment and no conflict between the coordinate axes.

[0178] The present invention discloses an automatic conversion method and conversion software for CNC machining codes between 5-axis linkage machine tools with different structures. The method comprises: by making certain logical modifications to a character string, a coordinate system conversion process based on Cartesian coordinate system theory is realized, mathematical and spatial geometry principles are satisfied, and automatic conversion of coordinate values ​​between two CNC machining machine tools with the same operating system but different structures is realized. The core function is the mutual conversion of the same coordinate point in different coordinate systems.

[0179] The technology "CNC machining program conversion method and device" which is somewhat similar to the present application, has the function of realizing the conversion of CNC machining programs between different operating systems, for example, between Fanuc, Siemens, Heidenhain and other operating systems, even if the tool path is the same, the keywords used in each operating system, as well as the way to express coordinate points, are generally not universal. Therefore, this technology solves the problem of switching the same tool path between different languages, similar to translating from English to Chinese, which is equivalent to the equivalent translation of sentences.

[0180] The problem solved by the present application is not the difference between different operating systems, but the adjustment of point coordinates that must be made to achieve the same predetermined trajectory due to different machine tool structures (for example, the rotating axes of the AC-axis cradle turntable machine tool and the BC-structure cradle turntable machine tool, one rotates around the X-axis, and the other rotates around the Y-axis). Due to the difference in structure, if the coordinate points applicable to the original machine tool are to be used in the new machine tool, they must be replaced with new point coordinates through corresponding mathematical calculations and conversions, rather than equivalent translations of statements. Even if the description of the software's visual interface or appearance controls is somewhat similar to the invention of "CNC machining program conversion method and device", it is essentially different from it in terms of core algorithms and usage conditions, and its functions are also to solve their own problems, and they are not contradictory to each other.

[0181] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0182] Although the present application has been described above with reference to specific embodiments, various modifications may be made thereto and parts thereof may be replaced with equivalents without departing from the scope of the present application. In particular, as long as there is no structural conflict, the various features in the specific embodiments disclosed in the present application may be used in combination with each other in any manner, and the fact that these combinations are not exhaustively described in this specification is only for the sake of omitting space and saving resources. Therefore, the present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. An automatic conversion method for CNC machining codes of 5-axis linkage machine tools with different structures based on Java platform, characterized by: The steps include: S1, reading the CNC machining code information of the model to be processed, and determining the model of the 5-axis linkage machine tool before conversion and the model of the 5-axis linkage machine tool to be converted; S2. Establish a relationship between the 5-axis linkage machine tools before and after the conversion in step S1 through the directions of the linear axes and the rotation axes in the coordinate system: Draw the coordinate systems of the two machine tools in correspondence with the angles of the rotation axes by drawing, and keep the origins of the two coordinate systems coincident. If the rotation axes are different, the rotation axes of the two coordinate systems before and after are made coincident with each other by rotating the coordinate systems when drawing, and obtain a corresponding relationship diagram; S3, obtaining the conversion logic according to the corresponding relationship diagram drawn in step S2; S4, extracting a substring from the NC machining code information of the image to be processed in step S1, and then converting it into a numerical value, converting the converted numerical value according to the conversion logic obtained in step S3, the replacement operation in the conversion process is completed by the replaceAll() function of Java, and the self-increment or self-decrement operation is completed by the custom cTran() function, so as to obtain the converted NC machining code information of the image to be processed; The conversion method of step S4 comprises the following steps: S4.

1. When text replacement is involved, use the replaceAll() method to complete the replacement of substrings in the code according to the conversion logic obtained in step S3; S4.

2. When numerical calculations are involved, use the custom cTran() method to complete the calculations of the corresponding numerical values ​​in the code according to the conversion logic obtained in step S3; Step S4.2 Customizing the cTran() method includes the following steps: S4.2.

1. Using a regular expression, extract the substrings of the coordinate values ​​that need to be incremented or decremented from the NC machining code information of the image to be processed in step S1 in turn according to the conversion logic obtained in step S3; S4.2.2, using two int arrays to record the start and end index positions of each extracted substring, and using two String arrays to store COUNT extracted substrings and COUNT+1 intermittent substrings remaining after the strings are taken out; S4.2.

3. Then, create a string array mediumstrs with the number of elements = COUNT×2+1, fill the element positions 0, 2, 4... (COUNT×2) of the array with the discontinuous substrings obtained in step S4.2.2, and fill the element positions 1, 3, 5... (COUNT×2-1) of the array with the extracted substrings obtained in step S4.2.2; S4.2.

4. Finally, through the string concatenation method concat(), all elements in the mediumstrs array are concatenated into a complete string and its value is returned to obtain the converted CNC machining code information of the image to be processed.

2. The method for automatically converting the numerical control machining codes of 5-axis linkage machine tools with different structures based on the Java platform according to claim 1 is characterized in that: The 5-axis linkage machine tools with different structures are any two of the AC-axis vertical cradle structure machine tools, BC-axis vertical cradle structure machine tools and other customized vertical rotary axis structure machine tools applicable to the M114 mode or the M128 mode.

3. The automatic conversion method of numerical control machining codes of 5-axis linkage machine tools with different structures based on Java platform according to claim 1 or 2, characterized in that: Based on the Java platform, in a main class, create an instance of the JTabbedPane type, which contains two JPanel type tab objects, simplePanel and customPanel. In the simplePanel tab, create basic components such as labels, scroll bars, buttons, and check boxes, set the size and position properties respectively, and initialize the names and contents of the basic components. Create two variables. The first variable is an int type noExpM114 object, whose value is initialized to 0 and has a range of 1 to 6. It is used to record and judge the selection result of the 5-axis linkage machine tool mode of the M114 model under the simplePanel tab object. The second variable is an int type noExpM128 object, whose value is initialized to 0 and has a range of 1 to 6. It is used to record and judge the selection result of the button in the 5-axis linkage machine tool mode of the M128 model under the simplePanel tab object.

4. The method for automatically converting the numerical control machining codes of 5-axis linkage machine tools with different structures based on the Java platform according to claim 3 is characterized in that: The selection results in the 5-axis linkage machine tool mode of the M114 model under the simplePanel tab object include: the first solution of AC to BC in M114 mode, the second solution of AC to BC in M114 mode, the first solution of BC to AC in M114 mode, the second solution of BC to AC in M114 mode, the C-axis rotary table of the AC-axis machine tool rotates 180 degrees in M114 mode, and the C-axis rotary table of the BC-axis machine tool rotates 180 degrees in M114 mode.

5. The method for automatically converting the numerical control machining codes of five-axis linkage machine tools with different structures based on the Java platform according to claim 4 is characterized in that: The selection results in the 5-axis linkage machine tool mode of the M128 model under the simplePanel tab object include: the first solution of AC to BC in M128 mode, the second solution of AC to BC in M128 mode, the first solution of BC to AC in M128 mode, the second solution of BC to AC in M128 mode, the C-axis rotary table of the AC-axis machine tool rotates 180 degrees in M128 mode, and the C-axis rotary table of the BC-axis machine tool rotates 180 degrees in M128 mode.

6. The method for automatically converting the numerical control machining codes of five-axis machine tools with different structures based on the Java platform according to claim 5 is characterized in that: Under the two variables noExpM114 and noExpM128 under the simplePanel tab object, a conversion window is created. Each time an instance of the window with the String str0 attribute is created, the conversion logic of step S3 is recorded in the attributes of String str0.

7. The method for automatically converting the numerical control machining codes of five-axis linkage machine tools with different structures based on the Java platform according to claim 6 is characterized in that: Under the customPanel tab object, create a custom conversion window. In the custom conversion window, create four String[] array objects, which are used to store the selectable options in the four drop-down list boxes.