Mechanical arm dynamic model identification method based on IBO-PI-Bi-LSTM-At neural network
By employing the IBO-PI-Bi-LSTM-At neural network method, combined with a bidirectional long short-term memory network and a physical constraint loss function, the accuracy and generalization problems in the identification of the robotic arm's dynamic model were solved, achieving high-precision and robust identification of dynamic parameters and improving the control performance of the robotic arm.
Patent Information
- Application Number
- CN202610036565.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-13
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies for identifying the dynamic models of robotic arms suffer from low identification accuracy, poor generalization ability, and a tendency to get trapped in local optima, making it difficult to meet the high-precision requirements of complex industrial environments.
A method based on the IBO-PI-Bi-LSTM-At neural network is adopted. By constructing a bidirectional long short-term memory network, an attention mechanism, and a physical constraint loss function, combined with an improved Bayesian optimization algorithm, the excitation trajectory of the robotic arm is generated and the data is filtered to achieve high-precision identification of the dynamic matrix.
It significantly improves the identification accuracy and robustness of the robotic arm's dynamic model, enabling high-precision state prediction and physical parameter analysis in complex environments, thereby enhancing the robotic arm's control performance.
Smart Images

Figure CN121893265A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robotic arm dynamics technology, specifically to a robotic arm dynamics model identification method based on an IBO-PI-Bi-LSTM-At neural network. Background Technology
[0002] With the continuous advancement of the intelligent manufacturing wave, robotic arms, as the core actuators in the field of industrial automation, have expanded their application scope from traditional assembly lines to high-precision scenarios such as precision machining, medical surgery, and space exploration. However, complex industrial environments place stringent demands on the accuracy of robotic arm dynamic model recognition—the dynamic identification capability of model parameters directly determines the stability of trajectory tracking, while the existence of nonlinear factors such as external disturbances, joint friction, and load changes makes it difficult for traditional modeling methods based on ideal conditions to meet the needs of actual working conditions.
[0003] To achieve high-precision dynamic model recognition, academia and industry have proposed various technical approaches, but existing solutions still have significant limitations. For example, the literature (Zhao Ming. Research on Inertial Parameter Identification of Robotic Arms Based on Improved Particle Swarm Optimization Algorithm. Harbin Institute of Technology, 2023) addresses the problem of traditional least squares methods easily getting trapped in local optima by proposing a parameter identification method combining particle swarm optimization algorithm, using swarm intelligence to search for the global optimum. However, this method is sensitive to the initial distribution of the particle swarm, and the convergence speed is greatly affected by the algorithm parameter settings, easily exhibiting premature convergence in complex dynamic systems. The literature (Zhou Yang. Online Identification of Friction Model of Robotic Arm Driven by Deep Learning. Shanghai Jiao Tong University, 2024) utilizes a Long Short-Term Memory (LSTM) network to construct a friction model and achieves dynamic compensation of friction parameters through training with historical data. However, this method relies on a large amount of high-quality training data, and the network structure is highly complex, leading to a heavy real-time computational burden and making it difficult to meet the rapid response requirements in highly dynamic scenarios. The literature (Sun Lei. Joint Parameter Identification of Robotic Arms Based on Extended Kalman Filter. Tsinghua University, 2023) combines state estimation with parameter identification, and achieves simultaneous estimation of inertial parameters and friction coefficients through a recursive algorithm; however, the extended Kalman filter is sensitive to the statistical characteristics of system noise, and the identification accuracy decreases significantly in non-Gaussian noise environments, and the algorithm stability is greatly affected by the choice of the initial covariance matrix. The literature (Lin Hao. Identification of Dynamic Parameters of Robotic Arms Combining Frequency Domain and Time Domain Methods. Zhejiang University, 2023) proposes a hybrid identification strategy that combines frequency domain response analysis with time domain excitation experiments, and improves parameter observability through multi-band signal excitation; however, this method requires the design of complex excitation signal sequences, and there is a model error accumulation problem in the process of frequency domain-time domain data fusion, resulting in poor consistency of identification results. The literature (Zheng Tao. Online update of robotic arm dynamics model based on sparse improved Bayesian learning. Beijing University of Aeronautics and Astronautics, 2024) introduces a sparse improved Bayesian framework to realize online adaptive adjustment of model parameters and reduce the risk of overfitting through probabilistic inference; however, the computational complexity of this method increases exponentially with the parameter dimension, making it difficult to achieve real-time updates in robotic arm systems with more than six degrees of freedom, and the choice of prior distribution has a significant impact on the identification results.
[0004] When using traditional learning algorithms to identify dynamic parameters, the problem of local optima is often encountered. This means that the optimization algorithm may converge to a local optimum rather than the global optimum. Furthermore, because traditional neural networks lack generalization ability when processing data, the constructed neural network model is difficult to effectively generalize to new data. Influenced by the hyperparameters of the neural network, different parameters may lead to different results. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies that use traditional learning algorithms for dynamic model identification, such as low identification accuracy, poor generalization ability, and easy getting trapped in local optima. This invention provides a method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network to solve the above problems.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows:
[0007] A method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network includes the following steps:
[0008] 11) Establish the dynamic matrix of the robotic arm: Establish the dynamic model of the robotic arm based on the Lagrange equation, and organize the identified dynamic matrix based on the dynamic model;
[0009] 12) Generation of the excitation trajectory of the robotic arm: The excitation trajectory of the robotic arm is generated by iteratively using a five-order polynomial improved Fourier series method.
[0010] 13) Calculation of joint torque of robotic arm: Control the robotic arm to move according to the excitation trajectory, collect the angle, angular velocity and angular acceleration of the joints during the movement of the robotic arm, obtain multiple sets of observation matrices as test samples, and collect the joint feedback current at the same time. Calculate the joint torque based on the torque coefficient.
[0011] 14) Filter the collected data;
[0012] 15) Construct an IBO-PI-Bi-LSTM-At neural network;
[0013] 16) Train the IBO-PI-Bi-LSTM-At neural network;
[0014] 17) Identification and evaluation of the dynamic model of the robotic arm.
[0015] The process of establishing the robotic arm dynamics matrix includes the following steps:
[0016] 21) The expression of the nonlinear differential equation modeled according to Lagrange is given by the following form:
[0017] ,
[0018] in, This represents the joint torque vector of the robotic arm; These represent the angular displacement, angular velocity, and angular acceleration of the robotic arm joints, respectively. This indicates the number of degrees of freedom of the robotic arm. It is an n-dimensional real vector;
[0019] Inertia matrix of robotic arm Let be an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space.
[0020] The centripetal Coriolis matrix of the robotic arm For one An asymmetric matrix of dimension 1 is used to describe the nonlinear inertial force effect generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm.
[0021] The terms together constitute a vector of Coriolis force and centrifugal force.
[0022] The gravity vector of the robotic arm For joint position The relevant nonlinear vector functions are used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field;
[0023] 22) Optimize the expression of the nonlinear differential equation into the following form:
[0024] ,
[0025] in, This represents the recombined joint torque vector. The recombined matrix is an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space. For the reorganization An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of nonlinear inertial force effects generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm. The recombined Coriolis force and centrifugal force vectors For the repositioning and joint positioning The relevant nonlinear vector function is used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field.
[0026] The filtering process for the collected data includes the following steps:
[0027] 31) Based on the joint angles, angular velocities, angular accelerations and joint feedback currents collected during the movement of the robotic arm, multiple sets of observation matrix data are constructed, and outliers in the observation matrix data are filtered out according to the differential change characteristics.
[0028] 32) Use a fourth-order Butterworth filter to filter the joint encoder signal, and then use a FLTFFIT filter to perform zero-phase digital filtering on the differential data to reduce the error caused by data noise.
[0029] The construction of the IBO-PI-Bi-LSTM-At neural network includes the following steps:
[0030] 41) The IBO-PI-Bi-LSTM-At neural network is defined as including a bidirectional long short-term memory neural network, an attention mechanism, a fully connected layer, and a physically constrained loss function;
[0031] 42) Define a bidirectional long short-term memory neural network comprising an input layer, one or more hidden layers, and an output layer; wherein the hidden layer is composed of forward LSTM units and backward LSTM units in parallel, forming a bidirectional structure; the forward LSTM units process the input data in the order of the time sequence, and the backward LSTM units process the input data in the reverse order of the time sequence; the final hidden state at each time step is the concatenated vector of the forward and backward outputs, i.e.:
[0032] ,
[0033] in, For the first The input vector at time step; and These are the hidden states of the forward and backward LSTMs, respectively; This is the final hidden state after splicing; This represents a vector concatenation operation. for The hidden state of the forward LSTM at each time step. for The hidden state of the backward LSTM at time step;
[0034] Each LSTM unit includes a forget gate, an input gate, an output gate, and a cell state. The calculation process is as follows:
[0035] ,
[0036] in, The forget gate output vector is used to determine whether to retain or forget the cell state from the previous time step. The proportion of information in the middle, The weight matrix of the forget gate is used to perform a linear transformation on the concatenated input. The bias vector of the forget gate. The sigmoid activation function compresses the output to... The range is defined as follows: the closer the value is to 1, the more information is retained; the closer it is to 0, the more information is forgotten. The input gate output vector controls the degree to which new information is written into the cell state. The weight matrix and bias vector of the input gate. Candidate cell state: Represents new information to be written to the cell state. The weight matrix and bias vector of candidate memory units. The hyperbolic tangent activation function restricts the output to... An interval is used to generate stable candidate values. The current cell state serves as the long-term memory of the LSTM unit, and is passed down through time steps. The cell state at the previous moment. The Hadamard product enables gating and filtering of information: the first term represents the old information to be retained, and the second term represents the new information to be written. Output gate output vector, used to control cell state. How much information is output as a hidden state? The hidden state at the current time step serves as the output of the LSTM unit and also as the input for the next time step. It can also be used for subsequent forecasting or control decisions. Nonlinear compression of cell states ensures that the output value remains within a stable range;
[0037] 43) Establish an attention mechanism;
[0038] Attention mechanisms work by inputting feature sequences The mapping is a vector of queries, keys, and values, specifically obtained through a linear transformation. , , ,
[0039] in, For sequence length, For the first The input feature vector at each time step, ,and The dimension of the input feature; query matrix The key matrix is used to represent the feature query information to be matched at the current time. The value matrix is used to represent feature index information that can be matched at historical moments. Used to represent semantic content information corresponding to each time step; To query the projection weight matrix; The key projection weight matrix; The projected weight matrix is used to represent the values. The projection dimension between the query and the key vector; The projection dimension of the value vector; , , These are the trainable parameters that are optimized using the backpropagation algorithm during model training;
[0040] Calculate the relevance score between the query and the key, and then normalize it using the softmax function to obtain the attention weight matrix. The feature vector output by the attention mechanism is expressed as follows:
[0041] ,
[0042] in, This is the attention weight matrix. For query matrix, This is the transpose of the key matrix. The feature dimension of the key vector is used to scale the dot product result to prevent gradient saturation.
[0043] 44) Define the fully connected layer as including the input terminal, the neuron array, and the output terminal.
[0044] Feature vectors output by the pre-level network As input, where The input feature dimension; the fully connected layer contains Several neurons form the output vector. ,in For output dimensions, It is an n-dimensional real vector. It is an m-dimensional real vector;
[0045] Structurally, fully connected layers achieve a complete interconnection topology between input and output, meaning that each neuron in the current layer establishes learnable connection weights with all neurons in the previous layer. This connection relationship is communicated through a weight matrix. and bias vector Perform parametric characterization. for 3D real vector;
[0046] 45) Define the physical constraint loss function:
[0047] The network loss function is defined as follows:
[0048] Based on the mean square error between the observed torque and the predicted torque, a data fitting loss function is designed, and a physical loss function is constructed:
[0049] ,
[0050] in, Represented as physical loss; These represent the angular displacement, angular velocity, and angular acceleration of the robotic arm joints, respectively. This is expressed as the joint torque of the robotic arm; The recombined matrix is an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space. For the reorganization An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of nonlinear inertial force effects generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm. The recombined Coriolis force and centrifugal force vectors For the repositioning and joint positioning The relevant nonlinear vector functions are used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field;
[0051] To address the symmetry constraint of the inertial matrix, a penalty term is used to enforce... Symmetric and positive definite:
[0052] ,
[0053] in, Represented as an inertial matrix symmetry constraint; The n×n dimensional symmetric positive definite inertia matrix, identified by a bidirectional long short-term memory neural network with a hybrid self-attention mechanism prediction model, is used to characterize the equivalent inertial properties of the robotic arm system in joint space. This is the transpose of the inertia matrix; The regularization coefficient is . It is the identity matrix;
[0054] For the centripetal-Coriolis matrix skew symmetry constraint, using The antisymmetric properties are designed, and the following are:
[0055] ,
[0056] in, Represented as an inertial matrix symmetry constraint; This indicates the angular velocity of the robotic arm joints; The transpose of the angular velocity of a robotic arm joint; The prediction model neural network identified by the bidirectional long short-term memory neural network with a hybrid self-attention mechanism is as follows: An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of nonlinear inertial force effects generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm; It is represented as the transpose of the centripetal-Coriolis force matrix obtained by the prediction model neural network through a bidirectional long short-term memory neural network hybrid self-attention mechanism;
[0057] The designed composite loss function is: And there are:
[0058] ,
[0059] in, Represented as a composite loss function; This is represented as data loss; Represented as physical loss; Represented as an inertial matrix symmetry constraint; Represented as an inertial matrix symmetry constraint; , and For hyperparameters, the effects of the loss function and various constraint terms are balanced.
[0060] The training of the IBO-PI-Bi-LSTM-At neural network involves optimizing the hyperparameters of the PI-Bi-LSTM-At neural network using an improved Bayesian optimization algorithm. Multiple sets of observation matrices are used as inputs to the neural network, and joint torques are used as outputs. The resulting trained IBO-PI-Bi-LSTM-At neural network includes the following steps:
[0061] 51) Randomly generate initial hyperparameter combinations in the solution space, train the model and record performance metrics to form the initial dataset;
[0062] 52) A probabilistic surrogate model was fitted using historical hyperparameter combinations and their performance index data via Gaussian process regression;
[0063] 53) Based on the surrogate model, the acquisition function is calculated to balance exploration and development. The point with the largest acquisition function is used as the next evaluation point to ensure efficient search for the global optimum;
[0064] 54) Evaluate the performance of the new hyperparameter combination, update the dataset and repeat steps 52)-53) until the maximum number of iterations or accuracy requirement is reached;
[0065] 55) Finally, output the optimal hyperparameter combination; apply the optimized optimal hyperparameters to the PI-Bi-LSTM-At neural network to obtain the IBO-PI-Bi-LSTM-At neural network.
[0066] The identification and evaluation of the robotic arm's dynamics model includes the following steps:
[0067] 61) Design a verification trajectory different from the excitation trajectory, so that the robotic arm follows the verification trajectory.
[0068] 62) Collect the joint angles, angular velocities, angular accelerations, and joint torques during multiple cycles of robotic arm movement, and use the collected joint angles, angular velocities, and angular accelerations as inputs to the trained IBO-PI-Bi-LSTM-At neural network;
[0069] 63) The IBO-PI-Bi-LSTM-At neural network outputs the identified dynamic matrix, calculates the joint torque based on the identified dynamic matrix, compares the actual joint torque value with the joint torque obtained from the identified dynamic matrix, and uses the torque residual and physical constraint loss value to evaluate the accuracy of the obtained dynamic model.
[0070] A computer-readable storage medium storing a computer program, which, when executed by a processor, enables a method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network.
[0071] A computer device is characterized by comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network can be implemented.
[0072] Beneficial effects
[0073] The present invention provides a method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network. Compared with existing technologies, this method builds an optimized neural network model based on the traditional Lagrangian dynamic model of a robotic arm. It employs a five-order polynomial improved Fourier series method to generate the excitation trajectory of the robotic arm through multiple iterations, ensuring full exploitation of the robotic arm's characteristics. The IBO-PI-Bi-LSTM-At neural network is constructed to embed the physical constraints of the robotic arm into the network propagation process in the form of explicit equations. The Bi-LSTM unit captures key dependencies in the temporal dynamics, and the self-attention mechanism dynamically focuses on the nonlinear coupling characteristics of the input data, achieving a deep integration of mechanistic constraints and data-driven approaches. This significantly improves the high-precision state prediction and physical parameter analysis capabilities of complex robotic arm systems. At the same time, an improved Bayesian optimization algorithm is used to adjust the hyperparameters of the constructed IBO-PI-Bi-LSTM-At neural network to achieve accurate identification of the robotic arm's dynamic model.
[0074] The robotic arm dynamics model identification method based on the IBO-PI-Bi-LSTM-At neural network proposed in this invention can achieve more accurate identification of robotic arm dynamics models, which helps to improve the control performance of robotic arms. Attached Figure Description
[0075] Figure 1 This is a sequence diagram of the method of the present invention;
[0076] Figure 2 The neural network model proposed in this invention;
[0077] Figure 3 This refers to the joint trajectory of the robotic arm in this invention;
[0078] Figure 4 This is the trajectory of the IBO optimization algorithm in this invention;
[0079] Figure 5 Comparison of simulation results for different neural network models;
[0080] Figure 6 A performance comparison chart of models trained for different neural network models. Detailed Implementation
[0081] To provide a better understanding of the structural features and effects achieved by the present invention, a detailed description is provided below, accompanied by preferred embodiments and accompanying drawings:
[0082] like Figure 1 As shown, this invention presents a method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network. The core of this method lies in constructing a hybrid modeling paradigm that integrates physical priors and data-driven approaches. By introducing a physical information embedding mechanism, prior knowledge of dynamics is incorporated into network constraints. A bidirectional long short-term memory network is used to deeply mine the temporal coupling features of joint motion. An attention mechanism is combined to adaptively focus on key motion states. At the same time, an innovative improved Bayesian optimization algorithm is used to globally optimize the network hyperparameters. This effectively overcomes the technical bottlenecks of traditional methods in dealing with strong nonlinearity, unmodeled dynamics, and external disturbances of robotic arms, such as low modeling accuracy, weak generalization ability, and poor robustness. This method achieves high-precision, robust, and physically consistent identification of dynamic parameters.
[0083] Includes the following steps:
[0084] The first step is to establish the dynamic matrix of the robotic arm: establish the dynamic model of the robotic arm based on the Lagrange equation, and then organize the identified dynamic matrix based on the dynamic model.
[0085] (1) The expression of the nonlinear differential equation modeled according to Lagrange is given by the following form:
[0086] ,
[0087] in, This represents the joint torque vector of the robotic arm; These represent the angular displacement, angular velocity, and angular acceleration of the robotic arm joints, respectively. This indicates the number of degrees of freedom of the robotic arm. for 3D real vector;
[0088] Inertia matrix of robotic arm Let be an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space.
[0089] The centripetal Coriolis matrix of the robotic arm For one An asymmetric matrix of dimension 1 is used to describe the nonlinear inertial force effect generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm.
[0090] The terms together constitute a vector of Coriolis force and centrifugal force.
[0091] The gravity vector of the robotic arm For joint position The relevant nonlinear vector functions are used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field;
[0092] (2) The expression of the nonlinear differential equation is optimized into the following form:
[0093] ,
[0094] in, This represents the recombined joint torque vector. The recombined matrix is an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space. For the reorganization An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of nonlinear inertial force effects generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm. The recombined Coriolis force and centrifugal force vectors For the repositioning and joint positioning The relevant nonlinear vector function is used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field.
[0095] Inertia matrix of robotic arm Let be an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The inertia matrix is a function used to characterize the equivalent inertial properties of a robotic arm system in joint space. It reflects the robotic arm's ability to resist changes in motion state during acceleration or deceleration, and its magnitude and distribution depend on the mass, center of mass position, inertia tensor, and joint configuration of each link. Due to the kinematic coupling effect of the robotic arm, the elements of the inertia matrix change with the joint pose. The inertia changes in real time, exhibiting strong nonlinearity and time-varying characteristics. Accurate acquisition or online estimation of the inertia matrix is crucial in control algorithm design. It plays a decisive role in achieving high-precision torque feedforward control, adaptive control, or computational torque control.
[0096] The overall structure consists of Coriolis and centrifugal force vectors: the centrifugal force originates from the inertial force caused by the acceleration of a single joint, while the Coriolis force originates from the Coriolis coupling force generated by the motion of one joint on another. The structure of this matrix depends on the joint pose. and its speed This reflects the strong nonlinear coupling characteristics in robotic arm dynamics. In high-dynamic trajectory tracking control, neglecting or mismodeling this matrix will lead to significant tracking errors and control instability.
[0097] The gravity vector of the robotic arm For joint position The relevant nonlinear vector function is used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity. Its value is determined by the mass of each link, the position of its center of mass relative to the joint axis, and its current pose. When the robotic arm is in a non-horizontal posture, some links will generate gravitational torques around the joint axis, requiring additional torque output from the actuators to balance them. Therefore, accurate modeling of the gravity vector is crucial. It is crucial for achieving smooth low-speed control, energy-saving operation, and zero-force control.
[0098] The second step is to generate the excitation trajectory of the robotic arm: using the traditional method, a fourier series method improved by a fifth-order polynomial is used to generate the excitation trajectory of the robotic arm through multiple iterations.
[0099] The third step is to calculate the joint torque of the robotic arm: using traditional methods, the robotic arm is controlled to move according to the excitation trajectory. The angle, angular velocity and angular acceleration of the joints during the movement of the robotic arm are collected to obtain multiple sets of observation matrices as test samples. At the same time, the joint feedback current is collected, and the joint torque is calculated based on the torque coefficient.
[0100] The fourth step is to filter the collected data.
[0101] (1) Based on the joint angle, angular velocity, angular acceleration and joint feedback current collected during the movement of the robotic arm, multiple sets of observation matrix data are constructed, and outliers in the observation matrix data are filtered out according to the differential change characteristics.
[0102] (2) Use a fourth-order Butterworth filter to filter the joint encoder signal, and then use a FLT FLT filter to perform zero-phase digital filtering on the data after differential operation to reduce the error caused by data noise.
[0103] The fifth step is to construct the IBO-PI-Bi-LSTM-At neural network, as follows: Figure 2 As shown.
[0104] This invention constructs an IBO-PI-Bi-LSTM-At neural network architecture that deeply integrates physical priors and data-driven approaches, aiming to overcome the core challenges in existing robotic arm dynamics modeling, such as incomplete capture of temporal dependencies, lack of physical interpretability, and difficulty in optimizing high-dimensional parameters. This architecture introduces a physical information embedding mechanism, integrating prior dynamic knowledge into network training as soft constraints, thus solving the technical bottlenecks of pure data-driven models, which are prone to non-physical interpretation and weak generalization ability. It utilizes a bidirectional long short-term memory network to simultaneously mine the deep correlation between the historical states and future trends of joint motion, overcoming the shortcomings of unidirectional temporal models in representing dynamic coupling effects. Combined with an attention mechanism, it achieves adaptive focusing on key motion features, effectively suppressing redundant information interference. Furthermore, it innovatively employs an improved Bayesian optimization algorithm to globally optimize network hyperparameters, solving the problems of traditional optimization methods easily getting trapped in local optima and having low search efficiency in high-dimensional mixed parameter spaces. This results in high-precision, robust, and physically consistent robotic arm dynamics model identification.
[0105] (1) The IBO-PI-Bi-LSTM-At neural network is defined as including a bidirectional long short-term memory neural network, an attention mechanism, a fully connected layer, and a physical constraint loss function.
[0106] (2) The bidirectional long short-term memory neural network is defined as including an input layer, one or more hidden layers, and an output layer; wherein, the hidden layer is composed of forward LSTM units and backward LSTM units in parallel, forming a bidirectional structure; the forward LSTM units process the input data in the order of the time series, and the backward LSTM units process the input data in the reverse order of the time series; the final hidden state at each time step is the concatenated vector of the forward and backward outputs, that is:
[0107] ,
[0108] in, For the first The input vector at time step; and These are the hidden states of the forward and backward LSTMs, respectively; This is the final hidden state after splicing; This represents a vector concatenation operation. for The hidden state of the forward LSTM at each time step. for The hidden state of the backward LSTM at time step;
[0109] Each LSTM unit includes a forget gate, an input gate, an output gate, and a cell state. The calculation process is as follows:
[0110] ,
[0111] in, The forget gate output vector is used to determine whether to retain or forget the cell state from the previous time step. The proportion of information in the middle, The weight matrix of the forget gate is used to perform a linear transformation on the concatenated input. The bias vector of the forget gate. The sigmoid activation function compresses the output to... The range is defined as follows: the closer the value is to 1, the more information is retained; the closer it is to 0, the more information is forgotten. The input gate output vector controls the degree to which new information is written into the cell state. The weight matrix and bias vector of the input gate. Candidate cell state: Represents new information to be written to the cell state. The weight matrix and bias vector of candidate memory units. The hyperbolic tangent activation function restricts the output to... An interval is used to generate stable candidate values. The current cell state serves as the long-term memory of the LSTM unit, and is passed down through time steps. The cell state at the previous moment. The Hadamard product enables gating and filtering of information: the first term represents the old information to be retained, and the second term represents the new information to be written. Output gate output vector, used to control cell state. How much information is output as a hidden state? The hidden state at the current time step serves as the output of the LSTM unit and also as the input for the next time step. It can also be used for subsequent forecasting or control decisions. Nonlinear compression of cell states ensures that the output value remains within a stable range.
[0112] (3) Establish an attention mechanism;
[0113] Attention mechanisms work by inputting feature sequences The mapping is a vector of queries, keys, and values, specifically obtained through a linear transformation. , , ,
[0114] in, For sequence length, For the first The input feature vector at each time step, ,and The dimension of the input feature; query matrix The key matrix is used to represent the feature query information to be matched at the current time. The value matrix is used to represent feature index information that can be matched at historical moments. Used to represent semantic content information corresponding to each time step; To query the projection weight matrix; The key projection weight matrix; The projected weight matrix is used to represent the values. The projection dimension between the query and the key vector; The projection dimension of the value vector; , , These are the trainable parameters that are optimized using the backpropagation algorithm during model training;
[0115] Calculate the relevance score between the query and the key, and then normalize it using the softmax function to obtain the attention weight matrix. The feature vector output by the attention mechanism is expressed as follows:
[0116] ,
[0117] in, This is the attention weight matrix. For query matrix, This is the transpose of the key matrix. The feature dimension of the key vector is used to scale the dot product result to prevent gradient saturation.
[0118] (4) Define the fully connected layer as including the input end, the neuron array, and the output end.
[0119] Feature vectors output by the pre-level network As input, where The input feature dimension; the fully connected layer contains Several neurons form the output vector. ,in For output dimensions, for 3D real vector for 3D real vector;
[0120] Structurally, fully connected layers achieve a complete interconnection topology between inputs and outputs. This means that each neuron in the current layer establishes learnable connection weights with all neurons in the previous layer, and these connections are communicated through a weight matrix. and bias vector Perform parametric characterization. for A 3D real vector.
[0121] (5) Define the physical constraint loss function:
[0122] The network loss function is defined as follows:
[0123] Based on the mean square error between the observed torque and the predicted torque, a physical loss function is constructed:
[0124] ,
[0125] in, Represented as physical loss; These represent the angular displacement, angular velocity, and angular acceleration of the robotic arm joints, respectively. This is expressed as the joint torque of the robotic arm; The recombined matrix is an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space. For the reorganization An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of nonlinear inertial force effects generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm. The recombined Coriolis force and centrifugal force vectors For the repositioning and joint positioning The relevant nonlinear vector functions are used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field;
[0126] To address the symmetry constraint of the inertial matrix, a penalty term is used to enforce... Symmetric and positive definite:
[0127] ,
[0128] in, Represented as an inertial matrix symmetry constraint; The n×n dimensional symmetric positive definite inertia matrix, identified by a bidirectional long short-term memory neural network with a hybrid self-attention mechanism prediction model, is used to characterize the equivalent inertial properties of the robotic arm system in joint space. This is the transpose of the inertia matrix; The regularization coefficient is . It is the identity matrix;
[0129] For the centripetal-Coriolis matrix skew symmetry constraint, using The antisymmetric properties are designed, and the following are:
[0130] ,
[0131] in, Represented as an inertial matrix symmetry constraint; This indicates the angular velocity of the robotic arm joints; The transpose of the angular velocity of a robotic arm joint; The prediction model neural network identified by the bidirectional long short-term memory neural network with a hybrid self-attention mechanism is as follows: An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of nonlinear inertial force effects generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm; It is represented as the transpose of the centripetal-Coriolis force matrix obtained by the prediction model neural network through a bidirectional long short-term memory neural network hybrid self-attention mechanism;
[0132] The designed composite loss function is: And there are:
[0133] ,
[0134] in, Represented as a composite loss function; This is represented as data loss; Represented as physical loss; Represented as an inertial matrix symmetry constraint; Represented as an inertial matrix symmetry constraint; , and For hyperparameters, the effects of the loss function and various constraint terms are balanced.
[0135] Step 6: Train the IBO-PI-Bi-LSTM-At neural network. The hyperparameters of the PI-Bi-LSTM-At neural network are optimized using an improved Bayesian optimization algorithm. Multiple sets of observation matrices are used as inputs to the neural network, and the joint torques are used as outputs. This process trains the IBO-PI-Bi-LSTM-At neural network, resulting in the trained IBO-PI-Bi-LSTM-At neural network.
[0136] (1) Randomly generate initial hyperparameter combinations in the solution space, train the model and record performance indicators to form the initial dataset.
[0137] (2) Use historical hyperparameter combinations and their performance index data to fit a probabilistic surrogate model through Gaussian process regression.
[0138] (3) Based on the surrogate model, the acquisition function is calculated to balance exploration and development. The point with the largest acquisition function is used as the next evaluation point to ensure efficient search for the global optimum.
[0139] (4) Evaluate the performance of the new hyperparameter combination, update the dataset and repeat steps (2)-(3) until the maximum number of iterations or accuracy requirement is reached.
[0140] (5) Finally, the optimal hyperparameter combination is output; the optimized optimal hyperparameter is applied to the PI-Bi-LSTM-At neural network to obtain the IBO-PI-Bi-LSTM-At neural network.
[0141] Step 7: Identification and evaluation of the robotic arm's dynamic model.
[0142] (1) Design a verification trajectory that is different from the excitation trajectory, so that the robotic arm follows the verification trajectory.
[0143] (2) Collect the joint angles, angular velocities, angular accelerations, and joint torques during multiple cycles of robotic arm movement, and use the collected joint angles, angular velocities, and angular accelerations as inputs to the trained IBO-PI-Bi-LSTM-At neural network;
[0144] (3) The IBO-PI-Bi-LSTM-At neural network outputs the identified dynamic matrix, calculates the joint torque based on the identified dynamic matrix, compares the actual value of the obtained joint torque with the joint torque obtained based on the identified dynamic matrix, and uses the torque residual and physical constraint loss value to evaluate the accuracy of the obtained dynamic model.
[0145] To obtain the actual and theoretical values of the joint torque, the parameters are set as follows: The designed optimal excitation trajectory is executed as follows: Figure 3As shown, the preset running cycle of the robot's excitation trajectory is 20s, the sampling frequency is 1kHz, and the harmonic number of the excitation trajectory is 5. The collected data is divided into a training set (70%) and a test set (30%), and imported into the constructed neural network for training. The hyperparameters of the neural network are optimized using an improved Bayesian optimization algorithm, and the range of hyperparameters is shown in Table 1. The training rounds are set to 8 rounds, with 30 sets of data trained each time. Figure 4 (a) shows the observed target values for the eight training epochs of the improved Bayesian optimization algorithm. The minimum target value was reached in the fifth training epoch, thus producing the best results in all training epochs. The optimal hyperparameter configuration is shown in Table 2. Figure 4 (b) shows the trajectory of the estimated and observed minimum target value during the 5th training iteration, where the estimated minimum converges to the true minimum of the function.
[0146] Table 1. Hyperparameter range of PI-Bi-LSTM-At.
[0147]
[0148] Table 2. Hyperparameters after IBO optimization.
[0149]
[0150] Figure 5 A comparison chart of the predicted torque and actual torque of the robotic arm is provided. Figure 5 It can be seen that, compared with the least squares method (LSM), recurrent neural network (RNN), physical information network (PINN), manually tuned hyperparameter PI-Bi-LSTM-At network (PI-Bi-LSTM-At), and Bayesian optimized hyperparameter PI-Bi-LSTM-At (BO-PI-Bi-LSTM-At), the predicted torque curve trained by the proposed IBO-PI-Bi-LSTM-At model has a good fit with the actual torque curve and can predict the joint torque of the robot very well.
[0151] Figure 6 Comparison charts of the performance metrics of various models are provided. Figure 6 It can be seen that, compared with Least Squares (LSM), Recurrent Neural Network (RNN), Physical Information Network (PINN), PI-Bi-LSTM-At network with manually adjusted hyperparameters (PI-Bi-LSTM-At), and PI-Bi-LSTM-At with Bayesian optimization of hyperparameters (BO-PI-Bi-LSTM-At), the proposed IBO-PI-Bi-LSTM-At model has the best model performance index.
[0152] Thus, the integration of the improved Bayesian optimization algorithm and the neural network can be completed. In view of the shortcomings of traditional identification methods, this invention proposes an IBO-PI-Bi-LSTM-At model, which solves the problems of low identification accuracy, poor generalization ability and easy getting trapped in local optima when using traditional neural network models for identification.
[0153] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network, characterized in that, Includes the following steps: 11) Establish the dynamic matrix of the robotic arm: Establish the dynamic model of the robotic arm based on the Lagrange equation, and organize the identified dynamic matrix based on the dynamic model; 12) Generation of the excitation trajectory of the robotic arm: The excitation trajectory of the robotic arm is generated by iteratively using a five-order polynomial improved Fourier series method. 13) Calculation of joint torque of robotic arm: Control the robotic arm to move according to the excitation trajectory, collect the angle, angular velocity and angular acceleration of the joints during the movement of the robotic arm, obtain multiple sets of observation matrices as test samples, and collect the joint feedback current at the same time. Calculate the joint torque based on the torque coefficient. 14) Filter the collected data; 15) Construct an IBO-PI-Bi-LSTM-At neural network; 16) Train the IBO-PI-Bi-LSTM-At neural network; 17) Identification and evaluation of the dynamic model of the robotic arm.
2. The method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network according to claim 1, characterized in that, The process of establishing the robotic arm dynamics matrix includes the following steps: 21) The expression of the nonlinear differential equation modeled according to Lagrange is given by the following form: , in, This represents the joint torque vector of the robotic arm; These represent the angular displacement, angular velocity, and angular acceleration of the robotic arm joints, respectively. This indicates the number of degrees of freedom of the robotic arm. It is an n-dimensional real vector; Inertia matrix of robotic arm Let be an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space. The centripetal Coriolis matrix of the robotic arm For one An asymmetric matrix of dimension 1 is used to describe the nonlinear inertial force effect generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm. The terms together constitute a vector of Coriolis force and centrifugal force. The gravity vector of the robotic arm For joint position The relevant nonlinear vector functions are used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field; 22) Optimize the expression of the nonlinear differential equation into the following form: , in, This represents the recombined joint torque vector. The recombined matrix is an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space. For the reorganization An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of the nonlinear inertial force effect generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm. The vectors of the recombined Coriolis force and centrifugal force. For the repositioning and joint positioning The relevant nonlinear vector function is used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field.
3. The method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network according to claim 1, characterized in that, The filtering process for the collected data includes the following steps: 31) Based on the joint angles, angular velocities, angular accelerations and joint feedback currents collected during the movement of the robotic arm, multiple sets of observation matrix data are constructed, and outliers in the observation matrix data are filtered out according to the differential change characteristics. 32) Use a fourth-order Butterworth filter to filter the joint encoder signal, and then use a FLTFFIT filter to perform zero-phase digital filtering on the differential data to reduce the error caused by data noise.
4. The method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network according to claim 1, characterized in that, The construction of the IBO-PI-Bi-LSTM-At neural network includes the following steps: 41) The IBO-PI-Bi-LSTM-At neural network is defined as including a bidirectional long short-term memory neural network, an attention mechanism, a fully connected layer, and a physically constrained loss function; 42) Define a bidirectional long short-term memory neural network comprising an input layer, one or more hidden layers, and an output layer; wherein the hidden layer is composed of forward LSTM units and backward LSTM units in parallel, forming a bidirectional structure; the forward LSTM units process the input data in the order of the time sequence, and the backward LSTM units process the input data in the reverse order of the time sequence; the final hidden state at each time step is the concatenated vector of the forward and backward outputs, i.e.: , in, For the first The input vector at time step; and These are the hidden states of the forward and backward LSTMs, respectively; This is the final hidden state after splicing; This represents a vector concatenation operation. for The hidden state of the forward LSTM at time step. for The hidden state of the backward LSTM at time step; Each LSTM unit includes a forget gate, an input gate, an output gate, and a cell state. The calculation process is as follows: , in, The forget gate output vector is used to determine whether to retain or forget the cell state from the previous time step. The proportion of information in the middle, The weight matrix of the forget gate is used to perform a linear transformation on the concatenated input. The bias vector of the forget gate. The sigmoid activation function compresses the output to... The range is defined as follows: the closer the value is to 1, the more information is retained; the closer it is to 0, the more information is forgotten. The input gate output vector controls the degree to which new information is written into the cell state. The weight matrix and bias vector of the input gate. Candidate cell state: Represents new information to be written to the cell state. The weight matrix and bias vector of candidate memory units. The hyperbolic tangent activation function restricts the output to... An interval is used to generate stable candidate values. The current cell state serves as the long-term memory of the LSTM unit, and is passed down through time steps. The cell state at the previous moment. The Hadamard product enables gating and filtering of information: the first term represents the old information to be retained, and the second term represents the new information to be written. Output gate output vector, used to control cell state. How much information is output as a hidden state? The hidden state at the current time step serves as the output of the LSTM unit and also as the input for the next time step. It can also be used for subsequent forecasting or control decisions. Nonlinear compression of cell states ensures that the output value remains within a stable range; 43) Establish an attention mechanism; Attention mechanisms work by inputting feature sequences The mapping is a vector of queries, keys, and values, specifically obtained through a linear transformation. , , , in, For sequence length, For the first The input feature vector at each time step, ,and The dimension of the input feature; query matrix The key matrix is used to represent the feature query information to be matched at the current time. The value matrix is used to represent feature index information that can be matched at historical moments. Used to represent semantic content information corresponding to each time step; To query the projection weight matrix; The key projection weight matrix; The projected weight matrix is used to represent the values. The projection dimension between the query and the key vector; The projection dimension of the value vector; , , These are the trainable parameters that are optimized using the backpropagation algorithm during model training; Calculate the relevance score between the query and the key, and then normalize it using the softmax function to obtain the attention weight matrix. The feature vector output by the attention mechanism is expressed as follows: , in, This is the attention weight matrix. For query matrix, This is the transpose of the key matrix. The feature dimension of the key vector is used to scale the dot product result to prevent gradient saturation. 44) Define the fully connected layer as including the input terminal, the neuron array, and the output terminal. Feature vectors output by the pre-level network As input, where The input feature dimension; the fully connected layer contains Several neurons form the output vector. ,in For output dimensions, It is an n-dimensional real vector. It is an m-dimensional real vector; Structurally, fully connected layers achieve a complete interconnection topology between input and output, meaning that each neuron in the current layer establishes learnable connection weights with all neurons in the previous layer. This connection relationship is communicated through a weight matrix. and bias vector Perform parametric characterization. for 3D real vector; 45) Define the physical constraint loss function: The network loss function is defined as follows: Based on the mean square error between the observed torque and the predicted torque, a data fitting loss function is designed, and a physical loss function is constructed: , in, Represented as physical loss; These represent the angular displacement, angular velocity, and angular acceleration of the robotic arm joints, respectively. This is expressed as the joint torque of the robotic arm; The recombined matrix is an n×n dimensional symmetric positive definite matrix whose elements are joint poses. The function is used to characterize the equivalent inertial properties of the robotic arm system in joint space. For the reorganization An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of the nonlinear inertial force effect generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm. The vectors of the recombined Coriolis force and centrifugal force. For the repositioning and joint positioning The relevant nonlinear vector functions are used to characterize the equivalent gravitational torque generated by each link of the robotic arm on each joint under the action of gravity field; To address the symmetry constraint of the inertial matrix, a penalty term is used to enforce... Symmetric and positive definite: , in, This is represented as an inertial matrix symmetry constraint; The n×n dimensional symmetric positive definite inertia matrix, identified by a bidirectional long short-term memory neural network with a hybrid self-attention mechanism prediction model, is used to characterize the equivalent inertial properties of the robotic arm system in joint space. This is the transpose of the inertia matrix; The regularization coefficient is . It is the identity matrix; To address the oblique symmetry constraint of the centripetal-Coriolis matrix, using The antisymmetric properties are designed, and the following are: , in, This is represented as an inertial matrix symmetry constraint; This indicates the angular velocity of the robotic arm joints; The transpose of the angular velocity of a robotic arm joint; The prediction model neural network identified by the bidirectional long short-term memory neural network with a hybrid self-attention mechanism is as follows: An asymmetric matrix of dimension 1, used to describe the centripetal Coriolis matrix of nonlinear inertial force effects generated by the interaction of velocity terms during the multi-joint coupled motion of a robotic arm; It is represented as the transpose of the centripetal-Coriolis force matrix obtained by the prediction model neural network through a bidirectional long short-term memory neural network hybrid self-attention mechanism; The designed composite loss function is: And there are: , in, Represented as a composite loss function; This is represented as data loss; Represented as physical loss; This is represented as an inertial matrix symmetry constraint; This is represented as an inertial matrix symmetry constraint; , and For hyperparameters, the effects of the loss function and various constraint terms are balanced.
5. The method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network according to claim 1, characterized in that, The training of the IBO-PI-Bi-LSTM-At neural network involves optimizing the hyperparameters of the PI-Bi-LSTM-At neural network using an improved Bayesian optimization algorithm. Multiple sets of observation matrices are used as inputs to the neural network, and joint torques are used as outputs. The resulting trained IBO-PI-Bi-LSTM-At neural network includes the following steps: 51) Randomly generate initial hyperparameter combinations in the solution space, train the model and record performance metrics to form the initial dataset; 52) A probabilistic surrogate model was fitted using historical hyperparameter combinations and their performance index data via Gaussian process regression; 53) Based on the surrogate model, the acquisition function is calculated to balance exploration and development. The point with the largest acquisition function is used as the next evaluation point to ensure efficient search for the global optimum; 54) Evaluate the performance of the new hyperparameter combination, update the dataset and repeat steps 52)-53) until the maximum number of iterations or accuracy requirement is reached; 55) Finally, output the optimal hyperparameter combination; apply the optimized optimal hyperparameters to the PI-Bi-LSTM-At neural network to obtain the IBO-PI-Bi-LSTM-At neural network.
6. The method for identifying the dynamic model of a robotic arm based on an IBO-PI-Bi-LSTM-At neural network according to claim 1, characterized in that, The identification and evaluation of the robotic arm's dynamics model includes the following steps: 61) Design a verification trajectory different from the excitation trajectory, so that the robotic arm follows the verification trajectory. 62) Collect the joint angles, angular velocities, angular accelerations, and joint torques during multiple cycles of robotic arm movement, and use the collected joint angles, angular velocities, and angular accelerations as inputs to the trained IBO-PI-Bi-LSTM-At neural network; 63) The IBO-PI-Bi-LSTM-At neural network outputs the identified dynamic matrix, calculates the joint torque based on the identified dynamic matrix, compares the actual joint torque value with the joint torque obtained from the identified dynamic matrix, and uses the torque residual and physical constraint loss value to evaluate the accuracy of the obtained dynamic model.
7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, enables the robotic arm dynamics model identification method based on the IBO-PI-Bi-LSTM-At neural network as described in any one of claims 1-6.
8. A computer device, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it can implement the robotic arm dynamics model identification method based on the IBO-PI-Bi-LSTM-At neural network as described in any one of claims 1-6.