Dynamic model error compensation method based on SSA-LSTM neural network model

By using the SSA-LSTM neural network model, combined with physical priors and sequential residual learning, the problem of complex parameters that are difficult to model in robot dynamics models is solved, achieving high-precision dynamics model compensation and improving the real-time performance and reliability of robot control.

CN121374588APending Publication Date: 2026-01-23SHANGHAI BAOSIGHT SOFTWARE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511674202.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively model and compensate for factors such as link elasticity, reducer flexibility, frictional forces varying with environmental changes, and motor inertial forces in robot dynamics models, leading to large calculation errors and impacting application effectiveness.

Method used

An SSA-LSTM neural network model is adopted, which combines physical priors and sequential residual learning. An initial model is established through the Newton-Euler method, Fourier series excitation trajectory is designed to collect data, an LSTM neural network is constructed and its parameters are optimized to achieve compensation for friction and other forces.

Benefits of technology

It reduces data requirements, improves the preservation of interpretable physical components, enhances model accuracy and robustness, reduces the computational complexity of traditional methods, and improves the real-time performance and reliability of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121374588A_ABST
    Figure CN121374588A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamical model error compensation method based on an SSA-LSTM neural network model, and relates to the technical field of robots, and the method comprises the steps: building a pre-uncompensated dynamical model of a robot through employing a Newton-Euler method or a Lagrange method according to a robot structure, and obtaining a predicted output torque under a minimum inertia parameter set; and calculating an uncompensated predicted torque for the original displacement, speed and acceleration data by using the uncompensated kinetic model. According to the method, through physical prior and sequence residual learning, the output of the physical dynamics model is used as a part of network input, data requirements are reduced, maintenance of interpretable physical components is improved, meanwhile, the problem of compensation of non-analytic items is solved, convergence is accelerated, generalization and physical consistency are improved, and the method is suitable for large-scale popularization and application. Under the condition of limited test data, lower residual errors and more stable online compensation performance can still be obtained, and control robustness is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of robots, in particular to a dynamics model error compensation method based on an SSA-LSTM neural network model. BACKGROUND

[0002] When a multi-axis serial robot performs dynamics model identification, main parameters such as gravity, Coriolis force, inertia force and friction force are generally considered, but it is difficult to model the parameters through an identification method for other complex characteristics such as link elasticity, reducer flexibility, differences in friction force to environmental changes and motor inertia force. The current modeling method has great difficulties, such as a large number of high-dimensional partial derivatives and derivative calculation that is difficult to complete, and the influence of friction force can only be obtained through a parameter identification method, and if there is no compensation, there will be a large deviation in actual application. Therefore, the robot dynamics calculation theory and the actual application error are large, thereby affecting the application of the robot in dynamics.

[0003] Patent CN116330280B discloses a robot collision detection method, device, equipment and medium, which realizes real-time compensation of dynamics model errors caused by temperature, wear and load changes under the premise of ensuring collision sensitivity, thereby solving the problem of false alarm of collision detection, and is also beneficial to improving the accuracy of the dynamics model.

[0004] The above patent solves the problem of false alarm of collision detection and is also beneficial to improving the accuracy of the dynamics model, but does not consider link elasticity, reducer flexibility, differences in friction force to environmental changes and motor inertia force, and it is difficult to model the parameters through an identification method.

[0005] Therefore, the application proposes to learn the physical prior and sequence residual to realize the output of the physical dynamics model As part of the network input, the dynamics model error compensation method based on the SSA-LSTM neural network model reduces the data requirement and improves the retention of the interpretable physical component, and solves the compensation problem of the non-analytical term. SUMMARY

[0006] The application aims to provide a dynamics model error compensation method based on an SSA-LSTM neural network model to solve the technical problem that link elasticity, reducer flexibility, differences in friction force to environmental changes and motor inertia force are not considered and it is difficult to model the parameters through an identification method in the background art.

[0007] To achieve the above object, the application provides the following technical scheme: a dynamics model error compensation method based on an SSA-LSTM neural network model, the compensation method comprising the following steps:

[0008] Step (1) A pre-compensated dynamics model of the robot is established by Newton-Euler method or Lagrange method according to the structure of the robot, and a predicted output torque expression under a minimum inertia parameter set is obtained ;

[0009] Step (2) A Fourier series excitation trajectory is designed and applied to obtain experimental data, and the excitation trajectory is expressed as , and original data of position, velocity, acceleration, current, joint torque and output torque are collected;

[0010] Step (3) The original displacement, velocity and acceleration data are calculated by the pre-compensated dynamics model to obtain the uncompensated predicted torque , and the original data and are normalized and divided into a training set and a validation set;

[0011] Step (4) An LSTM neural network compensation model is constructed with as an input vector , and the time window size, batch size, network unit number and network weight of the LSTM network are optimized by SSA to obtain optimal network parameters;

[0012] Step (5) The trained neural network model is applied to compensation prediction, and the compensated predicted output torque is obtained by using the inverse normalization function , and the compensation model is used for real-time dynamics model compensation and control.

[0013] Preferably, in step (2), the excitation trajectory adopts a Fourier series with only the first five terms to form a periodic function, the fundamental frequency of the Fourier series is 1 Hz, and the continuous excitation duration of the experiment is 5 minutes, covering the dynamic spectrum of the robot and collecting multi-working condition data for identification.

[0014] Preferably, in step (3), the original data collected at least include joint position q, joint velocity , joint acceleration , motor current, per-joint driving output torque and actual output torque measured by a sensor, and the data are used to construct an input vector and calculate a verification error.

[0015] Preferably, the normalization N and the inverse normalization are respectively used in step (3) and step (5) to map the original data to a numerical interval that can be processed by the network and map the network output back to the actual torque dimension, ensuring the stability of the training and the physical meaning of the compensated torque.

[0016] Preferably, the LSTM network comprises an LSTM unit, and the calculation relationship of the LSTM unit is:

[0017] ;

[0018] ;

[0019] ;

[0020] ;

[0021] ;

[0022] ;

[0023] The number of hidden layer neurons of the LSTM is set to 64, the initial time window size is set to 100, and the initial batch size is set to 50, so as to balance the fitting accuracy and online compensation real-time performance.

[0024] Preferably, the SSA is used to optimize the LSTM network parameters, and the key parameters of the SSA include: sparrow population number n, maximum iteration number k max , safety threshold ST, discoverer proportion P discoverer , and step control parameter β; the initial sample is set to a sparrow population number of 1, a safety threshold ST of 0.75, a discoverer proportion of 20%, and a maximum iteration number of 50.

[0025] Preferably, in the SSA, the root mean square error g of the network predicted moment and the actually measured moment is used as the fitness function, and the fitness function is expressed as:

[0026] ;

[0027] The SSA updates the population position according to the fitness evaluation until k max is reached, so as to obtain the network parameters that minimize the RMSE.

[0028] Preferably, the training process includes:

[0029] The training set is input into the constructed LSTM network, and the to-be-optimized parameters are calculated and updated based on the SSA;

[0030] The LSTM is back-propagated to calculate the error term of each LSTM unit and update the network weight;

[0031] The trained model is evaluated using the validation set, and after confirming that the compensation effect meets the preset performance indicators, the final model Hp is derived and used for real-time compensation in step (5).

[0032] Preferably, when the obtained compensation model is applied to real-time control, the predicted output moment Instead of uncompensated Carrying out dynamics control or collision detection, jitter suppression and flexibility control.

[0033] Preferably, the compensation system is used to perform a compensation method, and the compensation system comprises:

[0034] A dynamics model establishment module is configured to establish an uncompensated dynamics model according to the robot structure and calculate ;

[0035] An excitation trajectory output module is configured to generate a Fourier series excitation trajectory and perform continuous excitation;

[0036] A data acquisition module is configured to acquire position, speed, acceleration, current, joint torque and output torque raw data;

[0037] A preprocessing module is configured to normalize the raw data and divide training sets and verification sets;

[0038] An SSA optimization module is configured to calculate fitness according to set sparrow search parameters and update parameters to be optimized;

[0039] An LSTM model training and reasoning module is configured to build a compensation model Hp with LSTM units and perform training and online reasoning;

[0040] A reverse normalization and compensation output module is configured to generate a compensated predicted output torque according to And provide it to a real-time control unit.

[0041] Compared with the prior art, the present application has the following beneficial effects:

[0042] 1. The present application realizes that the physical dynamics model output As part of the network input, trains the LSTM to learn The timing residual or compensation amount between the actual torque, avoids the pure black box network blind learning of all dynamics, reduces the data demand and improves the retention of interpretable physical components, solves the compensation problem of non-analytic terms, speeds up the convergence, improves the generalization and physical consistency, and still obtains lower residual and more stable online compensation performance under the condition of limited experimental data, and enhances the control robustness;

[0043] ​2.The application realizes the memory and time-varying characteristics of a dynamic system by using the gating and cell state structure of LSTM, and outputs a compensation amount from the perspective of time series, solves the problem that traditional static regression is difficult to fit the strong historical dependence and hysteresis effect of friction and some dynamic responses, significantly reduces the low-frequency and medium-high frequency residual error energy, improves the adaptability to time-varying errors caused by temperature and load, and thus improves the reliability of trajectory tracking and collision detection;

[0044] 3.The application realizes global search of hyperparameters by using SSA for global optimization of LSTM hyperparameters and initial weights, solves the problem that LSTM hyperparameters are sensitive to training effect and convergence, and manual parameter adjustment is time-consuming and easy to fall into local optimum, improves training precision and stability, shortens the parameter adjustment period, reduces performance fluctuations caused by parameter selection, and obtains a more robust compensation model;

[0045] 4.The application promotes a high-precision offline model to a controller with hard real-time constraints by engineering online deployment and security policies, and handles the problem of performance degradation caused by distribution drift during online operation, guarantees the availability of compensation in the real-time control loop, safely falls back when encountering exceptions or confidence decreases, supports online fine-tuning to realize long-term adaptation, and thus improves long-term operation reliability and maintenance efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 A traditional dynamic control method of the application is shown in the schematic diagram.

[0047] Figure 2 A dynamic compensation control structure of the application is shown in the schematic diagram.

[0048] Figure 3 An LSTM cell of the application is shown in the schematic diagram.

[0049] Figure 4 An LSTM neural network model of the application is shown in the schematic diagram.

[0050] Figure 5 A dynamic model technical framework of the application is shown in the schematic diagram.

[0051] Figure 6 A dynamic model compensation process of the application is shown in the schematic diagram. DETAILED DESCRIPTION

[0052] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below, obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0053] In the description of the present application, it should be noted that the terms "upper", "lower", "inner", "outer", "front end", "rear end", "two ends", "one end", "the other end" and the like indicate the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore, it cannot be understood as a limitation on the present application. In addition, the terms "first", "second" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.

[0054] In the description of the present application, it should be noted that unless otherwise explicitly specified and limited, the terms "mounting", "provided with", "connection" and the like should be understood broadly, for example, "connection" can be fixed connection, can also be detachable connection, or integral connection; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium, can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0055] Please refer to Figure 1 and Figure 2 , the present application provides an embodiment: a dynamic model error compensation method based on SSA-LSTM neural network model, which provides a standard single-arm serial robot embodiment for basic offline training and offline verification;

[0056] Further, the robot: 6-DOF serial robot arm, each joint is equipped with high-precision angle encoder and current sensor; sampling frequency 1kHz, data recording is completed by real-time controller and saved as binary log; computing platform: offline training with GPU workstation, deployment with real-time controller for x86 industrial PC or embedded ARM+NPU;

[0057] Uncompensated dynamic model establishment: Newton-Euler or Lagrange method is used to establish the baseline dynamics , the geometric parameters and known component data are calculated and obtained ;

[0058] Excitation test design and data collection: excitation trajectories are designed using the first five terms of a Fourier series with a base frequency of 1 Hz and a duration of 5 minutes, covering multiple frequency / amplitude combinations to excite inertia, friction and flexibility characteristics. Each test records q, q', q" (obtained by differentiation or filtering), motor current, drive torque and external torque sensor data, a total of 10 groups of different amplitude / bias excitation sequences are collected for training / verification;

[0059] Preprocessing and training set construction: low-pass filter (Butterworth second-order, cutoff frequency 50 Hz) is applied to the original data, Savitzky-Golay is used to smooth the velocity / acceleration, and the uncompensated model is calculated ; Normalization: min-max normalization or z-score is used for network input N(·) and inverse normalization N -1 ; Division: 70% training, 15% validation, 15% testing (non-overlapping segments are used in time to avoid data leakage); input vector: x=N([q,q',q'', ]); target output: (or directly train the model to output the compensation amount Hp(x));

[0060] LSTM network structure and SSA optimization: LSTM: single-layer or double-layer LSTM; initial hidden layer neurons 64; time window initial 100 (i.e. each sample contains 100 continuous time sequences); batch size 50; SSA: time window, batch size, hidden layer units, learning rate, dropout (0-0.5) are used as optimization dimensions; sparrow population n=20 (the example is expanded to provide search diversity), maximum iteration k max =50, discoverer ratio 20%, safety threshold ST=0.75, and fitness function is root mean square error RMSE;

[0061] Training details: optimizer: Adam, initial learning rate 1e-3 (SSA adjustable); loss function MSE; training epochs 200, early stopping (validation loss does not decrease for 20 consecutive times) is used; in SSA, each generation, the current sparrow representative is trained or shortened to evaluate the fitness, so as to balance time and accuracy;

[0062] Verification and result output: use the test set to calculate , compare and RMSE, maximum absolute error and frequency domain error (FFT compares residual error energy distribution); in this example, the typical result is that the test set RMSE is reduced by 40%-70%, and the residual error energy in low and medium-high frequency bands is significantly reduced;

[0063] Offline-to-online deployment: export the trained network to ONNX, quantize (FP16 or INT8), and deploy it to the inference engine of the real-time controller, with inference delay controlled at ≤1ms / frame, ensuring real-time replacement .

[0064] Please refer to Figure 1 , Figure 2 and Figure 3 , the invention provides an embodiment: a dynamic model error compensation method based on SSA-LSTM neural network model, considering the time-varying friction with temperature, online incremental learning embodiment;

[0065] Further, for upper limb exoskeleton, friction, gear effect and soft tissue coupling are more obvious, and change significantly with temperature / load, requiring online adaptive ability; In addition to position, current, torque, temperature sensors (motor winding temperature, reducer temperature) and accelerometers are installed to capture vibration, with a sampling frequency of 500-1000Hz; The input vector is expanded to x=N([q, q', q'', ,T motor , T gear , a body ]), LSTM captures the time-varying characteristics caused by temperature through memory cells, and references the LSTM gating unit formula and sequence modeling advantages;

[0066] Deployment uses a main model + online fine-tuning structure: the main model H offline is fixed, and small batches of real-time data in the last 5-10s are used for online fine-tuning (learning rate is significantly smaller, such as 1e-5), only updating the output layer or the last layer of weights to avoid catastrophic forgetting; When the model prediction error exceeds the threshold (such as instantaneous RMS exceeding 2x historical average), fine-tuning is triggered, with a batch size of 16, a window length of 50, and 10 iterations for fast convergence;

[0067] If online fine-tuning causes control abnormalities (validation error rises or inference delay exceeds threshold), the system automatically reverts to and rolls back the parameters; At the same time, fault logs are recorded for offline analysis;

[0068] SSA is used for offline initialization + online small-range re-search: SSA searches for the global best hyperparameters in the offline stage, and uses local SSA (small population, few iterations) to fine-tune key hyperparameters (such as learning rate, dropout) in the online stage, to reduce computational burden.

[0069] Please refer to Figure 1 , Figure 2 and Figure 3An embodiment provided by the application is a dynamic model error compensation method based on an SSA-LSTM neural network model, multi-joint coupling training and segmented parallel deployment;

[0070] Further, the input is still q, q', q'' for each joint and the corresponding But the network uses multi-channel encoding (concatenate all joint data into a high-dimensional vector at each time step), and the output is a compensation vector Δ =Δ ,...,Δ ;

[0071] A stacked LSTM (2 layers) is used, with 64-128 units per layer, and a fully connected layer at the output to map to an n-dimensional compensation vector; To handle high-dimensional input, a one-dimensional convolutional layer can be added before the LSTM for feature extraction, or an attention mechanism can be used to weight the influence of different joints; The dimension of SSA optimization increases (network units, number of layers, attention parameters), the population n=30, k max =80, and the fitness function still uses the total RMSE (weighted sum of all joints); The model is deployed in segments: joints 1-3 are inferred on controller A, joints 4-6 are inferred on controller B, time synchronization is achieved through RT-EtherCAT, and the total inference delay is guaranteed to be <2ms, and the model uses pipeline inference to reduce overall latency.

[0072] Please refer to Figure 3 and Figure 4 An embodiment provided by the application is a dynamic model error compensation method based on an SSA-LSTM neural network model, a predicted output torque expression under a minimum inertia parameter set

[0073] The LSTM network includes LSTM units, and the LSTM unit calculation relationship is:

[0074] ;

[0075] ;

[0076] ;

[0077] ;

[0078] ;

[0079] ;

[0080] Further, is the sorted observation matrix, is the minimum inertia parameter set, denoted as friction term; x is the input vector, h is the output vector, f is the forget gate, i is the input gate, o is the output gate, C is the cell state, t is the time variable, σ and tanh are the sigmoid activation function and tanh activation function, respectively, W is the weight parameter, and b is the bias.

[0081] Please see Figure 5 and Figure 6 This invention provides an embodiment of a dynamic model error compensation method based on an SSA-LSTM neural network model. The SSA algorithm is used for neural network optimization, and its convergence speed and accuracy can be guaranteed. The SSA sparrow search algorithm performs global and local searches by simulating the foraging and anti-predation behaviors of sparrows. SSA divides sparrows into three categories: discoverers, joiners, and scouts. Among them, discoverers can search for areas with better food in the global scope, joiners observe discoverers in real time, and once discoverers find areas with better food, they will participate in competing for this area. Scouts are alert to predators in real time. Once a predator is detected approaching, it will send a danger signal to notify the flock, and the sparrows will also take anti-predation behaviors.

[0082] Furthermore, the specific algorithm expression is as follows:

[0083]

[0084] In the formula, X represents a randomly initialized sparrow population, x represents a single sparrow, d represents the dimension of the population (numerically the same as the number of parameters to be optimized in the LSTM neural network), and n represents the number of sparrows. Next, the fitness function is designed:

[0085]

[0086] In the formula, Let g be the fitness matrix, and g be the fitness value of the sparrow.

[0087]

[0088] In the formula, k is the current iteration number, k max The maximum number of iterations, For the position information of the i-th sparrow in the j-th dimension, j=1,2,3,...,d, α∈(0,1], ST and warning values ​​are the warning value and the safety value, respectively. ∈ (0,1], ST∈ (0.5,1] When the discoverer finds the predator, it will immediately issue an alarm signal. If the alarm value is greater than the safety threshold, the discoverer will update its position according to this formula. Otherwise, it will continue the previous search. Q is a random number that follows a normal distribution, and L is a 1×d matrix with each element being 1.

[0089]

[0090] wherein, is the optimal position occupied by the current discoverer, is the current global worst position, A is a matrix with each element randomly assigned as 1 or -1, and The joiners monitor the discoverer at any time during foraging, and as soon as the discoverer finds better food, the joiner will immediately compete with it. If the joiner wins, it will take the discoverer's food, otherwise it will continue foraging. The joiner updates its position according to the formula, and according to the condition, when the joiner with lower fitness does not obtain food, it will change its position to obtain more food. Finally,

[0091]

[0092] wherein, is the current global optimal position, β is a step control parameter, and β obeys N(0, 1) distribution, k ∈ [-1, 1], is the fitness value of the ith sparrow, is the global best fitness, is the global worst fitness, is a constant set to avoid zero in the denominator, the randomly initialized discoverer and joiner compete for food resources and update their positions according to the formula until the maximum number of iterations is reached, and the sparrow with the highest global fitness value is found as the global optimal solution.

[0093] Working principle: first, the Newton-Euler or Lagrange method is used to establish an uncompensated dynamic model according to the specific structure of the robot, and the baseline predicted torque expression is obtained as the model prior output, which reflects the analyzable dynamic components. This section provides a physical explanation and a rough prediction benchmark for compensation;

[0094] Due to the complexity of terms such as link elasticity, reducer flexibility, temperature-dependent friction, and motor inertia coupling, it is difficult to accurately describe them with precise analytical models. Therefore, LSTM neural networks are used to sequence model the residuals or compensation amounts of the baseline model. The network takes as input, learns the historical time-dependent and memory characteristics, and outputs the compensation amount, capturing time-varying and memory nonlinear errors. The gating structure of LSTM ensures selective retention and updating of historical information;

[0095] To improve the fitting effect and stability of LSTM, SSA is used to globally and locally search and optimize the key parameters of LSTM. The fitness is measured by the RMSE g of the predicted torque and the actual torque. After training, the network output is mapped back to the torque dimension through inverse normalization. Finally, the The output compensated predicted moment is used for real-time control, and this section realizes the integrated engineering implementation from offline identification → network training → online deployment.

[0096] It will be obvious to a person skilled in the art that the application is not limited to the details of the foregoing exemplary embodiments and can be implemented in other concrete forms without departing from the spirit or essential characteristics of the application. The foregoing embodiments are to be considered in all respects as illustrative only and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. No reference signs in the claims should be considered as limiting the scope of the claims to the features to which the reference signs are attached. The application covers both the following claims and any and all changes the meaning and range of equivalents of the claims.

Claims

1. A dynamic model error compensation method based on an SSA-LSTM neural network model, characterized in that: The compensation method includes the following steps: Step (1) Based on the robot structure, establish a pre-compensated uncompensated dynamic model of the robot using the Newton-Euler method or the Lagrange method to obtain the predicted output torque expression under the minimum inertia parameter set. ; Step (2) Design and apply Fourier series excitation trajectories to obtain experimental data, wherein the excitation trajectory is represented as Collect raw data on position, velocity, acceleration, current, joint torque, and output torque; Step (3) Calculate the uncompensated predicted torque from the original displacement, velocity, and acceleration data using the uncompensated dynamic model. and the original data with After normalization, the dataset is divided into a training set and a validation set.

2. The dynamic model error compensation method based on the SSA-LSTM neural network model according to claim 1, characterized in that: Method compensation methods also include: Step (4) Construct with LSTM neural network compensation model with input vector Furthermore, SSA was used to optimize the time window size, batch size, number of network units, and network weights of the LSTM network, and the optimal network parameters were obtained through training. Step (5) applies the trained neural network model to compensation prediction, using the inverse normalization function. Predicted output torque after compensation The compensation model was then used for real-time dynamic model compensation and control. In step (2), the excitation trajectory uses only the first five terms of the Fourier series to form a periodic function. The fundamental frequency of the Fourier series is 1Hz. The continuous excitation duration of the experiment is 5 minutes, covering the robot dynamics spectrum and collecting multi-condition data for identification.

3. The dynamic model error compensation method based on the SSA-LSTM neural network model according to claim 1, characterized in that: The raw data collected in step (3) includes at least: joint position q, joint velocity. Joint acceleration The data, including motor current, drive output torque per joint, and actual output torque measured by sensors, are used to construct input vectors and calculate verification errors.

4. The dynamic model error compensation method based on the SSA-LSTM neural network model according to claim 1, characterized in that: The normalized N and the denormalized In steps (3) and (5), the original data is mapped to the numerical range that the network can process and the network output is mapped back to the actual torque dimension, respectively, to ensure training stability and the physical meaning of the compensated torque.

5. The dynamic model error compensation method based on the SSA-LSTM neural network model according to claim 2, characterized in that: The LSTM network contains LSTM units, and the computational relationship between the LSTM units is as follows: ; ; ; ; ; ; The number of hidden neurons in the LSTM layer was set to 64, the time window size was initially set to 100, and the batch size was initially set to 50, balancing fitting accuracy and real-time online compensation.

6. The dynamic model error compensation method based on the SSA-LSTM neural network model according to claim 2, characterized in that: The SSA is used to optimize LSTM network parameters. Key parameters of SSA include: sparrow population size n and maximum number of iterations k. max Safety threshold ST, Proportion of discoverers P discoverer The step size control parameter β is set; the initial sample size is set to 1 sparrow population, the safety threshold ST=0.75, the proportion of discoverers is 20%, and the maximum number of iterations is 50.

7. The dynamic model error compensation method based on the SSA-LSTM neural network model according to claim 6, characterized in that: In the SSA, the torque is predicted by the network. Compared with the actual measured torque The root mean square error g is used as the fitness function, which is expressed as: ; SSA updates the population position based on fitness evaluation until it reaches k. max To obtain the network parameters that minimize g.

8. The dynamic model error compensation method based on the SSA-LSTM neural network model according to claim 2, characterized in that: The training process includes: Input the training set into the constructed LSTM network, and calculate and update the parameters to be optimized based on SSA. Backpropagation is performed on the LSTM to calculate the error term of each LSTM unit and update the network weights; The trained model is evaluated using the validation set. After confirming that the compensation effect meets the preset performance index, the final model Hp is exported and used for real-time compensation in step (5).

9. The dynamic model error compensation method based on the SSA-LSTM neural network model according to claim 8, characterized in that: When the obtained compensation model is applied to real-time control, the output torque is predicted after compensation. In place of the uncompensated Perform dynamic control or collision detection, jitter suppression and flexible control.

10. A dynamic model error compensation system based on an SSA-LSTM neural network model, wherein the dynamic model error compensation method based on an SSA-LSTM neural network model according to any one of claims 1-9 is characterized in that: The compensation system is used to execute the compensation method, and the compensation system includes: The dynamics model building module is used to build an uncompensated dynamics model based on the robot's structure and perform calculations. ; The excitation trajectory output module is used to generate Fourier series excitation trajectories and execute continuous excitation; The data acquisition module is used to collect raw data on position, velocity, acceleration, current, joint torque, and output torque. The preprocessing module is used to process the raw data and... Perform normalization and divide the training and validation sets; The SSA optimization module is used to calculate fitness and update the parameters to be optimized according to the set sparrow search parameters. The LSTM model training and inference module is used to build a compensation model Hp using LSTM units and perform training and online inference. The inverse normalization and compensation output module is used to determine the output based on the following: The compensated predicted output torque is generated and provided to the real-time control unit.