Four-rotor unmanned aerial vehicle active-disturbance-rejection control method based on DDPG
Through the active disturbance rejection control algorithm based on DDPG, combined with the deep deterministic strategy gradient algorithm and the linear active disturbance rejection control system, the stability and robustness problems of the quad-rotor UAV in the complex flight environment are solved, and high precision is achieved. Improved tracking and anti-interference performance.
Patent Information
- Application Number
- CN202410766454.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-18
AI Technical Summary
It is difficult to design a controller with high tracking accuracy and strong robustness with the existing technology to cope with the complex flight environment and system characteristics of quad-rotor UAVs, especially when faced with physical effects such as air resistance, self-gravity and gyroscopic effects. Maintain a steady flight.
Adopting an active disturbance rejection control algorithm based on DDPG, by establishing a mathematical model of a quad-rotor UAV, a linear active disturbance rejection control system is designed, and combined with the Deep Deterministic Policy Gradient Algorithm (DDPG), a suitable reward function and Actor-Critic are designed The network architecture optimizes the control parameters of the PD link and uses two experience pools to improve data utilization and training effects.
The tracking performance, anti-interference and robustness of the quad-rotor UAV are improved, allowing the UAV to approach the desired trajectory faster and enhancing the dynamic performance and stability of the system.
Smart Images

Figure CN118795918A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of reinforcement learning and anti-disturbance control, and in particular to a DDPG-based anti-disturbance control method for a quad-rotor unmanned aerial vehicle. Background Art
[0002] Unmanned aerial vehicle (UAV) refers to an unmanned aerial vehicle that uses radio remote control or autonomous control to fly. In recent years, with the rapid growth of microelectronics technology, the successful development of new materials, and the development of microprocessor and energy storage technology, the research on small UAVs has been promoted. Therefore, a large number of aircraft are widely used in various fields such as military, communication relay, reconnaissance, monitoring, express delivery, navigation, disaster relief, aerial photography, etc. Since aircraft have a wide range of application markets in aviation warfare and daily life, the research on aircraft has also become a focus of research at home and abroad.
[0003] In recent years, more and more researchers have paid attention to the quadcopter among multi-rotor aircraft. At present, most of the quadcopter aircraft are small, mainly composed of four rotors and a cross-shaped symmetrical fuselage. The design of the symmetrical rigid body makes it easy to establish the dynamic model, and the model is accurate and simplified. The quadcopter aircraft is provided with lift by four rotors, each of which is controlled by a motor to achieve six directions of movement, so the quadcopter aircraft is an under-actuated rotor helicopter. The system realizes the movement of the aircraft by controlling the rotation speed of the rotor. The movement includes: vertical take-off and landing, fixed-point hovering, forward and backward, while pitch, roll, and yaw are achieved by coordinating the rotation speed of the four motors so that the resultant force between the rotors forms a torque in the corresponding direction of movement. Similarly, when each rotor rotates, a counter-torque will be generated. Because the quadcopter is symmetrical, the quadcopter aircraft can balance the counter-torque caused by the rotor by rotating the rotor in different ways.
[0004] Achieving stable flight of a quadcopter is a prerequisite for it to complete its designated mission. However, due to the small size and light weight of the quadcopter, it is easily affected by physical effects such as air resistance, its own gravity and gyroscopic effect during actual flight. In addition, the quadcopter system is a typical under-actuated system. The four motors on the frame drive each propeller to rotate at high speed, and the difference in the speeds of the four propellers is used to achieve the change of flight altitude and flight attitude. At the same time, the quadcopter system has control characteristics such as strong coupling and nonlinearity, and there are multiple uncertainties in the dynamic model. In the face of complex flight environments, the most basic requirement for the quadcopter is to maintain stable flight.
[0005] Traditional control methods often use PID control strategies, which are widely used in industrial production. With the continuous updating and development of control methods, people gradually turn their attention to sliding mode control theory. Sliding mode control theory is very targeted at problems such as inaccurate models or unknown parameters in the model, and its essence is nonlinear control. The difference between this control method theory and other control theories is that as long as the switching function and variable structure control law are properly designed, the system can be forced to perform sliding mode motion according to the expected trajectory, and compared with other control methods, sliding mode control theory has the characteristics of small overshoot and fast tracking speed.
[0006] How to design a controller with high tracking accuracy and strong robustness based on the system characteristics of quadrotor drones has always been a research difficulty and one of the urgent problems to be solved in the process of quadrotor drones moving towards widespread application.
[0007] Therefore, we propose a DDPG-based active disturbance rejection control algorithm to solve the above problems. Summary of the invention
[0008] 1. Technical issues to be resolved
[0009] In view of the shortcomings of the prior art, the present invention provides a DDPG-based self-disturbance rejection control algorithm for a quad-rotor UAV, which solves the problems raised in the above background technology.
[0010] (II) Technical solution
[0011] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions:
[0012] A DDPG-based self-disturbance rejection control method for a quad-rotor unmanned aerial vehicle comprises the following steps.
[0013] Step 1: Establish a mathematical model of the quadrotor drone;
[0014] Step 2: Design a linear active disturbance rejection control system based on the established mathematical model;
[0015] Step 3: Establish the DDPG algorithm framework, design a suitable reward function, experience pool, Actor-Critic network architecture, etc.
[0016] Step 4: Combine the designed DDPG algorithm with the linear anti-disturbance control system to realize the attitude control of the quadrotor UAV.
[0017] Furthermore, in the step one, the specific flight principle of the quadrotor drone is first analyzed; secondly, the mathematical model of the quadrotor drone is obtained by using coordinate definition, rotation matrix, Euler dynamics and center of mass motion theorem.
[0018] Furthermore, in the step 2, the PD link plays the role of regulating the controller output in the LADRC, and the controller can be adjusted according to the size and change rate of the system error, thereby improving the system's anti-interference ability and dynamic performance; by using a linear extended state observer to estimate the state variables of the quadrotor UAV in real time, an estimated value of the state variable is obtained; and the total disturbance of the quadrotor UAV is compensated by the linear extended state observer.
[0019] Furthermore, in step 3, the observation space, action space and agent-related parameters of the DDPG algorithm are defined, and a suitable Actor-Critic network architecture, reward function, etc. are designed. The reward function is a key element in reinforcement learning. It supervises the agent learning and obtains the optimal strategy. The design is as follows:
[0020] R1=-|error|
[0021]
[0022] Furthermore, based on the original DDPG algorithm, the experience pool part is improved, and two experience pools are designed, one of which performs normal random sampling to ensure the randomness of the data and prevent falling into the local optimal solution. The other uses the method of priority experience sampling. In addition, the corresponding weight values of the two experience pools are set to increase the utilization rate of data samples and improve the training and learning effect.
[0023] Furthermore, in the step 4, in the process of adjusting the parameters of the linear anti-disturbance control controller, it is difficult to adjust the control parameters of the PD link, which may cause tracking errors and lead to unstable system output. Therefore, the DDPG algorithm is introduced to control the control parameters of the PD control link.
[0024] (III) Beneficial effects
[0025] Compared with the prior art, the present invention provides a DDPG-based self-disturbance rejection control method for a quad-rotor UAV, which has the following beneficial effects:
[0026] The present invention designs an anti-disturbance controller for a quad-rotor UAV based on DDPG and proposes a suitable reward function in the DDPG algorithm, so that the UAV can approach the desired trajectory as quickly as possible, thereby improving the tracking performance, anti-interference, robustness and other performances of the quad-rotor UAV system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a schematic diagram of the structure of the UAV flight controller system based on LADRC of the present invention;
[0028] Figure 2 It is a structural schematic diagram of the active disturbance rejection controller based on DDPG of the present invention;
[0029] Figure 3 Schematic diagram of the DDPG algorithm structure of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] Example
[0032] like Figure 1 , 2 As shown, an embodiment of the present invention proposes a DDPG-based self-disturbance rejection control method for a quad-rotor drone, comprising the following steps:
[0033] Step 1: According to the system structure of the quadcopter, assume that the Euler angles of the x, y, and z axes of the body coordinate system rotated to the ground coordinate system are And the spatial rotation changes in the order of X-axis, Y-axis and Z-axis respectively. Among them, φ is the roll angle, that is, the angle of rotation around its own X-axis; θ is the pitch angle, that is, the angle of rotation around its own Y-axis; is the yaw angle, that is, the angle of rotation around its own Z axis. According to the flight principle of the quad-rotor drone, the coordinate definition and the rotation matrix, the mathematical model of the quad-rotor drone is obtained:
[0034]
[0035] Among them, I x , I y , I z They are the moments of inertia of the x-axis, y-axis and z-axis respectively, U1 represents the resultant force exerted on the body by the rotor. U2, U3 and U4 represent the rotor lift exerted on the body when the quadrotor performs roll, pitch and yaw motions respectively.
[0036] Step 2: Based on the established system model, design a linear active disturbance rejection control system; take the pitch angle channel as an example. For the second-order nonlinear system, considering the internal and external disturbances of the system, the state equation of the controlled object is:
[0037]
[0038] The control quantity amplification factor b is estimated to be b0, and the estimation error ε=b-b0 is also included in the total disturbance of the system, which is:
[0039]
[0040] With x3=f, let Then we have:
[0041]
[0042] make
[0043] Create an extended state observer:
[0044]
[0045] u c =[uy] T
[0046] Among them, y c is the output, z is the state vector of the observer, and L is the observer error feedback gain matrix.
[0047] L=[l1 l2 l3] T
[0048] because:
[0049] λ=|SI-(A-LC)|=s 3 +l1s 2 +l2s+l3=(s+ω0) 3
[0050] get:
[0051]
[0052] Therefore, the linear state observer is:
[0053]
[0054] Linear error feedback control can achieve system stability by measuring the error between the system output and the desired output and using this error as a feedback signal to adjust the control input:
[0055] u0=K p (v1-z1)·+K d (v2-z2)
[0056] Step 3: Establish a deep reinforcement learning framework based on the Deep Deterministic Policy Gradient (DDPG) algorithm. DDPG is a deep deterministic policy gradient algorithm used to solve reinforcement learning problems in continuous action spaces.
[0057] DDPG consists of four neural networks. The Actor current network is based on the state of the agent t To select the current action a t, and the Critic current network is based on the current state s t The Q value is calculated based on the current action, and the Q value is used to evaluate the quality of the action. Similarly, the calculation process of the Actor target network and the Critic target network is the same, the difference is that the time to update the network parameters is different. The parameters of the Actor target network and the Critic target network are updated at intervals, while the Actor current network and the Critic current network are updated in real time.
[0058] The following is the detailed process of the DDPG algorithm:
[0059] First, initialize the Actor network parameters θ and the Critic network parameters φ. Initialize the target network parameters θ' and φ' to be the same as the corresponding Actor and Critic networks. The network parameters of the Actor's current network are θ μ , the input of its neural network is the current state s of the agent, and the action is selected through a deterministic policy function, as shown in the following formula.
[0060] a=μ(s,θ μ )
[0061] In addition, DDPG generally adds random noise after the deterministic strategy, turning the determined action selection into a random process, and samples the actions after adding the random noise N as the output of the agent, which constitutes an exploration strategy.
[0062] Secondly, define the experience replay buffer D to store historical experience; define the soft update parameter τ (used to update the target network parameters) and the learning rate α of the target policy network.
[0063] Secondly, the Actor network, which takes in state s and outputs action a, is represented by a neural network with parameters θ. The goal of the Actor network is to learn a deterministic policy π(s|θ) to maximize the cumulative reward. The Critic network receives state s and action a as input and outputs an action-value function Q(s,a).
[0064] The goal of the Critic network is to learn an action value function to evaluate the quality of the action selected by the Actor. After performing an action in the environment and selecting an action a according to the current policy π(s|θ), the reward value r is obtained. t and the next state s t+1 , will (s t ,a t ,r t ,s t+1) is inserted into the experience playback buffer as sample data, and two experience pools are designed. One of them performs normal random sampling to ensure the randomness of the data and prevent it from falling into the local optimal solution. The other is sorted according to the size of TD-error. The data with larger TD-error has better learning value and accelerates convergence, that is, experience sampling is prioritized. In addition, the corresponding weight values of the two experience pools are set, and the weight setting of random sampling is gradually increased as the training progresses and the network converges. Increase the utilization rate of data samples and improve the training and learning effect. Use sample data to train the Actor current network, the Actor target network, the Critic current network, and the Critic target network. The parameter used in the Critic current network is θ Q The Q value is calculated by iteration, which is generally expressed by the Bellman equation. The expression is as follows.
[0065] Q μ (s i ,a i )=E(r i +γQ μ (s i+1 ,μ(s i+1 )))
[0066] Here, γ is the discount factor.
[0067] After knowing the values of the Actor's current network and the Critic's current network, the DDPG algorithm updates the parameters of the Actor's current network and the Critic's current network through the Actor's target network and the Critic's target network. If the Critic's current network is to be optimal, its loss function should be as small as possible. Train the Critic's current network to find the parameter θ Q To make the loss function as small as possible, gradient descent is used here to update the parameters, and its expression is as follows:
[0068]
[0069] y in the formula i It is calculated by the Critic target network and the Actor target network, and its expression is as follows:
[0070] y i =r i +γQ'(s i+1 ,μ'(s i+1 ,|θ μ′ )|θ Q′ )#
[0071] The above expression can be used to get the gradient of the Critic's current network, and the gradient descent method can be used to adjust the parameters θ of the Critic's current network. Q Make optimizations.
[0072] In the optimization process of the above network parameters, the Actor target network and the Critic target network are used. Different from the parameter update process of the previous reinforcement learning algorithm, the parameter update of the neural network mentioned above adopts an update method called "soft". This update method copies the parameters of the Actor current network and the Critic current network to the corresponding target network at a certain number of steps, so that the parameters of the target network are updated slowly, which makes the label value calculated in a short time remain relatively stable. To a certain extent, it alleviates the problem of oscillation of the algorithm during the convergence process and ensures the stability of the neural network during the training process. The parameter of the Actor target network is θ μ' , and its update process is as follows:
[0073] θ μ =τθ μ +(1-τ)θ μ
[0074] The parameter of the Critic target network is θ Q' , and its update process is as follows:
[0075] θ Q =τθ μ +(1-τ)θ Q
[0076] Repeat the above process until the stopping condition is reached (such as reaching the maximum number of iterations or target performance). In general, the DDPG algorithm learns strategies in a continuous action space through the Actor-Critic architecture, and improves the stability and convergence of the algorithm through experience replay and target network.
[0077] The agent continuously makes autonomous decisions through trial and error and exploration, and judges the quality of the model through the value of the reward function. In drone control, the reward function may take into account the distance between the actual flight angle and the target angle. At the same time, the reward function should be easy to calculate and can be implemented in the actual environment. Therefore, the reward function is designed as:
[0078] R1=-|error|
[0079]
[0080] Among them, δ is a minimum value.
[0081] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. 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 DDPG-based self-disturbance rejection control method for a quadrotor drone, characterized in that: The following steps are involved: Step 1: Establish a mathematical model of the quadrotor drone; Step 2: Design a linear active disturbance rejection control system based on the established mathematical model; Step 3: Establish the DDPG algorithm framework, design a suitable reward function, experience pool, Actor-Critic network architecture, etc. Step 4: Combine the designed DDPG algorithm with the linear anti-disturbance control system to realize the attitude control of the quadrotor UAV.
2. The DDPG-based self-disturbance rejection control method for a quadrotor drone according to claim 1, characterized in that: In step 1, the mathematical model of the quadrotor drone is: represents the roll angle, i.e. the rotation angle of the quadrotor around the x-axis; θ represents the pitch angle, i.e. the rotation angle of the quadrotor around the y-axis; ψ represents the yaw angle, i.e. the rotation angle of the quadrotor around the z-axis; I x , I y , I z They are the moments of inertia of the x-axis, y-axis and z-axis respectively. U1 represents the resultant force exerted on the body by the rotor; U2, U3 and U4 are the rotor lift exerted on the body when the quadrotor performs roll, pitch and yaw motions respectively.
3. The DDPG-based self-disturbance rejection control method for a quadrotor drone according to claim 1, characterized in that: In the step 2, take the pitch angle channel as an example; for the second-order nonlinear system, considering the internal and external disturbances of the system, the state equation of the controlled object is: The linear extended state observer is designed as: The linear error feedback control law (LESF), i.e., the control quantity output form of PD control, is: u0=k p (y−z1)+k d z2。 4. The DDPG-based self-disturbance rejection control method for a quad-rotor unmanned aerial vehicle according to claim 1, characterized in that: In step 3, DDPG consists of four neural networks; the Actor current network is based on the state s of the agent. t To select the current action a t , and the Critic current network is based on the current state s t The Q value is calculated based on the current action, and the Q value is used to evaluate the quality of the action. Similarly, the calculation process of the Actor target network and the Critic target network is the same. The difference is that the time of updating the network parameters is different. The parameters of the Actor target network and the Critic target network are updated at intervals, while the Actor current network and the Critic current network are updated in real time. The network parameters of the Actor's current network are θ μ , the input of its neural network is the current state s of the agent t , the action is selected through the deterministic strategy function, as shown in the following formula; a=μ(s,|θ μ ) In addition, DDPG generally adds random noise after the deterministic strategy, turning the determined action selection into a random process, and samples the actions after adding the random noise N as the output of the agent, which constitutes an exploration strategy; After the agent uses the above Actor's current network output action, it obtains the reward value r t and the next state s t+1 , will (s t , a t , r t ,s t+1 ) is inserted into the experience pool as sample data, and two experience pools are designed. One of them performs normal random sampling to ensure the randomness of the data and prevent it from falling into the local optimal solution; the other is sorted according to the size of TD-error. The data with larger TD-error has better learning value and accelerates convergence, that is, experience sampling is given priority; in addition, the corresponding weight values of the two experience pools are set, and the weight setting of random sampling is gradually increased as the training progresses and the network converges; the utilization rate of data samples is increased, and the training and learning effect is increased; the sample data is used to train the Actor current network, the Actor target network, the Critic current network and the Critic target network; The parameter used in the current Critic network is θ Q , the Q value is calculated by iteration, generally expressed by Bellman equation, as shown below; Q μ (s i ,a i )=E(r i +γQ μ (s i+1 ,μ(s i+1 ))) After knowing the values of the Actor's current network and the Critic's current network, the DDPG algorithm updates the parameters of the Actor's current network and the Critic's current network through the Actor's target network and the Critic's target network; if the Critic's current network is to be optimal, its loss function should be as small as possible, and the Critic's current network is trained to find the parameter θ Q To make the loss function as small as possible, gradient descent is used here to update the parameters, and its expression is as follows: y in the formula i It is calculated by the Critic target network and the Actor target network, and its expression is as follows: The above expression can be used to get the gradient of the Critic's current network, and the gradient descent method can be used to adjust the parameters θ of the Critic's current network. Q Optimize In the optimization process of the above network parameters, the Actor target network and the Critic target network are used. Different from the parameter update process of the previous reinforcement learning algorithm, the parameter update of the neural network mentioned above adopts a "soft" update method; this update method copies the parameters of the Actor current network and the Critic current network to the corresponding target network at a certain number of steps, so that the parameters of the target network are updated slowly, which makes the label value calculated in a short time relatively stable; to a certain extent, it alleviates the problem of oscillation in the algorithm during convergence and ensures the stability of the neural network during training; the parameter of the Actor target network is θ μ′ , and its update process is as follows: i μ =tθ μ +(1-τ)θ μ The parameter of the Critic target network is θ Q′ , and its update process is as follows: i Q =tθ μ +(1-τ)θ Q 。 5. The DDPG-based self-disturbance rejection control method for a quadrotor drone according to claim 1, characterized in that: In the step 4, in the process of adjusting the parameters of the linear active disturbance rejection controller, it is difficult to adjust the control parameters of the PD link, which will produce tracking errors and lead to unstable system output. Therefore, the DDPG algorithm is introduced to adjust the control parameters of the PD control link.
Citation Information
Cited By
High-altitude operation six-degree-of-freedom mechanical arm and self-adaptive anti-interference control method and system thereof
CN120287301A
Four-rotor unmanned aerial vehicle attitude preset performance control method based on reinforcement learning
CN120821291A
A quadrotor unmanned aerial vehicle attitude preset performance control method based on reinforcement learning
CN120821291B
