Model data dual-drive robot dynamics modeling method

Through BP neural network and knowledge distillation technology, combined with the prior knowledge of teacher model and student model and a small amount of experimental data, a high-precision and interpretable robot dynamics modeling method is constructed, which solves the problems of model-driven methods in the existing technology. The problem of parameter uncertainty and high cost and high data requirements of data-driven methods enables high-precision dynamic modeling suitable for engineering practice.

CN118643736APending Publication Date: 2024-09-13TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410684592.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

Among existing robot dynamics modeling methods, model-driven methods suffer from parameter uncertainty and low accuracy, while data-driven methods require a large amount of high-quality experimental data and lack interpretability.

Method used

The BP neural network is used to construct the teacher model and the student model. The prior knowledge of the teacher model and a small amount of experimental data are used, combined with the knowledge distillation technology to construct a high-precision dynamic model. The nominal rigid body dynamic model and finite configuration are learned through the BP neural network. Based on the measurement data, the mapping relationship between the nominal drive joint variables and their first- and second-order reciprocals and joint torques is constructed, and a model that takes into account both accuracy and generalization ability is obtained through the knowledge distillation network.

Benefits of technology

It achieves high-precision and interpretable dynamics modeling, reduces experimental costs, is suitable for engineering practice, and solves the problem of neural network overfitting when the data set is sparse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0004866556450000011
    Figure HDA0004866556450000011
  • Figure BDA0004866556440000075
    Figure BDA0004866556440000075
  • Figure BDA00048665564400000714
    Figure BDA00048665564400000714
Patent Text Reader

Abstract

The invention discloses a dynamic modeling method for a model data dual-drive robot. According to the method, a knowledge distillation method is adopted, and accurate model data dual-drive robot dynamic modeling is constructed in combination with a nominal rigid body dynamic model of the robot and measurement data under a limited shape. The method mainly comprises the following steps: firstly, constructing a theoretical training set and an actual measurement training set by adopting a nominal rigid body dynamic model and a small amount of actual measurement data; constructing a teacher model by using the theoretical training set, and constructing a student model by using the actual measurement training set; and finally, combining teacher and student models to construct a knowledge distillation network, and finally obtaining a dynamical model considering both precision and generalization ability. The method achieves good balance between algorithm complexity and model precision, and has very high engineering application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a robot dynamics modeling technology, and in particular to a model data dual-drive robot dynamics modeling method. Background Art

[0002] The robot dynamics model describes the mapping relationship between the driving joint variables and their first and second order derivatives and the driving joint forces. An accurate dynamics model is an important theoretical basis for robot mechanism design, motion control and fault diagnosis. At present, there are three main types of robot dynamics modeling methods: model-driven, data-driven and model-data dual-driven methods. Model-driven modeling methods establish the equilibrium / conservation equations of the research object based on mechanical principles, such as the Newton-Euler method, the Lagrange method and the Kane method. The advantage of this method is that it can establish a model with an analytical format and clear physical meaning, but the model parameters usually have certain uncertainties, and in order to control the complexity of the model, the influence of smaller components and friction is usually ignored during the modeling process, resulting in reduced model accuracy. In order to avoid the above modeling and unmodeling errors, researchers have proposed a data-driven modeling method. This method uses a large amount of experimental data to build a proxy model to predict the dynamic behavior of the robot. The advantage of this method is that compared with theoretical modeling, the proxy model can capture the real dynamic behavior of the research object and the model accuracy is higher. However, this method also faces the following problems: First, training a proxy model with sufficient accuracy and generalization ability requires a large amount of high-quality experimental data, which will greatly increase the experimental cost; second, the proxy model is not interpretable and has no analytical format, which is not conducive to engineering applications. In order to combine the advantages of the two types of modeling methods, researchers have proposed a modeling method that is dual-driven by model data in recent years. This type of method mainly includes the following paradigms, such as: mechanism model plus data-driven residual prediction model, data-driven mechanism model parameter fine-tuning method, and method of embedding mechanism model into network structure. Among them, the data-driven mechanism model parameter fine-tuning method has achieved a good balance between algorithm complexity and model accuracy, and has therefore been widely studied. This patent proposes a robot precision dynamics modeling method that combines theoretical models and a small amount of experimental data. Compared with previous studies, this method can use the prior knowledge of theoretical models and less experimental data to establish a dynamic model with higher accuracy and generalization ability. Summary of the invention

[0003] The present invention aims to overcome the deficiencies in the prior art and provides a general method for dynamic modeling of a model data dual-drive robot. The method uses a BP neural network to learn an existing low-precision dynamic model to construct a teacher model, and uses the teacher model network parameters as a priori and combines a small amount of experimental data to construct a student model with higher accuracy.

[0004] The technical solution adopted by the present invention is: a general method for dynamics modeling of a model data dual-drive robot, the method comprising the following steps:

[0005] (1) Using the robot's nominal rigid body dynamics model and the measurement data under finite configuration, we construct a data set of the robot's nominal driving joint variables and their first- and second-order inverses and the corresponding joint torque values, which constitute the training set and

[0006] (2) Using BP neural network to construct the teacher model, based on Construct the (nonlinear) mapping relationship between the operation or driving joint variables and their first and second order inverses and the driving joint torque.

[0007] (3) The BP neural network is used to construct the student model. Based on the idea of ​​knowledge distillation, some hidden layer parameters of the teacher model are used as priors and as the initial values ​​of the corresponding items of the student model. Fine-tune the student model parameters.

[0008] (4) Combining the teacher model and the student model as priors, a knowledge distillation network is constructed, and finally a knowledge distillation model that takes into account both accuracy and generalization ability is obtained.

[0009] Among them, the above-mentioned nominal rigid body dynamics model based on the robot and the measurement data under the finite configuration are used to construct the nominal driving joint variables of the robot and their first and second order inverses and the corresponding joint torque values, which constitute the training set and The following steps are involved:

[0010] The robot's terminal posture, velocity, acceleration and corresponding driving joint torque under s groups of different configurations are organized into a set consisting of s groups of ordered data pairs. This set can be expressed as:

[0011]

[0012] In the formula, p t,k =(p t,k,1 p t,k,2 ...p t,k,n ) T represents the terminal position of the robot in the kth group of configurations, and is the corresponding speed and acceleration, and n represents the number of degrees of freedom of the robot. Substitute the robot's posture into the ideal kinematics inverse solution of the robot to obtain the corresponding nominal drive joint value:

[0013]

[0014] In the formula, qt,k =(q t,k,1 q t,k,2 ...q t,k,n ) T It represents the driving joint value corresponding to the kth group of postures of the robot, and maps g to the ideal inverse kinematic solution of the robot.

[0015] by and Respectively represent the velocity and acceleration of the kth group of postures. By introducing the ideal dynamics model of the robot, the corresponding nominal driving joint torque can be obtained:

[0016]

[0017] In the formula, τ t,k =(τ t,k,1 τ t,k,2 ...τ t,k,n ) T Represents the corresponding driving joint torque, and mapping D is the ideal dynamic model of the robot.

[0018] The nominal drive joint variables and their first and second order inverses and drive joint torques of the robot in s groups of different configurations are sorted into a set of ordered data pairs to form a training set Its input is The output is τ t,k . This set can be expressed as:

[0019]

[0020] Planning trajectory, the measured driving joint variables of the robot under m sets of different configurations and their first and second order inverses are expressed as q s,m , and Among them, q s,m =(q s,m,1 q s,m,2 ...q s,m,n ) T The corresponding measured drive motor torque feedback value is expressed as τ s,m =(τ s,m,1 τ s,m,2 ...τ s,m,n ) T The measured driving joint variables and their first and second order inverses and driving joint torques of the robot in m groups of different configurations are sorted into a set of ordered data pairs to form a training set. Its input is The output is τ s,m . This set can be expressed as:

[0021]

[0022] Among them, the above-mentioned teacher model is constructed using BP neural network, based on Constructing the (non-linear) mapping relationship between the operation or driving joint variables and their first and second order inverses and the driving joint torque includes the following steps:

[0023] Construct a teacher model and fit the function that maps the network's input data set to the network's target data set:

[0024]

[0025] In the formula Enter values ​​for the network; is the network output value; n=(n0 n1…n h ) where n i is the number of neurons in the i-th layer of the network, where the 0th layer is the input layer and the hth layer is the output layer; in is the weight moment of the i-th layer network; in is the bias of each neuron in the i-th layer of the network; f is the activation function of the network.

[0026] The output of each layer of the neural network can be expressed as:

[0027]

[0028] in is the output of the i-th layer of the network, Function f is the Sigmoid activation function.

[0029] Based on the F-norm, the loss function of the teacher model can be constructed, which is expressed as:

[0030]

[0031] Among them, α||·||2 is the regularization term. Using the LM gradient descent method, the teacher model can be trained to fit the (nonlinear) mapping relationship between the operation or driving joint variables and their first and second order inverses and the corresponding driving joint theoretical torque. At this point, the teacher model training is completed. Due to the sufficient amount of training set data, the teacher model is very close to the rigid body dynamics model. However, due to the modeling and unmodeling errors of the rigid body dynamics model, the teacher model inevitably has errors. Therefore, it is necessary to further construct the student model.

[0032] Among them, the above-mentioned student model is constructed based on BP neural network. Based on the idea of ​​knowledge distillation, some hidden layer parameters of the teacher model are used as priors as the initial values ​​of the corresponding items of the student model. Fine-tuning the student model parameters involves the following steps:

[0033] Following the teacher model architecture, the student model is constructed to fit the function that maps the network's input data set to the network's target data set:

[0034]

[0035] The terms in the formula are the same as those in the teacher model. Specifically, the weights and bias parameters of some layers of the trained teacher model are used as priors and assigned to the student model. The process can be expressed as:

[0036]

[0037] Among them, h1 is the number of hidden layers retained, and its initial parameter values ​​are randomly selected to ensure that the student model has a certain fitting ability for the experimental data.

[0038] Based on the F-norm, the loss function of the student model can be constructed, which is expressed as:

[0039]

[0040] Constructed from experimental data The LM gradient descent method is used to train the student model. After training, a high-precision dynamic model can be obtained. The data set is too small and the student model is overfitting. Therefore, it is necessary to further build a knowledge distillation model to combine the generalization ability of the teacher model and the accuracy of the student model.

[0041] The above-mentioned method of constructing a knowledge distillation network based on the teacher model and the student model as a priori, and finally obtaining a model data dual-driven dynamics model that takes into account both accuracy and generalization ability, includes the following steps:

[0042] Taking into account the influence of distance, a knowledge distillation model with both stability and accuracy is constructed. Its network structure and parameters are the same as the student model, and the expression is as follows:

[0043]

[0044] When the target point is close to the actual measurement point, the knowledge distillation model should be more biased towards the student model to obtain higher fitting accuracy; on the contrary, the knowledge distillation model should be more biased towards the teacher model to ensure stability. Specifically, by combining the loss functions of the teacher model and the student model, the loss function of the knowledge distillation model is constructed as follows:

[0045] LossFn KD =βLossFn TM +(1-β)LossFn SM +α(|WTM ||2+||W SM ||2) (13)

[0046] Where β is the inverse distance weight factor, the value of which is coupled with the distance between the target point and the adjacent measured points and is defined as follows:

[0047]

[0048] Here, Δq i represents the distance between the i-th predicted target point of the knowledge distillation model and the nearest measured point, Δq total Indicates the actual measurement point spacing, Δq max and Δq min They represent the upper and lower limits of distance compensation, λ∈[0,1]. In formula (12), Δq i When it is small, take β = 0 to suppress the error caused by the teacher model, Δq i When Δq is large, λ is used to control the influence of the teacher model on the knowledge distillation model. The value of λ depends on the degree of trust in the student model. The higher the trustworthiness of the student model, the lower the value of λ should be. min <Δq i <Δq max When , linear interpolation is used to avoid discontinuous values. Finally, use As the training set, the knowledge distillation model is solved based on the LM gradient descent method.

[0049] The beneficial effects of the present invention are:

[0050] 1. This invention follows the technical route of knowledge distillation, constructs a teacher model by learning a rigid body dynamics model through a neural network, and uses the teacher model network parameters as a priori and combines a small amount of experimental data to construct a student model. In theory, this method has higher accuracy and certain interpretability.

[0051] 2. Using distance as the judgment criterion, combined with the parameters and loss functions of the teacher and student models, the knowledge distillation model is trained and constructed. This model inherits the advantages of the student model while taking into account a certain generalization ability. Since the output is more stable, it is more suitable for engineering practice.

[0052] The present invention not only takes knowledge distillation as its guiding ideology, but also proposes a method to integrate a kinetic model with a small amount of experimental data to construct a high-precision kinetic model. In addition, it also addresses the overfitting problem of neural networks when the data set is sparse, integrates the teacher model and the student model, and obtains a knowledge distillation network with both accuracy and generalization capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is the flow chart of the dynamics modeling of the dual-drive robot with model data. DETAILED DESCRIPTION

[0054] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0055] A general method for dynamic modeling of dual-drive robots with model data, such as Figure 1 As shown, the following steps are included:

[0056] Step 1: Construct the robot's nominal drive joint variables and their first and second order derivatives and the corresponding theoretical and actual joint torque value data pairs to form a theoretical training set With the actual training set

[0057]

[0058] Given a group of different positions, velocities, and accelerations of the robot end point p Use the kinematic model to calculate the corresponding joint volume Save the set of data pairs as a collection

[0059]

[0060] In the formula, p t,k =(p t,k,1 p t,k,2 ...p t,k,n ) T represents the terminal position of the robot in the kth group of configurations, and is the corresponding velocity and acceleration, q t,k =(q t,k,1 q t,k,2 ...q t,k,n ) T represents the driving joint value corresponding to the kth group of postures of the robot, and are the corresponding driving joint speed and acceleration, and n represents the number of degrees of freedom of the robot.

[0061] Group s Substitute the ideal dynamics model of the robot to obtain the corresponding nominal driving joint torque:

[0062]

[0063] by is the input, τ t,k As output, construct a set of s groups of ordered data pairs to form a training set It can be expressed as:

[0064]

[0065] Planning trajectory, the measured driving joint variables of the robot under m sets of different configurations and their first and second order inverses are expressed as q s,m , and Among them, q s,m =(q s,m,1 q s,m,2 ...q s,m,n ) T The corresponding measured drive motor torque feedback value is expressed as τ s,m =(τ s,m,1 τ s,m,2 ...τ s,m,n ) T The measured driving joint variables and their first and second order inverses and driving joint torques of the robot in m groups of different configurations are sorted into a set of ordered data pairs to form a training set. Its input is The output is τ s,m , which can be expressed as

[0066]

[0067] Step 2: Use the BP neural network structure to construct a teacher model and fit the robot's nominal joint values To the nominal joint torque τ s,m Mapping

[0068] First, construct the teacher model

[0069]

[0070] In the formula Enter values ​​for the network; is the network output value; n=(n0 n1…n h ) where n i is the number of neurons in the i-th layer of the network, where the 0th layer is the input layer and the hth layer is the output layer; in is the weight moment of the i-th layer network; in is the bias of each neuron in the i-th layer of the network; f is the activation function of the network.

[0071] The output of each layer of the neural network can be expressed as:

[0072]

[0073] in is the output of the i-th layer of the network, f is the Sigmoid activation function.

[0074] Based on the F-norm, the loss function of the j teacher model can be constructed, which is expressed as:

[0075]

[0076] Among them, α||·||2 is the regularization term. The teacher model is trained using the LM gradient descent method until the loss function value meets the requirements, and the (nonlinear) mapping relationship between the nominal drive joint variables and their first and second order inverses and the corresponding nominal drive torque can be fitted. At this point, the teacher model training is completed.

[0077] Step 3: Use the same structure of the teacher model to construct the student model, take the hidden layer parameters of the teacher model as the prior, and combine a small amount of experimental data to fit the actual joint values ​​of the robot To the actual driving joint torque τ s,m Mapping

[0078] Following the teacher model structure, the student model is constructed as follows:

[0079]

[0080] In the formula Enter values ​​for the network; Output value for the network; in is the weight moment of the i-th layer network; in is the bias of each neuron in the i-th layer of the network.

[0081] The hidden layer weights and bias parameters of the trained teacher model are assigned to the student model as a priori. The process can be expressed as

[0082]

[0083] Among them, h1 is the number of hidden layers retained, and its parameters are randomly initialized to retain the student model's ability to learn the true model.

[0084] Based on the F-norm, the loss function of the student model can be constructed, which is expressed as:

[0085]

[0086] based on Use the LM gradient descent method to train the student model until the loss function value meets the requirements, and then fit the mapping from the actual joint value of the robot to the actual driving joint torque.

[0087] Step 4: Use the teacher model and student model as priors to build a knowledge distillation model that is both stable and accurate

[0088] The structure and parameters of the knowledge distillation model are the same as those of the student model, and the expressions are as follows:

[0089]

[0090] Combining the loss functions of the teacher model and the student model, the loss function of the knowledge distillation model is constructed:

[0091] LossFn KD =βLossFn TM +(1-β)LossFn SM +α(|W TM ||2+||W SM ||2) (12)

[0092] Where β is the inverse distance weight factor, the value of which is coupled with the distance between the target point and the adjacent measured points and is defined as follows:

[0093]

[0094] Here, Δq i represents the distance between the i-th predicted target point of knowledge distillation and the nearest measured point, Δq total Indicates the actual measurement point spacing, Δq max and Δq min They represent the upper and lower limits of distance compensation, λ∈[0,1]. In formula (12), Δq i When it is small, take β = 0 to suppress the error caused by the teacher model, Δq i When Δq is large, λ is used to control the influence of the teacher model on the knowledge distillation model. The value of λ depends on the degree of trust in the student model. The higher the trustworthiness of the student model, the lower the value of λ should be. min <Δq i <Δq max When , linear interpolation is used to avoid discontinuous values. Finally, use As the training set, the model is trained based on the LM gradient descent method until the loss function value meets the requirements, and the knowledge distillation model is solved.

[0095] Although the functions and working processes of the present invention have been described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific functions and working processes. The above-mentioned specific implementation methods are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which are all within the protection of the present invention.

Claims

1. A model data dual-drive robot dynamics modeling method, It is characterized in that The following steps are involved: (1) Using the robot's nominal rigid body dynamics model and the measurement data under finite configuration, the robot's nominal driving joint variables and their first and second order derivatives and the corresponding joint torque values ​​are constructed to form the training set and (2) Using BP neural network to construct the teacher model, based on Constructing a nonlinear mapping relationship between the operation or driving joint variables and their first and second order derivatives and the driving joint torque; (3) The BP neural network is used to construct the student model. Based on the idea of ​​knowledge distillation, the parameters of the first nh layers of the teacher model are used as the prior, where n is the number of hidden layers and h is the number of layers to be retained, as the initial values ​​of the corresponding items of the student model. Fine-tune student model parameters; (4) Finally, the teacher model and the student model are combined as prior knowledge to guide the construction of the knowledge distillation network, and finally a dynamic model driven by both model and data is obtained that takes into account both accuracy and generalization ability.

2. The model data dual-drive robot dynamics modeling method according to claim 1, It is characterized in that The step (1) is implemented as follows: The robot's terminal posture, velocity, acceleration and the corresponding driving joint torque under s groups of different configurations are organized into a set consisting of s groups of ordered data pairs, which can be expressed as: In the formula, p t,k =(p t,k,1 p t,k,2 ...p t,k,n ) T represents the terminal position of the robot in the kth group of configurations, and is the corresponding speed and acceleration, and n represents the number of degrees of freedom of the robot. The robot's position, speed, and acceleration are brought into the ideal kinematic inverse solution of the robot to obtain the corresponding nominal drive joint values: In the formula, q t,k =(q t,k,1 q t,k,2 ...q t,k,n ) T represents the driving joint value corresponding to the kth group of postures of the robot, and They represent the driving joint velocity and acceleration respectively, and the mapping g is the ideal inverse kinematic solution of the robot; Will By introducing the ideal dynamics model of the robot, the corresponding nominal driving joint torque can be obtained: In the formula, τ t,k =(τ t,k,1 τ t,k,2 ...τ t,k,n ) T represents the corresponding driving joint torque, and mapping D is the ideal dynamic model of the robot; The nominal drive joint variables and their first and second order derivatives and drive joint torques of the robot in s groups of different configurations are sorted into a set of ordered data pairs to form a training set Its input is The output is τ t,k . This set can be expressed as: Planning trajectory, the measured driving joint variables and their first and second order derivatives of the robot under m different configurations are expressed as q s,m , and Among them, q s,m =(q s,m,1 q s,m,2 ...q s,m,n ) T ; The corresponding measured drive motor torque feedback value is expressed as τ s,m =(τ s,m,1 τ s,m,2 ...τ s,m,n ) T ; The measured driving joint variables and their first and second order derivatives and driving joint torques of the robot in m groups of different configurations are sorted into a set of ordered data pairs to form a training set Its input is The output is τ s,m ; 3. The model data dual-drive robot dynamics modeling method according to claim 1, It is characterized in that The step (2) is specifically implemented as follows: Construct a teacher model and fit the function that maps the network's input data set to the network's target data set: In the formula Enter values ​​for the network; is the network output value; n=(n 0 n 1 …n h ) where n i is the number of neurons in the i-th layer of the network, where the 0th layer is the input layer and the hth layer is the output layer; in is the weight moment of the i-th layer network; in is the bias of each neuron in the i-th layer network; f is the activation function of the network; The output of each layer of the neural network can be expressed as: in is the output of the i-th layer of the network, Function f is the Sigmoid activation function; Based on the F-norm, the loss function of the teacher model can be constructed, which is expressed as: Among them, α||·|| 2 is a regular term; based on The teacher model can be trained to fit the nonlinear mapping relationship between the nominal driving joint variables and their first and second order derivatives and the corresponding nominal driving joint torques.

4. The model data dual-drive robot dynamics modeling method according to claim 1, It is characterized in that The step (3) is specifically implemented as follows: Following the teacher model architecture, the student model is constructed to fit the function that maps the network's input data set to the network's target data set: In the formula, the network topology is the same as the teacher model. Specifically, the weights and bias parameters of some layers of the trained teacher model are used as priors and assigned to the student model. The process can be expressed as: Among them, h 1 The number of hidden layers to be retained, the initial values ​​of its parameters are randomly selected to preserve the learning ability of the student model on the true model; Based on the F-norm, the loss function of the student model can be constructed, which is expressed as: Constructed from experimental data The LM gradient descent method is used to train the student model.

5. The model data dual-drive robot dynamics modeling method according to claim 1, It is characterized in that The step (4) is specifically implemented as follows: Taking into account the influence of distance, a knowledge distillation model with both stability and accuracy is constructed. Its network structure and parameters are the same as the student model, and the expression is as follows: When the target point is close to the actual measurement point, the knowledge distillation model should be more biased towards the student model to obtain higher fitting accuracy; on the contrary, the knowledge distillation model should be more biased towards the teacher model to ensure stability; specifically, by combining the loss functions of the teacher model and the student model, the loss function of the knowledge distillation model is constructed as follows: LossFn KD =βLossFn TM +(1-β)LossFn SM +α(|W TM || 2 +||W SM || 2 ) (13) Where β is the inverse distance weight factor, the value of which is coupled with the distance between the target point and the adjacent measured points and is defined as follows: Here, Δq i represents the distance between the i-th predicted target point of the knowledge distillation model and the nearest measured point, Δq total Indicates the actual measurement point spacing, Δq max and Δq min They represent the upper and lower limits of distance compensation, λ∈[0,1]; in formula (12), Δq i When it is small, take β = 0 to suppress the error caused by the teacher model, Δq i When Δq is large, λ is used to control the influence of the teacher model on the knowledge distillation model. The value of λ depends on the degree of trust in the student model. The higher the trustworthiness of the student model, the lower the value of λ should be. min <Δq i <Δq max When , linear interpolation is used to avoid discontinuous values, and finally use As the training set, the knowledge distillation model is solved based on the LM gradient descent method.