Processing method and device for improving position instruction interpolation precision in numerical control system, processor and computer readable storage medium thereof
By caching and precisely interpolated position instructions in the CNC system, the problem of insufficient interpolation accuracy of position instructions in the prior art is solved, and higher processing accuracy and effect are achieved.
Patent Information
- Application Number
- CN202411551829.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-28
AI Technical Summary
In existing CNC machine tools, the position command interpolation accuracy is insufficient, resulting in the processing of parts contours that may deviate from the design requirements, affecting the machining accuracy and effect.
By implementing the servo drive caches position instructions, calculates position instruction increments in the CNC system, and performs fine interpolation of position instructions, including sending and buffering multiple position instructions in each synchronization cycle of the EtherCAT bus, calculating acceleration and average speed for precise interpolation.
It improves the interpolation accuracy of position instructions, enhances the machining accuracy and processing effect of the machine tool, and is suitable for a wide range of CNC system applications.
Smart Images

Figure CN119536137A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of numerical control machine tools, in particular to the field of position instruction interpolation of servo drives, and specifically refers to a processing method, device, processor and computer-readable storage medium for improving the position instruction interpolation accuracy in a numerical control system. Background Art
[0002] The servo drive is a key component in CNC machine tools. It is responsible for receiving position instructions, speed instructions, and positioning instructions from the CNC system for cutting processing. In the processing application of CNC machine tools, the accuracy of the interpolation instructions directly determines the accuracy of the CNC machine tool's replication of the part contour during the processing process. If the accuracy of the interpolation instructions is not high, the contour of the processed part may deviate from the design requirements, resulting in unqualified parts. Therefore, improving the interpolation accuracy of the position instructions can improve the machine tool processing accuracy and processing effect. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a processing method, device, processor and computer-readable storage medium for improving the interpolation accuracy of position instructions in a CNC system that meets the requirements of high processing accuracy, good processing effect and a wide range of applications.
[0004] In order to achieve the above-mentioned object, the processing method, device, processor and computer-readable storage medium thereof for improving the position instruction interpolation accuracy in the numerical control system of the present invention are as follows:
[0005] The processing method for improving the position instruction interpolation accuracy in the numerical control system is mainly characterized in that the method comprises the following steps:
[0006] (1) Servo drive cache position instructions;
[0007] (2) Calculate the position command increment;
[0008] (3) Perform fine interpolation processing on the position instructions.
[0009] Preferably, the step (1) specifically comprises the following steps:
[0010] (1.1) The servo drive works in the periodic synchronous position loop mode. In each synchronization cycle of the EtherCAT bus, the host sends four synchronous position instructions Pcmd(k), Pcmd(k+1), Pcmd(k+2) and Pcmd(k+3) with equal time intervals, where k is a certain moment;
[0011] (1.2) The servo drive receives and caches the position command.
[0012] Preferably, the position command increment is calculated in step (2), specifically:
[0013] Assuming that the position command at time k-1 is Pcmd(k-1), the position command increment is calculated according to the following formula:
[0014] ΔP(k)=Pcmd(k)–Pcmd(k-1);
[0015] ΔP(k+1)=Pcmd(k+1)–Pcmd(k);
[0016] Here, k is a certain moment.
[0017] Preferably, the step (3) specifically comprises the following steps:
[0018] (3.1) Calculate the acceleration a(k) of two adjacent position instructions;
[0019] (3.2) Calculate the average velocity v(k) at time k;
[0020] (3.3) Calculate the current position command Pcmd(k+t);
[0021] (3.4) Based on the acceleration a(k) and the average velocity v(k), Pcmd(k+t) is calculated;
[0022] (3.5) Pcmd(k+t) is used as the current position command to perform servo position loop control. Preferably, the acceleration a(k) of two adjacent position commands is calculated in step (3.1), specifically: the acceleration a(k) of two adjacent position commands is calculated according to the following formula:
[0023]
[0024] Among them, T s It is one quarter of the EhterCAT communication cycle T.
[0025] Preferably, the average speed v(k) at time k is calculated in step (3.2), specifically:
[0026] The average speed v(k) at time k is calculated according to the following formula:
[0027]
[0028] Among them, T s It is one quarter of the EhterCAT communication cycle T.
[0029] Preferably, the position command Pcmd(k+t) at the current moment is calculated in the step (3.3), specifically: the position command Pcmd(k+t) at the current moment is calculated according to the following formula:
[0030] Pcmd(k+t)=Pcmd(k)+v(k)t+a(k)t 2 .
[0031] Preferably, Pcmd(k+t) is calculated in step (3.4), specifically:
[0032] Pcmd(k+t) is calculated according to the following formula:
[0033]
[0034] Among them, the value range of t is 0~T s .
[0035] The main feature of the device for realizing processing to improve the interpolation accuracy of position instructions in the numerical control system is that the device comprises:
[0036] a processor configured to execute computer executable instructions;
[0037] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the processing method for improving the position instruction interpolation accuracy in the above-mentioned numerical control system are implemented.
[0038] The processor in the numerical control system for realizing the processing of improving the interpolation accuracy of position instructions has the main feature that the processor is configured to execute computer executable instructions, and when the computer executable instructions are executed by the processor, the various steps of the processing method for improving the interpolation accuracy of position instructions in the above-mentioned numerical control system are realized.
[0039] The computer-readable storage medium has the main feature of storing a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the processing method for improving the position instruction interpolation accuracy in the above-mentioned numerical control system.
[0040] The processing method, device, processor and computer-readable storage medium for improving the interpolation accuracy of position instructions in the numerical control system of the present invention are adopted. By performing cyclic calculations, the interpolated position instructions can be obtained in real time. This method improves the interpolation accuracy of the position instructions and ultimately improves the machining accuracy and machining effect of the machine tool. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1The present invention is a flowchart of a processing method for improving the position instruction interpolation accuracy in the numerical control system of the present invention.
[0042] Figure 2 The present invention is a relationship diagram of position instructions within a synchronous cycle of a processing method for improving position instruction interpolation accuracy in a numerical control system of the present invention. DETAILED DESCRIPTION
[0043] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.
[0044] The processing method for improving the position instruction interpolation accuracy in the numerical control system of the present invention comprises the following steps:
[0045] (1) Servo drive cache position instructions;
[0046] (2) Calculate the position command increment;
[0047] (3) Perform fine interpolation processing on the position instructions.
[0048] As a preferred embodiment of the present invention, the step (1) specifically comprises the following steps:
[0049] (1.1) The servo drive works in the periodic synchronous position loop mode. In each synchronization cycle of the EtherCAT bus, the host sends four synchronous position instructions Pcmd(k), Pcmd(k+1), Pcmd(k+2) and Pcmd(k+3) with equal time intervals, where k is a certain moment;
[0050] (1.2) The servo drive receives and caches the position command.
[0051] As a preferred embodiment of the present invention, the position instruction increment is calculated in step (2), specifically:
[0052] Assuming that the position command at time k-1 is Pcmd(k-1), the position command increment is calculated according to the following formula:
[0053] ΔP(k)=Pcmd(k)–Pcmd(k-1);
[0054] ΔP(k+1)=Pcmd(k+1)–Pcmd(k);
[0055] Here, k is a certain moment.
[0056] As a preferred embodiment of the present invention, the step (3) specifically comprises the following steps:
[0057] (3.1) Calculate the acceleration a(k) of two adjacent position instructions;
[0058] (3.2) Calculate the average velocity v(k) at time k;
[0059] (3.3) Calculate the current position command Pcmd(k+t);
[0060] (3.4) Based on the acceleration a(k) and the average velocity v(k), Pcmd(k+t) is calculated;
[0061] (3.5) Take Pcmd(k+t) as the current position command and perform servo position loop control.
[0062] As a preferred embodiment of the present invention, the acceleration a(k) of two adjacent position instructions is calculated in step (3.1), specifically:
[0063] The acceleration a(k) between two adjacent position instructions is calculated according to the following formula:
[0064]
[0065] Among them, T s It is one quarter of the EhterCAT communication cycle T.
[0066] As a preferred embodiment of the present invention, the average speed v(k) at time k is calculated in step (3.2), specifically:
[0067] The average speed v(k) at time k is calculated according to the following formula:
[0068]
[0069] Among them, T s It is one quarter of the EhterCAT communication cycle T.
[0070] As a preferred embodiment of the present invention, the position instruction Pcmd(k+t) at the current moment is calculated in step (3.3), specifically:
[0071] The current position command Pcmd(k+t) is calculated according to the following formula:
[0072] Pcmd(k+t)=Pcmd(k)+v(k)t+a(k)t 2 .
[0073] As a preferred embodiment of the present invention, Pcmd(k+t) is calculated in step (3.4), specifically:
[0074] Pcmd(k+t) is calculated according to the following formula:
[0075]
[0076] Among them, the value range of t is 0~T s .
[0077] The device for realizing processing to improve the position instruction interpolation accuracy in the numerical control system of the present invention, wherein the device comprises:
[0078] a processor configured to execute computer executable instructions;
[0079] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the processing method for improving the position instruction interpolation accuracy in the above-mentioned numerical control system are implemented.
[0080] The present invention discloses a processor for realizing a process for improving the interpolation accuracy of position instructions in the numerical control system, wherein the processor is configured to execute computer executable instructions, and when the computer executable instructions are executed by the processor, the various steps of the processing method for improving the interpolation accuracy of position instructions in the above-mentioned numerical control system are realized.
[0081] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the processing method for improving the position instruction interpolation accuracy in the above-mentioned numerical control system.
[0082] In a specific embodiment of the present invention, the following Figure 1 to Figure 2 , describe the specific implementation method:
[0083] In this example, the EhterCAT communication cycle T is 2ms, the servo drive position loop sampling cycle is 125us, and T s It is 500us (a quarter of the EhterCAT communication cycle T).
[0084] Step 1: Servo drive cache position command:
[0085] The servo drive operates in the periodic synchronous position loop mode, such as Figure 1 As shown in the figure, in each synchronization cycle of the EtherCAT bus, the host computer (CNC system) sends four synchronization position instructions Pcmd(k), Pcmd(k+1), Pcmd(k+2) and Pcmd(k+3) with equal time intervals, and the servo driver receives and caches the above position instructions, where k is a certain moment. However, the standard CIA402 protocol used in the servo has only one frame of position instructions in one synchronization cycle. Therefore, the accuracy of obtaining position instructions by this method is greatly improved.
[0086] Step 2: Calculate the position command increment:
[0087] Assuming that the position command at time k-1 is Pcmd(k-1), the position command increments of the two adjacent segments in step 1 are:
[0088] ΔP(k)=Pcmd(k)–Pcmd(k-1);
[0089] ΔP(k+1)=Pcmd(k+1)–Pcmd(k);
[0090] Step 3: Position command fine interpolation:
[0091] Usually, the position loop sampling period of the servo drive is less than the EhterCAT communication period T. For example, the position loop sampling period of the servo drive is 125us, and the EhterCAT communication period is 2ms. After step 1, the interval time of the position command is 500us, so the position command needs to be further interpolated. In this example, since the position loop sampling period of the servo drive is 125us and Ts is 500us, the position command at time k to (k+1) needs to be interpolated 4 times.
[0092] Calculate the acceleration a(k) between two adjacent position instructions:
[0093]
[0094] Among them, T s It is one quarter of the EhterCAT communication cycle T;
[0095] Calculate the average velocity v(k) at time k:
[0096]
[0097] Calculate the current position command Pcmd(k+t):
[0098] Pcmd(k+t)=Pcmd(k)+v(k)t+a(k)t 2 ;
[0099] According to the acceleration a(k) and the average velocity v(k), we get:
[0100]
[0101] Among them, the value range of t is 0~T s , Pcmd(k+t) is the position command at the current moment, participating in the control of the servo position loop. In this example, the value of t is 1 / T s , 2 / T s , 3 / T s and 4 / T s.
[0102] The technical solution of the present invention requires the driver to cooperate with the host computer. Usually, in one communication cycle, the host computer only sends one target position instruction. However, the host computer in the present invention sends four analyzed target position instructions at a time, which greatly improves the accuracy of the position instruction.
[0103] After receiving the position instruction, the driver in the technical solution of the present invention interpolates the position instruction again. The usual interpolation method calculates the average value of the position increment and distributes it to each position loop cycle. The interpolation method of the present invention calculates the acceleration through the position instruction from the perspective of the driver, and the calculation method is different.
[0104] The specific implementation scheme of this embodiment can refer to the relevant description in the above embodiment, which will not be repeated here.
[0105] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0106] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0107] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0108] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0109] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0110] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0111] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0112] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0113] The processing method, device, processor and computer-readable storage medium for improving the interpolation accuracy of position instructions in the numerical control system of the present invention are adopted. By performing cyclic calculations, the interpolated position instructions can be obtained in real time. This method improves the interpolation accuracy of the position instructions and ultimately improves the machining accuracy and machining effect of the machine tool.
[0114] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.
Claims
1. A processing method for improving the position instruction interpolation accuracy in a numerical control system, characterized in that: The method comprises the following steps: (1) Servo drive cache position instructions; (2) Calculate the position command increment; (3) Perform fine interpolation processing on the position instructions.
2. The processing method for improving the position instruction interpolation accuracy in the numerical control system according to claim 1, characterized in that: The step (1) specifically comprises the following steps: (1.1) The servo drive works in the periodic synchronous position loop mode. In each synchronization cycle of the EtherCAT bus, the host sends four synchronous position instructions Pcmd(k), Pcmd(k+1), Pcmd(k+2) and Pcmd(k+3) with equal time intervals, where k is a certain moment; (1.2) The servo drive receives and caches the position command.
3. The processing method for improving the position instruction interpolation accuracy in the numerical control system according to claim 1, characterized in that: The position command increment is calculated in step (2), specifically: Assuming that the position command at time k-1 is Pcmd(k-1), the position command increment is calculated according to the following formula: ΔP(k)=Pcmd(k)–Pcmd(k-1); ΔP(k+1)=Pcmd(k+1)–Pcmd(k); Here, k is a certain moment.
4. The processing method for improving the position instruction interpolation accuracy in a numerical control system according to claim 1, characterized in that: The step (3) specifically comprises the following steps: (3.1) Calculate the acceleration a(k) of two adjacent position instructions; (3.2) Calculate the average velocity v(k) at time k; (3.3) Calculate the current position command Pcmd(k+t); (3.4) Based on the acceleration a(k) and the average velocity v(k), Pcmd(k+t) is calculated; (3.5) Take Pcmd(k+t) as the current position command and perform servo position loop control.
5. The processing method for improving the position instruction interpolation accuracy in a numerical control system according to claim 4, characterized in that: The acceleration a(k) of two adjacent position instructions is calculated in step (3.1), specifically: The acceleration a(k) between two adjacent position instructions is calculated according to the following formula: Among them, T s It is one quarter of the EhterCAT communication cycle T.
6. The processing method for improving the position instruction interpolation accuracy in a numerical control system according to claim 4, characterized in that: The average speed v(k) at time k is calculated in step (3.2), specifically: The average speed v(k) at time k is calculated according to the following formula: Among them, T s It is one quarter of the EhterCAT communication cycle T.
7. The processing method for improving the position instruction interpolation accuracy in a numerical control system according to claim 4, characterized in that: The current position command Pcmd(k+t) is calculated in step (3.3), specifically: The current position command Pcmd(k+t) is calculated according to the following formula: Pcmd(k+t)=Pcmd(k)+v(k)t+a(k)t 2 。 8. The processing method for improving the position instruction interpolation accuracy in a numerical control system according to claim 4, characterized in that: Pcmd(k+t) is calculated in step (3.4), specifically: Pcmd(k+t) is calculated according to the following formula: Among them, the value range of t is 0~T s .
9. A device for improving the position instruction interpolation accuracy in a numerical control system, characterized in that: The device comprises: a processor configured to execute computer-executable instructions; A memory storing one or more computer executable instructions, wherein when the computer executable instructions are executed by the processor, the steps of the processing method for improving the position instruction interpolation accuracy in the numerical control system according to any one of claims 1 to 8 are implemented.
10. A processor for improving the position instruction interpolation accuracy in a numerical control system, characterized in that: The processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the processing method for improving the position instruction interpolation accuracy in the numerical control system described in any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the processing method for improving the position instruction interpolation accuracy in the numerical control system described in any one of claims 1 to 8.