Double-neural network model predictive control method for flexible joint of robot
Through the dual neural network model prediction control method, the dynamics and optimization solution process of the flexible joint system are approximate respectively by GRU and NARX neural networks, which solves the problem that traditional control methods are difficult to meet the high precision and rapid response of flexible joint systems, and achieves high efficiency and real-time control.
Patent Information
- Application Number
- CN202411979934.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional control methods are difficult to meet the requirements of high accuracy and rapid response of flexible joint systems, especially when dealing with highly nonlinear and uncertain systems.
The dual neural network model prediction control method is adopted to approximate the dynamics of the system through the GRU neural network model, and the optimization solution process of the model prediction controller is accelerated in combination with the NARX neural network model.
It realizes efficient real-time control of flexible joint systems on low-performance hardware, reduces the computational overhead of traditional optimization methods in high-dimensional nonlinear systems, and meets the needs of high precision and fast response.
Smart Images

Figure CN119396008A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of robot intelligent control, and in particular relates to a dual neural network model predictive control method for robot flexible joints. Background Art
[0002] In modern robotics, flexible joint robots are increasingly used. Flexible joints are usually implemented through series elastic actuators (SEAs), which can provide higher force control accuracy while improving the flexibility and safety of the robot. However, the nonlinearity and complex dynamic characteristics of flexible joint systems pose challenges to the design of control strategies. Traditional control methods, such as PID controllers, although they perform well in simple systems, often have difficulty meeting the requirements of high precision and fast response when dealing with flexible joint systems with high nonlinearity and uncertainty. To this end, researchers have begun to explore new control strategies that combine machine learning and optimization algorithms to improve the performance and adaptability of the system.
[0003] Neural network model predictive control (NNMPC) is an advanced control method that combines machine learning and classical control theory. By modeling the dynamics of the system through a neural network, NNNPC can achieve real-time optimization control in complex nonlinear systems, but its solution process consumes a lot of computing resources and is difficult to implement on low-performance hardware. Summary of the invention
[0004] The present invention provides a dual neural network model predictive control method for robot flexible joints to solve the above-mentioned technical problems, and specifically adopts the following technical solutions: A dual neural network model predictive control method for a robot flexible joint comprises the following steps: S1: Model the nonlinear dynamic system of the flexible joint robot and construct a dynamic model; S2: Set the GRU neural network model to approximate the dynamic model of the system; S3: Based on the GRU neural network model, a hybrid control NMNPC controller including position, velocity and torque is constructed; S4: Optimize and solve the NMNPC controller based on the nonlinear optimization solver; S5: Set the NARX neural network model to approximate the solution of the NMNPC controller to form a dual neural network model predictive control method.
[0005] Furthermore, the dynamic model of the flexible joint robot is established through the Newton-Euler equation.
[0006] Furthermore, the kinetic model is as follows,
[0007] in, q∈R 6 , θ∈R 6 Represent the joint angle position vectors on the connecting rod side and the motor side respectively, M(q)∈R 6 and I(θ) ∈R 6 is the symmetric positive definite inertia matrix of the connecting rod side and the motor side, , and are the Coriolis force matrix, the connecting rod side damping vector and the motor side damping vector, respectively. G(q)∈R 6 , and denote the gravity torque vector, external force torque vector and motor torque vector respectively, represents the joint torque vector, K∈R 6*6 A positive definite diagonal matrix representing the stiffness of the elastic body.
[0008] Furthermore, in step S2, the GRU neural network model is:
[0009] X(K)=[x(k),x(k-1),...,x(kd x +1)] T
[0010] U(K)=[u(k),u(k-1),...,u(kd u +1)]
[0011] in, X(K) Indicates the system status from kd x +1 Time has come k The value of the moment, U(k) For the system from kd u +1 Time has come k The control input at the moment, d x and d u Respectively represent the maximum order of the output and input delay of the network, x1=q, , x3=θ, , X5=I m ,u=U vol ,x=[x1,x2,x3,x4,x5] T represents the system state vector, and u represents the control input of the system.
[0012] Furthermore, after step S2, the method further comprises: Develop a sampling method for neural network data sets and collect data to train the GRU neural network model.
[0013] Furthermore, the sampling method of the neural network data set is formulated, and the specific method of collecting data for training the GRU neural network model is as follows: First, generate a random control variable u∈ (u min ,u max ) , and applies it to the flexible joint system, and the duration of each control input is a random value t∈ (t min ,t max ) , the system output is collected at fixed time intervals, and the output data includes position, speed and torque to meet the needs of position, speed and torque control. Then, it is judged whether the preset maximum number of collections has been reached; if not, random control inputs are continued to be generated; if reached, the data set is saved in time series, which contains time, control input and system output information, and the data collection process ends; In the training of the GRU neural network model, the mean square error is selected as the loss function, and the Adam optimization algorithm is used to update the network weights.
[0014] Furthermore, the time range of t is set to be between 20 milliseconds and 2 seconds.
[0015] Furthermore, in step S3, the cost function of the joint controller is:
[0016] Constrained by:
[0017]
[0018]
[0019] In the formula represents the optimal control input sequence for optimization solution, Indicates from k+1 arrive k+T The state prediction sequence at the moment, U k+1:k+T =[u0,u1,...,u T-1 ]express k+1 arrive k+TThe system control input sequence to be optimized at any time, x min and x max They represent the maximum and minimum values of the system control input constraints respectively, and T is the prediction time domain length; According to the goal of joint position, velocity and torque hybrid control, the cost function of the NMNPC controller is set as follows:
[0020] In the formula Indicated in k+i The predicted joint positions at each moment, is the corresponding position reference signal, For k+i The predicted joint velocity at each moment, is the corresponding speed reference signal, For k+i The joint torque predicted at each moment can be obtained by Calculated, is the corresponding torque reference signal, and the parameters α>0, β>0, γ>0, η>0 represent the position error, velocity error, torque error, and penalty parameters of the control input, respectively.
[0021] Furthermore, in step S4, the solution of the NMNPC controller is optimized by using the IPOPT solver.
[0022] Further, in step S5, based on the data collected by the NMNPC method, the NARX neural network model is used to directly learn the optimal solution of the NMNPC controller, and the collected data is recorded as , which consists of a time series, the IPOPT solver function is,
[0023] in represents the linear mapping of the IPOPT solver function, and then the NMNPC controller is approximated by the NARX neural network model. The NARX neural network model is,
[0024] in Calculated by GRU neural network model, x d (k) represents the desired target, and the input of the NARX neural network model is , the output of the NARX neural network model is the predicted system control input boundary .
[0025] The benefit of the present invention lies in the dual neural network model predictive control method for robot flexible joints, which introduces two neural networks to work together: one is used to approximate the dynamics of the system, and the other is specifically used to accelerate the optimization solution process of the model predictive controller, reducing the computational overhead that may be caused by traditional optimization methods in high-dimensional nonlinear systems, thereby achieving real-time control.
[0026] The invention is beneficial in that the dual neural network model predictive control method for robot flexible joints is provided, in which the first neural network is responsible for learning and approximating the complex dynamic characteristics of the system and capturing the nonlinear relationship of the flexible joint system. The second neural network generates a nearly optimal control strategy by learning the optimization process of the controller. This method enables the generation of the control strategy to be completed directly through the forward propagation of the neural network, thereby greatly shortening the optimization calculation time and meeting the needs of real-time control. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0028] Figure 1 It is a flow chart of the dual neural network model predictive control method for robot flexible joints of the present invention; Figure 2 It is a principle block diagram of the dual neural network model predictive control method for robot flexible joints of the present invention; Figure 3 Schematic diagram of the GRU neural network of the present invention; Figure 4 It is a flowchart of the neural network data set acquisition process of the present invention; Figure 5 is a flow chart of the neural network training process of the present invention; Figure 6 The flowchart of the IPOT optimization solution process of the invention; Figure 7 It is a principle block diagram of the NMNPC controller algorithm of the present invention; Figure 8 This is a result diagram of joint space position tracking of an example of the present invention; Fig. 9 This is a diagram of the joint space velocity tracking result of an example of the present invention; Fig.10 This is a diagram of the joint space torque tracking results of an example of the present invention. DETAILED DESCRIPTION
[0029] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0030] like Figure 1 and 2 As shown, a dual neural network model predictive control (DNMPC) method for a robot flexible joint of the present application includes the following steps: Step S1: Modeling the nonlinear dynamic system of the flexible joint robot to construct a dynamic model.
[0031] In step S1, the dynamic model of the flexible joint robot is established by the Newton-Euler equation. The dynamic model is as follows:
[0032] in, q∈R 6 , θ∈R 6 Represent the joint angle position vectors on the connecting rod side and the motor side respectively, M(q)∈R 6 and I(θ) ∈R 6 is the symmetric positive definite inertia matrix of the connecting rod side and the motor side, , and are the Coriolis force matrix, the connecting rod side damping vector and the motor side damping vector, respectively. G(q)∈R 6 , and denote the gravity torque vector, external force torque vector and motor torque vector respectively, = K(q- θ)∈R 6 represents the joint torque vector, K∈R 6*6 A positive definite diagonal matrix representing the stiffness of the elastic body.
[0033] Step S2: Set the GRU neural network model to approximate the dynamic model of the system.
[0034] Due to the shortcomings of uncertain parameters in the joint model and difficulty in establishing an accurate friction model, this application uses a GRU neural network to learn the dynamic model of the single-joint SEA system.
[0035] GRU neural network model Figure 3As shown, define x1=q, , x3=θ, , X5=I m ,u=U vol ,x=[x1,x2,x3,x4,x5] T represents the system state vector, and u represents the control input of the system. X(K)=[x(k),x(k-1),..., x(kd x +1)] T , X(k) Indicates that the system status changes from kd x +1 time to k time, let U(K)=[u(k),u(k-1),...,u (kd u +1)] , U(k) For the system from kd u +1 to k time, where d x and d u Respectively represent the maximum order of the network's output and input delays. The GRU neural network model can be expressed as:
[0036] The above formula can be applied recursively to achieve multi-step prediction, for example
[0037] in, .
[0038] Furthermore, a sampling method for neural network data sets is formulated to collect data for training the GRU neural network model. Data set sampling will directly affect the training process of the dynamic recurrent neural network, and insufficient data sets will lead to model deviation.
[0039] In the implementation of the present application, a sampling method for a neural network data set is formulated, and a specific method for collecting data to train a GRU neural network model is as follows: like Figure 4 As shown, first, generate a random control variable u∈ (u min ,u max ) , and applies it to the flexible joint system, and the duration of each control input is a random value t∈ (t min ,t max )In the implementation of the present application, the time range of t is set to be between 20 milliseconds and 2 seconds. The system output is collected at fixed time intervals, and the output data includes position, speed and torque to meet the needs of position, speed and torque control. Then, it is determined whether the preset maximum number of collections has been reached. If not, random control inputs are continued to be generated. If reached, the data set is saved in time series, and the data set contains time, control input and system output information, and the data collection process ends.
[0040] In the training of the GRU neural network model, the mean square error (MSE) is selected as the loss function. As shown in the following formula,
[0041] The Adam algorithm formula used in the training process is as follows:
[0042]
[0043]
[0044]
[0045] Parameter update method:
[0046] in g t is the gradient, α=0.001, β1=0.9, β2=0.999, ε=10 -8 ,M t and G t They are the first-order moment estimate and the second-order moment estimate of the gradient, and It is for M t and G t The learning rate is dynamically adjusted according to the gradient, and This forms a dynamic constraint on the learning rate.
[0047] The data set is input into the GRU neural network model in a time series cycle. The training process is open-loop training, and only single-step prediction is performed. The data of the future time step is used as a reference value. The specific process is as follows: Figure 5 shown.
[0048] The Adam algorithm is used to update the network weights. To increase the training speed, the data set is processed in batches. The training is stopped when a certain number of iterations or the gradient is less than a certain threshold, and the network weights are saved. The trained neural network is used to iterate multi-step predictions, and the multi-step prediction error of the network is tested. If the error is within the allowable range, the network weights are saved and the training ends. If the multi-step prediction error exceeds the preset range, the above process is returned to continue training the network.
[0049] Step S3: Based on the GRU neural network model, a hybrid control NMNPC controller including position, speed and torque is constructed.
[0050] According to the principle of MPC, the NMNPC controller is designed in combination with the GRU neural network model to control the single-joint SEA robot system.
[0051] The cost function of the joint controller can be expressed as follows:
[0052] Constrained by:
[0053]
[0054]
[0055] In the formula represents the optimal control input sequence for optimization solution, Indicates from k+1 arrive k+T The state prediction sequence at the moment, U k+1:k+T =[u0,u1,...,u T-1 ]express k+1 arrive k+T The system control input sequence to be optimized at any time, x min and x max They represent the maximum and minimum values of the system control input constraints respectively, and T is the prediction time domain length.
[0056] According to the goal of joint position, velocity and torque hybrid control, the cost function of the NMNPC controller is set as follows:
[0057] In the formula Indicated in k+i The predicted joint positions at each moment, is the corresponding position reference signal, For k+i The predicted joint velocity at each moment, is the corresponding speed reference signal, For k+i The joint torque predicted at each moment can be obtained by Calculated, is the corresponding torque reference signal, and the parameters α>0, β>0, γ>0, η>0 represent the position error, velocity error, torque error, and penalty parameters of the control input, respectively.
[0058] The design of the cost function provides the system with more flexibility and adjustability. By adjusting the weight coefficient, different control objectives can be weighted to adapt to various control requirements and tasks, making MPC widely applicable and superior in robot joint control. By setting different control parameters α, β, γ, η, the controller can achieve position, speed, and torque mixed control, or separate position, speed, and torque control.
[0059] Step S4: Optimize and solve the NMNPC controller based on a nonlinear optimization solver.
[0060] like Figure 6 As shown, it specifically includes: inputting the expected position, speed, and torque targets, inputting the current and past state into the GRU neural network; using the GRU neural network to predict the system output at future times; and calculating the derivative of the value function with respect to the control input by back propagating through time.
[0061] In the implementation of the present application, the solution of the NMNPC controller is optimized by the IPOPT solver. The optimal control input sequence at the future moment is obtained. The first item obtained by the solution is applied to the system. At the next moment, the future output of the system is re-predicted with the newly obtained measurement value as the initial condition and the optimization problem is solved. The first item of the optimized solution is then applied to the system. The above process is repeated to form the feedback control of the NMNPC. In summary, the control principle block diagram of the NMNPC algorithm in the present invention is as follows: Figure 7 shown.
[0062] Step S5: Setting the NARX neural network model to approximate the solution of the NMNPC controller to form a dual neural network model predictive control method.
[0063] Although IPOPT can effectively solve the optimization problem, the iterative solution process still consumes a lot of computing time and resources. In order to reduce the computational burden and speed up the calculation, an additional neural network is used to directly learn the optimal solution of the NMNPC controller based on the data collected by the NMNPC method.
[0064] The collected data is recorded as , which consists of a time series, the IPOPT solver function is,
[0065] in represents the linear mapping of the IPOPT solver function, and then the NMNPC controller is approximated by the NARX neural network model. The NARX neural network model is,
[0066] in Calculated by GRU neural network model, x d (k) represents the desired target, and the input of the NARX neural network model is , the output of the NARX neural network model is the predicted system control input boundary .
[0067] Data collection process: Based on the NMNPC controller, position, speed and torque hybrid control experiments are designed under different working conditions, and data under the neural network model predictive controller is collected. The data collection process is similar to the collection process in the process. Similarly, the data training process is similar to the training process in step S2.
[0068] In this application, the position and speed references are obtained through the trajectory generator based on the point-to-point instructions, and the joint torque instructions are the gravity torque calculated based on the weight of the load and the position of the connecting rod side. The controller parameters are α=120, β=0.04, γ=0.7, η=0.1. The PD controller is the most commonly used control method in engineering and is quite representative. Therefore, a position-speed-torque hybrid controller based on PD is designed to compare the performance with the dual neural network control prediction method (DNMPC).
[0069] Table 1 Average error of DNMPC and PD controllers Average Error Position (rad) Speed (rad / s) Torque (Nm / rad) DNMPC 0.0047 0.0197 0.159 PD 0.0119 0.046 0.506 The experimental results are as follows Figure 8 - Fig.10 As shown in the figure, it can be seen from the results that the use of the NMNPC control algorithm can well achieve the tracking of position, speed, and torque. Although the controller based on PD can also achieve the tracking of position, speed, and torque, the error is much larger than that of the NMNPC algorithm. The average error is shown in Table 1. From the results in the table, it can be seen that the accuracy of DMNPC is much higher than that of the PD-based method. The experimental results show that the method proposed in the present invention can achieve high-precision position, speed, and torque hybrid control, which verifies the superiority of the invention.
[0070] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any form, and any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A dual neural network model predictive control method for robot flexible joints, characterized in that: The following steps are involved: S1: Model the nonlinear dynamic system of the flexible joint robot and construct a dynamic model; S2: Set the GRU neural network model to approximate the dynamic model of the system; S3: Based on the GRU neural network model, a hybrid control NMNPC controller including position, velocity and torque is constructed; S4: Optimize and solve the NMNPC controller based on the nonlinear optimization solver; S5: Set the NARX neural network model to approximate the solution of the NMNPC controller, thereby forming a dual neural network model predictive control method.
2. The dual neural network model predictive control method for robot flexible joints according to claim 1, characterized in that: In step S1, a dynamic model of the flexible joint robot is established by using the Newton-Euler equation.
3. The dual neural network model predictive control method for robot flexible joints according to claim 2, characterized in that: The kinetic model is shown below: , in, q∈R 6 , θ∈R 6 Represent the joint angle position vectors on the connecting rod side and the motor side respectively, M(q)∈R 6 and I(θ) ∈R 6 is the symmetric positive definite inertia matrix of the connecting rod side and the motor side, , and are the Coriolis force matrix, the connecting rod side damping vector and the motor side damping vector, respectively. G(q)∈R 6 , and denote the gravity torque vector, external force torque vector and motor torque vector respectively, = K(q- θ)∈R 6 represents the joint torque vector, K∈R 6*6 A positive definite diagonal matrix representing the stiffness of the elastic body.
4. The dual neural network model predictive control method for robot flexible joints according to claim 1, characterized in that: In step S2, the GRU neural network model is: , X(K)=[x(k),x(k-1),...,x(kd x +1)] T , U(K)=[u(k),u(k-1),...,u(kd u +1)] , in, X(K) Indicates the system status from kd x +1 Time has come k The value of the moment, U(k) For the system from kd u +1 Time has come k The control input at the moment, d x and d u Respectively represent the maximum order of the output and input delay of the network, x1=q, , x3=θ, , X5=I m ,u=U vol ,x=[x1,x2,x3,x4,x5] T represents the system state vector, and u represents the control input of the system.
5. The dual neural network model predictive control method for robot flexible joints according to claim 4, characterized in that: After step S2, the method further comprises: Develop a sampling method for neural network data sets and collect data to train the GRU neural network model.
6. The dual neural network model predictive control method for robot flexible joints according to claim 5, characterized in that: The sampling method of the neural network data set is formulated, and the specific method of collecting data to train the GRU neural network model is as follows: First, generate a random control variable u∈ (u min ,u max ) , and applies it to the flexible joint system, and the duration of each control input is a random value t∈ (t min ,t max ) ,The system output is collected at fixed time intervals, and the output data includes position, speed and torque to meet the needs of position, speed and torque control. Then, it is determined whether the preset maximum number of collections has been reached; if not, random control inputs will continue to be generated; If it is reached, the data set is saved in time series, which contains time, control input and system output information, and the data collection process ends; In the training of the GRU neural network model, the mean square error is selected as the loss function, and the Adam optimization algorithm is used to update the network weights.
7. The dual neural network model predictive control method for robot flexible joints according to claim 6, characterized in that: The time range of t is set between 20 milliseconds and 2 seconds.
8. The dual neural network model predictive control method for robot flexible joints according to claim 4, characterized in that: In step S3, the cost function of the joint controller is: , Constrained by: , , , In the formula represents the optimal control input sequence for optimization solution, Indicates from k+1 arrive k+T The state prediction sequence at the moment, U k+1:k+T =[u0,u1,...,u T-1 ]express k+1 arrive k+T The system control input sequence to be optimized at any time, x min and x max Respectively represent the maximum and minimum values of the system control input constraints, T To predict the time domain length; According to the goal of joint position, velocity and torque hybrid control, the cost function of the NMNPC controller is set as follows: , In the formula Indicated in k+i The predicted joint positions at each moment, is the corresponding position reference signal, For k+i The predicted joint velocity at each moment, is the corresponding speed reference signal, For k+i The joint torque predicted at each moment can be obtained by Calculated, is the corresponding torque reference signal, and the parameters α>0, β>0, γ>0, η>0 represent the position error, velocity error, torque error, and penalty parameters of the control input, respectively.
9. The dual neural network model predictive control method for robot flexible joints according to claim 4, characterized in that: In step S4, the solution of the NMNPC controller is optimized by the IPOPT solver.
10. The dual neural network model predictive control method for robot flexible joints according to claim 9, characterized in that: In step S5, based on the data collected by the NMNPC method, the NARX neural network model is used to directly learn the optimal solution of the NMNPC controller. The collected data is recorded as , which consists of a time series, the IPOPT solver function is, , in represents the linear mapping of the IPOPT solver function, and then the NMNPC controller is approximated by the NARX neural network model. The NARX neural network model is, , in Calculated by GRU neural network model, x d (k) represents the desired target, and the input of the NARX neural network model is , the output of the NARX neural network model is the predicted system control input boundary .
Citation Information
Patent Citations
Neural network model prediction control method for series elastic actuator of robot
CN113255208A
Intelligent air pressure monitoring and air tightness detection method and system
CN116465569A
Intelligent fire monitoring and fire-fighting device remote monitoring method and system
CN116524426A
Flexible mechanical arm controller design method and system based on neural network
CN117921738A
Method for predicting wind speed based on complex-valued forward neural network
WO2022247049A1
Cited By
Robot flexible joint predictive control method based on double neural network models
CN120269584A
Predictive control method for robot flexible joints based on dual neural network model
CN120269584B
Intelligent automobile path tracking control method based on dual-network iterative optimization
CN120686638A
Intelligent vehicle path tracking control method based on double network iterative optimization
CN120686638B