Servo system tracking error dataset reconstruction method and apparatus, device, and storage medium
By using a servo system mechanism model and data layer optimization methods, a lightweight dataset is generated, which solves the problems of data compression and dynamic feature preservation in the time-series data processing of servo systems. This enables efficient servo tracking error prediction and is suitable for online operation and maintenance and model iteration of servo systems.
Patent Information
- Application Number
- CN202611379549.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-27
AI Technical Summary
Existing time-series data processing methods for servo systems cannot effectively balance data compression, dynamic feature preservation, and multi-condition adaptation, resulting in high computational consumption, long iteration cycles, and insufficient dynamic error prediction capabilities during model training.
By establishing a servo system mechanism model, obtaining the temporal characteristics of velocity and acceleration, performing standardization processing, using a fixed-length sliding window slice, calculating the comprehensive rate of change, constructing a power probability retention function for differential sampling, generating a lightweight dataset, and using an LSTM network for nonlinear residual prediction.
It significantly reduces training computational power consumption, improves the prediction accuracy of servo tracking error and multi-axis linkage contour error, and maintains or exceeds the prediction accuracy of the original full data training results. It is suitable for online operation and maintenance and model iteration.
Smart Images

Figure CN123177329A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of servo system data processing technology, and in particular to a method, apparatus, device and storage medium for reconstructing a servo system tracking error dataset. Background Technology
[0002] The tracking error of the servo feed system in ultra-precision machine tools directly determines the machining contour accuracy and surface quality of optical components and semiconductor devices. Mechanism-data hybrid modeling is the mainstream high-precision framework for servo tracking error prediction, but it has significant pain points in engineering applications: The machine tool uses a 1000Hz high-frequency sensor to collect time-series data. A single working condition generates millions of samples. The massive full data training has high computing power overhead and long iteration cycle, which is not conducive to online model tuning and deployment. The machine tool operates under a constant speed and steady state for more than 70% of the time, generating a large number of homogeneous and redundant samples with weak speed and acceleration fluctuations. High-value samples such as dynamic acceleration and deceleration, reversal, and trajectory cusps account for a very small proportion. The gradient of steady-state samples dominates model training, and the dynamic error characteristics are severely diluted, resulting in a significant decrease in the model's ability to generalize and predict sudden operating conditions. Existing time-series data simplification methods have inherent flaws: uniform downsampling indiscriminately reduces samples, easily losing dynamic key time-series information; fixed threshold hard screening relies on manual parameter tuning, has poor adaptability, and is prone to causing breakage of time-series features; random sampling suffers from the loss of key samples and multi-axis time-series misalignment; gradient and clustering adaptive sampling only use single features to evaluate sample value and are hard partitioning screening, lacking a flexible and adjustable differentiated sampling mechanism; power probability resampling is only applied to imbalanced datasets and has not yet been combined with the characteristics of the servo signal change rate to achieve adaptive reconstruction of time-series datasets.
[0003] Existing research on servo hybrid error prediction mainly focuses on network structure optimization, neglecting the problem of data layer sample distribution imbalance. It lacks a dedicated time-series data lightweight optimization scheme that adapts to the mechanism-data hybrid modeling framework, making it difficult to simultaneously meet the three major engineering requirements of data compression, dynamic feature preservation, and operating condition adaptation. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and storage medium for reconstructing a servo system tracking error dataset. It aims to solve the technical problem that existing servo time-series data processing methods cannot balance data compression, dynamic feature preservation, and multi-condition adaptation. By adopting a data layer optimization approach, it eliminates the need to modify the backend prediction network structure, significantly reduces training computational power consumption, and enriches high-value samples under dynamic conditions, thereby improving the accuracy and robustness of servo tracking error and multi-axis linkage contour error prediction.
[0005] In a first aspect, the present invention provides a method for reconstructing a tracking error dataset for a servo system, the method comprising: A mechanistic model of the servo system is established, and the mechanistic predicted position is obtained based on the reference position command. The actual position of the servo system is obtained, and the difference between the mechanistic predicted position and the actual position is used as a nonlinear residual label. First-order and second-order differences are performed on the reference position command to obtain velocity time-series characteristics and acceleration time-series characteristics. The velocity time-series features, acceleration time-series features, and nonlinear residual labels are standardized. The standardized velocity time-series sequence, acceleration time-series sequence, and nonlinear residual label sequence are sliced using a fixed-length sliding window to generate a time-series window sample set that includes velocity, acceleration, and residual information at multiple time points. The comprehensive rate of change is calculated based on the velocity and acceleration sequences within each time window sample, and the dynamic information value of each time window sample is quantified by the comprehensive rate of change. Based on the comprehensive rate of change of samples in each time window, a power probability retention function is constructed. Differential sampling is performed on samples in each time window to remove steady-state redundant samples and retain samples with high dynamic information value, thus obtaining the reconstructed lightweight dataset. The reconstructed lightweight dataset is input into the prediction network to obtain a nonlinear residual prediction value; the mechanism prediction position is superimposed with the nonlinear residual prediction value to obtain a composite position prediction value; and the servo system tracking error prediction value is obtained based on the composite position prediction value.
[0006] In one possible design, the step of establishing a mechanistic model of the servo system and obtaining the mechanistic predicted position based on the reference position command specifically includes: A three-loop servo mechanism model of a permanent magnet linear synchronous motor is established, consisting of a current loop, a speed loop, and a position loop from the inside out. The current loop is simplified to hysteresis-free tracking, and the position loop PID controller, the speed loop PI controller, and the motor transfer function are sequentially integrated. The intermediate variables current and speed are eliminated, and the reference position is derived. to the actual grating position The whole machine closed-loop transfer function for: in, For the complex frequency variable of the Laplace transform, The thrust constant of the linear motor. For the speed loop PI controller, the transfer function, For the position loop PID controller, the transfer function is... This refers to the total mass of the motor and load converted to the mover side. It is the viscous damping coefficient; Perform a Laplace transform on the reference position command to obtain the reference position. ; the reference position Multiply by the closed-loop transfer function To obtain the actual grating position ; for the actual grating position Perform an inverse Laplace transform to obtain the predicted location of the mechanism in the time domain.
[0007] In one possible design, the velocity timing features, acceleration timing features, and nonlinear residual labels are standardized, specifically including: For the velocity time sequence characteristics Acceleration time series characteristics The constructed two-dimensional input feature matrix and by nonlinear residual labels The output label sequence Z-score standardization is performed using the global mean and global standard deviation to obtain the standardized feature matrix. and standardized label sequence : in, The feature is the global mean. The global standard deviation of the feature. The global mean of the residuals. This represents the global standard deviation of the residuals.
[0008] In one possible design, the combined rate of change is calculated based on the velocity and acceleration sequences within each of the time-series window samples, including: For the i The velocity and acceleration sequences within a time window are used to calculate the first-order absolute difference of velocity between adjacent sampling points using the following formula. and the first-order absolute difference of acceleration : in, The window length is a fixed-length sliding window. The sampling point number within the window. and The velocity sequence is at the 1st The and the first The value of each sampling point, and The acceleration sequence is respectively in the 1st... The and the first The value of each sampling point; Based on the first-order absolute difference of the velocity and the first-order absolute difference of acceleration The first is determined by the following formula. i The overall rate of change of each time window : According to the comprehensive rate of change The numerical value quantifies the dynamic information value of the corresponding time-series window samples.
[0009] In one possible design, a power-law probability retention function is constructed based on the combined rate of change of samples from each time series window, and differentiated sampling is performed on samples from each time series window, including: Sort the overall rate of change of all time-series samples in ascending order; define the normalized ranking position based on the sorting number. The sample value ranking is mapped to a set continuous interval; Set the global minimum sampling probability and global maximum sampling probability After constructing the sorted order i retention probability of a sample for: Where γ is a power-law control parameter, and γ>1; according to the retention probability Bernoulli random mask sampling is performed on the sorted samples of each time window to obtain the reconstructed lightweight dataset.
[0010] In one possible design, the prediction network is an LSTM network; the reconstructed lightweight dataset is input into the prediction network, and a nonlinear residual prediction value is obtained by fitting; the mechanism prediction position is superimposed with the nonlinear residual prediction value to obtain a composite position prediction value; based on the composite position prediction value, a servo system tracking error prediction value is obtained, including: The velocity and acceleration time-series features of each time-series window in the reconstructed lightweight dataset are used as inputs to the LSTM network, and the corresponding nonlinear residual labels are used as supervision signals to train the LSTM network. After training, the LSTM network establishes a mapping relationship from velocity and acceleration time-series features to nonlinear residuals. The velocity and acceleration time-series features corresponding to the test position command are input into the trained LSTM network, and after forward computation by the network, nonlinear residual prediction values are output. The test position command is processed by the servo system mechanism model to obtain the mechanism prediction position. The mechanism prediction position is added to the nonlinear residual prediction value to obtain the composite position prediction value. The difference between the composite position prediction value and the actual measured position is used to obtain the servo system tracking error prediction value.
[0011] In one possible design, after subtracting the composite position prediction value from the measured actual position to obtain the servo system tracking error prediction value, the method further includes: Hermite cubic spline interpolation is used to reconstruct the predicted trajectory and the theoretical trajectory piecewise, respectively, to obtain a continuous smooth trajectory; the parametric equation of the Hermite cubic spline interpolation is: in, u For the parameter variables of the spline curve, and The positions of the parameters on the spline curve are respectively u The corresponding X-axis and Z-axis coordinates; a x The coefficients of the cubic terms in the cubic polynomial along the x-axis. b x The coefficients of the quadratic term in the cubic polynomial along the x-axis. c x The coefficients of the linear term in the cubic polynomial along the x-axis are... d x The coefficients of the constant term in the cubic polynomial along the X-axis; a z The coefficients of the cubic terms in the cubic polynomial along the Z-axis are... b z The coefficients of the quadratic term in the cubic polynomial along the Z-axis. c z The coefficients of the linear term in the cubic polynomial along the Z-axis are... d z The coefficients of the constant term in the cubic polynomial along the Z-axis; Using the instantaneous tangent vector obtained by solving the coordinates of the two ends of the segment and the central difference as the interpolation boundary constraints, the parametric equations of the Hermite cubic spline interpolation are solved. a x , b x , c x , d x , a z , b z , c z and d z This yields a piecewise smooth continuous trajectory curve; Based on the continuous trajectory curve, for any predicted coordinate point P ref The bisection iterative perpendicular method is used to iteratively optimize within the parameter interval, solving for the nearest matching point on the spline curve to the predicted coordinate point. With the predicted coordinate points P ref Matching point The Euclidean distance between them is used as the profile error.
[0012] In a second aspect, the present invention provides a servo system tracking error dataset reconstruction apparatus, the apparatus comprising: The model building module is configured to establish a mechanistic model of the servo system, obtain the mechanistic predicted position based on the reference position command, acquire the actual position of the servo system, and use the difference between the mechanistic predicted position and the actual position as a nonlinear residual label; perform first-order and second-order differences on the reference position command to obtain velocity time-series features and acceleration time-series features. The standardization and slicing module is configured to standardize the velocity time series features, acceleration time series features, and nonlinear residual labels; and to slice the standardized velocity time series, acceleration time series, and nonlinear residual label sequences using a fixed-length sliding window to generate a time series window sample set that includes velocity, acceleration, and residual information at multiple time points. The comprehensive rate of change calculation module is configured to calculate the comprehensive rate of change based on the velocity sequence and acceleration sequence within each time window sample, and to quantify the dynamic information value of each time window sample using the comprehensive rate of change. The data reconstruction module is configured to construct a power probability retention function based on the comprehensive change rate of samples in each time window, perform differential sampling on samples in each time window, filter out steady-state redundant samples and retain samples with high dynamic information value, and obtain a reconstructed lightweight dataset. The error misdetection module is configured to input the reconstructed lightweight dataset into the prediction network, fit it to obtain a nonlinear residual prediction value; superimpose the mechanism prediction position with the nonlinear residual prediction value to obtain a composite position prediction value; and obtain a servo system tracking error prediction value based on the composite position prediction value.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform the servo system tracking error dataset reconstruction method as described in the first aspect and various possible designs of the first aspect.
[0014] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the servo system tracking error dataset reconstruction method described in the first aspect and various possible designs of the first aspect.
[0015] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the servo system tracking error dataset reconstruction method described in the first aspect and various possible designs of the first aspect.
[0016] The servo system tracking error dataset reconstruction method, apparatus, device, and storage medium provided by this invention have at least the following beneficial effects: (1) The present invention calculates the first-order absolute difference between the velocity sequence and the acceleration sequence within the window and superimposes them to obtain the comprehensive rate of change. This can objectively reflect the richness of dynamic features of samples in each time window, provide a continuous and separable evaluation benchmark for differentiated sampling, and avoid the uncertainty caused by subjective threshold setting.
[0017] (2) By constructing a power probability retention function, the present invention uses the power exponent to adjust the parameter γ>1 so that the sampling probability increases non-linearly, so that high dynamic window samples have a high retention probability and steady-state redundant window samples have a low retention probability, thereby achieving flexible adaptive screening that retains dynamic samples and deletes steady-state samples. This not only retains key transient features, but also avoids the breakage of time sequence features caused by hard threshold screening.
[0018] (3) This invention reconstructs a lightweight dataset by differentially sampling the original time-series window samples, which can enrich samples with high dynamic information value in the training set while filtering out a large number of steady-state redundant samples. In the embodiment, under the conditions of a sample retention rate of about 27% and a training time reduction of about 73%, the tracking error prediction accuracy is still maintained or better than the original full data training results. It achieves the best or near-best prediction effect under four typical variable curvature trajectories: Fibonacci spiral, cardioid, Archimedes spiral and circle. This proves that this invention can indeed ensure that the prediction accuracy does not decrease while significantly reducing the computational power consumption of model training, and is suitable for online operation and maintenance and model iteration of servo systems.
[0019] (4) The dataset reconstruction method proposed in this invention is independent of the prediction model architecture and can be adapted to various time series networks such as LSTM, GRU, and TCN. It has good versatility and engineering application value. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0021] Figure 1 This is a schematic diagram illustrating the overall complete execution flow of a servo system tracking error dataset reconstruction method provided in an embodiment of the present invention. Figure 2A block diagram of the PMLSM three-loop servo cascade control structure provided in an embodiment of the present invention; Figure 3 The original sample density map and sample retention ratio map are provided for embodiments of the present invention; wherein, (a) is the sample retention ratio map; and (b) is the original sample density map; Figure 4 This is a schematic diagram of the overall architecture for mechanism-data hybrid prediction provided in an embodiment of the present invention; Figure 5 The following are schematic diagrams of four typical experimental processing trajectories provided for embodiments of the present invention; wherein, (a) Fibonacci spiral; (b) Archimedes spiral; (c) cardioid; and (d) circular. Figure 6 The following is a comparison chart of the actual residual and four predicted residual trajectories, and the actual tracking error and four predicted tracking error trajectories for the Fibonacci spiral trajectory provided in the embodiments of the present invention; wherein, (a) Fibonacci spiral trajectory - X-axis; (b) Fibonacci spiral trajectory - Z-axis; Figure 7 The following is a comparison chart of the actual residual and four predicted residual trajectories, and the actual tracking error and four predicted tracking error trajectories for a cardioid trajectory, provided for embodiments of the present invention; wherein, (a) cardioid trajectory - X-axis; (b) cardioid trajectory - Z-axis; Figure 8 The following is a comparison chart of the actual residual and four predicted residual trajectories, and the actual tracking error and four predicted tracking error trajectories for the Archimedean spiral trajectory provided in the embodiments of the present invention; wherein, (a) Archimedean spiral trajectory - X-axis; (b) Archimedean spiral trajectory - Z-axis; Figure 9 The following is a comparison chart of the actual residual and four predicted residual trajectories, and the actual tracking error and four predicted tracking error trajectories for a circular trajectory, provided for embodiments of the present invention; wherein, (a) circular trajectory - X-axis; (b) circular trajectory - Z-axis; Figure 10 The above is a comparison chart of the actual residual and the predicted residual trajectory of each model, as well as the actual tracking error and the predicted tracking error trajectory of each model, for the Fibonacci spiral trajectory provided in the embodiments of the present invention; wherein, (a) Fibonacci spiral trajectory - X-axis; (b) Fibonacci spiral trajectory - Z-axis; Figure 11 The above is a comparison chart of the actual residual and the predicted residual trajectory of each model, as well as the actual tracking error and the predicted tracking error trajectory of each model, for a cardioid trajectory provided in the embodiments of the present invention; wherein, (a) cardioid trajectory - X-axis; (b) cardioid trajectory - Z-axis; Figure 12The above is a comparison chart of the actual residual and the predicted residual trajectory of each model, as well as the actual tracking error and the predicted tracking error trajectory of each model, for the Archimedean spiral trajectory provided in the embodiments of the present invention; wherein, (a) Archimedean spiral trajectory - X-axis; (b) Archimedean spiral trajectory - Z-axis; Figure 13 The above is a comparison chart of the actual residual and the predicted residual trajectory of each model, and the actual tracking error and the predicted tracking error trajectory of each model for a circular trajectory, provided for embodiments of the present invention; wherein, (a) circular trajectory - X-axis; (b) circular trajectory - Z-axis; Figure 14 This is a schematic diagram illustrating the principle of Hermite cubic spline interpolation + binary iterative contour error solution provided in an embodiment of the present invention. Figure 15 Comparison of RMSE of RDPP-LSTM and some other methods / models for contour error prediction provided in this embodiment of the invention; wherein, (a) Fibonacci spiral; (b) Archimedes spiral; (c) heart shape; (d) circle; Figure 16 Comparison of X / Z axis linkage trajectory curves of RDPP-LSTM provided in this embodiment of the invention; wherein, (a) Fibonacci spiral (deviation from theoretical trajectory magnified by 2000 times); (b) Archimedes spiral (deviation from theoretical trajectory magnified by 2000 times); (c) cardioid (deviation from theoretical trajectory magnified by 2000 times); (d) circle (deviation from theoretical trajectory magnified by 2000 times). Figure 17 A structural diagram of a servo system tracking error dataset reconstruction device provided in an embodiment of the present invention.
[0022] The accompanying drawings have illustrated specific embodiments of the invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the invention in any way, but rather to illustrate the concept of the invention to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0023] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0024] In the technical solution of this invention, the collection, storage, use, processing, transmission, provision and disclosure of relevant data and information comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0025] It should be noted that in the embodiments of the present invention, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of the present invention. However, they do not mean that the inventor has used or necessarily used the solution.
[0026] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0027] This invention provides a method for reconstructing a servo system tracking error dataset based on power probability sampling driven by the rate of change. Figure 1 This is a schematic diagram illustrating the overall complete execution flow of a servo system tracking error dataset reconstruction method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the servo system tracking error dataset reconstruction method includes the following steps S10-S60.
[0028] S10: Establish the mechanism model of the servo system and obtain the mechanism prediction position based on the reference position command; obtain the actual position of the servo system and use the difference between the mechanism prediction position and the actual position as the nonlinear residual label; perform first-order and second-order differences on the reference position command to obtain the velocity timing characteristics and acceleration timing characteristics.
[0029] In some embodiments, step S10 can establish a PMLSM three-loop servo mechanism model in the following manner, and calculate the velocity timing characteristics and acceleration timing characteristics based on the model.
[0030] Specifically, the dynamic equations of the PMLSM are derived. When a three-phase symmetrical current is applied to the linear motor, electromagnetic thrust is generated. The thrust in the rated range is linearly related to the q-axis current. The time-domain thrust formula is as follows: in, To provide electromagnetic thrust to the motor, For the effective armature control current of the motor, This is the thrust constant of the linear motor.
[0031] The servo system consists of three cascaded closed loops from the inside out: a current loop (PI), a speed loop (PI), and a position loop (PID). The bandwidth of the current loop is much higher than that of the speed and position loops, simplifying the current command to track without hysteresis. The position loop PID, speed loop PI, and motor transfer function are sequentially linked, eliminating the intermediate variables of current and speed, to derive the reference position. to the actual grating position The whole machine closed-loop transfer function : in, For the complex frequency variable of the Laplace transform, The thrust constant of the linear motor. For the speed loop PI controller, the transfer function, For the position loop PID controller, the transfer function is... This refers to the total mass of the motor and load converted to the mover side. is the viscous damping coefficient.
[0032] The block diagram of the three-loop cascade control structure of the above closed-loop transfer function is as follows: Figure 2 As shown, the transfer function reflects the frequency domain response characteristics from the reference position command to the actual grating position. The position loop PID controller and the speed loop PI controller handle position tracking and speed regulation, respectively, while the current loop is approximated as a proportional element due to its much higher bandwidth compared to the position and speed loops. Using this transfer function, the linear predictive response of the servo system under a given reference position command can be calculated. This response represents the system's output behavior under ideal linear conditions.
[0033] Specifically, such as Figure 2 As shown, the servo system employs a three-loop cascade control structure, consisting of a position loop, a speed loop, and a current loop nested layer by layer from the outside in, thus fully realizing the system's closed-loop position control function. The system input terminal imports reference position commands. It is then connected to the first comparison point. This first comparison point is used to input a reference position command. The reverse input worktable actual position feedback signal The two signals are compared to calculate the position error signal. Position error signal Input position loop controller After completing the adjustment calculation through the position loop control law, a reference speed command is output. This enables the system to achieve closed-loop control for position tracking.
[0034] Reference speed command output by the position loop Connect to a second comparison point, which receives a positive input reference speed command. The actual speed feedback signal of the input worktable is reversed. The difference between the signals is used to generate a speed error signal. This speed error signal is then input to the speed loop controller. After adjustment and calculation by the speed loop control law, the equivalent current command is output. This completes the closed-loop speed regulation of the system. Since the bandwidth of the current loop is much higher than that of the position loop and the speed loop, the current response can be approximately achieved with zero hysteresis tracking. Therefore, this control structure simplifies the current loop, treating it as an equivalent proportional transfer characteristic, so that the current command can directly correspond to the effective current of the motor armature.
[0035] Equivalent current command output by the speed loop Input the thrust constant of the permanent magnet linear synchronous motor It completes the conversion of current signal to electromagnetic thrust signal, and outputs the electromagnetic thrust of the motor. The electromagnetic thrust output by the motor Connect to the third comparison point, which receives a positive electromagnetic thrust. Total external disturbance force of the reverse access system .in The load resistance borne by the worktable The net driving force for the movement of the worktable's mover is obtained by subtracting the two thrust signals to calculate the external disturbance force experienced by the system during operation. This net driving force is then input into the mechanical dynamics system. After calculations by the mechanical dynamics component, the actual speed of the worktable is output. .
[0036] Actual speed of the worktable Input points section The actual position of the workbench is obtained through integration. This serves as the system's final position output. Simultaneously, the actual speed of the worktable's movement... The data is fed back to the reverse input terminal of the speed loop summation and comparison point, forming a speed closed-loop feedback; actual position The feedback is sent back to the inverting input of the position loop summation comparison point, forming a position closed-loop feedback. This completes the three-loop cascade closed-loop feedback control structure of position, speed, and current, enabling precise high-precision position closed-loop control of the servo system.
[0037] The reference position command of the CNC system is used to output the ideal linear predicted position of the system through the transfer function; the actual position of the worktable is collected in real time from the grating ruler, and the difference between the predicted position and the actual position is used as the nonlinear residual to be fitted by the LSTM network; the velocity sequence is obtained by first-order difference of the reference position command, and the acceleration sequence is obtained by second-order difference, which are used as the input features of the network.
[0038] The velocity and acceleration sequences reflect the motion rate and force state of the servo system under position command, respectively. The velocity sequence is obtained by taking the first-order difference point by point from the reference position command, and the acceleration sequence is obtained by taking the second-order difference point by point from the reference position command. Together, they constitute the basic feature set describing the system's motion state, providing input information for the subsequent LSTM network to fit the nonlinear residuals.
[0039] It should be noted that the actual position of the servo system is obtained in real time by feedback from the grating ruler. The grating ruler, as a high-precision displacement sensor, is installed on the worktable and can collect the actual displacement of the worktable in real time at the machine tool sampling frequency (1000Hz in this embodiment), which serves as the reference value for the actual position of the system.
[0040] S20: Standardize the velocity time series features, acceleration time series features, and nonlinear residual labels; slice the standardized velocity time series, acceleration time series, and nonlinear residual label series using a fixed-length sliding window to generate a time series window sample set that includes velocity, acceleration, and residual information at multiple time points.
[0041] In some embodiments, step S20 may perform timing normalization and sliding window slicing in the following manner.
[0042] The physical dimensions and amplitudes of velocity, acceleration, and residuals vary greatly, and direct training would cause an imbalance in the weights of the loss function. Therefore, global mean and standard deviation standardization is used for the two-dimensional input feature matrix. Output label sequence Normalization formula: The feature is the global mean. The global standard deviation of the feature. The global mean of the residuals. This represents the global standard deviation of the residuals.
[0043] Z-score standardization transforms data into a standard normal distribution with a mean of 0 and a standard deviation of 1 by subtracting the mean and dividing by the standard deviation. This standardization method preserves the relative distribution characteristics of the original data and does not change the temporal dependencies of the data, making it suitable for subsequent time-series slicing based on sliding windows.
[0044] Set a fixed window length For the standardized continuous time series, slide slices point by point, each window contains A series of continuous sampling points are used, with adjacent windows stepping by one sampling point to generate a massive independent temporal window sample set. All samples constitute the original sample pool to be reconstructed.
[0045] The essence of sliding window slicing is to transform a continuous temporal sequence into multiple local temporal segments, each segment serving as an independent training sample. Window length. The selection of the window length needs to consider two factors: if the window is too short, the temporal information contained in a single window is insufficient, making it difficult to reflect the dynamic evolution of the system; if the window is too long, the number of samples decreases and features from various different operating conditions may be mixed in within the window, reducing the purity of the samples. In this embodiment, the window length... The configuration is based on the servo system's response time and the curvature variation characteristics of the machining trajectory, with a typical range of 50-200 sampling points. All window samples are arranged in chronological order to form the original sample pool, and each sample contains... The velocity characteristics, acceleration characteristics, and corresponding residual labels for each consecutive time step.
[0046] S30: Calculate the comprehensive rate of change based on the velocity and acceleration sequences within each time window sample, and quantify the dynamic information value of each time window sample using the comprehensive rate of change.
[0047] In some embodiments, a method for calculating the overall rate of change is provided. Specifically, for the velocity sequence within a window... v , acceleration sequence a Calculate the first-order absolute difference between adjacent sampling points, eliminate the interference of positive and negative signs in the direction of motion, and retain only the wave intensity: in, The window length is a fixed-length sliding window. The sampling point number within the window. and The velocity sequence is at the 1st The and the first The value of each sampling point, and The acceleration sequence is respectively in the 1st... The and the first The value of each sampling point; This represents the first-order absolute difference of velocity. This is the first-order absolute difference value of the acceleration.
[0048] Superimpose all velocity and acceleration differences within the window and take the average to eliminate numerical scale differences caused by the window length, and define the first... i Overall Change Rate of Each Window : The larger the value, the higher the overall fluctuation range of velocity and acceleration within the window, corresponding to the dynamic motion conditions of the machine tool, and the key features of residual evolution carried by the sample. A value close to 0 indicates that the window is in a long-term, uniform, steady-state region, with high redundancy of sample information. For all... The score is calculated for each window individually to obtain the global sample value vector. .
[0049] According to the above definition, the overall rate of change It can be used as a quantitative indicator of the dynamic information value of a sample, and its value range is non-negative real numbers. The larger the value, the richer the dynamic information contained in the sample, and the higher its value for training the prediction model. The smaller the value, the more the samples tend to be in a steady-state redundancy, and the lower their contribution to model training. This provides a continuously separable quantitative evaluation benchmark for subsequent differential sampling.
[0050] S40: Based on the comprehensive change rate of samples in each time window, construct a power probability retention function, perform differential sampling on samples in each time window, filter out steady-state redundant samples and retain samples with high dynamic information value, and obtain the reconstructed lightweight dataset.
[0051] In this embodiment, the power probability mapping function constructed in step S40 is used to achieve flexible differentiated sampling.
[0052] In some embodiments, the overall change rate of all samples is rearranged in ascending order to achieve an ordered distribution of values from low to high. The index mapping relationship before and after sorting is recorded synchronously to ensure that the original window order can be restored after probability calculation. A normalized ranking position is defined based on the sorting sequence number. Mapping sample value ranking to Continuous intervals eliminate the influence of the total sample size on the probability calculation scale. The closer it is to 0, the lower the corresponding sample change rate and the higher the steady-state redundancy. The closer it is to 1, the stronger the dynamic fluctuation of the corresponding sample and the higher the information value.
[0053] Normalized ranking position It is the relative position of the sample after being sorted in ascending order, and it is calculated as follows: ,in i This is the sequence number after ascending order. This normalization method ensures that the ranking position is consistent with the total sample size. This is irrelevant and facilitates a unified sampling standard across datasets of different sizes. Since the samples are already sorted in ascending order of overall rate of change, It is also equivalent to the empirical cumulative distribution function value of the overall sample change rate, reflecting the relative value quantile of the sample among all samples.
[0054] Set the global minimum sampling probability Maximum sampling probability These correspond to the two extreme samples with the lowest and highest rates of change, respectively. The probability of the intermediate interval is smoothly transitioned by a power function, ultimately yielding the sorted result. i The retention probability of each sample: In the formula, γ is a power-law control parameter that directly determines the concavity and convexity of the probability curve, corresponding to three different sampling modes: (1) γ>1: The curve is concave downwards, the probability of low-ranked steady-state samples increases slowly, and the probability of high-ranked dynamic samples increases rapidly, which greatly compresses the probability of redundant sample extraction, in line with the reconstruction goal of preserving dynamics and deleting steady-state samples. (2) γ=1: The function degenerates into a linear mapping, the probability is proportional to the ranking position, and there is no differentiated screening ability; (3) 0<γ<1: The curve is convex, the probability of retaining steady-state samples is too high, the effect of dynamic sample screening is weakened, and it is not suitable for servo time series data reconstruction field.
[0055] In this embodiment, a configuration with γ > 1 is selected to achieve the reconstruction goal of retaining dynamic samples and deleting steady-state samples. Specifically, the larger the value of γ, the stronger the downward convexity of the probability curve, further reducing the retention probability of low-ranked samples and further increasing the retention probability of high-ranked samples. The value of γ can be adjusted according to the actual data distribution and the desired sample retention rate. In this embodiment, the typical value range of γ is 2 to 4. and The values are set to be close to 0 and close to 1, respectively, to ensure that the lowest value sample still has a very low probability of retention rather than being completely removed (preserving the continuity of transitional samples), while the highest value sample has a near-complete retention probability.
[0056] Finally, based on the above retention probabilities Bernoulli random mask sampling is performed on the sorted samples of each time window. That is, a random number following a uniform distribution is generated independently for each sample. If the random number is less than or equal to If a sample is selected, it is retained; otherwise, it is discarded. The essence of Bernoulli random mask sampling is to use probability... By independently performing binary selection on each sample without setting a fixed threshold, flexible screening can be achieved as a whole while maintaining the randomness of individual sample retention or rejection, avoiding sample selection bias and temporal feature breakage caused by hard threshold screening.
[0057] The sampling probability function curve is shown below. Figure 3 As shown.
[0058] S50: Input the reconstructed lightweight dataset into the prediction network and fit it to obtain the nonlinear residual prediction value; superimpose the mechanism prediction position with the nonlinear residual prediction value to obtain the composite position prediction value; obtain the servo system tracking error prediction value based on the composite position prediction value.
[0059] In some embodiments, the prediction network is selected as an LSTM network. The reconstructed lightweight dataset is used as input, and the velocity and acceleration time series are fed into the LSTM network. The network outputs nonlinear residual prediction values. The mechanistic model employs the three-loop transfer function of the servo system. After training, for new test commands, the linear predicted position output by the mechanistic model and the residual compensation output by the LSTM are used respectively. The two are then superimposed to obtain the final predicted position, thereby obtaining the predicted tracking error value. A schematic diagram of the overall architecture of the mechanistic-data hybrid prediction is shown below. Figure 4 As shown.
[0060] The overall architecture of this mechanism-data hybrid prediction includes a training phase for the transfer function residual prediction model and a prediction phase for the hybrid-driven servo system composite model.
[0061] In the training phase of the transfer function residual prediction model, the reference command is used as a unified input source, and the signal is transmitted in three parallel paths: the first path is input to the motion feature module, which performs differential processing on the reference command to obtain the velocity and acceleration time-series features, which serve as the input features of the prediction network; the second path is input to the servo system transfer function module, which calculates the actual position predicted by the transfer function through a pre-established three-loop servo transfer function, and outputs the linear ideal response position of the servo system; the third path is input to the actual servo system, which acquires the actual position output of the workbench, serving as the true benchmark for residual calculation. The actual position predicted by the transfer function and the actual position output by the actual servo system are connected to the same comparison point. The difference is calculated with the actual position as the positive input and the transfer function predicted position as the negative input to obtain the nonlinear residual label of the servo system; the velocity and acceleration time-series features output by the motion feature module are used as input, and the corresponding time-series residuals are used as output labels, which are then input into the LSTM network for supervised training to complete the parameter fitting of the residual prediction model, enabling the LSTM network to predict the nonlinear residual of the system based on motion features.
[0062] After training, the system enters the hybrid-driven servo system composite model prediction stage. For new reference commands, a fusion prediction is performed: the new reference commands are processed in parallel via two paths. One path is input to the motion feature module, which performs differential analysis on the reference commands to obtain velocity and acceleration features, which are then input to the trained LSTM network, which outputs a nonlinear residual prediction value. The other path is input to the servo system transfer function module, which calculates the actual position predicted by the transfer function, i.e., the linear prediction position output by the mechanistic model. The linear prediction position output by the transfer function is then superimposed with the residual prediction value output by the LSTM network at a comparison point to obtain the composite model's predicted actual position—the final position prediction result after the fusion of the mechanistic model and the data model.
[0063] Finally, the reference command and the actual position predicted by the composite model are connected to the rightmost comparison point. The predicted tracking error of the servo system is calculated by subtracting the actual position predicted by the composite model from the reference command as the baseline value, thus achieving high-precision prediction of single-axis servo tracking error. To verify the advantages of the method of this invention with a single variable, four types of preprocessing schemes are set up for parallel comparison. All schemes share the same LSTM network structure, sliding window length, number of training iterations, learning rate, and other hyperparameters, only changing the pre-data reconstruction strategy: (1) The original full sample, without any downsampling or sample screening operations; (2) Uniformly and equally spaced downsampling, and uniformly reducing the time window according to a fixed ratio; (3) Fixed threshold hard screening: a fixed cutoff value is set based on the overall rate of change, and steady-state samples below the threshold are removed; (4) Rate of change-driven power probability adaptive data reconstruction, namely the nonlinear power function probability sampling mechanism proposed in this invention.
[0064] To comprehensively and objectively quantify the overall performance of different data preprocessing schemes, this section constructs a complete quantitative evaluation system from three dimensions: model prediction accuracy, dataset compression and lightweighting efficiency, and dynamic feature preservation capability.
[0065] To further verify the predictive superiority of the proposed rate-of-change-driven power probability adaptive data reconstruction combined with LSTM model (RDPP-LSTM), a comparative experiment was conducted using 10 mainstream models, including machine learning, basic temporal networks, and hybrid deep learning. The comparative models included multiple linear regression (MLR), random forest (RF), CNN, GRU, BiLSTM, CNN-LSTM, TCN-GRU, LSTM-Adaboost, TCN-BiLSTM-Attention, and Transformer-LSTM. Multiple linear regression (MLR) and random forest (RF) are traditional machine learning models that can fit the mapping relationship between input features and servo residuals; CNN focuses on local spatial and temporal convolutional feature extraction; GRU and BiLSTM are basic recurrent temporal networks that can capture basic temporal dependencies; CNN-LSTM, TCN-GRU, and LSTM-Adaboost improve single recurrent networks through convolutional fusion and ensemble learning, thereby enhancing multi-scale feature extraction capabilities to a certain extent; TCN-BiLSTM-Attention and Transformer-LSTM introduce multi-scale convolution and attention mechanisms, which can automatically strengthen the weights of abrupt dynamic features.
[0066] All comparison models use the same experimental dataset, unified normalization method, training iterations, and learning rate as described in this paper, only changing the prediction network structure. The root mean square error (RMSE) is used as the quantitative evaluation standard to ensure the fairness and effectiveness of the prediction performance comparison between different models.
[0067] S60: High-precision solution and performance evaluation of multi-axis linkage contour error.
[0068] To fully verify the comprehensive performance of the RDPP-LSTM method proposed in this invention in multi-axis linkage machining scenarios, a high-precision contour error calculation method using Hermite cubic spline trajectory reconstruction + binary iterative perpendicular foot solution was adopted to conduct a contour error prediction comparison experiment.
[0069] Direct Euclidean distance between discrete sampling points and piecewise linear projection can introduce calculation errors at trajectory cusps and high curvature regions. This embodiment uses Hermite interpolation to reconstruct a continuous smooth trajectory piecewise. in, u For the parameter variables of the spline curve, and The positions of the parameters on the spline curve are respectively u The corresponding X-axis and Z-axis coordinates; a x The coefficients of the cubic terms in the cubic polynomial along the x-axis. bx The coefficients of the quadratic term in the cubic polynomial along the x-axis. c x The coefficients of the linear term in the cubic polynomial along the x-axis are... d x The coefficients of the constant term in the cubic polynomial along the X-axis; a z The coefficients of the cubic terms in the cubic polynomial along the Z-axis are... b z The coefficients of the quadratic term in the cubic polynomial along the Z-axis. c z The coefficients of the linear term in the cubic polynomial along the Z-axis are... d z The coefficients of the constant term in the cubic polynomial along the Z-axis; The instantaneous tangent vector obtained by solving the coordinates at both ends of the segment and the central difference is used as the interpolation boundary constraint to eliminate the distortion of discrete sampling piecewise linear curves.
[0070] For any predicted coordinate point P ref Coarse matching determines the interpolation segment, and binary iterative optimization is performed within the parameter interval to find the nearest matching point on the spline curve to the prediction point. The Euclidean distance between two points represents the high-precision profile error. Figure 14 This is a schematic diagram illustrating the principle of Hermite cubic spline interpolation + binary iterative contour error solution provided in an embodiment of the present invention. Figure 14 As shown in the figure, the solid lines represent the actual trajectory formed by the machine tool's feed motion, and the dashed lines represent the command trajectory output by the CNC system. This embodiment combines continuous curve interpolation technology with an iterative perpendicular foot search algorithm to achieve high-precision solution of contour errors under multi-axis linkage machining conditions.
[0071] At the trajectory sampling level, discrete instruction sampling points are distributed on the instruction trajectory side. , , , , The actual trajectory side has discrete actual sampling points. , , , , Traditional contour error calculation methods often directly use discrete sampling points to solve for the Euclidean distance or calculate the error through piecewise linear projection. These methods have significant drawbacks; in complex trajectory regions such as cusps and high curvature areas, they easily introduce large calculation deviations, failing to meet the requirements for high-precision machining error detection. Therefore, this invention employs the Hermite cubic spline interpolation algorithm to perform piecewise fitting on the discrete sampling points, reconstructing a continuous and smooth trajectory curve, thus eliminating the trajectory distortion problem caused by discrete sampling.
[0072] The first one on the instruction trajectory i sampling points For example, the specific solution process for contour error proposed in this embodiment is divided into two steps: piecewise coarse matching and binary iterative perpendicular foot optimization. The specific process is as follows: Step S601: Segmented coarse matching and continuous trajectory reconstruction.
[0073] Based on the temporal location and coordinate distribution range of each sampling point, the command point is accurately determined. The corresponding interpolation segment in the actual trajectory is formed by two adjacent actual sampling points. and Defining the boundary. Based on the coordinate information of the two endpoints of the segment, and combined with the instantaneous tangent vector of the endpoint obtained by the central difference algorithm as a double boundary constraint, a Hermite cubic parametric curve is constructed to complete the continuous and smooth reconstruction of the actual trajectory of the corresponding interval, transforming the discrete sampling point trajectory into a differentiable continuous curve trajectory.
[0074] Step S602: Binary iterative perpendicular foot optimization and error solving.
[0075] A binary iterative optimization calculation is performed within the reconstructed interpolation segment parameter interval. In the initial iteration phase, an initial matching point is selected within the interval. Calculate command points Matching point with the initial point Euclidean distance between This value is used as the initial contour error estimate. Following the bisection iteration rule, the trajectory parameter range is continuously compressed, and the matching point positions are dynamically adjusted to iteratively approximate the distance to the command point on the continuous trajectory. The closest point.
[0076] Once the iterative calculation meets the convergence condition, the optimal perpendicular matching point is output. At this time, the instruction sampling point Matching point with vertical foot Euclidean distance between This is the high-precision contour error value corresponding to the sampling point.
[0077] The contour error solving method proposed in this invention effectively eliminates the distortion problem of polyline trajectory caused by discrete sampling, overcomes the shortcomings of traditional algorithms in calculating accuracy in complex trajectory regions such as high curvature and cusps, and can still maintain stable and accurate error calculation effect under complex machining trajectory conditions with variable curvature. It can objectively and realistically quantify the trajectory following accuracy in multi-axis linkage machining process, and provide reliable data support for CNC machining accuracy detection and error compensation.
[0078] The comparison chart of RMSE prediction for contour error using RDPP-LSTM and some other methods / models is shown below. Figure 15 As shown. Furthermore, to eliminate the interference of servo system phase lag and prediction timing offset on trajectory similarity evaluation, this paper uses the average spatial nearest distance to characterize the geometric fit between the predicted trajectory and the actual machining trajectory. For each sampling point of the actual trajectory, the minimum spatial Euclidean distance is calculated by traversing the entire predicted trajectory, and the average of the minimum distances of all sampling points is this index. This evaluation index does not depend on time synchronization; it only measures the overall deviation between the two curves from the perspective of contour geometry, consistent with the geometric solution approach for machine tool contour errors. It can objectively and accurately select the prediction model whose overall contour shape is closest to the actual machining path. Since the original contour error amplitude is small, the theoretical, actual, and RDPP-LSTM predicted trajectories highly overlap after drawing, and the deviation differences are difficult to distinguish. This paper uses the theoretical command trajectory as a benchmark, amplifies the contour error vector corresponding to each sampling point by 2000 times, and superimposes it onto the theoretical trajectory to complete the visualization comparison. This amplifies the slight geometric deviation and intuitively presents the contour fit state between the optimal predicted contour and the actual machining trajectory. The comparison results are shown below. Figure 16 As shown.
[0079] The following is a specific implementation example to further illustrate the feasibility and progressiveness of the method of the present invention.
[0080] The experimental data in this embodiment was collected from a domestically produced ultra-precision CNC machine tool. To obtain the machine tool's operational data under different motion states, the experimental trajectory design needed to fully consider the motion type and velocity type of each axis. Therefore, four trajectory types were designed, including Fibonacci spiral, Archimedean spiral, circle, and heart shape, such as... Figure 5 As shown.
[0081] In step S50, the front-end data processing methods were compared. After power probability sampling and reconstruction, low-value steady-state samples were filtered out with a high probability, and the retention probability of dynamic samples with high change rate was significantly improved. The average comprehensive change rate of the reconstructed dataset was significantly higher than that of the original dataset, as shown in Tables 1 and 2.
[0082] Table 1. Mean value of the overall change rate along the X-axis
[0083] Table 2. Mean value of the comprehensive change rate along the Z-axis
[0084] The rate-of-change-driven power probability adaptive reconstruction method proposed in this invention achieves a significant increase in the average rate of change on both the X and Z axes, with increases of 626.6619 and 752.0188 respectively, which is far superior to other comparative schemes.
[0085] To verify the effect of data reconstruction on prediction performance, this embodiment uses RMSE and MAE metrics to comprehensively evaluate the prediction results of each experimental group, and presents the prediction performance of various trajectory curves along the X and Z axes, as shown in the figure. Figure 6 As shown in Tables 3 and 4, it can be seen that the Z-axis tracking error of each trajectory is much higher than the X-axis tracking error. This is because the X-axis of the three-axis vertical ultra-precision machine tool used in this embodiment is mounted on the Z-axis, resulting in the Z-axis performance being far inferior to that of the X-axis.
[0086] Table 3 Comparison of Prediction Accuracy Indicators for Different Front-End Processing Methods on the X-Axis
[0087] Table 4 Comparison of Prediction Accuracy Indicators for Different Front-End Processing Methods on the Z-Axis
[0088] To quantify the optimization effect of different preprocessing schemes on the computational cost of model training, a sample retention rate index is defined to measure the lightweight nature of the dataset. It is calculated as the percentage of the number of valid samples after screening to the original total number of samples. The training time is the measured time taken for the complete training of the model under a unified experimental environment. The data is summarized in Table 5.
[0089] Table 5 Comparison of training efficiency for different front-end processing methods on the X / Z axes
[0090] Compared with three preprocessing schemes—original full sampling, uniform downsampling, and fixed-threshold hard sampling—this embodiment's rate-of-change-driven power probability adaptive sampling simultaneously reduces the RMSE and MAE of X and Z-axis servo tracking error prediction under Fibonacci spiral, cardioid, Archimedean spiral, and circular trajectories. Fixed-threshold hard sampling rigidly removes samples, losing transitional features and resulting in the worst prediction accuracy. While uniform downsampling has a sample retention rate of 12.50% and the fastest training speed, indiscriminate culling loses dynamic key features, leading to only a slight improvement in accuracy. This embodiment's method has a sample retention rate of 26.97%, and its training time is slightly better than fixed-threshold hard sampling. It completely preserves temporal dynamic information while reducing approximately 73% of the original data and training computational power, balancing prediction accuracy and data lightweight efficiency. Furthermore, it exhibits stable performance under different feed axes and various complex trajectories, demonstrating excellent versatility and engineering practicality.
[0091] To further verify the predictive superiority of the RDPP-LSTM proposed in this invention, a comparative experiment was conducted using 10 mainstream models, including machine learning, basic temporal networks, and hybrid deep learning. The comparison results are as follows: Figures 6-9 As shown in Tables 6 and 7.
[0092] Table 6 Comparison of RMSE (Reference Prediction Speed) for Different Models on the X-axis (nm)
[0093] Table 7 Comparison of RMSE (Reference Mean Squared Error) for different Z-axis prediction models (nm)
[0094] Overall, RDPP-LSTM demonstrates the best or near-best prediction accuracy on most X-axis trajectories and all Z-axis trajectories, maintaining low error even with significant fluctuations in the height direction. In contrast, traditional single models and some combined models show a significant increase in error on complex trajectories, thus verifying the effectiveness and robustness of RDPP-LSTM in tracking error prediction tasks.
[0095] In step S60, a contour error prediction comparison experiment was conducted on four types of linked trajectories, and Hermite cubic spline trajectory reconstruction + binary iterative perpendicular foot solution was used to solve for high-precision contour errors. The specific comparison results are shown in Table 8 below.
[0096] Table 8 Comparison of RMSE (nm) for contour error estimation by different methods
[0097] As shown in Table 8 above, RDPP-LSTM achieves the best or near-best prediction accuracy for all four test trajectories: Fibonacci spiral, cardioid trajectory, Archimedean spiral, and circular trajectory, with RMSE values of 99.20 nm, 125.87 nm, 231.32 nm, and 97.71 nm, respectively. This significantly outperforms the preprocessing methods of raw data-LSTM, fixed threshold-LSTM, and uniformly spaced LSTM, and also surpasses several mainstream prediction models such as MLR, GRU, and BiLSTM. Even for the more complex trajectory of the Archimedean spiral, RDPP-LSTM (231.32 nm) is only second to fixed threshold-LSTM (220.86 nm), still significantly outperforming the other 12 comparison methods. This indicates that the method maintains stable prediction capabilities under different trajectory complexities without significant performance degradation.
[0098] In addition, the average spatial nearest distance is used as an indicator. It does not rely on time synchronization and only measures the overall deviation of the two curves from the perspective of contour geometry. This is consistent with the geometric solution of machine tool contour error. The prediction model that most closely matches the actual machining path in terms of overall contour shape is objectively and accurately selected. The results are shown in Table 9 below.
[0099] Table 9 Comparison of average spatial nearest distances (nm) for each method
[0100] In summary, RDPP-LSTM achieved the best or second-best prediction results in the comparative experiments, with overall prediction accuracy and stability significantly superior to other comparative methods. This demonstrates that the proposed method, combining rate-of-change-driven power probability sampling (RDPP) with LSTM, can effectively reduce noise interference in tracking error prediction, improve error prediction accuracy under complex motion trajectories, and verify the effectiveness and engineering application value of the proposed method in tracking error prediction tasks.
[0101] This invention also provides a servo system tracking error dataset reconstruction device for implementing the methods described in any of the above embodiments, such as... Figure 17 As shown, the device includes: The model building module 1701 is configured to establish a mechanistic model of the servo system, obtain the mechanistic predicted position based on the reference position command, acquire the actual position of the servo system, and use the difference between the mechanistic predicted position and the actual position as a nonlinear residual label; perform first-order and second-order differences on the reference position command to obtain velocity time-series features and acceleration time-series features. The standardization and slicing module 1702 is configured to standardize the velocity time series features, acceleration time series features, and nonlinear residual labels; and to slice the standardized velocity time series, acceleration time series, and nonlinear residual label sequence using a fixed-length sliding window to generate a time series window sample set including velocity, acceleration, and residual information at multiple time points. The comprehensive rate of change calculation module 1703 is configured to calculate the comprehensive rate of change based on the velocity sequence and acceleration sequence within each time window sample, and to quantify the dynamic information value of each time window sample using the comprehensive rate of change. The data reconstruction module 1704 is configured to construct a power probability retention function based on the comprehensive change rate of samples in each time window, perform differential sampling on samples in each time window, filter out steady-state redundant samples and retain samples with high dynamic information value, and obtain a reconstructed lightweight dataset. The error misdetection module 1705 is configured to input the reconstructed lightweight dataset into the prediction network, fit it to obtain a nonlinear residual prediction value; superimpose the mechanism prediction position with the nonlinear residual prediction value to obtain a composite position prediction value; and obtain a servo system tracking error prediction value based on the composite position prediction value.
[0102] This invention provides an electronic device. The electronic device may include a processor and a memory, wherein the processor and the memory can communicate; exemplarily, the processor and the memory communicate via a communication bus.
[0103] The processor executes computer execution instructions stored in memory, causing the processor to perform the scheme in the above embodiments. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0104] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.
[0105] The electronic device provided in this embodiment of the invention can be the terminal device described in the above embodiments.
[0106] This invention also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the technical solution of the servo system tracking error dataset reconstruction method described in the above embodiments.
[0107] This invention also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the servo system tracking error dataset reconstruction method in the above embodiments.
[0108] In the several embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules 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 indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0109] The modules described as separate components may or may not be physically separate. The components shown as modules 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 modules can be selected to implement the solution of this embodiment according to actual needs.
[0110] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0111] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute certain steps of the methods of the various embodiments of the present invention.
[0112] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0113] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0114] Buses can be Industry Standard Architecture (ISA) buses, Peripheral Component Interconnect (PCI) buses, or Extended Industry Standard Architecture (EISA) buses, etc. Buses can be categorized into address buses, data buses, control buses, etc.
[0115] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0116] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.
[0117] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for reconstructing a tracking error dataset for a servo system, characterized in that, The method includes: A mechanistic model of the servo system is established, and the mechanistic predicted position is obtained based on the reference position command. The actual position of the servo system is obtained, and the difference between the mechanistic predicted position and the actual position is used as a nonlinear residual label. First-order and second-order differences are performed on the reference position command to obtain velocity time-series characteristics and acceleration time-series characteristics. The velocity time-series features, acceleration time-series features, and nonlinear residual labels are standardized. The standardized velocity time-series sequence, acceleration time-series sequence, and nonlinear residual label sequence are sliced using a fixed-length sliding window to generate a time-series window sample set that includes velocity, acceleration, and residual information at multiple time points. The comprehensive rate of change is calculated based on the velocity and acceleration sequences within each time window sample, and the dynamic information value of each time window sample is quantified by the comprehensive rate of change. Based on the comprehensive rate of change of samples in each time window, a power probability retention function is constructed. Differential sampling is performed on samples in each time window to remove steady-state redundant samples and retain samples with high dynamic information value, thus obtaining the reconstructed lightweight dataset. The reconstructed lightweight dataset is input into the prediction network to obtain a nonlinear residual prediction value; the mechanism prediction position is superimposed with the nonlinear residual prediction value to obtain a composite position prediction value; and the servo system tracking error prediction value is obtained based on the composite position prediction value.
2. The servo system tracking error dataset reconstruction method according to claim 1, characterized in that, Establish a mechanistic model of the servo system, and obtain the mechanistic predicted position based on the reference position command, including: A three-loop servo mechanism model of a permanent magnet linear synchronous motor is established, consisting of a current loop, a speed loop, and a position loop from the inside out. The current loop is simplified to hysteresis-free tracking, and the position loop PID controller, the speed loop PI controller, and the motor transfer function are sequentially integrated. The intermediate variables current and speed are eliminated, and the reference position is derived. to the actual grating position The whole machine closed-loop transfer function for: in, For the complex frequency variable of the Laplace transform, The thrust constant of the linear motor. For the speed loop PI controller, the transfer function, For the position loop PID controller, the transfer function is... This refers to the total mass of the motor and load converted to the mover side. It is the viscous damping coefficient; Perform a Laplace transform on the reference position command to obtain the reference position. ; the reference position Multiply by the closed-loop transfer function To obtain the actual grating position ; for the actual grating position Perform an inverse Laplace transform to obtain the predicted location of the mechanism in the time domain.
3. The servo system tracking error dataset reconstruction method according to claim 2, characterized in that, The velocity time-series features, acceleration time-series features, and nonlinear residual labels are standardized, including: For the velocity time sequence characteristics Acceleration time series characteristics The constructed two-dimensional input feature matrix and by nonlinear residual labels The output label sequence Z-score standardization is performed using the global mean and global standard deviation to obtain the standardized feature matrix. and standardized label sequence : in, The feature is the global mean. The global standard deviation of the feature. The global mean of the residuals. This represents the global standard deviation of the residuals.
4. The servo system tracking error dataset reconstruction method according to claim 3, characterized in that, The comprehensive rate of change is calculated based on the velocity and acceleration sequences within each time window sample, including: For the i The velocity and acceleration sequences within a time window are used to calculate the first-order absolute difference of velocity between adjacent sampling points using the following formula. and the first-order absolute difference of acceleration : in, The window length is a fixed-length sliding window. The sampling point number within the window. and The velocity sequence is at the 1st The and the first The value of each sampling point, and The acceleration sequence is respectively in the 1st... The and the first The value of each sampling point; Based on the first-order absolute difference of the velocity and the first-order absolute difference of acceleration The first is determined by the following formula. i The overall rate of change of each time window : According to the comprehensive rate of change The numerical value quantifies the dynamic information value of the corresponding time-series window samples.
5. The servo system tracking error dataset reconstruction method according to claim 4, characterized in that, Based on the comprehensive rate of change of samples in each time series window, a power-law probability retention function is constructed to perform differentiated sampling for samples in each time series window, including: Sort the overall rate of change of all time-series samples in ascending order; define the normalized ranking position based on the sorting number. The sample value ranking is mapped to a set continuous interval; Set the global minimum sampling probability and global maximum sampling probability After constructing the sorted order i retention probability of a sample for: Where γ is a power-law control parameter, and γ>1; according to the retention probability Bernoulli random mask sampling is performed on the sorted samples of each time window to obtain the reconstructed lightweight dataset.
6. The servo system tracking error dataset reconstruction method according to claim 1, characterized in that, The prediction network is an LSTM network; the reconstructed lightweight dataset is input into the prediction network, and a nonlinear residual prediction value is obtained by fitting; the mechanism prediction position is superimposed with the nonlinear residual prediction value to obtain a composite position prediction value; The servo system tracking error prediction value is obtained based on the composite position prediction value, including: The velocity and acceleration time-series features of each time-series window in the reconstructed lightweight dataset are used as inputs to the LSTM network, and the corresponding nonlinear residual labels are used as supervision signals to train the LSTM network. After training, the LSTM network establishes a mapping relationship from velocity and acceleration time-series features to nonlinear residuals. The velocity and acceleration time-series features corresponding to the test position command are input into the trained LSTM network, and after forward computation by the network, nonlinear residual prediction values are output. The test position command is processed by the servo system mechanism model to obtain the mechanism prediction position. The mechanism prediction position is added to the nonlinear residual prediction value to obtain the composite position prediction value. The difference between the composite position prediction value and the actual measured position is used to obtain the servo system tracking error prediction value.
7. The servo system tracking error dataset reconstruction method according to claim 6, characterized in that, After subtracting the composite position prediction value from the measured actual position to obtain the servo system tracking error prediction value, the method further includes: Hermite cubic spline interpolation is used to reconstruct the predicted trajectory and the theoretical trajectory piecewise, respectively, to obtain a continuous smooth trajectory; the parametric equation of the Hermite cubic spline interpolation is: in, u For the parameter variables of the spline curve, and The positions of the parameters on the spline curve are respectively u The corresponding X-axis and Z-axis coordinates; a x The coefficients of the cubic terms in the cubic polynomial along the x-axis. b x The coefficients of the quadratic term in the cubic polynomial along the x-axis. c x The coefficients of the linear term in the cubic polynomial along the x-axis are... d x The coefficients of the constant term in the cubic polynomial along the X-axis; a z The coefficients of the cubic terms in the cubic polynomial along the Z-axis are... b z The coefficients of the quadratic term in the cubic polynomial along the Z-axis. c z The coefficients of the linear term in the cubic polynomial along the Z-axis are... d z The coefficients of the constant term in the cubic polynomial along the Z-axis; Using the instantaneous tangent vector obtained by solving the coordinates of the two ends of the segment and the central difference as the interpolation boundary constraints, the parametric equations of the Hermite cubic spline interpolation are solved. a x , b x , c x , d x , a z , b z , c z and d z This yields a piecewise smooth continuous trajectory curve; Based on the continuous trajectory curve, for any predicted coordinate point P ref The bisection iterative perpendicular method is used to iteratively optimize within the parameter interval, solving for the nearest matching point on the spline curve to the predicted coordinate point. With the predicted coordinate points P ref Matching point The Euclidean distance between them is used as the profile error.
8. A servo system tracking error dataset reconstruction device, characterized in that, The device includes: The model building module is configured to establish a mechanistic model of the servo system, obtain the mechanistic predicted position based on the reference position command, acquire the actual position of the servo system, and use the difference between the mechanistic predicted position and the actual position as a nonlinear residual label; perform first-order and second-order differences on the reference position command to obtain velocity time-series features and acceleration time-series features. The standardization and slicing module is configured to standardize the velocity time series features, acceleration time series features, and nonlinear residual labels; and to slice the standardized velocity time series, acceleration time series, and nonlinear residual label sequences using a fixed-length sliding window to generate a time series window sample set that includes velocity, acceleration, and residual information at multiple time points. The comprehensive rate of change calculation module is configured to calculate the comprehensive rate of change based on the velocity sequence and acceleration sequence within each time window sample, and to quantify the dynamic information value of each time window sample using the comprehensive rate of change. The data reconstruction module is configured to construct a power probability retention function based on the comprehensive change rate of samples in each time window, perform differential sampling on samples in each time window, filter out steady-state redundant samples and retain samples with high dynamic information value, and obtain a reconstructed lightweight dataset. The error misdetection module is configured to input the reconstructed lightweight dataset into the prediction network, fit it to obtain a nonlinear residual prediction value; superimpose the mechanism prediction position with the nonlinear residual prediction value to obtain a composite position prediction value; and obtain a servo system tracking error prediction value based on the composite position prediction value.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the servo system tracking error dataset reconstruction method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the servo system tracking error dataset reconstruction method as described in any one of claims 1-7.
