An industrial robot modeling method based on a gated recurrent neural network
By using gated recurrent neural networks (GRUs) for industrial robot modeling, the problems of complex model calculations and poor anti-interference in existing technologies are solved, achieving high-precision estimation of robot dynamic parameters and improved motion control performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2026-04-10
AI Technical Summary
Existing mechanistic modeling methods are computationally complex and cannot produce accurate models, while identification modeling methods cannot reflect the nonlinear characteristics of robots and have poor anti-interference capabilities. Traditional linearized identification models have a large computational load.
A gated recurrent neural network (GRU) is used to model industrial robots. By collecting robot state data and preprocessing it, the model parameters are trained using a stochastic optimization method with GRU hidden layers and adaptive momentum to construct a robot dynamics model.
This enables rapid and accurate estimation of robot dynamic parameters, improves the model's accuracy and anti-interference capability, and enhances the performance of robot motion control.
Smart Images

Figure CN116512266B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of robots, and particularly relates to an industrial robot modeling method based on a gated recurrent neural network (GRU). BACKGROUND
[0002] Modeling of an industrial robot is a prerequisite for realizing high-speed and high-precision control, and a model is used to compensate for position deviation caused by non-linear factors such as changes in the inertia of the robot, so as to improve the motion control performance. This method is widely used in various fields of industrial robots, including construction robots, welding robots, and spraying robots.
[0003] Current methods include mechanism modeling and identification modeling. The mechanism modeling method mainly includes the Newton-Euler method and the Lagrange method, but the mechanism modeling method has a complex calculation process and cannot obtain an accurate model. The identification modeling method commonly used at present is the least square method, which needs to first linearize the robot model, and then use the actual joint variable data and torque data of the robot to fit to obtain. The linear identification model used in this method cannot reflect the nonlinear characteristics of the robot, has poor anti-interference performance for colored noise, and has a large amount of calculation. SUMMARY
[0004] In order to overcome the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide an industrial robot modeling method based on a gated recurrent neural network, to model the dynamics of the robot using a gated recurrent neural network (GRU), which has high fault tolerance and high-speed optimization solution capability, and can quickly and accurately estimate the dynamics parameters of the robot through the neural network.
[0005] In order to achieve the above-mentioned purpose, the technical solution adopted by the present application is as follows:
[0006] An industrial robot modeling method based on a gated recurrent neural network, comprising the following steps:
[0007] Step 1: applying an excitation signal to the robot, collecting robot state data, including joint angular displacement, angular velocity, angular acceleration, and joint torque;
[0008] Step 2: preprocessing the collected state data;
[0009] Step 3: using a gated recurrent neural network as a robot dynamics model to determine the network topology structure;
[0010] Step 4: using the data preprocessed in step 2 to train the model parameters by using a self-adaptive momentum random optimization method;
[0011] Step 5, generate test trajectory in robot joint space, input to trained model to predict torque, calculate error to verify model effect.
[0012] In one embodiment, the step 2, the collected industrial robot joint angle displacement, angular velocity, angular acceleration and joint torque data, first according to three standard deviation criterion, remove gross error, then use median average filtering method to deal with, reduce the influence of data noise.
[0013] In one embodiment, the step 3, the robot dynamics model includes input layer, GRU hidden layer, original output layer, full connection layer and final output layer; the GRU hidden layer contains several memory units with same structure, each memory unit is composed of update gate and reset gate, the state of memory unit is updated through update gate and reset gate, at any time t, the input of memory unit is composed of its previous time, i.e. t-1 time hidden state h t-1 and current time, i.e. t time input x it Two parts, x it Indicates the joint motion variable of the i th joint at t time, Indicates the joint angle displacement, angular velocity and angular acceleration of the i th joint at t time, respectively, the calculation formula is as follows:
[0014] z t =σ(W z x it +U z h t-1 )
[0015] r t =σ(W r x it +U r h t-1 )
[0016]
[0017]
[0018] Wherein, z t is the output of update gate; r t is the output of reset gate; h t is the hidden state at t time; is the activation state at t time; W z , U z , W r , U r , W A , U A are corresponding weights; σ represents sigmoid function, and the output of final output layer is robot joint torque
[0019]
[0020] where W y is the matrix weight.
[0021] In one embodiment, Huber function is used as the loss function, denoted as:
[0022]
[0023] where, and y true represent the model predicted joint torque and the actual torque of the robot, respectively; δ is a hyperparameter.
[0024] In one embodiment, the step 4, the model parameters are updated using the Adam adaptive learning rate method. First, the first-order moment m t and the second-order moment v t are estimated:
[0025] m t = β1 1 * m t-1 + (1-β1 1) * g
[0026] v t = β2 * v t-1 + (1-β2) * g 2
[0027] where β1 is the exponential decay rate of the first-order moment estimation; β2 is the exponential decay rate of the second-order moment estimation; g is the gradient;
[0028] Second, the first-order moment estimation and the second-order moment estimation bias correction are performed:
[0029]
[0030]
[0031] where m t ' is the bias-corrected first moment vector, v t ' is the bias-corrected second moment vector; and finally the parameter update is:
[0032]
[0033] where θ t+1 and θ t are the parameter vectors to be updated; the parameter eps is a positive number close to 0; and α is the learning rate, used to control the step size.
[0034] In one embodiment, the parameter updating is performed until the Huber function value meets a given fitting requirement, and a root mean square error between a torque estimation value sequence calculated by the model according to the trajectory and a torque real value sequence meets a given error range.
[0035] In one embodiment, the step 5, the model is evaluated, and a mean square error between an estimated torque calculated by the approximate model and a motor output torque real value meets a given fitting requirement, given a test trajectory in a feasible working space.
[0036] The application also provides a corresponding industrial robot motion control method, which is modeled by using the industrial robot modeling method based on the gated recurrent neural network, and a position deviation of industrial robot motion caused by a nonlinear factor is compensated by using the obtained model.
[0037] The application also provides a corresponding industrial robot motion control system, which adopts PID control, and has a model established by using the industrial robot modeling method based on the gated recurrent neural network in a feedforward control unit thereof.
[0038] Compared with the prior art, the application collects robot joint motion variables and joint motor torques, pre-processes the measurement data, selects a gated recurrent neural network as a model, trains model parameters by using a random optimization method with adaptive momentum, and obtains a system description capable of reflecting the relationship between the industrial robot joint motion variables and the joint motor torques. The application models the industrial robot by using the gated recurrent neural network, and the method is convenient and feasible, the model has high precision, and the use of the model for motion control can improve the performance of the robot. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 is an experimental content flow block diagram of robot dynamics modeling in the application.
[0040] Figure 2 is a joint angle displacement, joint angular velocity and joint angular acceleration curve diagram of an identified experimental trajectory of joint 1 in an embodiment of the application.
[0041] Figure 3 is a neural network model structure diagram in the application.
[0042] Figure 4 is a gated recurrent neural network GRU layer node structure diagram in the application.
[0043] Figure 5 is a flow chart of an Adam adaptive learning rate method in the application.
[0044] Figure 6 is a comparison example diagram of a torque estimation value and a motor torque real value of joint 1 in an embodiment of the application. DETAILED DESCRIPTION
[0045] Embodiments of the present application will be described in detail below with reference to the accompanying drawings and examples.
[0046] As shown in Figure 1 , the present application is a kind of industrial robot modeling method based on gated recurrent neural network (GRU), comprising the following steps:
[0047] Step 1, apply excitation signal to the robot, collect joint angle displacement, angular velocity, angular acceleration and joint torque and other robot state data, and obtain experimental data.
[0048] This step takes a six-axis industrial robot as an example. For each joint of the robot, in the joint space of the robot, select a five-order Fourier series trajectory to control the industrial robot to perform experimental motion as:
[0049]
[0050]
[0051]
[0052] Where q lo is the offset, q i (t) is the angular displacement, is the angular velocity, is the angular acceleration, N i is the number of terms of the i-th joint, select 5, l represents the l-th term of the Fourier series, a l,i and b l,i are the amplitude of the trigonometric function, select 0.1, the fundamental angular frequency w f = 2π*0.1, and the single-period trajectory is 10 seconds.
[0053] Run the selected excitation trajectory continuously, collect the motion variables of each joint of the robot during motion: joint angle displacement, angular velocity, angular acceleration and joint torque data, and obtain an experimental sample data sequence of size 24*1429, as shown in Figure 2 , line a, line b and line c are the angular displacement, angular velocity and angular acceleration of joint 1 of the sample data, respectively.
[0054] The current state data of the industrial robot is measured in real time by the sensor interface module in the industrial robot, i.e. the sensor module group, and stored in the local storage. It is transmitted from the robot control system to the operation device via Ethernet cable and TCP / IP protocol.
[0055] Step 2, pre-process the collected state data.
[0056] In this step, the collected experimental sample data is processed by the three standard deviation criterion to remove the gross error in the data, and then the experimental data collected is processed by the median average filtering method, one maximum value and one minimum value are removed from each group of data, the average value of the remaining data is calculated to eliminate the pulse error caused by accidental interference, reduce the periodic interference, increase the data smoothness, and reduce the influence of data noise on the experiment. The above experimental sample data obviously includes joint angular displacement, angular velocity, angular acceleration and joint torque data.
[0057] The data is divided, and in an embodiment of the application, the first 80% of the collected experimental data sequence is used as a training set of the model for training of the neural network, and the last 20% is used as a test set for testing and verifying the accuracy and effect of the model.
[0058] Step 3, constructing a neural network model, selecting a gated recurrent neural network as a robot dynamics model, and determining a network topology structure.
[0059] The gated recurrent neural network has strong autonomous learning ability, can extract basic rules from a large amount of data, and can avoid the problems of gradient disappearance and gradient explosion of traditional recurrent neural networks, especially for prediction problems such as robot modeling and identification with time sequence characteristics, has the characteristics of fast training speed, small error and simple model construction.
[0060] In this step, in the modeling stage, a gated recurrent neural network model is built, including an input layer, a GRU hidden layer and an output layer, as shown in Figure 3 The output layer is divided into an original output layer and a final output layer, the difference being that the output position of the original output layer is provided with a full connection layer, and the output of the full connection layer is used as the final output.
[0061] The input value of the input layer x it represents the joint motion variable of the i-th joint at time t, respectively represent the joint angular displacement, angular velocity and angular acceleration of the i-th joint at time t. For a six-axis industrial robot, the number of neuron input layer nodes is set to 18. The GRU hidden layer includes a plurality of GRU memory units with the same structure, each unit is composed of an update gate and a reset gate, and the state of the memory unit is updated through the update gate and the reset gate. At any time t, the input of the memory unit is composed of the hidden state h t-1 of the previous time, i.e. t-1, and the input x it of the current time, i.e. t, as shown in Figure 4 The calculation formula is as follows:
[0062] z t =σ(W z x it +Uz h t-1 )
[0063] r t =σ(W r x it +U r h t-1 )
[0064]
[0065]
[0066] wherein z t is the output of the update gate; r t is the output of the reset gate; h t is the hidden state at time t; a is the activation state at time t; W z , U z , W r , U r , W A , U A are the corresponding weights; and sigma represents a sigmoid function. In the embodiment, the number of GRU memory units in the hidden layer is determined to be 30 according to an empirical formula determined based on the neural network hidden layer; the number of output layer neurons is set to 6, and the joint torque of the robot is obtained through forward calculation as follows:
[0067]
[0068] wherein W y is the weight of the output matrix.
[0069] Step 4: The data preprocessed in step 2 is used to train the model parameters by using a random optimization method with adaptive momentum.
[0070] During training, in each iteration, the training set data is sequentially divided according to the GRU input dimension, the data of each sampling point is sent into the GRU memory unit for feature extraction, and the model is trained. For all training sets [x, y true ], the joint torque is obtained through forward calculation , and the error and the loss function are calculated. The error is mean square error (MSE), and the loss function is Huber function, which is expressed as:
[0071]
[0072] wherein, and y truerespectively, represent the model predicted joint torque and the actual torque of the robot; δ is a hyperparameter; δ is a hyperparameter, usually takes 5-10, and 8 in the embodiment.
[0073] The model parameters are updated by using the Adam adaptive learning rate method, so that the parameter update is smooth and not easy to fall into local optimum, as shown in the following formula: Figure 5 As shown in the formula, first, the first-order moment m t and the second-order moment v t are estimated as follows:
[0074] m t = β1*m t-1 + (1-β1)*g
[0075] v t = β2*v t-1 + (1-β2)*g 2
[0076] wherein β1 is the exponential decay rate of the first-order moment estimation; β2 is the exponential decay rate of the second-order moment estimation; g is the gradient; in the embodiment, the parameters β1 = 0.9 and β2 = 0.999.
[0077] Secondly, the first-order moment estimation and the second-order moment estimation bias correction are performed as follows:
[0078]
[0079]
[0080] wherein m t ' is the bias-corrected first moment vector, and v t ' is the bias-corrected second moment vector.
[0081] Finally, the parameter update is performed as follows:
[0082]
[0083] wherein θ t+1 and θ t are the parameter vectors to be updated; the parameter eps is a positive number close to 0, which is used to prevent the denominator from being 0 in the update process, and eps = 1 x 10 -8 in the embodiment; α is the learning rate, which is used to control the step size, and the learning rate is set to 0.01 in the embodiment.
[0084] The parameter update is performed until the Huber function value meets the given fitting requirements, and the root mean square error of the torque estimation value sequence calculated by the model according to the trajectory and the torque true value sequence meets the given error range.
[0085] According to the above formula, the neural network model is iteratively trained, and the root mean square error of the torque estimation value sequence obtained by the neural network model according to the experimental data and the torque real value sequence of the training set is minimized or the training is stopped when the maximum iteration number 2000 is reached, that is, the approximate model of the robot can be obtained. Figure 6 As shown in the figure, the blue line train_real is the real torque sequence of joint 1, and the yellow line train_predit is the torque sequence output by the GRU network model of joint 1 training set, and the error is 1.9635, which meets the given fitting requirement; it is shown that during the identification trajectory motion of the industrial robot, the root mean square error of the torque estimation value sequence calculated by the dynamics model according to the trajectory and the torque real value sequence meets the given error range.
[0086] Step 5, generate a test trajectory in the joint motion space of the robot, input it into the trained model to predict the torque, and calculate the error to verify the effect of the model. Specifically, the model is evaluated, a test trajectory in the feasible working space is given, and the mean square error between the estimated torque calculated by the approximate model and the motor output torque true value meets the given fitting requirement.
[0087] In the embodiment of the application, the test set motion variable is input into the GRU network for training, and the torque output of the test set is as shown in Figure 6 The pink line test_real, and the actual torque of the test set is as shown in Figure 6 The black line test_predit, and the error between the two is 4.3206, and it can be seen that the degree of coincidence is high, so the modeling is accurate and effective.
[0088] The purpose of the robot inverse dynamics modeling in the application mainly has two points, first, since the robot is a complex nonlinear system, modeling is performed to enable the model to design a control scheme and a controller, which is used to solve the nonlinear effect of the robot, compensate the position deviation caused by the inertia change of the robot and other nonlinear factors, and improve the motion control performance; secondly, in the common robot, the PID control is used as a feedforward control to reduce the system error, and this method is widely used in the field of industrial robots, and is used for construction robots, welding robots, spraying robots and the like.
Claims
1. A method for modeling industrial robots based on gated recurrent neural networks, characterized in that, Includes the following steps: Step 1: Apply an excitation signal to the robot, select a fifth-order Fourier series trajectory, and collect robot state data, including joint angular displacement, angular velocity, angular acceleration, and joint torque. Step 2: For the collected data of joint angular displacement, angular velocity, angular acceleration and joint torque of industrial robot, first remove gross errors according to the three standard deviation criteria, and then process it with the median average filtering method to reduce the impact of data noise. Step 3: A gated recurrent neural network (GRU) is used as the robot dynamics model to determine the network topology. The robot dynamics model includes an input layer, a GRU hidden layer, a raw output layer, a fully connected layer, and a final output layer. The GRU hidden layer contains several memory units with the same structure. Each memory unit consists of an update gate and a reset gate. The state of the memory unit is updated through the update gate and the reset gate. At any time t, the input of the memory unit is changed from its hidden state at the previous time, i.e., time t-1. and the input at the current time, i.e., time t. It consists of two parts. Let represent the joint motion variable of the i-th joint at time t. , , , Let represent the joint angular displacement, angular velocity, and angular acceleration at time t for the i-th joint, respectively. The calculation formulas are as follows: in, To update the output of the gate; To reset the output of the gate; Let be the hidden state at time t; The activation state at time t; , , , , , For the corresponding weights; This represents the sigmoid function, and the final output layer outputs the robot's joint torques. : in, These are the matrix weights; Step 4: Using the preprocessed data from Step 2, train the model parameters using an adaptive momentum stochastic optimization method; use the Huber function as the loss function, expressed as: in, and These are represented as the model-predicted joint torque and the robot's actual torque, respectively. For hyperparameters; The Adam adaptive learning rate method is used to update the model parameters. First, the first moment is estimated. and second moment : in, The exponential decay rate is estimated by the first moment. The exponential decay rate is estimated by the second moment. For gradient; Secondly, bias corrections are performed for the first-order moment estimation and the second-order moment estimation: in, The first moment vector is used to correct the deviation. The second moment vector is used to correct the deviation; finally, the parameters are updated as follows: in, and The parameter vector to be updated; parameters It is a positive number close to 0; The learning rate is used to control the stride length. The parameters are updated until the Huber function value meets the given fitting requirements, and the root mean square error between the torque estimate sequence calculated by the model based on the trajectory and the torque true value sequence meets the given error range. Step 5: Generate a test trajectory in the robot joint motion space and input it into the trained model to predict torque. Calculate the error to verify the model's effectiveness. Evaluate the model: given a test trajectory in a feasible workspace, the mean square error between the estimated torque calculated by the approximate model and the true value of the motor output torque meets the given fitting requirements.
2. An industrial robot motion control method, characterized in that, The industrial robot modeling method based on gated recurrent neural network as described in claim 1 is used to model the robot, and the resulting model is used to compensate for the deviation in the motion position of the industrial robot caused by nonlinear factors.
3. An industrial robot motion control system, employing PID control, characterized in that, Its feedforward control unit has a model established using the industrial robot modeling method based on gated recurrent neural networks as described in claim 1.
Citation Information
Patent Citations
Robot dynamics modeling method based on deep learning
CN108621159A
Six-axes robot kinetic parameter identification method based on neural network
CN109773794A