Method and apparatus for testing the interrupt response capability of CNC systems with computational load

CN122194847BActive Publication Date: 2026-08-14GENERAL TECH GRP MASCH TOOL ENG RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-14
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

该类方法虽去除了外部设备,但测量精度受软件开销影响,且同样未考虑实际工况负载对中断响应能力的影响

Benefits of technology

[0024] As can be seen from the above technical solutions, this application has the following advantages: By applying a computational load including real-time and non-real-time tasks to the platform and maintaining continuous operation during the test, the actual working state of the CNC system is simulated. Real-time tasks simulate time-sensitive tasks such as interpolation calculations, while non-real-time tasks simulate non-critical tasks such as human-computer interaction, making the test scenario highly consistent with actual working conditions. It overcomes the shortcomings of existing technologies that test under no-load or ideal conditions and cannot reflect the interrupt response capability under actual working conditions. By setting the priority of the interrupt handling function higher than that of real-time and non-real-time tasks, it ensures that the currently executing task can be immediately preempted when an interrupt is triggered. This design eliminates scheduling interference from other tasks within the system on the interrupt response, truly reflecting the interrupt response hardware and underlying software capabilities of the platform itself, and avoiding distortion of test results due to task scheduling strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122194847B_ABST
    Figure CN122194847B_ABST
Patent Text Reader

Abstract

This application relates to the field of CNC system interrupt response testing, specifically to a method and apparatus for testing the interrupt response capability of a CNC system platform under computational load. The method includes: configuring real-time and non-real-time tasks on the CNC system platform and maintaining continuous operation during the test; configuring the platform's first pin to external interrupt mode and configuring an interrupt handling function; generating a periodic excitation signal synchronized with the platform's control cycle using a signal generator and inputting it to the first pin to trigger an interrupt; simultaneously acquiring the excitation signal and the interrupt response signal using a signal receiver, continuously measuring the time interval between signal edges within each excitation cycle as the interrupt response time within a preset test time; statistically calculating the maximum value, average value, and jitter to evaluate the platform's real-time performance and determinism under actual operating load conditions. This solves the problem that existing technologies cannot accurately evaluate interrupt response capability under load conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of CNC system interruption response testing technology, specifically to a method and apparatus for testing the interruption response capability of a CNC system platform with computational load. Background Technology

[0002] As CNC systems continue to evolve towards higher speeds and greater precision, high-performance CNC systems not only need to run real-time tasks such as interpolation calculations and non-real-time tasks such as graphics display simultaneously, but also must efficiently handle real-time interrupts from multiple tasks, including motion control algorithm scheduling and I / O signal response. Interrupt response time, as a key indicator of real-time operating system performance, directly reflects the time from the generation of an external interrupt to the start of interrupt service routine execution, and is an important basis for evaluating the real-time performance of a CNC system.

[0003] Existing interrupt response time testing methods mainly fall into two categories: one uses external devices (such as signal generators and oscilloscopes) for measurement, generating excitation signals and acquiring response signals to read the time interval from the waveforms. While this method offers high measurement accuracy, it requires external auxiliary equipment, is complex to operate, has a long testing cycle, and is difficult to implement for extended periods, resulting in insufficient test samples and an inability to accurately evaluate the system's hard real-time performance. The other category uses a purely software-based approach, injecting interrupt handling functions into the operating system kernel and using internal timers to record timestamps. Although this method eliminates external devices, its measurement accuracy is affected by software overhead, and it also fails to consider the impact of actual operating load on interrupt response capabilities.

[0004] Existing technologies do not address testing interrupt response capabilities under computational loads simulating real-world CNC system operation, thus failing to assess the platform's real-time performance and determinism in actual operating environments. Therefore, there is an urgent need for a testing method capable of accurately measuring interrupt response time and evaluating its real-time performance and stability under load conditions, providing a reliable basis for selecting CNC system chips and operating systems. Summary of the Invention

[0005] To address the aforementioned problems, this invention provides a method and apparatus for testing the interrupt response capability of a CNC system platform with computational load.

[0006] In a first aspect, the present invention provides a method for testing the interrupt response capability of a CNC system platform with computational load, comprising the following steps: Step 1: Configure the computing load for the CNC system using a platform. The platform includes a chip and an operating system mounted on the chip. The computing load includes real-time tasks and non-real-time tasks that simulate the actual working conditions of the CNC system, and it runs continuously during the interruption response test. Step 2: Configure the first general-purpose input / output pin of the platform to external interrupt mode and configure an interrupt handling function so that when the first general-purpose input / output pin receives an interrupt trigger signal, an interrupt response signal is output through the second general-purpose input / output pin. The priority of the interrupt handling function is set to be higher than the priority of the real-time task and the non-real-time task. Step 3: Use a signal generator to generate a periodic excitation signal that is synchronized with the control cycle of the platform, and input the excitation signal to the first general-purpose input / output pin of the platform to trigger a platform interrupt, so that the interrupt handling function can preempt the currently executing real-time task or non-real-time task. Step 4: Using a signal receiver, simultaneously acquire the excitation signal and the interrupt response signal output by the platform. Continuously measure and record the time interval between the edge of the excitation signal and the edge of the interrupt response signal in each excitation cycle within a preset test time, and use this time as the interrupt response time. Step 5: Based on the interrupt response time recorded over multiple consecutive periods, calculate the maximum value, average value, and interrupt response jitter of the interrupt response time to obtain the evaluation results of the platform's interrupt response capability in real-time task context and non-real-time task context.

[0007] Interrupts are triggered by periodic excitation signals synchronized with the platform's control cycle, ensuring that interrupt triggering matches the actual system's clock. Excitation and response signals are simultaneously acquired via external signal acquisition, and the signal edge time interval is measured, avoiding the overhead and errors introduced by software measurements. Interrupt response times are continuously collected for multiple cycles within a preset test time. The maximum, average, and jitter values ​​are calculated using statistical methods, solving the problem of existing technologies' inability to accurately evaluate the system's hard real-time performance due to insufficient test samples and the inability to conduct long-term continuous testing. The introduction of jitter metrics allows for a comprehensive assessment of the platform's real-time performance and stability under actual operating loads.

[0008] As a preferred embodiment of the technical solution of the present invention, the step of calculating the load configuration includes: The real-time task is configured as the interpolation program for the CNC system, including trajectory planning, kinematic transformation and dynamic compensation; Non-real-time tasks are configured as data management and human-computer interaction programs, including G-code parsing, precision compensation, and 3D graphics display tasks; Furthermore, the priority of real-time tasks is higher than that of non-real-time tasks.

[0009] By configuring real-time tasks as the core interpolation program of the CNC system and non-real-time tasks as data management and human-machine interaction programs, the computational load is highly matched with the actual business operations of the CNC system. At the same time, by clearly defining the priority of real-time tasks over non-real-time tasks, a complete task scheduling system is constructed, providing a realistic task execution environment for testing.

[0010] As a preferred embodiment of the technical solution of the present invention, the step of configuring the interrupt handling function includes: The interrupt handling function is configured such that when the first general-purpose input / output pin receives an interrupt trigger signal, it controls the second general-purpose input / output pin to output a level toggling signal, which serves as the interrupt response signal.

[0011] Setting the interrupt handling function to output a level-to-toggle signal simplifies the identification and acquisition of interrupt response signals, enabling external measuring devices to quickly and accurately capture signal edges, reducing measurement errors in interrupt response time, and improving the accuracy and reliability of test data.

[0012] As a preferred embodiment of the technical solution of the present invention, the signal generator is a signal generator with a built-in signal generation module of an oscilloscope or a signal generator of a dedicated device; the signal receiver is a signal receiver of an oscilloscope or a dedicated device. When using an oscilloscope for measurement, connect the output of the oscilloscope's signal generation module to the first general-purpose input / output pin of the platform, and connect the output of the signal generation module to the first analog input channel of the oscilloscope as a trigger source and comparison signal; connect the second general-purpose input / output pin of the platform to the second analog input channel of the oscilloscope; and connect the signal ground of the oscilloscope's signal generation module to the digital ground of the platform. Select the oscilloscope bandwidth as N times the platform control cycle frequency, and set the trigger type to edge trigger.

[0013] Standardizing test hardware connections and parameter configurations reduces the difficulty of test operations. Settings such as oscilloscope bandwidth matching with control cycle frequency and common ground connection effectively avoid signal attenuation, interference, and delay. Dual analog input channels separately acquire excitation and response signals, enabling real-time comparison of the two signals and making interrupt response time edge measurement more intuitive.

[0014] As a preferred embodiment of the present invention, the period of the excitation signal is the same as the control period of the platform; The interrupt response time is obtained by measuring the time interval between the edge of the input excitation signal and the edge of the output interrupt response signal within the same cycle on an oscilloscope or signal receiver.

[0015] By aligning the excitation signal cycle with the platform control cycle, the interrupt trigger frequency perfectly matches the actual control rhythm of the CNC system, simulating interrupt response scenarios in real control processes. Simultaneously, the interrupt response time measurement standard is standardized as the signal edge time interval to avoid test data deviations caused by inconsistent measurement nodes.

[0016] As a preferred embodiment of the technical solution of the present invention, the steps of statistically calculating the maximum value, average value, and interrupt response jitter of the interrupt response time include: Record the type of task currently being executed by the platform at the time of each interruption, including real-time task context and non-real-time task context; Perform the following operations, respectively, for interrupt response time in real-time task context and interrupt response time in non-real-time task context: Plot a histogram of all interrupt response times with interrupt response time on the x-axis and frequency on the y-axis. Based on the histogram, a normal distribution curve is obtained by fitting the histogram. The mean and standard deviation of the interruption response time are calculated based on the normal distribution curve. The jitter value for interrupt response time is M times the standard deviation. The ratio of the jitter value to the average value is calculated and used as the interrupt response stability coefficient of the platform in the context of this task.

[0017] By recording the task type at the time of interruption triggering, interruption response data is categorized and statistically analyzed. Histograms are plotted for both real-time and non-real-time task contexts, a normal distribution is fitted, and the mean, standard deviation, jitter value, and interruption response stability coefficient are calculated to comprehensively quantify the interruption response characteristics in different task contexts. The normal distribution fitting reveals the statistical regularity of interruption response time under load conditions. M times the standard deviation, used as the jitter value, accurately quantifies the stability of the interruption response. The interruption response stability coefficient combines jitter and average response time to form a comprehensive evaluation index, overcoming the limitations of single-index evaluation.

[0018] As a preferred embodiment of the technical solution of the present invention, the method further includes: The maximum value, average value and interrupt response stability coefficient of the interrupt response time obtained from the real-time task context are compared with the preset first threshold. The maximum interrupt response time and interrupt response stability coefficient obtained from the non-real-time task context are compared with the preset second threshold, respectively. Calculate the absolute value of the difference between the average interrupt response time of the real-time task context and the non-real-time task context, and use it as the task context response difference. If the maximum value in the real-time task context is less than the control cycle of the platform, the average value in the real-time task context is less than a first preset proportion of the control cycle, the interrupt response stability coefficient in the real-time task context is less than or equal to a first preset stability threshold, the maximum value in the non-real-time task context is less than the control cycle of the platform, the interrupt response stability coefficient in the non-real-time task context is less than or equal to a second preset stability threshold, and the task context response difference is less than a preset difference threshold, then the platform is determined to meet the interrupt response requirements of the CNC system; otherwise, the platform is determined to not meet the interrupt response requirements of the CNC system.

[0019] The metrics of real-time task context are compared with a first threshold to ensure that the interrupt response capability meets the standard under harsh operating conditions; the metrics of non-real-time task context are compared with a second threshold to evaluate the performance under normal operating conditions; the task context response difference is calculated to quantify the response differences of the platform between tasks of different priorities. Through the comprehensive judgment of multiple metrics, it is ensured that a qualified platform can meet the high-speed and high-precision interrupt response requirements of CNC systems.

[0020] As a preferred embodiment of the technical solution of the present invention, the load configuration step further includes multi-load level configuration: Set up multiple load levels, each load level corresponding to a different combination of real-time task intensity and non-real-time task intensity; According to the order of load level from low to high, repeat steps 2 to 5 at each load level to obtain the maximum value, average value and jitter value of interrupt response time at each load level. Plot the curves showing the changes in load level and the maximum, average, and jitter values ​​of interrupt response time to characterize the performance degradation trend of the platform's interrupt response capability under different load intensities.

[0021] By setting multiple load levels, conducting step-by-step tests, and plotting performance degradation curves, the platform's interruption response capability can be evaluated across the entire load range, overcoming the limitations of single-load testing. The changing curves visually identify platform performance inflection points and load criticalities, providing precise references for CNC system load planning and performance optimization.

[0022] Secondly, the present invention also provides a testing device for the interrupt response capability of a CNC system platform with computational load, comprising: The computational load configuration module is used to configure the computational load of the CNC system platform. The platform includes a chip and an operating system mounted on the chip. The computational load includes real-time tasks and non-real-time tasks that simulate the actual working conditions of the CNC system, and continues to run continuously during interruption response testing. An interrupt response configuration module is used to configure the first general-purpose input / output pin of the platform to external interrupt mode and configure an interrupt handling function so that when the first general-purpose input / output pin receives an interrupt trigger signal, an interrupt response signal is output through the second general-purpose input / output pin. The priority of the interrupt handling function is set to be higher than the priority of the real-time task and the non-real-time task. A signal generator is used to generate a periodic excitation signal synchronized with the control cycle of the platform, and output the excitation signal to the first general-purpose input / output pin of the platform to trigger a platform interrupt, so that the interrupt handling function can preempt the currently executing real-time task or non-real-time task. A signal receiver, which uses the same frequency reference as the signal generator to achieve synchronization, is used to simultaneously acquire the excitation signal and the interrupt response signal output by the platform. Within a preset test time, it continuously measures and records the time interval from the edge of the excitation signal to the edge of the interrupt response signal in each excitation cycle, as the interrupt response time. The statistical analysis module is used to statistically calculate the maximum value, average value, and interrupt response jitter of the interrupt response time based on the interrupt response time over multiple consecutive periods, and to obtain the evaluation results of the platform's interrupt response capability in real-time task context and non-real-time task context.

[0023] As a preferred embodiment of the technical solution of the present invention, the computing load configuration module includes: The real-time task configuration unit is used to configure the interpolation program of the CNC system, including trajectory planning, kinematic transformation and dynamic compensation; The non-real-time task configuration unit is used to configure data management and human-computer interaction programs, including G-code parsing, precision compensation, and 3D graphics display tasks. Furthermore, the priority of real-time tasks is higher than that of non-real-time tasks.

[0024] As can be seen from the above technical solutions, this application has the following advantages: By applying a computational load including real-time and non-real-time tasks to the platform and maintaining continuous operation during the test, the actual working state of the CNC system is simulated. Real-time tasks simulate time-sensitive tasks such as interpolation calculations, while non-real-time tasks simulate non-critical tasks such as human-computer interaction, making the test scenario highly consistent with actual working conditions. It overcomes the shortcomings of existing technologies that test under no-load or ideal conditions and cannot reflect the interrupt response capability under actual working conditions. By setting the priority of the interrupt handling function higher than that of real-time and non-real-time tasks, it ensures that the currently executing task can be immediately preempted when an interrupt is triggered. This design eliminates scheduling interference from other tasks within the system on the interrupt response, truly reflecting the interrupt response hardware and underlying software capabilities of the platform itself, and avoiding distortion of test results due to task scheduling strategies.

[0025] Interrupt response times were continuously measured over a large number of cycles within a preset test period. Maximum, average, and jitter values ​​were calculated using statistical methods to comprehensively evaluate the platform's real-time performance and stability under actual workload conditions. By periodically triggering interrupts during the continuous operation of real-time and non-real-time tasks, the system simulated real-world scenarios where interruptions might occur in different task contexts during CNC operation. The interrupt handling function performed only minimal level-to-level operations, introducing no additional software overhead, ensuring that the test results accurately reflect the platform's interrupt response capabilities. Attached Figure Description

[0026] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart illustrating the method provided in an embodiment of the present invention.

[0028] Figure 2 This is a schematic diagram of the oscilloscope connection in an embodiment of the present invention.

[0029] Figure 3 This is a schematic diagram of the connection of a special device in another embodiment of the present invention.

[0030] Figure 4 This is a diagram illustrating interrupt response time and jitter.

[0031] Figure 5 This is a schematic diagram illustrating the analysis and calculation of jitter. Detailed Implementation

[0032] To make the purpose, features, and advantages of this application more apparent and understandable, specific embodiments and accompanying drawings will be used to clearly and completely describe the technical solution protected by this application. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this application and in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0034] like Figure 1As shown, this embodiment of the invention provides a method for testing the interrupt response capability of a CNC system platform with computational load, including the following steps: Step 1: Configure the computing load for the CNC system using a platform. The platform includes a chip and an operating system mounted on the chip. The computing load includes real-time tasks and non-real-time tasks that simulate the actual working conditions of the CNC system, and it runs continuously during the interruption response test. In this embodiment of the invention, the computational load includes two parts: a real-time task (also referred to as real-time measurement in this embodiment) and a non-real-time task (also referred to as non-real-time measurement in this embodiment). The real-time task is configured as the interpolation program of the CNC system, including algorithms such as trajectory planning, kinematic transformation, and dynamic compensation. In this embodiment, the real-time measurement load continuously runs interpolation calculations with a period of 1ms. The non-real-time task is configured as a data management and human-computer interaction program, including tasks such as G-code parsing, accuracy compensation, and 3D graphics display.

[0035] For the testing of the five-axis CNC system chip and operating system platform, the real-time measurement load is selected from the S-shaped specimen machining program that conforms to GB / T39967-2021 "Accuracy Inspection of S-shaped Specimens for Five-Axis Linkage Machining Centers", which is used as the interpolation load for continuous operation.

[0036] It should be noted that during the interruption response test, it is necessary to ensure that the configured real-time and non-real-time computing loads continue to run continuously in order to fully evaluate the platform's real-time performance and stability under actual working conditions.

[0037] Step 2: Configure the first general-purpose input / output pin of the platform to external interrupt mode and configure an interrupt handling function so that when the first general-purpose input / output pin receives an interrupt trigger signal, an interrupt response signal is output through the second general-purpose input / output pin. The priority of the interrupt handling function is set to be higher than the priority of the real-time task and the non-real-time task. The specific steps are as follows: Select an idle GPIO pin on the platform as an interrupt input pin (such as GPIO(EINT0)), configure it in external interrupt mode, and set the trigger mode to rising edge trigger.

[0038] Write an interrupt handler function to achieve the following functionality: When an interrupt trigger signal is received on a specified GPIO input pin, output a level toggle signal through the corresponding GPIO output pin (such as GPIO(0)). The initial state is set to low level, and a high level is output after the interrupt is triggered, which serves as the interrupt response signal.

[0039] The interrupt handler function is compiled, loaded into the platform, and set to the highest priority of the operating system to ensure that the interrupt response is not preempted by other tasks.

[0040] Step 3: Use a signal generator to generate a periodic excitation signal that is synchronized with the control cycle of the platform, and input the excitation signal to the first general-purpose input / output pin of the platform to trigger a platform interrupt, so that the interrupt handling function can preempt the currently executing real-time task or non-real-time task. In this embodiment, the control cycle of the CNC system under test is 125μs, corresponding to a control cycle frequency of 8kHz. An oscilloscope's signal generation module is used as the signal generator to produce a square wave excitation signal with a frequency of 8kHz. This signal frequency is the same as the control cycle, achieving synchronous triggering. The square wave signal facilitates comparison and observation with the edges of the output signal.

[0041] Step 4: Using a signal receiver, simultaneously acquire the excitation signal and the interrupt response signal output by the platform. Continuously measure and record the time interval between the edge of the excitation signal and the edge of the interrupt response signal in each excitation cycle within a preset test time, as the interrupt response time. Record the task type currently being executed by the platform each time an interrupt is triggered. The task type includes real-time task context and non-real-time task context.

[0042] When using an oscilloscope for measurement, its signal generation module acts as the excitation source, and the oscilloscope itself acts as the receiver. Figure 2 As shown, connect the output of the oscilloscope's signal generation module to the platform's first general-purpose input / output pin (interrupt input pin); connect the output signal to the oscilloscope's first analog input channel CH1 via a probe as a trigger source and comparison signal; connect the platform's second general-purpose input / output pin (interrupt response output pin) to the oscilloscope's second analog input channel CH2 to capture the output interrupt response signal; connect the oscilloscope's signal ground to the platform's digital ground to ensure a common ground reference; select the oscilloscope's bandwidth as 80kHz (10 times the control cycle frequency of 8kHz); and set the trigger type to edge trigger.

[0043] Using a signal receiver (an oscilloscope is used as the signal receiver in this embodiment), both the excitation signal and the interrupt response signal output by the platform are simultaneously acquired. Within a preset test time, the time interval between the edge of the excitation signal and the edge of the interrupt response signal in each excitation cycle is continuously measured and recorded as the interrupt response time. Here, the interrupt response time is defined as the time interval between the rising edge of the excitation signal and the rising edge of the interrupt response signal within the same cycle.

[0044] In this embodiment of the invention, the preset test time is determined based on the statistical confidence level requirement, specifically including: Obtain the estimated standard deviation of interruption response time using pre-testing or historical data. ; Set the confidence level and error tolerance. The confidence level is set according to the reliability requirements of the platform under test: 95% for conventional CNC systems, 99% for high-reliability systems, and 99.9% for safety-critical systems. The error tolerance is set according to the platform's control cycle, typically 1% to 5% of the control cycle, to ensure that the measurement accuracy can effectively distinguish the differences in interruption response time under different task contexts.

[0045] Using formula Calculate the minimum sample size required to satisfy the mean estimation requirement; This is the critical value for the standard normal distribution, taken as 1.96 at a 95% confidence level and 2.576 at a 99% confidence level; The estimated standard deviation of interrupt response time, in units of Consistency was achieved through pre-testing; This is the error tolerance, expressed in time.

[0046] If it is necessary to evaluate extreme cases of interruption response time, the sample size should be increased to 5 to 10 times the above calculated value, or the test duration should be set to be no less than 10 minutes to ensure that a sufficient number of extreme event samples are obtained so that the statistical results of extreme values ​​have engineering credibility. Set the preset test time to be no less than the ratio of the minimum sample size to the excitation signal frequency (i.e., the platform control cycle frequency).

[0047] It should be noted that extreme events refer to rare long delays occurring during interrupt response. These events can be caused by, but are not limited to, task preemption delays, CPU cache misses, interrupt masking windows, and memory access conflicts. To accurately assess the platform's interrupt response capabilities under extreme conditions, a sufficient number of extreme event samples must be collected through prolonged and continuous testing to ensure the statistical results have engineering reliability. In statistical analysis, the 99.9th percentile is typically used as a quantitative indicator of extreme conditions to avoid interference from single, occasional anomalies in the evaluation results.

[0048] Step 5: Based on the interrupt response time recorded over multiple consecutive periods, calculate the maximum, average, and jitter values ​​of the interrupt response time in both real-time and non-real-time task contexts. This yields an evaluation result of the platform's interrupt response capability in both real-time and non-real-time task contexts. The specific statistical analysis steps are as follows: The interrupt response time data is categorized by task type into real-time task context datasets and non-real-time task context datasets. For each dataset, the following operations are performed: A histogram is plotted with interruption response time on the x-axis and frequency on the y-axis. The histogram provides a visual overview of the data distribution characteristics and reveals the maximum interruption response time within the task context. Since interruption response time data typically follows a normal distribution under load, a normal distribution curve is obtained by fitting the histogram. The fitting method can be either the least squares method or the maximum likelihood estimation method. The mean μ and standard deviation σ of the interruption response time are calculated based on the fitted normal distribution curve. Six times the standard deviation is used as the jitter value of the interruption response time, i.e., jitter = 6σ. The ratio of the jitter value to the mean is calculated as the interruption response stability coefficient within the task context.

[0049] The maximum, average, and interrupt response stability coefficients of the interrupt response time obtained from the real-time task context are compared with a preset first threshold; the maximum, average, and interrupt response stability coefficients of the interrupt response time obtained from the non-real-time task context are compared with a preset second threshold; the difference between the average interrupt response time of the real-time task context and the non-real-time task context is calculated as the task context response difference.

[0050] If the maximum value in the real-time task context is less than the platform's control cycle, the average value in the real-time task context is less than a first preset proportion of the control cycle, the interrupt response stability coefficient in the real-time task context is less than or equal to a first preset stability threshold, the maximum value in the non-real-time task context is less than the platform's control cycle, the interrupt response stability coefficient in the non-real-time task context is less than or equal to a second preset stability threshold, and the task context response difference is less than a preset difference threshold, then the platform is determined to meet the interrupt response requirements of the CNC system; otherwise, the platform is determined not to meet the interrupt response requirements of the CNC system. In this embodiment of the invention, the interrupt response time and jitter are as follows: Figure 4 As shown, T0 is the time from interrupt generation to CPU receiving the interrupt signal; T1 is the time from CPU receiving the interrupt to CPU saving the context; T2 is the time from CPU saving the context to CPU finding the corresponding interrupt handler function entry point; T3 is the time from CPU finding the entry point to CPU completing interrupt task processing; the jitter analysis and calculation are as follows: Figure 5 As shown. Figure 4 As shown, the time interval between the rising edge of the excitation signal and the rising edge of the interrupt response signal in the oscilloscope waveform is the interrupt response time. In this embodiment of the invention, the first preset ratio is 20% to 50%.

[0051] During interrupt response testing, both real-time and non-real-time computational loads ran continuously. When an interrupt was triggered, the operating system scheduled tasks according to priority: since the interrupt handler was set to the highest priority, the currently executing real-time or non-real-time task was paused, and the CPU switched to executing the interrupt handler; after the interrupt handler finished executing, the system resumed the execution of the paused task. This simulates the real-world interrupt response scenario of a CNC system during actual operation, meaning that interrupts can occur during the execution of real-time tasks or non-real-time tasks, thus comprehensively evaluating the platform's interrupt response capabilities in different task contexts.

[0052] In some embodiments, the steps of statistically calculating the maximum, average, and jitter values ​​of the interruption response time further include: performing outlier detection on the interruption response time data using the Grubbs criterion before plotting the histogram; removing outlier data points exceeding a preset confidence interval, where the preset confidence interval is the average plus or minus 6 times the standard deviation; and re-performing normal distribution fitting and statistical calculation based on the valid data after removing outlier data. This ensures the reliability of the statistical results and avoids evaluation distortion caused by occasional interference.

[0053] In some embodiments, after plotting the curves showing the changes in load level with the maximum, average, and jitter values ​​of interrupt response time, the method further includes: The slope of the change curve is calculated to identify the critical load level where the platform's interrupt response capability significantly degrades (characterized by the slope exceeding a set value). When the rate of change of jitter values ​​between adjacent load levels exceeds a preset threshold, the load level is marked as a performance inflection point. The critical load level or performance inflection point is output as a reference value for the upper limit of the platform's load capacity. Identifying performance inflection points through curve slope analysis provides a quantitative basis for load planning of the CNC system.

[0054] In some embodiments, a visualization step is also included: The interrupt response time distribution of real-time task context and non-real-time task context is displayed in the same coordinate system in the form of overlaid histograms or box plots; the control cycle, preset average threshold and stability threshold of the platform are marked; and the data distribution of real-time task context and non-real-time task context is distinguished by different colors or patterns.

[0055] In some embodiments, when a dedicated device is used, the specific connection is as follows: Figure 3 As shown. If a dedicated device is used for measurement, connect the signal generator output of the dedicated device to the GPIO input pin of the platform, and connect the GPIO output pin of the platform to the signal receiver of the dedicated device to form a complete signal excitation and response test loop.

[0056] The load test in this application is to simulate a scenario in which interrupts are periodically inserted during the continuous operation of real-time and non-real-time tasks, and to measure the system latency from interrupt triggering to response.

[0057] This invention also provides a method for testing the interrupt response capability of a CNC system platform with computational load. The computational load configuration step further includes multi-load level configuration, which is used to comprehensively evaluate the performance degradation trend of the platform's interrupt response capability under different load intensities.

[0058] This embodiment expands upon the above embodiment by extending the computational load configuration steps and setting multiple load levels. Each load level corresponds to a different combination of real-time and non-real-time task intensities. The real-time task intensity is achieved by adjusting the computational complexity or interpolation cycle of the interpolation program, while the non-real-time task intensity is achieved by adjusting the graphics display refresh rate, 3D model complexity, or data parsing frequency. The real-time task intensity and the non-real-time task intensity are adjusted independently to simulate different combinations of operating conditions.

[0059] Adjusting the load intensity includes the following steps: Based on the input intensity level, perform real-time task intensity adjustment, specifically including adjusting the interpolation period, interpolation computation complexity, or interpolation data volume; Based on the input intensity level, perform non-real-time task intensity adjustment, specifically including adjusting the graphics display refresh rate, 3D model complexity, or data parsing frequency.

[0060] For example, five load levels are set in this embodiment: First load level: Real-time task load is 25% of the rated load, and non-real-time task load is 25% of the rated load; Second load level: Real-time task load is 50% of the rated load, and non-real-time task load is 50% of the rated load; Third load level: Real-time task load is 75% of the rated load, and non-real-time task load is 75% of the rated load; Fourth load level: Real-time tasks are loaded at 100% of the rated load, and non-real-time tasks are loaded at 100% of the rated load. Fifth load level: Real-time task load is 100% of the rated load, and non-real-time task load is 150% of the rated load, to simulate overload conditions.

[0061] In order of increasing load level, steps 2 to 5 are executed sequentially at each load level to obtain the maximum, average, and jitter values ​​of interrupt response time at each load level.

[0062] After testing, curves showing the changes in load level and the maximum, average, and jitter values ​​of interrupt response time were plotted to characterize the performance degradation trend of the platform's interrupt response capability under different load intensities. For example, when the load exceeds 75% of the rated value, the jitter value begins to increase sharply, indicating that the platform is approaching its performance limit, providing a safety margin reference for system design.

[0063] This invention simulates the real-world operation of a CNC system by applying a computational load that includes both real-time and non-real-time tasks. It triggers interrupts using periodic external excitation signals synchronized with the system control cycle. The interrupt response time is obtained by acquiring the edge intervals of the excitation and response signals through external measurements. Based on a normal distribution fitting, the jitter value and interrupt response stability coefficient are calculated, forming a complete evaluation system. This method can comprehensively evaluate the real-time performance and determinism of CNC system chips and operating system platforms under actual operating loads, providing important practical guidance for chip selection, operating system optimization, and performance acceptance of high-end CNC systems, especially five-axis linkage systems.

[0064] This invention provides a testing device for the interrupt response capability of a CNC system platform with computational load, comprising: A computational load configuration module is used to configure the computational load of a CNC system platform. The platform includes a chip and an operating system mounted on the chip. The computational load includes real-time tasks and non-real-time tasks, and continues to run continuously during interruption response testing. An interrupt response configuration module is used to configure the first general-purpose input / output pin of the platform to external interrupt mode and configure an interrupt handling function so that when the first general-purpose input / output pin receives an interrupt trigger signal, an interrupt response signal is output through the second general-purpose input / output pin. The priority of the interrupt handling function is set to be higher than the priority of the real-time task and the non-real-time task. A signal generator is used to generate a periodic excitation signal synchronized with the control cycle of the platform, and output the excitation signal to the first general-purpose input / output pin of the platform to trigger a platform interrupt, so that the interrupt handling function can preempt the currently executing real-time task or non-real-time task. A signal receiver, which uses the same frequency reference as the signal generator to achieve synchronization, is used to simultaneously acquire the excitation signal and the interrupt response signal output by the platform. Within a preset test time, it continuously measures and records the time interval from the edge of the excitation signal to the edge of the interrupt response signal in each excitation cycle, as the interrupt response time. When using a dedicated device, the signal receiver and the signal generator use the same frequency reference by means of common source and same frequency or by synchronizing with a reference clock.

[0065] The statistical analysis module is used to statistically calculate the maximum value, average value, and jitter of the interrupt response time based on a large number of continuous records, and to obtain the evaluation results of the platform's interrupt response capability in real-time task context and non-real-time task context.

[0066] In this embodiment of the invention, the computing load configuration module includes: The real-time task configuration unit is used to configure the interpolation program of the CNC system, including trajectory planning, kinematic transformation and dynamic compensation; The non-real-time task configuration unit is used to configure data management and human-computer interaction programs, including G-code parsing, precision compensation, and 3D graphics display tasks. Furthermore, the priority of real-time tasks is higher than that of non-real-time tasks.

[0067] When the test object is a five-axis CNC system chip and operating system platform, the real-time load configuration unit configures the real-time load calculation as an S-shaped specimen machining program that conforms to the national standard for the accuracy inspection of S-shaped specimens in five-axis linkage machining centers.

[0068] In some embodiments, the device further includes: An adaptive adjustment module is used to automatically adjust the excitation signal frequency of the signal generator or the preset test time based on the difference in interrupt response time obtained statistically from the real-time task context and the non-real-time task context. The feedback control module is used to output optimization suggestions when it is determined that the platform does not meet the interrupt response requirements of the CNC system. The optimization suggestions include: improving the execution efficiency of the interrupt handling function, adjusting the task priority setting, and optimizing the operating system scheduling strategy.

[0069] In some embodiments, a report generation module is also included for automatically generating a test report, the test report including: Test environment information, including platform model, operating system version, and computing load configuration; Test parameter information, including control cycle, excitation signal frequency, test duration, and sample size; Test results include the maximum, average, jitter, and interrupt response stability coefficients for both real-time and non-real-time task contexts. Evaluation conclusions include comparisons of various indicators with thresholds, comprehensive judgment results, and task context response differences. Performance graphs include curves showing the changes in load level and interrupt response time, maximum value, average value, and jitter, as well as a comparison graph of interrupt response time distribution between real-time task context and non-real-time task context.

[0070] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or other media capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, server, or a second terminal, network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0071] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0072] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0073] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0074] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for testing the interrupt response capability of a CNC system platform with computational load, characterized in that, Includes the following steps: Step 1: Configure the computational load for the CNC system using a platform. The platform includes a chip and an operating system mounted on the chip. The computational load includes real-time tasks and non-real-time tasks simulating the actual working conditions of the CNC system, and maintains continuous operation during interruption response testing. The steps for configuring the computational load include: configuring the real-time tasks as the interpolation program of the CNC system, including trajectory planning, kinematic transformation, and dynamic compensation; configuring the non-real-time tasks as data management and human-computer interaction programs, including G-code parsing, accuracy compensation, and 3D graphics display tasks; and, the priority of the real-time tasks is higher than that of the non-real-time tasks. Step 2: Configure the first general-purpose input / output pin of the platform to external interrupt mode and configure an interrupt handling function so that when the first general-purpose input / output pin receives an interrupt trigger signal, an interrupt response signal is output through the second general-purpose input / output pin. The priority of the interrupt handling function is set to be higher than the priority of the real-time task and the non-real-time task. Step 3: Use a signal generator to generate a periodic excitation signal that is synchronized with the control cycle of the platform, and input the excitation signal to the first general-purpose input / output pin of the platform to trigger a platform interrupt, so that the interrupt handling function can preempt the currently executing real-time task or non-real-time task. Step 4: Using a signal receiver, simultaneously acquire the excitation signal and the interrupt response signal output by the platform. Continuously measure and record the time interval between the edge of the excitation signal and the edge of the interrupt response signal within each excitation cycle within a preset test time, as the interrupt response time. The period of the excitation signal is the same as the control cycle of the platform. The interrupt response time is obtained by measuring the time interval between the edge of the input excitation signal and the edge of the output interrupt response signal within the same cycle using an oscilloscope or signal receiver. Step 5: Based on the interrupt response time recorded over multiple consecutive periods, calculate the maximum value, average value, and interrupt response jitter of the interrupt response time to obtain the evaluation results of the platform's interrupt response capability in real-time task context and non-real-time task context. The steps for statistically calculating the maximum and average interrupt response times, as well as interrupt response jitter, include: Record the task type currently being executed by the platform at the time of each interruption trigger. The task type includes real-time task context and non-real-time task context. Perform the following operations for the interrupt response time in the real-time task context and the interrupt response time in the non-real-time task context: plot a histogram of all interrupt response times with interrupt response time as the x-axis and frequency as the y-axis; fit a normal distribution to the histogram to obtain a normal distribution curve; calculate the mean and standard deviation of the interrupt response time based on the normal distribution curve; use M times the standard deviation as the jitter value of the interrupt response time; calculate the ratio of the jitter value to the mean value as the interrupt response stability coefficient of the platform in that task context. The maximum, average, and interrupt response stability coefficients of the interrupt response time obtained from the real-time task context are compared with a preset first threshold. The maximum and average interrupt response times of the interrupt response time obtained from the non-real-time task context are compared with a preset second threshold. The absolute value of the difference between the average interrupt response time of the real-time task context and the non-real-time task context is calculated as the task context response difference. If the maximum value in the real-time task context is less than the control cycle of the platform, the average value in the real-time task context is less than a first preset proportion of the control cycle, the interrupt response stability coefficient in the real-time task context is less than or equal to the first preset stability threshold, the maximum value in the non-real-time task context is less than the control cycle of the platform, the interrupt response stability coefficient in the non-real-time task context is less than or equal to the second preset stability threshold, and the task context response difference is less than a preset difference threshold, then the platform is determined to meet the interrupt response requirements of the CNC system; otherwise, the platform is determined to not meet the interrupt response requirements of the CNC system.

2. The method for testing the interrupt response capability of a CNC system platform with computational load according to claim 1, characterized in that, The steps for configuring interrupt handlers include: The interrupt handling function is configured such that when the first general-purpose input / output pin receives an interrupt trigger signal, it controls the second general-purpose input / output pin to output a level toggling signal, which serves as the interrupt response signal.

3. The method for testing the interrupt response capability of a CNC system platform with computational load according to claim 1, characterized in that, The signal generator is a signal generator with a built-in signal generation module in the oscilloscope or a dedicated device; the signal receiver is a signal receiver in the oscilloscope or a dedicated device. When using an oscilloscope for measurement, connect the output of the oscilloscope's signal generation module to the first general-purpose input / output pin of the platform, and connect the output of the signal generation module to the first analog input channel of the oscilloscope as a trigger source and comparison signal; connect the second general-purpose input / output pin of the platform to the second analog input channel of the oscilloscope. And connect the signal ground of the oscilloscope signal generation module to the digital ground of the platform; Select the oscilloscope bandwidth as N times the platform control cycle frequency, and set the trigger type to edge trigger.

4. The method for testing the interrupt response capability of a CNC system platform with computational load according to claim 1, characterized in that, The load configuration process also includes configuring multiple load levels: Set up multiple load levels, each load level corresponding to a different combination of real-time task intensity and non-real-time task intensity; According to the order of load level from low to high, repeat steps 2 to 5 at each load level to obtain the maximum value, average value and jitter value of interrupt response time at each load level. Plot the curves showing the changes in load level and the maximum, average, and jitter values ​​of interrupt response time to characterize the performance degradation trend of the platform's interrupt response capability under different load intensities.

5. A testing device for the interrupt response capability of a CNC system platform with computational load, used to implement the method as described in any one of claims 1-4, characterized in that, include: A computational load configuration module is used to configure the computational load for a CNC system platform. The platform includes a chip and an operating system mounted on the chip. The computational load includes real-time tasks and non-real-time tasks simulating the actual working conditions of the CNC system, and maintains continuous operation during interruption response testing. The computational load configuration module includes: The real-time task configuration unit is used to configure the interpolation program of the CNC system, including trajectory planning, kinematic transformation and dynamic compensation; The non-real-time task configuration unit is used to configure data management and human-computer interaction programs, including G-code parsing, precision compensation, and 3D graphics display tasks. Furthermore, the priority of real-time tasks is higher than that of non-real-time tasks; An interrupt response configuration module is used to configure the first general-purpose input / output pin of the platform to external interrupt mode and configure an interrupt handling function so that when the first general-purpose input / output pin receives an interrupt trigger signal, an interrupt response signal is output through the second general-purpose input / output pin. The priority of the interrupt handling function is set to be higher than the priority of the real-time task and the non-real-time task. A signal generator is used to generate a periodic excitation signal synchronized with the control cycle of the platform, and output the excitation signal to the first general-purpose input / output pin of the platform to trigger a platform interrupt, so that the interrupt handling function can preempt the currently executing real-time task or non-real-time task. A signal receiver, which uses the same frequency reference as the signal generator to achieve synchronization, is used to simultaneously acquire the excitation signal and the interrupt response signal output by the platform. Within a preset test time, it continuously measures and records the time interval from the edge of the excitation signal to the edge of the interrupt response signal in each excitation cycle, as the interrupt response time. The statistical analysis module is used to statistically calculate the maximum value, average value, and interrupt response jitter of the interrupt response time based on the interrupt response time over multiple consecutive periods, and to obtain the evaluation results of the platform's interrupt response capability in real-time task context and non-real-time task context.

Citation Information

Patent Citations

  • Interface interruption measurement method and device

    CN113032305A

  • FPGA (Field Programmable Gate Array)-based dedicated chip real-time evaluation method

    CN120469782A