A trajectory tracking control method for unmanned boat based on reinforcement learning MPC
By applying the reinforcement learning MPC method on the unmanned boat and using the DDPG algorithm to design an intelligent controller, the problem of difficult trajectory tracking of the unmanned boat in complex sea conditions is solved, the anti-interference and autonomy are improved, and the tracking error is reduced.
Patent Information
- Application Number
- CN202210477463.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-04
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-05-04
AI Technical Summary
It is difficult for unmanned boats to effectively track their trajectories in complex sea conditions, and they are especially prone to collisions when encountering obstacles. Existing control algorithms have deficiencies in anti-interference and autonomy.
The model predictive control (MPC) method based on reinforcement learning is adopted, and the intelligent controller is designed through the deep deterministic policy gradient (DDPG) algorithm. The kinematics and control response model of the unmanned boat are used to construct a performance index function to solve the optimal trajectory tracking. Optimal control sequence.
It improves the robustness and anti-interference ability of trajectory tracking control, has self-learning ability, and can adapt to complex sea conditions. Compared with the traditional MPC control algorithm, it is more autonomous and real-time, and has smaller tracking errors.
Smart Images

Figure CN114879671B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of trajectory tracking control of surface unmanned boats, and in particular relates to a trajectory tracking control method of an unmanned boat based on reinforcement learning MPC. Background Art
[0002] An unmanned surface vehicle (USV) is an unmanned surface vessel with strong autonomy and high intelligence. It has a wide range of uses in the military and civilian fields. How to ensure that the unmanned vehicle can safely and autonomously navigate on the sea is an important topic in the field of unmanned vehicle research. In actual applications, unmanned vehicles mostly work in complex sea conditions. In addition to being disturbed by the marine environment such as wind, waves and currents, unmanned boats often encounter obstacles such as islands, reefs, ships, and buoys during navigation. These obstacles are divided into static obstacles and moving obstacles, which will create the risk of collision of unmanned boats during navigation. Therefore, before the unmanned boat sails, path planning is generally carried out to plan a safe and shortest track for the unmanned boat, so that the unmanned boat can sail autonomously along the preset track.
[0003] Unmanned boats mostly sail in complex marine environments and are easily affected by wind, waves, and currents. In addition, most unmanned boats are under-actuated systems with high nonlinearity, which makes the trajectory tracking control of unmanned boats extremely complicated. From the current development status at home and abroad, unmanned boat trajectory tracking control generally adopts sliding mode control, backstepping method, neural network PID, fuzzy PID, self-disturbance rejection control and other methods. With the development and progress of artificial intelligence, researchers pay more and more attention to integrating intelligent algorithms such as deep learning, reinforcement learning, neural networks, and swarm intelligence algorithms into the design of trajectory tracking controllers to make up for the defects of current control algorithms. Summary of the invention
[0004] The purpose of the present invention is to provide an unmanned boat trajectory tracking control method based on reinforcement learning MPC.
[0005] A trajectory tracking control method for an unmanned boat based on reinforcement learning MPC includes the following steps:
[0006] Step 1: Obtain the real-time status information (x, y, ψ, r) of the unmanned boat, including the position coordinates (x, y), real-time heading angle ψ, and bow angular velocity r of the unmanned boat;
[0007] Step 2: Track point P according to the current trajectory k+1 (x k+1 ,y k+1 ) and the last track tracking point is P k (x k ,y k ), using the LOS guidance algorithm to calculate the real-time expected heading angle ψ of the unmanned boat d ;
[0008] Step 3: Establish a horizontal plane mathematical model for unmanned boat trajectory tracking and design a DDPG-MPC intelligent controller for unmanned boat trajectory tracking;
[0009] The unmanned boat sails at a constant speed U, and the trajectory tracking mathematical model is:
[0010]
[0011] Among them, T represents the rapid response and heading stability of the unmanned boat to the rudder; K is the gain coefficient; α is the nonlinear coefficient; δ is the steering angle;
[0012] In controller design, the state variable χ=(x,y,ψ,r), the output Y=(x,y,ψ), and the control variable u=δ;
[0013] The prediction model of the unmanned boat trajectory tracking nonlinear system under discrete conditions is expressed as:
[0014] χ(k+1)=f(χ(k),u(k),w(k))
[0015] Where w(k) is the system disturbance; f(·) is the nonlinear function of the system;
[0016] Considering that the predicted value of the state variable χ at time k for time k+i can be expressed as χ(k+i|k), the corresponding system output value is Y(k+i|k)=Cχ(k+i|k), and the input system reference trajectory at time k+i is Y ref (k+i|k), the control quantity acting on the system δ(k+i|k);
[0017] Consider that starting from time k, the prediction model predicts the state sequence χ(k), output sequence Y(k), control sequence u(k) and trajectory reference sequence Y for the next N moments ref (k) is expressed as:
[0018] χ(k)=(χ(k+1|k),...,χ(k+N|k)) T
[0019] Y(k)=(Y(k+1|k),...,Y(k+N|k)) T
[0020] u(k)=(u(k|k),...,u(k+N-1|k)) T
[0021] Y ref (k)=(Y ref (k+1|k),......,Y ref (k+N|k)) T
[0022] Based on the above, the performance index of unmanned boat trajectory tracking control is established:
[0023]
[0024] Among them, Q, R are the weight matrices of the performance index function;
[0025] Step 4: Use the DDPG algorithm to solve the optimal control sequence in the MPC rolling optimization process. The first control variable of the control sequence acts on the unmanned boat system.
[0026] Furthermore, the step 4 is specifically as follows:
[0027] Step 4.1: Construct the Actor-Critic network of the DDPG algorithm, including four network structures: Actor strategy network μ(a|θ π ), Critic value network Q(s,a|θ Q ), Actor target strategy network μ(a|θ π′ ), Critic target value network Q(s,a|θ Q′ ), the network structures of the current network and the target network are consistent;
[0028] Step 4.2: Initialize network model parameters θ π ,θ Q , the parameters of the current network are copied to the target network;
[0029] θ π′ ←θ π ,θ Q′ ←θ Q
[0030] Step 4.3: Select the state sequence χ(k) of the unmanned boat as the state s of the DDPG algorithm t , control sequence u(k) as the action a to be executed t ; Select the negative number of the performance index function of the unmanned boat trajectory tracking control as the reward return of the DDPG algorithm;
[0031]
[0032] Step 4.4: Initialize the state of the unmanned boat, according to the current state of the unmanned boat s t , the policy network is based on the current policy μ(a|θ π ) gives the state s t The execution action a t , while the value network gives the state s t Next, perform action a tThe value of Q(s,a|θ Q ), the first action of the action sequence, i.e., the first control quantity of the control sequence, is applied to the unmanned boat system to make it interact with the environment, and the state s at the next moment is obtained. t+1 And get timely rewards t , the data samples (s t ,a t ,r t ,s t+1 ) are stored in the experience pool for training the strategy network and the value network;
[0033] Step 4.5: Randomly select M data samples (s i ,a i ,r i ,s i+1 ), for the training of the value network, construct the loss function of the value network training:
[0034]
[0035] For the training of the policy network, the policy gradient algorithm is used to update the parameters of the training policy network and calculate the policy gradient of the policy network:
[0036]
[0037] For the target network, the soft update method is used to update its parameters:
[0038] θ Q′ =τθ Q +(1-τ)θ Q′
[0039] θ π′ =τθ π +(1-τ)θ π′
[0040] Step 4.6: After multiple iterations of training, the policy network generates the optimal policy The trained policy network is used as the solver for MPC rolling optimization.
[0041] The beneficial effects of the present invention are:
[0042] In the design process of the MPC trajectory tracking controller of the unmanned boat, the present invention selects the kinematic model and the manipulation response model of the unmanned boat as the prediction model, constructs the control performance index function according to the unmanned boat trajectory tracking task requirements, and uses the DDPG algorithm of reinforcement learning to construct the solver of the performance index function in the MPC rolling optimization process. The optimal control sequence of trajectory tracking is solved by minimizing the performance index function, and finally the first control quantity of the control sequence at each moment is applied to the unmanned boat system. The present invention improves the robustness and anti-interference of trajectory tracking control, and at the same time has self-learning ability, adapts to complex sea conditions, and has stronger autonomy and real-time performance than traditional MPC control algorithms, and has smaller tracking errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is the overall flow chart of the present invention.
[0044] Figure 2 Schematic diagram of the LOS guidance algorithm.
[0045] Figure 3 Schematic diagram of the implementation steps of the reinforcement learning DDPG algorithm. DETAILED DESCRIPTION
[0046] The present invention is further described below in conjunction with the accompanying drawings.
[0047] The present invention proposes an unmanned boat trajectory tracking control method based on reinforcement learning MPC to achieve autonomous control of unmanned boat trajectory tracking. In the design process of the MPC trajectory tracking controller of the unmanned boat, the kinematic model and the manipulation response model of the unmanned boat are selected as the prediction model, and the control performance index function is constructed according to the unmanned boat trajectory tracking task requirements. In the MPC rolling optimization process, the DDPG algorithm of reinforcement learning is used to construct a solver of the performance index function, and the optimal control sequence of trajectory tracking is solved by minimizing the performance index function, and finally the first control quantity of the control sequence at each moment is applied to the unmanned boat system. The method proposed by the present invention improves the robustness and anti-interference of trajectory tracking control, and at the same time has self-learning ability and is adaptable to complex sea conditions.
[0048] A method for tracking the trajectory of an unmanned boat based on reinforcement learning MPC, the flow chart is as follows Figure 1 As shown, it mainly includes the following steps:
[0049] Step 1. Monitor the status information of the unmanned boat in real time, obtain the position coordinates (x, y) of the unmanned boat through the GPS navigation and positioning system, use the compass to detect the real-time heading angle ψ of the unmanned boat, and use the gyroscope to detect the bow angular velocity r of the unmanned boat.
[0050] Step 2. Obtain the status information (x, y, ψ, r) of the unmanned boat in real time, and track the current trajectory point Pk+1 (x k+1 ,y k+1 ) and the last track tracking point is P k (x k ,y k ) Use the LOS guidance algorithm to calculate the real-time expected heading angle ψ of the unmanned boat d Detailed steps are as follows Figure 2 As shown:
[0051] The current position (x, y) of the unmanned boat is projected to the desired trajectory as (x d (ω),y d (ω)), where ω is the trajectory parameter. The Serret-Frenet coordinate system is established with this point as the origin, and the tangent direction along the desired trajectory is recorded as x p The angle between the axis and the longitudinal axis of the inertial coordinate system is recorded as the trajectory azimuth angle ψ p , then ψ p =arctan(y d ′(ω) / x d ′(ω)). Among them, ψ p ∈[-π,π],y d ′(ω)=dy d (ω) / dω,x d ′(ω)=dx d (ω) / dω.
[0052] The trajectory parameter update rate is: The speed of the unmanned boat.
[0053] Expected heading point (x LOS ,y LOS ) and the projection point of the current position of the unmanned boat on the expected trajectory is recorded as Δ, called the foresight distance, Δ = nL, n = 2 ~ 10, L is the length of the unmanned boat. LOS ,y LOS ) is the azimuth angle relative to the current position of the unmanned boat, which is the real-time expected heading angle of the unmanned boat ψ d .
[0054] ψ d =ψ p +arctan(-y e / Δ)
[0055] Step 3: Establish a horizontal plane mathematical model for unmanned boat trajectory tracking, and use the model predictive control method (MPC) combined with the deep deterministic policy gradient (DDPG) algorithm of reinforcement learning to design the DDPG-MPC intelligent controller for unmanned boat trajectory tracking.
[0056] The first-order nonlinear maneuvering response model of the unmanned boat is:
[0057]
[0058] T represents the rapid response and heading stability of the unmanned boat to the rudder; K is the gain coefficient; α is the nonlinear coefficient; r is the bow angular velocity; δ is the steering angle.
[0059] Thus, the unmanned boat trajectory tracking model is obtained:
[0060]
[0061] Considering that the longitudinal speed of the unmanned boat is much greater than the lateral speed u>>v in actual navigation, the lateral speed v≈0, and the unmanned boat sails at a constant speed U, the above mathematical model can be simplified as:
[0062]
[0063] Set the sampling time T s After discretization, the prediction model of unmanned boat trajectory tracking is obtained:
[0064]
[0065] The prediction model can infer the position x(k+1), y(k+1), heading angle ψ(k+1), and angular velocity r(k+1) at the next moment through the current position x(k), y(k), heading angle ψ(k), angular velocity r(k) and steering angle δ(k).
[0066] Where w(k) is the disturbance variable of the system.
[0067] In controller design, the state variable χ=(x,y,ψ,r), the output Y=(x,y,ψ), and the control variable u=δ.
[0068] The prediction model of the unmanned boat trajectory tracking nonlinear system under discrete conditions can be expressed as:
[0069] χ(k+1)=f(χ(k),u(k),w(k))
[0070] Considering that the predicted value of the state variable χ at time k for time k+i can be expressed as χ(k+i|k), the corresponding system output value is Y(k+i|k)=Cχ(k+i|k), and the input system reference trajectory at time k+i is Y ref (k+i|k), the control quantity δ(k+i|k) acting on the system.
[0071] Consider that starting from time k, the prediction model predicts the state sequence χ(k), output sequence Y(k), control sequence u(k) and trajectory reference sequence Y for the next N time periods. ref (k) can be expressed as:
[0072] χ(k)=(χ(k+1|k),...,χ(k+N|k)) T
[0073] Y(k)=(Y(k+1|k),...,Y(k+N|k)) T
[0074] u(k)=(u(k|k),...,u(k+N-1|k)) T
[0075] Y ref (k)=(Y ref (k+1|k),......,Y ref (k+N|k)) T
[0076] Based on the above, the performance index of unmanned boat trajectory tracking control can be established:
[0077]
[0078] Where Q, R is the weight matrix of the performance index function.
[0079] Step 4. Figure 3 As shown in the figure, the deep deterministic policy gradient (DDPG) algorithm of reinforcement learning is used to solve the optimal control sequence in the MPC rolling optimization process, and the first control quantity of the control sequence acts on the unmanned boat system.
[0080] (1) Construct the Actor-Critic network of the DDPG algorithm, including four network structures, the Actor strategy network μ(a|θ π ), Critic value network Q(s,a|θ Q ), Actor target policy network μ(a|θ π′ ), Critic target value network Q(s,a|θ Q′ ). The network structures of the current network and the target network are consistent.
[0081] (2) Initialize network model parameters θ π ,θ Q , the parameters of the current network are copied to the target network
[0082] θ π′ ←θ π ,θ Q′ ←θ Q .
[0083] (3) Select the state sequence χ(k) of the unmanned boat at a certain time as the state s of the DDPG algorithm t, control sequence u(k) as the action a to be executed t .
[0084] (4) Select the negative of the performance index function of the unmanned boat trajectory tracking control as the reward return of the DDPG algorithm:
[0085]
[0086] (5) Initialize the state of the unmanned boat, according to the current state of the unmanned boat s t , the policy network is based on the current policy μ(a|θ π ) gives the state s t The execution action a t , while the value network gives the state s t Next, perform action a t The value of Q(s,a|θ Q ), the first action of the action sequence, i.e., the first control quantity of the control sequence, is applied to the unmanned boat system to make it interact with the environment, and the state s at the next moment is obtained. t+1 And get timely rewards t , the data samples (s t ,a t ,r t ,s t+1 ) are stored in the experience pool for training the strategy network and the value network.
[0087] (6) Randomly select M data samples (s i ,a i ,r i ,s i+1 ), for the training of the value network, construct the loss function of the value network training:
[0088]
[0089] For the training of the policy network, the policy gradient algorithm is used to update the parameters of the training policy network and calculate the policy gradient of the policy network:
[0090]
[0091] For the target network, the soft update method is used to update its parameters:
[0092] θ Q′ =τθ Q +(1-τ)θ Q′
[0093] θ π′ =τθ π +(1-τ)θ π′
[0094] (7) After multiple iterations of training, the policy network generates the optimal policy The trained policy network is used as the solver for MPC rolling optimization.
[0095] The unmanned boat trajectory tracking method described in the present invention is applied to the autonomous navigation of the unmanned boat, which effectively improves the anti-interference and robustness in the unmanned boat trajectory tracking process. Compared with the traditional MPC control algorithm, it has stronger autonomy and real-time performance and smaller tracking error.
[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A trajectory tracking control method for an unmanned boat based on reinforcement learning MPC, characterized in that: The steps include: Step 1: Obtain the real-time status information (x, y, ψ, r) of the unmanned boat, including the position coordinates (x, y), real-time heading angle ψ, and bow angular velocity r of the unmanned boat; Step 2: Track point P according to the current trajectory k+1 (x k+1 ,y k+1 ) and the last track tracking point is P k (x k ,y k ), using the LOS guidance algorithm to calculate the real-time expected heading angle ψ of the unmanned boat d ; Step 3: Establish a horizontal plane mathematical model for unmanned boat trajectory tracking and design a DDPG-MPC intelligent controller for unmanned boat trajectory tracking; The unmanned boat sails at a constant speed U, and the trajectory tracking mathematical model is: Among them, T represents the rapid response and heading stability of the unmanned boat to the rudder; K is the gain coefficient; α is the nonlinear coefficient; δ is the steering angle; In controller design, the state variable χ=(x,y,ψ,r), the output Y=(x,y,ψ), and the control variable u=δ; The prediction model of the unmanned boat trajectory tracking nonlinear system under discrete conditions is expressed as: χ(k+1)=f(χ(k),u(k),w(k)) Where w(k) is the system disturbance; f(·) is the nonlinear function of the system; Considering that the predicted value of the state variable χ at time k for time k+i can be expressed as χ(k+i|k), the corresponding system output value is Y(k+i|k)=Cχ(k+i|k), and the input system reference trajectory at time k+i is Y ref (k+i|k), the control quantity acting on the system δ(k+i|k); Consider that starting from time k, the prediction model predicts the state sequence χ(k), output sequence Y(k), control sequence u(k) and trajectory reference sequence Y for the next N time periods. ref (k) is expressed as: x(k)=(x(k+1|k),......,x(k+N|k)) T Y(k)=(Y(k+1|k),......,Y(k+N|k)) T u(k)=(u(k|k),......,u(k+N-1|k)) T AND ref (k)=(Y ref (k+1|k),......,And ref (k+N|k)) T Based on the above, the performance index of unmanned boat trajectory tracking control is established: Among them, Q, R are the weight matrices of the performance index function; Step 4: Use the DDPG algorithm to solve the optimal control sequence in the MPC rolling optimization process. The first control variable of the control sequence acts on the unmanned boat system.
2. The unmanned boat trajectory tracking control method based on reinforcement learning MPC according to claim 1 is characterized in that: The step 4 is specifically as follows: Step 4.1: Construct the Actor-Critic network of the DDPG algorithm, including four network structures: Actor strategy network μ(a|θ π ), Critic value network Q(s,a|θ Q ), Actor target strategy network μ(a|θ π′ ), Critic target value network Q(s,a|θ Q ′), the network structures of the current network and the target network are consistent; Step 4.2: Initialize network model parameters θ π ,θ Q , the parameters of the current network are copied to the target network; i π′ ←θ π ,the Q′ ←θ Q Step 4.3: Select the state sequence χ(k) of the unmanned boat as the state s of the DDPG algorithm t , control sequence u(k) as the action a to be executed t ; Select the negative number of the performance index function of the unmanned boat trajectory tracking control as the reward return of the DDPG algorithm; Step 4.4: Initialize the state of the unmanned boat, according to the current state of the unmanned boat s t , the policy network is based on the current policy μ(a|θ π ) gives the state s t The execution action a t , while the value network gives the state s t Next, perform action a t The value of Q(s,a|θ Q ), the first action of the action sequence, i.e., the first control quantity of the control sequence, is applied to the unmanned boat system to make it interact with the environment, and the state s at the next moment is obtained. t+1 And get timely rewards t , the data samples (s t ,a t ,r t ,s t+1 ) are stored in the experience pool for training the strategy network and the value network; Step 4.5: Randomly select M data samples (s i ,a i ,r i ,s i+1 ), for the training of the value network, construct the loss function of the value network training: For the training of the policy network, the policy gradient algorithm is used to update the parameters of the training policy network and calculate the policy gradient of the policy network: For the target network, the soft update method is used to update its parameters: i Q′ =tθ Q +(1-τ)θ Q′ i π′ =tθ π +(1-τ)θ π′ Step 4.6: After multiple iterations of training, the policy network generates the optimal policy The trained policy network is used as the solver for MPC rolling optimization.
