Arc interpolation output optimization method and system
By declaring user variables and intelligently judging arc types in the CNC system and selecting appropriate output methods, the alarm problem caused by insufficient coordinate accuracy of the end point of the arc interpolation command is solved, and higher processing accuracy and system stability are achieved.
Patent Information
- Application Number
- CN202411680166.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-18
AI Technical Summary
In the existing CNC system, the alarm problem of "radius value exceeding the difference" caused by insufficient coordinate accuracy of the arc interpolation command will affect the processing accuracy and system stability.
By declaring user variables containing points, axis angles and arc radius, intelligently judge the arc type and selecting the appropriate output method (center method or radius method), ensure the precise assignment and output of the coordinates of the end point of the arc.
It effectively solves the alarm problem caused by insufficient coordinate accuracy of arc command end point in CNC system, ensures the accuracy and universality of NC programs, and improves debugging efficiency and accuracy.
Smart Images

Figure CN119644905A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of numerical control machining, and in particular to a circular arc interpolation output optimization method and system. Background Art
[0002] In the field of CNC machining, circular interpolation instructions are one of the commonly used instructions in milling, which can enable the tool to move along a predetermined circular arc trajectory on the workpiece. For CNC systems such as FANUC and Siemens, circular interpolation instructions are usually expressed in two ways: the center method and the radius method.
[0003] The center method defines the component values of the arc start point to the center position on the X, Y, and Z axes by giving the numerical values after I, J, and K, thereby determining the center position of the arc interpolation. This method requires the clear start and end points of the arc and the position of the center relative to the start point. However, there is a significant problem with the center method, namely the accuracy of the arc end point position. When the difference in radius values at the start and end points of the arc exceeds the allowable value set by the CNC system (such as parameter No. 3410 of the FANUC system), the system will issue an alarm (such as PS0020) "Radius value out of tolerance". This is because the deterministic parameters output by the center method include the coordinates of the arc start point position, the distance of the arc center relative to the arc start point, and the coordinates of the arc end point position, but when determining the shape and position of the arc based on this information, there is an over-constraint problem, such as Figure 1 If the arc end point coordinates given by the program code are not accurate enough, the system will alarm due to over-constraint during actual machine tool operation.
[0004] The radius method determines the arc radius by giving an R value, thereby confirming the arc through the arc start point, end point and arc radius. Among them, when R is a positive value, it means that the center angle of the circle is less than or equal to 180°, and when R is a negative value, it means that the center angle of the circle is greater than 180°. This method simplifies the writing of arc interpolation instructions to a certain extent, but there are problems when processing full circle instructions. Because the end point and starting point of the full circle instruction are at the same position, the center position of the arc cannot be determined using the radius method.
[0005] At present, the arc output command used by QJCAM's existing QJPP post-processing files is G02 / G03Xp_Yp_I_J_F_, which is the circle center method output method. Although this method can cover most arc processing scenarios, it is easy to cause the CNC system to alarm when the machine tool executes the program due to the above-mentioned arc end point position accuracy problem. Therefore, it is necessary to optimize the arc interpolation output in QJPP post-processing to solve this problem. Summary of the invention
[0006] To this end, an embodiment of the present invention provides a circular interpolation output optimization method and system for solving the problem of "radius value out of tolerance" in the numerical control system alarm caused by insufficient accuracy of the coordinates of the end point of the circular interpolation instruction in the prior art.
[0007] In order to solve the above problem, an embodiment of the present invention provides a circular interpolation output optimization method, which includes:
[0008] Declare user variables, wherein the user variables include point position, axis angle and arc radius;
[0009] Based on the user variables, determine the output content of the arc interpolation instruction, and output corresponding NC program instructions for different arc planes;
[0010] Based on the NC program instructions, the type of arc is determined according to the size of the center angle:
[0011] Based on the type of the arc, the arc end point position coordinates are assigned to user-defined variables respectively, and according to the judgment result of the center angle, the center method arc output block or the radius method arc output block is edited;
[0012] Integrate the edited circular interpolation output block into the NC program and output it.
[0013] Preferably, the method for determining the output content of the arc interpolation instruction and outputting the corresponding NC program instruction for different arc planes is:
[0014] Use the arc working plane variable m_arc_plane_mcs provided by QJCAM software to determine the output content of the arc interpolation instruction, and output the corresponding NC program instructions for different arc planes.
[0015] Preferably, the method of using the arc working plane variable m_arc_plane_mcs provided by the QJCAM software to determine the output content of the arc interpolation instruction and outputting the corresponding NC program instructions for different arc planes includes:
[0016] If the arc work plane variable belongs to the XY plane, then XYIJ is output and ZK is shielded;
[0017] If the arc work plane variable belongs to the YZ plane, then YZJK is output and XI is shielded;
[0018] If the arc work plane variable belongs to the ZX plane, then ZXKI is output and YJ is shielded;
[0019] Among them, XYZ corresponds to the coordinates of the arc end point, and IJK is the deviation value of the arc center relative to the arc start point in the XYZ direction.
[0020] Preferably, the method for determining the type of arc according to the size of the central angle is:
[0021] If the central angle is less than or equal to 180°, the arc radius value remains positive, that is, the radius method is used and R+ is output, where R is the radius;
[0022] If the center angle is between 180° and 360°, the arc radius value is negated, that is, the radius method is used and R- is output.
[0023] Preferably, the method of assigning the arc endpoint position coordinates to user-defined variables is:
[0024] Assign the arc endpoint position coordinates to the user-defined variables user_axis_one / two / thr respectively.
[0025] Preferably, the method of editing the arc output block of the center method or the arc output block of the radius method according to the judgment result of the center angle includes:
[0026] Determine whether the center angle of the circle is 360°. If the center angle of the circle is 360°, that is, the arc is a full circle, then the center method is used to output the arc interpolation instruction; otherwise, the radius method is used to output the arc interpolation instruction;
[0027] Edit the arc output block using the center method or the arc output block using the radius method, and output the relevant information according to the command format requirements of the CNC system.
[0028] Preferably, the relevant information includes: m_sys_circle_code corresponds to the G02 / G03 arc interpolation direction, XYZ corresponds to the arc end position coordinates, IJK is the deviation value of the arc center relative to the arc starting point in the XYZ direction, F is the arc processing feed speed, and R is the arc radius.
[0029] The embodiment of the present invention further provides a circular interpolation output optimization system, which is used to implement the circular interpolation output optimization method described above, and specifically includes:
[0030] A variable declaration module is used to declare user variables, wherein the user variables include point positions, axis angles, and arc radius;
[0031] The arc working plane judgment module is used to judge the output content of the arc interpolation instruction based on the user variable, and output the corresponding NC program instruction for different arc planes;
[0032] The arc type judgment module is used to judge the type of the arc according to the size of the center angle based on the NC program instruction:
[0033] The position variable assignment and arc interpolation instruction output selection module is used to assign the arc end point position coordinates to user-defined variables based on the type of the arc, and edit the center method arc output block or the radius method arc output block according to the judgment result of the center angle;
[0034] The NC program output module is used to integrate the edited arc interpolation output block into the NC program and output it.
[0035] An embodiment of the present invention also provides an electronic device, which includes a processor, a memory and a bus system, wherein the processor and the memory are connected via the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the above-mentioned circular interpolation output optimization method.
[0036] An embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer software product, and the computer software product includes a number of instructions for enabling a computer device to execute the above-mentioned circular interpolation output optimization method.
[0037] It can be seen from the above technical solutions that the present invention has the following beneficial effects:
[0038] The embodiment of the present invention proposes a circular arc interpolation output optimization method and system, which effectively solves the "radius value out of tolerance" alarm problem caused by insufficient accuracy of the arc command end point coordinates in the numerical control system by accurately processing user variables, intelligently judging the arc type, and selecting the appropriate output method (center method or radius method), and ensures that the NC program can cover the processing requirements of all arcs from 0 to 360°. The method is suitable for widely used numerical control systems such as FANUC and Siemens, significantly improving the debugging efficiency, accuracy and versatility of numerical control machining programs, and providing programming engineers with more powerful and flexible tools. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the implementation cases of the present invention or the technical solutions in the prior art, the following is a brief description of the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention will be more clearly understood. The drawings are schematic and should not be understood as limiting the present invention in any way. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0040] Figure 1 A schematic diagram of an over-constraint problem in the circle center method in the background technology;
[0041] Figure 2 A flowchart of a circular interpolation output optimization method provided in an embodiment;
[0042] Figure 3 A schematic diagram of the architecture of an arc interpolation output optimization method provided in an embodiment
[0043] Figure 4 A coding diagram for declaring user variables in an embodiment;
[0044] Figure 5 A schematic diagram of coding for determining the output content of a circular interpolation instruction in an embodiment;
[0045] Figure 6 A schematic diagram of coding for determining the type of arc in an embodiment;
[0046] Figure 7 A schematic diagram of coding for assigning the arc end point position coordinates to user-defined variables in an embodiment;
[0047] Figure 8 It is a coding schematic diagram of using a corresponding method according to the judgment result of the central angle of a circle in the embodiment;
[0048] Fig. 9 A schematic diagram of editing a center-method arc output block and a radius-method arc output block in an embodiment;
[0049] Fig.10 This is a schematic diagram showing the full circle arc interpolation instruction in the embodiment;
[0050] Fig.11 This is a schematic diagram of an arc output with a central angle less than 180° in the embodiment;
[0051] Fig.12 Schematic diagram of an arc output with a center angle between 180° and 360° in the embodiment;
[0052] Fig.13 Schematic diagram of the arc interpolation direction in the embodiment - counterclockwise arc output;
[0053] Fig.14 A block diagram of a circular arc interpolation output optimization system provided in an embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] Embodiment 1
[0056] In order to solve the problem of "radius value out of tolerance" in the CNC system alarm caused by insufficient accuracy of the coordinates of the end point of the arc interpolation instruction in the prior art. Figure 2 As shown in FIG. 3, an embodiment of the present invention provides a circular arc interpolation output optimization method, the method comprising:
[0057] Step S1: Declare user variables, where the user variables include point position, axis angle and arc radius;
[0058] Step S2: Based on the user variable, determine the output content of the arc interpolation instruction, and output the corresponding NC program instruction for different arc planes;
[0059] Step S3: Based on the NC program instructions, determine the type of arc according to the size of the center angle:
[0060] Step S4: Based on the type of arc, the arc end position coordinates are assigned to user-defined variables respectively, and according to the judgment result of the center angle, the center method arc output block or the radius method arc output block is edited;
[0061] Step S5: Integrate the edited arc interpolation output block into the NC program and output it.
[0062] It can be seen from the above technical solution that the present invention proposes a circular interpolation output optimization method, which aims to solve the "radius value out of tolerance" alarm problem caused by insufficient accuracy of the coordinates of the end point of the circular interpolation instruction in the numerical control system. This method declares user variables containing point positions, axis angles, and arc radius, and outputs corresponding NC program instructions according to the arc plane. Subsequently, the arc type is determined based on the size of the center angle, and the coordinates of the arc end point are assigned to the user variable accordingly, and the arc output block of the center method or radius method is selected to be edited. Finally, the edited arc interpolation output block is integrated into the NC program and output, thereby ensuring that any processed arc can meet the requirements of the numerical control system, such as FANUC and Siemens, etc., avoiding program running alarms, shortening debugging time, and improving the efficiency and accuracy of programming engineers in issuing numerical control processing programs, achieving wider adaptability and higher versatility.
[0063] In step S1, in the QJPP post-processing constructor, you first need to declare user variables such as point position, axis angle, and arc radius that will be used later. These variables will be used in the subsequent arc interpolation output python function to ensure effective data transmission and processing. Declare user variables as follows Figure 4 shown.
[0064] In step S2, based on the user variable, the arc working plane variable m_arc_plane_mcs provided by the QJCAM software is used to determine the output content of the arc interpolation instruction, and the corresponding NC program instructions are output for different arc planes. This step ensures the matching of the arc interpolation instruction and the machining plane, and improves the accuracy of machining. Figure 5 As shown, step S2 specifically includes:
[0065] If the arc work plane variable belongs to the XY plane, then XYIJ is output and ZK is shielded;
[0066] If the arc work plane variable belongs to the YZ plane, then YZJK is output and XI is shielded;
[0067] If the arc work plane variable belongs to the ZX plane, then ZXKI is output and YJ is shielded;
[0068] Among them, XYZ corresponds to the coordinates of the arc end point, and IJK is the deviation value of the arc center relative to the arc start point in the XYZ direction.
[0069] In step S3, based on the above NC program instructions, the arc processing program compiled by QJCAM software determines the type of arc according to the size of the center angle. It determines whether the processed arc exceeds 180°, which determines the positive or negative R value when the radius method outputs the arc interpolation instruction. The CNC system manufacturer (FANUC) stipulates that if an arc of more than 180° needs to be specified, the radius needs to be specified with a negative value. The radius value is confirmed through a simple IF judgment, such as Figure 6 As shown, m_arc_center_angle is the arc center angle variable provided by QJCAM, and the user-defined variable user_m_arc_radius is used to receive the arc radius value (with sign).
[0070] Specifically, if the center angle is less than or equal to 180°, the arc radius value remains positive, that is, the radius method is used and R+ is output, where R is the radius. If the center angle is between 180° and 360°, the arc radius value is inverted, that is, the radius method is used and R- is output.
[0071] In step S4, based on the type of the arc, the arc end point position coordinates are assigned to user-defined variables user_axis_one / two / thr, respectively, such as Figure 7 shown.
[0072] Further, according to the judgment result of the center angle, the method of editing the center method arc output block or the radius method arc output block is as follows: Figure 8 As shown, including:
[0073] Determine whether the center angle of the circle is 360°. If the center angle of the circle is 360°, that is, the arc is a full circle, then the center method is used to output the arc interpolation instruction; otherwise, the radius method is used to output the arc interpolation instruction.
[0074] Edit the arc output block of the center method or the arc output block of the radius method, and output the relevant information according to the instruction format of the CNC system, such as Fig. 9 As shown, m_sys_circle_code corresponds to the G02 / G03 arc interpolation direction, XYZ corresponds to the arc end position coordinates, IJK is the deviation value of the arc center relative to the arc start point in the XYZ direction, F is the arc processing feed speed, and R is the arc radius. This step ensures that the output arc interpolation command meets the requirements of the CNC system and can correctly guide the machine tool to perform arc processing.
[0075] In step S5, the edited circular interpolation output block is integrated into the NC program and output. This step completes the conversion from the circular machining program to the NC program, so that the machine tool can perform machining according to the specified circular interpolation instruction.
[0076] Through the above steps, the present invention realizes the optimization of the QJPP post-processing arc interpolation output, and improves the accuracy and efficiency of arc processing.
[0077] In order to further illustrate the advantages of the present invention, it is described below in conjunction with simulation.
[0078] Use QJCAM software to compile arc (full circle) processing program, and generate NC processing program through the above optimized post-processing file (this program only displays arc interpolation instructions and does not meet the actual machining conditions). The full circle generates the center method arc interpolation instructions, such as Fig.10 shown.
[0079] The output diagram of an arc with a central angle less than 180° is as follows Fig.11 shown.
[0080] The output diagram of the arc with a center angle between 180° and 360° is as follows Fig.12 shown.
[0081] Arc interpolation direction - counterclockwise arc output diagram as shown below Fig.13 shown.
[0082] Embodiment 2
[0083] like Fig.13 As shown, the present invention provides a circular interpolation output optimization system, which is used to implement the circular interpolation output optimization method of the above-mentioned embodiment 1, and specifically includes:
[0084] The variable declaration module 100 is used to declare user variables, wherein the user variables include point positions, axis angles and arc radius;
[0085] The arc working plane judgment module 200 is used to judge the output content of the arc interpolation instruction based on the user variable, and output the corresponding NC program instruction for different arc planes;
[0086] The arc type determination module 300 is used to determine the type of the arc according to the size of the center angle based on the NC program instruction:
[0087] The position variable assignment and arc interpolation instruction output selection module 400 is used to assign the arc end point position coordinates to user-defined variables based on the arc type, and edit the center method arc output block or the radius method arc output block according to the judgment result of the center angle;
[0088] The NC program output module 500 is used to integrate the edited arc interpolation output block into the NC program and output it.
[0089] A circular interpolation output optimization system of the present embodiment is used to implement the aforementioned circular interpolation output optimization method. Therefore, the specific implementation method of the circular interpolation output optimization system can be seen in the embodiment part of the aforementioned circular interpolation output optimization method. For example, the variable declaration module 100, the arc working plane judgment module 200, the arc type judgment module 300, the position variable assignment and circular interpolation instruction output selection module 400, and the NC program output module 500 are respectively used to implement steps S1, S2, S3, S4, and S5 in the aforementioned circular interpolation output optimization method. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part. In order to avoid redundancy, it will not be repeated here.
[0090] Embodiment 3
[0091] An embodiment of the present invention provides an electronic device, which includes a processor, a memory and a bus system. The processor and the memory are connected through the bus system. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the above-mentioned circular interpolation output optimization method.
[0092] Embodiment 4
[0093] An embodiment of the present invention provides a computer storage medium storing a computer software product. The computer software product includes a number of instructions for enabling a computer device to execute the above-mentioned circular interpolation output optimization method.
[0094] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0095] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0096] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0097] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from them are still within the protection scope of the invention.
Claims
1. A circular interpolation output optimization method, characterized in that: include: Declare user variables, wherein the user variables include point position, axis angle and arc radius; Based on the user variables, determine the output content of the arc interpolation instruction, and output corresponding NC program instructions for different arc planes; Based on the NC program instructions, the type of arc is determined according to the size of the center angle: Based on the type of the arc, the arc end point position coordinates are assigned to user-defined variables respectively, and according to the judgment result of the center angle, the center method arc output block or the radius method arc output block is edited; Integrate the edited circular interpolation output block into the NC program and output it.
2. The circular interpolation output optimization method according to claim 1, characterized in that: The method for determining the output content of the arc interpolation instruction and outputting the corresponding NC program instruction for different arc planes is as follows: Use the arc working plane variable m_arc_plane_mcs provided by QJCAM software to determine the output content of the arc interpolation instruction, and output the corresponding NC program instructions for different arc planes.
3. The circular interpolation output optimization method according to claim 2, characterized in that: The method of using the arc working plane variable m_arc_plane_mcs provided by the QJCAM software to judge the output content of the arc interpolation instruction and outputting the corresponding NC program instructions for different arc planes includes: If the arc work plane variable belongs to the XY plane, then XYIJ is output and ZK is shielded; If the arc work plane variable belongs to the YZ plane, then YZJK is output and XI is shielded; If the arc work plane variable belongs to the ZX plane, then ZXKI is output and YJ is shielded; Among them, XYZ corresponds to the coordinates of the arc end point, and IJK is the deviation value of the arc center relative to the arc start point in the XYZ direction.
4. The circular interpolation output optimization method according to claim 1, characterized in that: The method for determining the type of arc according to the size of the center angle is: If the central angle is less than or equal to 180°, the arc radius value remains positive, that is, the radius method is used and R+ is output, where R is the radius; If the center angle is between 180° and 360°, the arc radius value is negated, that is, the radius method is used and R- is output.
5. The circular interpolation output optimization method according to claim 1, characterized in that: The method of assigning the arc end point position coordinates to user-defined variables is: Assign the arc endpoint position coordinates to the user-defined variables user_axis_one / two / thr respectively.
6. The circular interpolation output optimization method according to claim 1, characterized in that: The method of editing the arc output block of the center method or the arc output block of the radius method according to the judgment result of the center angle includes: Determine whether the center angle of the circle is 360°. If the center angle of the circle is 360°, that is, the arc is a full circle, then the center method is used to output the arc interpolation instruction; otherwise, the radius method is used to output the arc interpolation instruction; Edit the arc output block using the center method or the arc output block using the radius method, and output the relevant information according to the command format requirements of the CNC system.
7. The circular interpolation output optimization method according to claim 6, characterized in that: The related information includes: m_sys_circle_code corresponds to the G02 / G03 arc interpolation direction, XYZ corresponds to the arc end position coordinates, IJK is the deviation value of the arc center relative to the arc start point in the XYZ direction, F is the arc processing feed speed, and R is the arc radius.
8. A circular arc interpolation output optimization system, characterized in that: The system is used to implement the circular interpolation output optimization method according to any one of claims 1 to 7, specifically comprising: A variable declaration module is used to declare user variables, wherein the user variables include point positions, axis angles, and arc radius; The arc working plane judgment module is used to judge the output content of the arc interpolation instruction based on the user variable, and output the corresponding NC program instruction for different arc planes; The arc type judgment module is used to judge the type of the arc according to the size of the center angle based on the NC program instruction: The position variable assignment and arc interpolation instruction output selection module is used to assign the arc end point position coordinates to user-defined variables based on the type of the arc, and edit the center method arc output block or the radius method arc output block according to the judgment result of the center angle; The NC program output module is used to integrate the edited arc interpolation output block into the NC program and output it.
9. An electronic device, characterized in that: The electronic device includes a processor, a memory and a bus system, the processor and the memory are connected through the bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the circular interpolation output optimization method described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer software product, and the computer software product includes a number of instructions for enabling a computer device to execute the circular interpolation output optimization method described in any one of claims 1 to 7.