Automatic test method and system for numerical control system, electronic equipment and medium

The FastDTW algorithm is used to calculate the maximum local error of the CNC system command interpolation trajectory, which solves the problem of low efficiency of manual testing in the existing technology, realizes efficient automated testing, reduces costs and improves accuracy.

CN121657633APending Publication Date: 2026-03-13WUHAN HUAZHONG NUMERICAL CONTROL
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing CNC system testing relies on manual verification of instruction interpolation trajectories, which is inefficient and consumes a lot of human resources, making it difficult to meet the market's demand for CNC system stability.

Method used

The FastDTW algorithm is used to calculate the maximum local error of the interpolation trajectory based on theoretical and actual commands. The search radius parameter is adjusted to balance the algorithm's performance and accuracy. The results are then directly compared with the preset process threshold to automatically generate test results.

Benefits of technology

It has achieved automated testing, reduced testing costs, improved testing efficiency, and achieved an accuracy rate of over 98%, enabling rapid deployment to replace manual testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121657633A_ABST
    Figure CN121657633A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of numerical control systems, and discloses an automatic test method and system for a numerical control system, electronic equipment and a medium. The method comprises the steps of obtaining a theoretical instruction interpolation track; obtaining an actual instruction interpolation track; obtaining the maximum local error of the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G code according to a FastDTW algorithm; and comparing the maximum local error corresponding to each G code with a preset process threshold to obtain a test result. The calculation result of the adjusted FastDTW algorithm, namely the maximum local error, is directly compared with the preset process threshold value of the process requirement standard in the actual test application, and extra threshold value determination work is not needed. The search radius parameter of the FastDTW algorithm can balance the algorithm performance and accuracy to ensure that the test requirements are met to the maximum extent. The implementation and deployment cost is extremely low, the rapid online operation replaces manpower for actual test application, and the test efficiency of the numerical control system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of numerical control system technology, and in particular to an automated testing method, system, electronic device, and medium for numerical control systems. Background Technology

[0002] In recent years, with the rapid development of China's manufacturing industry, CNC systems, as the brain of industrial mother machines, have been widely used. The market has increasingly higher requirements for the stability of CNC systems, so it is particularly important to do a good job in testing CNC systems.

[0003] Currently, verifying the correctness of command interpolation trajectories remains a key focus in CNC system testing. Test results are typically obtained by test engineers through observation of sampled command interpolation trajectories, combined with their experience. However, each CNC system software release requires verifying the correctness of each G-command execution. This manual testing method is not only resource-intensive but also inefficient. Summary of the Invention

[0004] The main objective of this invention is to provide an automated testing method, system, electronic device, and medium for CNC systems, aiming to solve at least one of the aforementioned technical problems.

[0005] In a first aspect, embodiments of the present invention provide an automated testing method for a numerical control system, comprising:

[0006] Obtain the theoretical command interpolation trajectory;

[0007] Obtain the actual command interpolation trajectory;

[0008] The maximum local error between the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G-code is obtained using the FastDTW algorithm.

[0009] The test results are obtained by comparing the maximum local error corresponding to each G code with a preset process threshold.

[0010] In some embodiments, obtaining the theoretical instruction interpolation trajectory includes:

[0011] Select G-code from the test case library;

[0012] Execute the G-code on a previous version of the CNC system;

[0013] Theoretical instruction location data is collected during the execution of the G-code.

[0014] The theoretical command interpolation trajectory is obtained based on the theoretical command position data.

[0015] In some embodiments, obtaining the actual instruction interpolation trajectory includes:

[0016] Execute G-code on the CNC system version to be verified;

[0017] During the execution of the G code, actual instruction location data is collected;

[0018] The actual command interpolation trajectory is obtained based on the actual command position data.

[0019] In some embodiments, obtaining the maximum local error between the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G code according to the FastDTW algorithm includes:

[0020] Run the FastDTW algorithm;

[0021] The theoretical command interpolation trajectory and the actual command interpolation trajectory are input into the FastDTW algorithm to obtain the cumulative distance of the shortest regularized path;

[0022] Obtain the set of point pairs corresponding to the cumulative distance of the shortest regular path;

[0023] The maximum local error is taken as the maximum value of the corresponding point pair in the shortest regular path based on the set of point pairs.

[0024] In some embodiments, the method further includes:

[0025] During the execution of the FastDTW algorithm, the search radius parameter of the FastDTW algorithm is adjusted according to the time series length or the matching result.

[0026] In some embodiments, adjusting the search radius parameter of the FastDTW algorithm based on the time series length or matching result includes:

[0027] Set the range of the search radius parameter, and set the search radius parameter to the maximum value of the range by default;

[0028] When the data length of either the theoretical command interpolation trajectory or the actual command interpolation trajectory exceeds the preset length, the search radius parameter is reduced based on the data length.

[0029] In some embodiments, comparing the maximum local error corresponding to each G code with a preset process threshold to obtain test results includes:

[0030] The maximum local error corresponding to each G code is compared with a preset process threshold;

[0031] If the maximum local error exceeds the preset process threshold, then the corresponding G-code execution is abnormal.

[0032] Secondly, embodiments of the present invention provide an automated testing system for CNC systems, comprising:

[0033] Theoretical acquisition module, used to acquire theoretical command interpolation trajectory;

[0034] The actual test module is used to obtain the actual command interpolation trajectory;

[0035] The maximum local error calculation module is used to obtain the maximum local error of the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G code according to the FastDTW algorithm.

[0036] The test result output module is used to compare the maximum local error corresponding to each G code with a preset process threshold to obtain the test result.

[0037] Thirdly, embodiments of the present invention provide an electronic device, including:

[0038] One or more processors;

[0039] Memory, used to store one or more programs;

[0040] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described above.

[0041] Fourthly, embodiments of the present invention provide a computer-readable medium on which a computer program is stored, the computer program being executed by a processor to implement the steps of any of the methods described above.

[0042] This invention provides an automated testing method for CNC systems, comprising: acquiring a theoretical instruction interpolation trajectory; acquiring an actual instruction interpolation trajectory; obtaining the maximum local error of the theoretical and actual instruction interpolation trajectories for each G-code using the FastDTW algorithm; and comparing the maximum local error for each G-code with a preset process threshold to obtain a test result. In this invention, the calculated result of the adjusted FastDTW algorithm, i.e., the maximum local error, can be directly compared with the preset process threshold of the process requirements standard in actual testing applications, without the need for additional threshold determination. The search radius parameter inherent in the FastDTW algorithm balances algorithm performance and accuracy to ensure that testing requirements are met to the greatest extent. This automated testing method for CNC systems has extremely low implementation and deployment costs, and can be quickly deployed to replace manual labor in actual testing applications, thereby improving the testing efficiency of CNC systems. Attached Figure Description

[0043] Figure 1 A flowchart illustrating an automated testing method for a numerical control system provided in an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of an optional specific implementation method involved in the embodiment of the present invention;

[0045] Figure 3 This is a schematic diagram showing the maximum local error between the theoretical command interpolation trajectory and the actual command interpolation trajectory involved in the embodiments of the present invention.

[0046] Figure 4 A structural block diagram of an automated testing system for CNC systems provided in an embodiment of the present invention;

[0047] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention.

[0048] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0049] To enable those skilled in the art to better understand the technical solutions of the present invention, exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0050] Where there is no conflict, the various embodiments of the present invention and the features thereof may be combined with each other.

[0051] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.

[0052] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Terms such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.

[0053] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having the meaning consistent with their meaning in the context of the relevant art and the invention, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.

[0054] In the technical solution of this invention, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information all comply with relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution follows relevant national laws and regulations (e.g., the "Information Security Technology - Personal Information Security Specification"). For example: appropriate measures are taken for personal information access control; restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; and explicit identity targeting is eliminated when using personal information to avoid precisely locating a specific individual.

[0055] To address at least one of the technical problems existing in related technologies, this invention provides an automated testing method for CNC systems. Figure 1 This is a flowchart illustrating an automated testing method for a numerical control system provided in an embodiment of the present invention.

[0056] As an embodiment of the present invention, such as Figure 1 As shown, the automated testing method for the CNC system includes:

[0057] Step S100: Obtain the theoretical command interpolation trajectory;

[0058] Step S200: Obtain the actual command interpolation trajectory;

[0059] Step S300: Obtain the maximum local error between the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G code according to the FastDTW algorithm;

[0060] Step S400: Compare the maximum local error corresponding to each G code with a preset process threshold to obtain the test result.

[0061] It should be noted that the execution subject in this embodiment can be an electronic device, which can be a computer device with data processing function, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment, a computer device is used as an example for explanation.

[0062] Specifically, the method described in this embodiment is an automated testing method for CNC systems based on the FastDTW (Fast Dynamic Time Warping) algorithm. It should be noted that this embodiment uses the verification of the correctness of the instruction interpolation trajectory as an example. In the field of CNC systems, the instruction interpolation trajectory refers to the CNC system continuously, smoothly, and precisely controlling the movement of the tool or workpiece according to the instructions in the machining program to generate a predetermined machining trajectory. Interpolation refers to generating a series of intermediate points between a given starting point and an ending point according to a specific algorithm, so that the movement trajectory of the tool or workpiece at these points conforms to the predetermined machining requirements. The trajectory refers to the path followed by the tool or workpiece during machining; this path can be a straight line, an arc, or other complex curves. Instructions are commands in the CNC program, including parameters such as movement speed, direction, and distance, guiding the CNC system on how to control the movement of the tool or workpiece. The following describes the method described in this embodiment with specific steps.

[0063] In one embodiment, obtaining the theoretical instruction interpolation trajectory includes: selecting G-code from a test case library; executing the G-code on a historical CNC system version; collecting theoretical instruction position data during the execution of the G-code; and obtaining the theoretical instruction interpolation trajectory based on the theoretical instruction position data.

[0064] Specifically, such as Figure 2 As shown, the theoretical instruction interpolation trajectory is acquired by pre-collecting the theoretical instruction interpolation trajectory generated during the execution of G-code, and saving it as the expected result (theoretical instruction interpolation trajectory). Specifically, the theoretical instruction interpolation trajectory refers to the instruction interpolation trajectory (theoretical instruction interpolation trajectory) obtained by acquiring the trajectory when all G-code instructions execute correctly. This trajectory can be acquired on a verified or released CNC system version.

[0065] For example, select several G-code examples from the test case library and execute them on a previously released version of the CNC system. During execution, collect instruction position data (theoretical instruction position data), use this data (theoretical instruction position data) as the theoretical interpolation trajectory, and archive it in *.csv file format. For easy differentiation, the file can be named "xxx_X.csv", where "xxx" represents the G-code file name. For example, if the G-code file name is "O1.txt", then the corresponding theoretical instruction interpolation trajectory file name is "O1_X.csv".

[0066] In one embodiment, obtaining the actual instruction interpolation trajectory includes: executing G-code on the CNC system version to be verified; collecting actual instruction position data during the execution of the G-code; and obtaining the actual instruction interpolation trajectory based on the actual instruction position data.

[0067] Specifically, such as Figure 2 As shown, the actual instruction interpolation trajectory is collected: During actual testing, the instruction interpolation trajectory generated during the execution of G code is collected and saved as the trajectory to be verified (actual instruction interpolation trajectory).

[0068] For example, more than 100 G-code examples related to radius compensation in the step of obtaining the theoretical command interpolation trajectory (several G-code examples in the test case library) were selected and executed on the CNC system version to be tested. During the execution, command position data (actual command position data) was collected. This data (actual command position data) was used as the actual interpolation trajectory and saved in *.csv file format. For easy distinction, the file was named "xxx_Y.csv", where "xxx" represents the G-code file name. For example, if the G-code file name is "O1.txt", then the corresponding actual command interpolation trajectory file name is "O1_Y.csv".

[0069] In one embodiment, obtaining the maximum local error of the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G code according to the FastDTW algorithm includes: running the FastDTW algorithm; inputting the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory into the FastDTW algorithm to obtain the cumulative distance of the shortest regularized path; obtaining the set of point pairs corresponding to the cumulative distance of the shortest regularized path; and taking the maximum value of the corresponding point pairs in the shortest regularized path as the maximum local error based on the set of point pairs.

[0070] Specifically, such as Figure 2 As shown, the FastDTW algorithm is used to calculate the maximum local error between the expected result trajectory (theoretical instruction interpolation trajectory) and the trajectory to be verified (actual instruction interpolation trajectory) for each test case.

[0071] It is understandable that the FastDTW algorithm specifically refers to a method for calculating the distance between two time series of unequal lengths. For example, given two time series X=[x1,x2,x3,…,xn] with lengths of m and n respectively. m ]、Y=[y1,y2,y3,…,y n The FastDTW algorithm first constructs an m*n matrix and performs path planning from (1,1) to (m,n) in the matrix point set. The planned path needs to satisfy continuity, monotonicity, and boundary conditions. Assume x i With y j The distance between the two points is d(x) i ,y j In the planned path, the path distance gradually increases at each matrix point. Let the cumulative distance of the planned path be Dist, then the cumulative distance to the point (m,n) in the matrix is ​​expressed as... Dynamic programming is used to find the path with the shortest cumulative distance from (1,1) to (m,n) in the matrix point set. The cumulative distance generated by this path is also called the FastDTW distance between the two time series. The closer the calculated distance value is to 0, the more similar the two time series are. If the distance value is equal to 0, it means that the two time series completely overlap. Therefore, the similarity between the theoretical instruction interpolation trajectory and the trajectory to be verified can be verified based on the results calculated by the algorithm, thereby verifying the correctness of the execution of the G instruction.

[0072] Specifically, the maximum local error refers to the distance between the two least similar points in the expected trajectory and the trajectory to be verified. In CNC system G-instruction testing, more attention is paid to the local error of a certain segment between the theoretical instruction interpolation trajectory and the actual interpolation trajectory, so as to further locate G-instruction problems. However, the traditional FastDTW algorithm calculates the cumulative distance of the shortest regularized path in the distance matrix of two trajectories, which cannot be compared with the process requirements of testing in practical applications. Therefore, this embodiment needs to adjust the FastDTW algorithm, assuming that the set of point pairs corresponding to the shortest regularized path is P=[(i1,j1),(i2,j2),…,(i n ,j n If the sum of the points is zero, then the maximum value of the corresponding pair of points in the shortest normalized path is taken, and this value is expressed as: (Maximum local error).

[0073] For example, theoretical command interpolation trajectory data and corresponding actual command interpolation trajectory data are used as inputs to the FastDTW algorithm. For instance, O1_X.csv and O1_Y.csv are used as inputs, and the maximum local error between them is calculated. Figure 3 As shown.

[0074] It should be noted that the original FastDTW algorithm calculates the distance between two time series using dynamic programming, typically focusing on the cumulative distance between the two trajectories, i.e., the cumulative distance of the shortest regularized path. This embodiment uses the adjusted FastDTW algorithm: First, the FastDTW algorithm is run to obtain the shortest regularized path between the two trajectories, i.e., the set of point pairs P=[(i1,j1),(i2,j2),…,(i n ,j n Then, in the set of point pairs P, calculate the distance between each pair of points (i,j). Finally, find the largest of these distances; this largest distance is the maximum local error.

[0075] In this embodiment, by calculating the maximum local error, problems with the CNC system's G-codes can be located more accurately. The maximum local error provides an intuitive indicator of trajectory error, helping to quickly identify and diagnose areas with large trajectory deviations, and then make targeted adjustments and optimizations. This adjustment in this embodiment allows the FastDTW algorithm to better adapt to the testing requirements of CNC systems, especially in situations where local trajectory errors are a concern. By identifying the maximum local error, CNC commands can be adjusted in a targeted manner, and machining parameters can be optimized, thereby improving machining quality and efficiency.

[0076] In one embodiment, the method further includes: adjusting the search radius parameter of the FastDTW algorithm according to the time series length or matching result during the operation of the FastDTW algorithm.

[0077] Specifically, such as Figure 2 As shown, the search radius parameter of the FastDTW algorithm is adjusted. The search radius parameter is a key parameter in the FastDTW algorithm used to control the search range during the calculation process; that is, for each point in one time series, the search range for points considered in another time series. Generally, a smaller search radius parameter results in less computation but may affect the overall accuracy of the algorithm; a larger search radius parameter results in more computation but may improve the overall accuracy. In this embodiment, the search radius parameter is adaptively adjusted based on the time series length or matching results, which helps to balance the algorithm's performance and accuracy, ensuring that testing requirements are met to the greatest extent possible.

[0078] In one embodiment, adjusting the search radius parameter of the FastDTW algorithm based on the time series length or matching result includes: setting a range for the search radius parameter and setting the search radius parameter to the maximum value of the range by default; when the data length of either the theoretical command interpolation trajectory or the actual command interpolation trajectory exceeds a preset length, reducing the search radius parameter based on the data length.

[0079] For example, the search radius parameter `radius` is set to a range of 1 to 5, with a default value of `radius=5`. When the data length of either the theoretical or actual interpolation trajectory exceeds 10... 4 When the data length increases by 22500, the radius decreases by 1. For example, when the data length is in the range of 10000~32500, the radius is 4, and so on. When the data length of any one of the theoretical interpolation trajectory and the actual interpolation trajectory exceeds 10... 5When the value is 1, radius = 1. It is understood that the values ​​described above in this embodiment are merely illustrative examples, and can be set according to specific circumstances in actual applications. This embodiment does not impose any limitations on this.

[0080] In this embodiment, the adjusted FastDTW algorithm calculation results can be directly compared with the process requirements standards in actual testing applications without the need for additional threshold determination. The search radius parameter built into FastDTW itself can balance algorithm performance and accuracy to ensure that testing requirements are met to the greatest extent. In general, the implementation and deployment costs are extremely low, and it can be quickly deployed to replace manual labor in actual testing applications, thereby improving the testing efficiency of CNC systems.

[0081] In one embodiment, the maximum local error corresponding to each G-code is compared with a preset process threshold to obtain a test result, including: comparing the maximum local error corresponding to each G-code with a preset process threshold; if the maximum local error exceeds the preset process threshold, the execution of the corresponding G-code is abnormal.

[0082] Specifically, such as Figure 2 As shown, the maximum local error calculated for each G code is compared with a set threshold, and the test results are given.

[0083] For example, the calculated maximum local error is compared with the actual test process requirements. If the maximum local error exceeds the actual test process requirement standard (preset process threshold), it indicates that the corresponding G-code execution is abnormal and needs to be investigated; otherwise, it indicates that the corresponding G-code execution is normal. In this embodiment, the process requirement standard (preset process threshold) can be set to 0.01mm. After comparison with manual testing, the final statistical results show that the accuracy of the automated testing method for CNC systems described in this embodiment is above 98%.

[0084] This embodiment provides an automated testing method for CNC systems, including: acquiring theoretical instruction interpolation trajectories; acquiring actual instruction interpolation trajectories; obtaining the maximum local error of the theoretical and actual instruction interpolation trajectories corresponding to each G-code using the FastDTW algorithm; and comparing the maximum local error corresponding to each G-code with a preset process threshold to obtain test results. In this embodiment, the calculated result of the adjusted FastDTW algorithm, i.e., the maximum local error, can be directly compared with the preset process threshold of the process requirement standard in actual testing applications, without the need for additional threshold determination. The search radius parameter inherent in the FastDTW algorithm itself balances algorithm performance and accuracy to ensure that testing requirements are met to the greatest extent. This automated testing method for CNC systems has extremely low implementation and deployment costs, and can be quickly deployed to replace manual labor in actual testing applications, thereby improving the testing efficiency of CNC systems.

[0085] Reference Figure 4 , Figure 4 This is a structural block diagram of an embodiment of the automated testing system for CNC systems according to the present invention. Figure 4 As shown, the automated testing system for the CNC system includes:

[0086] Theoretical acquisition module 10 is used to acquire theoretical instruction interpolation trajectory;

[0087] Actual test module 20 is used to obtain the actual command interpolation trajectory;

[0088] The maximum local error calculation module 30 is used to obtain the maximum local error of the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G code according to the FastDTW algorithm.

[0089] The test result output module 40 is used to compare the maximum local error corresponding to each G code with a preset process threshold to obtain the test result.

[0090] Specifically, theoretical instruction interpolation trajectories generated during G-code execution are collected in advance and saved as expected results (theoretical instruction interpolation trajectories); during actual testing, instruction interpolation trajectories generated during G-code execution are collected and saved as trajectories to be verified (actual instruction interpolation trajectories); the search radius parameter of the FastDTW algorithm is adjusted; the FastDTW algorithm is used to calculate the maximum local error between the expected result trajectory and the trajectory to be verified for each test case; the maximum local error calculated for each G-code is compared with a set threshold to provide the test results.

[0091] For example, the theoretical acquisition module 10 selects several G-code examples from the test case library, executes them on a previously released version of the CNC system, collects instruction position data during execution, uses this data as the theoretical interpolation trajectory, and archives it in *.csv file format. For easy differentiation, the file is named "xxx_X.csv", where "xxx" represents the G-code file name. For example, if the G-code file name is "O1.txt", then the corresponding theoretical instruction interpolation trajectory file name is "O1_X.csv".

[0092] For example, in the actual test module 20: more than 100 examples of radius compensation-related G-codes used in the theoretical acquisition module 10 are selected and executed on the CNC system version to be tested. During the execution, command position data is collected, and this data is used as the actual interpolation trajectory and saved in *.csv file format. For easy distinction, the file is named "xxx_Y.csv", where "xxx" represents the G-code file name. For example, if the G-code file name is "O1.txt", then the corresponding actual command interpolation trajectory file name is "O1_Y.csv".

[0093] For example, the search radius parameter radius is set to a range of 1 to 5, with the default being radius=5. When the data length of any one of the theoretical interpolation trajectory and the actual interpolation trajectory exceeds 10... 4 At this point, the search radius begins to shrink. For every 22,500 increase in data length, the radius decreases by 1. For example, when the data length is between 10,000 and 32,500, the radius is 4, and so on. When the data length of any one of the theoretical or actual interpolation trajectories exceeds 10... 5 When the radius is 1, radius = 1.

[0094] For example, the maximum local error calculation module 30: takes the theoretical interpolation trajectory data and the corresponding actual interpolation trajectory data as inputs to the FastDTW algorithm, such as O1_X.csv and O1_Y.csv, and calculates the maximum local error between them, such as... Figure 3 As shown.

[0095] For example, the test result output module 40 compares the calculated maximum local error with the actual test process requirements. If the maximum local error exceeds the actual test process requirement standard, it indicates that the corresponding G-code execution is abnormal and needs to be investigated; otherwise, it indicates that the corresponding G-code execution is normal. In this embodiment, the process requirement standard is set to 0.01mm. After comparison with manual testing, the final statistical result shows an accuracy rate of over 98%.

[0096] This embodiment provides an automated testing system for CNC systems. This system directly compares the calculated maximum local error (MLO) of the adjusted FastDTW algorithm with the preset process thresholds required in actual testing applications, eliminating the need for additional threshold determination. The FastDTW algorithm's built-in search radius parameter balances algorithm performance and accuracy, ensuring maximum satisfaction of testing requirements. It boasts extremely low implementation and deployment costs, allowing for rapid deployment to replace manual labor in actual testing applications, thereby improving the efficiency of CNC system testing.

[0097] It should be noted that technical details not described in detail in this embodiment of the CNC system automated testing system can be found in any embodiment of the present invention applied to the CNC system automated testing method described above, and will not be repeated here.

[0098] Based on the same inventive concept, embodiments of the present invention also provide an electronic device. Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Figure 5 As shown, an embodiment of the present invention provides an electronic device including: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement any of the CNC system automated testing methods described in the above embodiments; the one or more I / O interfaces 103 are connected between the processors and the memory, configured to enable information interaction between the processors and the memory.

[0099] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus).

[0100] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.

[0101] In some embodiments, the one or more processors 101 include a field-programmable gate array.

[0102] This invention also provides a computer-readable medium. The computer-readable medium stores a computer program, which, when executed by a processor, implements the steps of any of the CNC system automated testing methods described in the above embodiments. The computer-readable storage medium can be volatile or non-volatile.

[0103] This invention also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the above-described automated testing method for CNC systems.

[0104] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).

[0105] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0106] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0107] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.

[0108] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0109] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0110] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0111] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0113] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.

Claims

1. An automated testing method for a numerical control system, characterized in that, include: Obtain the theoretical command interpolation trajectory; Obtain the actual command interpolation trajectory; The maximum local error between the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G-code is obtained using the FastDTW algorithm. The test results are obtained by comparing the maximum local error corresponding to each G code with a preset process threshold.

2. The method as described in claim 1, characterized in that, The acquisition of the theoretical instruction interpolation trajectory includes: Select G-code from the test case library; Execute the G-code on a previous version of the CNC system; Theoretical instruction location data is collected during the execution of the G-code. The theoretical command interpolation trajectory is obtained based on the theoretical command position data.

3. The method as described in claim 1, characterized in that, The acquisition of the actual command interpolation trajectory includes: Execute G-code on the CNC system version to be verified; During the execution of the G code, actual instruction location data is collected; The actual command interpolation trajectory is obtained based on the actual command position data.

4. The method as described in claim 1, characterized in that, The maximum local error between the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G-code obtained according to the FastDTW algorithm includes: Run the FastDTW algorithm; The theoretical command interpolation trajectory and the actual command interpolation trajectory are input into the FastDTW algorithm to obtain the cumulative distance of the shortest regularized path; Obtain the set of point pairs corresponding to the cumulative distance of the shortest regular path; The maximum local error is taken as the maximum value of the corresponding point pair in the shortest regular path based on the set of point pairs.

5. The method as described in claim 4, characterized in that, The method further includes: During the execution of the FastDTW algorithm, the search radius parameter of the FastDTW algorithm is adjusted according to the time series length or the matching result.

6. The method as described in claim 5, characterized in that, The adjustment of the search radius parameter of the FastDTW algorithm based on the time series length or matching result includes: Set the range of the search radius parameter, and set the search radius parameter to the maximum value of the range by default; When the data length of either the theoretical command interpolation trajectory or the actual command interpolation trajectory exceeds the preset length, the search radius parameter is reduced based on the data length.

7. The method according to any one of claims 1 to 6, characterized in that, The step of comparing the maximum local error corresponding to each G code with a preset process threshold to obtain the test result includes: The maximum local error corresponding to each G code is compared with a preset process threshold; If the maximum local error exceeds the preset process threshold, then the corresponding G-code execution is abnormal.

8. An automated testing system for CNC systems, characterized in that, include: Theoretical acquisition module, used to acquire theoretical command interpolation trajectory; The actual test module is used to obtain the actual command interpolation trajectory; The maximum local error calculation module is used to obtain the maximum local error of the theoretical instruction interpolation trajectory and the actual instruction interpolation trajectory corresponding to each G code according to the FastDTW algorithm. The test result output module is used to compare the maximum local error corresponding to each G code with a preset process threshold to obtain the test result.

9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Online detecting method and system for numerical control machine tool machining error

    CN104166373A

  • Friction identification method and friction identification device

    CN105814506A

  • Numerical control machine tool machining plane contour error acquisition method and device, medium and equipment

    CN118707894A

  • Desktop digital human interactive studio method based on JavaFX

    CN119937773A

  • Numerical control device, numerical control method, and storage medium

    JP2023122566A