Safety attraction domain estimation and safety control method based on reinforcement learning

Through the safety attraction domain estimation and safety control method based on reinforcement learning, the problem of stability and safety conflicts in wheeled robot control is solved, and system safety guarantee is achieved without sacrificing stability and does not rely on accurate model knowledge.

CN118655870APending Publication Date: 2024-09-17HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410670846.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

When stability and safety conflict with existing wheeled robot control methods, stability needs to be sacrificed to give priority to safety, and there is a lack of solutions that integrate multidisciplinary technical means.

Method used

The safety attraction domain estimation and safety control method based on reinforcement learning is used to iteratively solve the control strategy to obtain the safe attraction domain and controller by discretizing the kinematic model, designing control obstacle functions and optimization problems, ensuring system security without sacrificing stability. sex.

Benefits of technology

While ensuring system security, the system stability is maintained, and the optimal estimation of the security attraction domain and system security guarantee that do not rely on accurate model knowledge are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118655870A
    Figure CN118655870A
Patent Text Reader

Abstract

The invention discloses a safety attraction domain estimation and safety control method based on reinforcement learning, and belongs to the technical field of safety control. The problem that in an existing wheeled robot control method, when the stability conflicts with the safety, the stability needs to be sacrificed to give priority to the safety is solved. According to the method, a control barrier function and a subset estimation method are introduced, an optimization problem is formulated in a unified framework, reinforcement learning and polynomial summation are introduced to express the optimal safety controller and the control barrier function, the system safety can be guaranteed, and meanwhile, the system reliability is improved. The stability of the system is ensured by using the Lyapunov function, that is, when the stability conflicts with the security, the method does not need to sacrifice the stability to preferentially consider the security. Moreover, the method provided by the invention does not depend on accurate model knowledge. The method can be applied to the technical field of safety control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of safety control, and in particular relates to a safety attraction domain estimation and safety control method based on reinforcement learning. Background Art

[0002] Reinforcement learning technology has been widely used in the fields of robotics and games. This technology can realize the design of intelligent control schemes based entirely on data. As an important branch of machine learning, reinforcement learning has been applied in various fields, including robotics, games, and industrial control. Recognizing that reinforcement learning technology has the potential to solve the challenges posed by increasingly complex control systems, researchers in the control field are actively developing learning-based control algorithms. One of the notable exploration directions is to integrate optimal control technology with reinforcement learning methods. In addition to the traditional emphasis on stability and other performance indicators, safety becomes a critical consideration, even taking precedence over stability issues. This shift reflects the increasing importance of ensuring the safety of controlled systems in various applications (such as safety-critical systems).

[0003] Safety-critical systems usually refer to those systems that have a serious impact on human life, property or the environment, so their safety is of vital importance. These systems may involve critical infrastructure (e.g., energy supply, transportation system), medical equipment, military systems, aerospace technology, financial systems, etc. The controller design of safety-critical systems, such as power systems, self-driving cars, industrial robots, and chemical reactors, needs to meet performance specifications and multiple safety constraints at the same time. Maintaining the stability of the system within a given safety set poses a severe challenge to the controller design task, and violating safety constraints may lead to system failure and harm. Safety control issues involve the response and prevention of control systems when facing various security threats and risks. With the widespread application of control systems in daily life, industrial production, transportation and other fields, safety has become an important concern. In recent years, safety control problems have occurred frequently, posing a great threat to economic development, infrastructure safety, and people's lives and property, making how to ensure the safety of control systems a major issue that needs to be solved urgently.

[0004] Especially for the control of wheeled robots, although the research on control system safety issues has made continuous breakthroughs, the insufficiency of relying solely on single-disciplinary knowledge, such as control, computer science or robotics technology, for control system safety design is becoming increasingly prominent. When stability conflicts with safety, stability needs to be sacrificed to give priority to safety. Therefore, how to integrate multidisciplinary technical means to solve the safety problem of control systems has become an important issue that needs to be solved urgently. Summary of the invention

[0005] The purpose of the present invention is to solve the problem that in the existing wheeled robot control method, when stability and safety conflict, stability needs to be sacrificed to give priority to safety, and a safety attraction domain estimation and safety control method based on reinforcement learning is proposed.

[0006] The technical solution adopted by the present invention to solve the above technical problems is:

[0007] According to one aspect of the present invention, a method for estimating and controlling a safety attraction domain based on reinforcement learning is provided, and the method specifically comprises the following steps:

[0008] Step 1: discretize the kinematic model of the wheeled robot to obtain a linear discrete system model;

[0009] Step 2: Design the control obstacle function h(x k );

[0010] Step 3: Based on the control obstacle function, the optimization problem of the control strategy is designed to be solved, the designed optimization problem is iteratively solved to obtain the control strategy and the safety attraction domain estimation results, and the controller is designed according to the obtained control strategy.

[0011] Furthermore, the specific process of step one is:

[0012] The kinematic model of the wheeled robot is:

[0013]

[0014] Among them, (x, y) represents the position of the robot, represents the first-order derivative of x, represents the first-order derivative of y, θ represents the heading angle of the robot, represents the first-order derivative of θ, v represents the linear velocity of the robot, and ω represents the angular velocity of the robot;

[0015] The kinematic model of the wheeled robot is discretized to obtain a linear discrete system model:

[0016] x k+1 =Ax k +Bu k

[0017] Among them, x k is the system state at time k, that is, x k is composed of the robot's position and heading angle at time k, x k+1 is the system state at time k+1, u k is the system input at time k, the matrix T s represents the sampling interval, v ris the reference linear velocity of the robot, ω r is the reference angular velocity of the robot.

[0018] Furthermore, the control obstacle function h(x k )for:

[0019] h(x k )=Z T (x k )Q z Z(x k )

[0020] Among them, Z(x k )=[1,x 1,k ,x 2,k ,x 3,k ], x 1,k ,x 2,k ,x 3,k Both are system states x k The state variable in Z T (x k ) is Z(x k ), Q z is a symmetric matrix, and Q z ≥0.

[0021] Furthermore, the control obstacle function-based design is used to solve the optimization problem of the control strategy, and the optimization problem is specifically:

[0022]

[0023] Δh j (x k )+ηh j (x k )-I(x k )h j (x k )∈Τ SOS

[0024] P j-1 -P j ≥0

[0025] -h j (x k )+q i (x k )J i (x k )∈Τ SOS

[0026] in, γ is the weight coefficient, yes The transpose of Representation Matrix The trace of x0 is the system state at the initial moment, η is a constant, Q and R are weight matrices, Q ≥ 0, R > 0, and the intermediate variable Δh j (x k )=h j (x k+1 )-h j (x k ), SOS represents the sum of positive squares, Pj represents the matrix obtained at the jth iteration, Pj-1 represents the matrix obtained at the j-1th iteration, I(x k )=Z T (x k )J P Z(x k ), J P is the semidefinite programming variable matrix, K j represents the control strategy obtained in the jth iteration;

[0027] J i (x k ) is a polynomial, and J i (x k )satisfy:

[0028] X u ={x k ∈X|J i (x k )≤0,i=1,...,N}

[0029] Among them, X is the state set, X u is the set of unsafe states, and N is the number of unsafe states.

[0030] Furthermore, the optimization problem of the design is iteratively solved to obtain the control strategy and the safety attraction region estimation result, and the controller is designed according to the obtained control strategy; specifically:

[0031] Step 31: Initialize the control obstacle function According to (A-BK0) T P0(A-BK0)-P0+Q+K0 T RK0≤0, select an initialized control strategy K0;

[0032] Where c is The upper bound of is the initialized symmetric matrix;

[0033] Step 32, initialize the number of iterations j = 1;

[0034] Step 3. Solve the optimization problem and obtain the matrix P obtained at the jth iteration. j and According to the matrix P j Calculate the control strategy K j+1 :

[0035] K j+1 =(R+B T P j B) -1 B T P j A

[0036] Among them, the superscript -1 represents the inverse of the matrix;

[0037] Step 34: Determine whether |P is satisfied j -P j-1 |≤ε2, |·| represents the value of the determinant of the calculation matrix, and ε2 is the threshold;

[0038] If |P j -P j-1 |≤ε2, then the control strategy K j+1 As the final control strategy According to the control strategy Designing the controller At the same time according to Get the estimated result of the safe attraction domain

[0039] Otherwise |P j -P j-1 |>ε2, then set j=j+1 and return to execute step 33.

[0040] According to another aspect of the present invention, a method for estimating and controlling a safety attraction domain based on reinforcement learning is provided, and the method specifically comprises the following steps:

[0041] Step 1: discretize the kinematic model of the wheeled robot to obtain a linear discrete system model;

[0042] Step 2: Design the control obstacle function h(x k );

[0043] Step 3: Based on the control obstacle function, the optimization problem of the control strategy is designed to be solved, the designed optimization problem is iteratively solved to obtain the control strategy and the safety attraction domain estimation results, and the controller is designed according to the obtained control strategy.

[0044] Furthermore, the specific process of step one is:

[0045] The kinematic model of the wheeled robot is:

[0046]

[0047] Among them, (x, y) represents the position of the robot, represents the first-order derivative of x, represents the first-order derivative of y, θ represents the heading angle of the robot, represents the first-order derivative of θ, v represents the linear velocity of the robot, and ω represents the angular velocity of the robot;

[0048] The kinematic model of the wheeled robot is discretized to obtain a linear discrete system model:

[0049] x k+1 =A j x k +B(u k +K j x k )

[0050] Among them, x k is the system state at time k, that is, x k is composed of the robot's position and heading angle at time k, x k+1 is the system state at time k+1, u k is the system input at time k, the matrix A j =A-BK j , j ≥ 0, T s represents the sampling interval, v r is the reference linear velocity of the robot, w r is the reference angular velocity of the robot.

[0051] Furthermore, the control obstacle function h(x k )for:

[0052] h(x k )=Z T (x k )Q z Z(x k )

[0053] Among them, Z(x k )=[1,x 1,k ,x 2,k ,x 3,k ], x 1,k ,x 2,k ,x 3,k Both are system status x k The state variable in Z T (x k ) is Z(x k ), Q z is a symmetric matrix, and Qz ≥0.

[0054] Furthermore, the control obstacle function-based design is used to solve the optimization problem of the control strategy, and the optimization problem is specifically:

[0055]

[0056] stΘ j π=Φ j vec(P j+1 )+Ψ j

[0057]

[0058] S j ≥0

[0059]

[0060] P j -P j+1 ≥0

[0061] -h j+1 (x k )+q i (x k )J i (x k )∈Τ SOS

[0062] in, γ is the weight coefficient, yes The transpose of Representation Matrix The trace of x0 is the system state at the initial moment, P j+1 represents the matrix obtained at the jth iteration, represents the positive definite matrix obtained at the jth iteration, I(x k )=Z T (x k )J P Z(x k ), J P is the semidefinite programming variable matrix, η is a constant;

[0063] Intermediate variable matrices π, Ψ j , Θ j and Φ j for:

[0064]

[0065]

[0066] Where: vec(B T Pj +1 A) represents the matrix B T P j+1 The elements in A are sorted by columns, Kj represents the control strategy obtained in the jth iteration, stands for Kronecker product, S j =(A-BK j ) T P j+1 (A-BK j )-P j+1 +Q+K j T R j , v ≥ n 2 +m 2 +nm, m is the system state x k The dimension of n is the control input u k Dimensions;

[0067]

[0068] Among them, x k+l-1 is the system state at time k+l-1, u k+l-1 is the system input at time k+l-1, l=k,k+1,…,v,

[0069]

[0070] S j =(A-BK j ) T P j+1 (A-BK j )-P j+1 +Q+K j T R j

[0071] in, n1 is a constant;

[0072] J i (x k ) is a polynomial, and J i (x k )satisfy:

[0073] X u ={x k ∈X|J i (x k )≤0,i=1,...,N}

[0074] Among them, X is the state set, Xu is the set of unsafe states, and N is the number of unsafe states.

[0075] Furthermore, the optimization problem of the design is iteratively solved to obtain a control strategy, and a controller is designed according to the obtained control strategy; specifically:

[0076] Step 31: Initialize the control obstacle function According to (A-BK0) T P0(A-BK0)-P0+Q+K0 T RK0≤0, select an initialized control strategy K0;

[0077] Where c is The upper bound of is the initialized symmetric matrix;

[0078] Step 32: Initialize the number of iterations j=0;

[0079] Step 3. Solve the optimization problem and obtain the matrix P obtained at the jth iteration. j+1 and According to the matrix P j+1 Calculate the control strategy K j+1 :

[0080] K j+1 =(R+B T P j+1 B) -1 B T P j+1 A

[0081] Among them, the superscript -1 represents the inverse of the matrix;

[0082] Step 34: Determine whether |P is satisfied j+1 -P j |≤ε3, |·| represents the value of the determinant of the calculation matrix, and ε3 is the threshold;

[0083] If |P j+1 -P j |≤ε3, then the control strategy K j+1 As the final control strategy, according to the control strategy K j+1 Design controller u k =-K k+1 x k , and according to Get the estimated result of the safe attraction domain

[0084] Otherwise |P j+1 -P j|>ε3, then set j=j+1 and return to execute step 33.

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

[0086] The present invention introduces a method for controlling obstacle functions and subset estimation, formulates an optimization problem within a unified framework, and then introduces reinforcement learning and polynomial summation to express the optimal safety controller and the control obstacle function. The method of the present invention can ensure the safety of the system while using the Lyapunov function to ensure the stability of the system. That is, when stability conflicts with safety, the method of the present invention does not need to sacrifice stability to give priority to safety.

[0087] Moreover, compared with the existing methods, the method proposed in the present invention does not rely on accurate model knowledge. Without knowing the accurate model knowledge, the method of the present invention can still effectively characterize the optimal estimate of the safety attraction domain and ensure the safety of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] Figure 1 is a flow chart of the method of the present invention;

[0089] Figure 2 It is the trajectory tracking result diagram of the mobile robot;

[0090] The horizontal and vertical coordinates in the figure represent the position of the robot in the two-dimensional plane, and the unit is "meter"; the blue solid line is the reference trajectory, the pink dotted line and the red dotted line are two tracking trajectories with the same starting point but different starting angles, and the black "*" represents the starting point of the robot when tracking the reference trajectory;

[0091] Figure 3 It is a schematic diagram of the trajectory tracking error of different initial states;

[0092] In the figure, x1, x2 and x3 represent three state quantities, where (x1, x2) represents the position of the robot and x3 represents the heading angle of the robot. The cyan ellipsoid represents the state that satisfies V(x k )=c, the yellow ellipsoid represents the state point that satisfies h * (x k )=0. The black ellipse represents the safety margin about the position. The red curve represents multiple state trajectories with different initial conditions, and the black “*” represents the starting point of the state trajectory;

[0093] Figure 4 yes Figure 3 Top view along the x1 and x2 axes. DETAILED DESCRIPTION

[0094] Specific implementation method 1: Combination Figure 1This embodiment describes a method for estimating and controlling a secure attraction domain based on reinforcement learning, and the method specifically comprises the following steps:

[0095] Step 1: discretize the kinematic model of the wheeled robot to obtain a linear discrete system model;

[0096] Step 2: Design the control obstacle function h(x k );

[0097] Step 3: Based on the control obstacle function, the optimization problem of the control strategy is designed to be solved, the designed optimization problem is iteratively solved to obtain the control strategy and the safety attraction domain estimation results, and the controller is designed according to the obtained control strategy.

[0098] Specific implementation method 2: This implementation method is different from the specific implementation method 1 in that the specific process of step 1 is as follows:

[0099] The kinematic model of the wheeled robot is:

[0100]

[0101] Among them, (x, y) represents the position of the robot, represents the first-order derivative of x, represents the first-order derivative of y, θ represents the heading angle of the robot, represents the first-order derivative of θ, v represents the linear velocity of the robot, and ω represents the angular velocity of the robot;

[0102] The kinematic model of the wheeled robot is discretized to obtain a linear discrete system model:

[0103] x k+1 =Ax k +Bu k

[0104] Among them, x k is the system state at time k, that is, x k is composed of the robot's position and heading angle at time k, x k+1 is the system state at time k+1, u k is the system input at time k, the matrix T s represents the sampling interval, v r is the reference linear velocity of the robot, ω r is the reference angular velocity of the robot.

[0105] The other steps and parameters are the same as those in the first embodiment.

[0106] Specific implementation method three: This implementation method is different from specific implementation methods one or two in that the control obstacle function h(x k )for:

[0107] h(x k )=Z T (x k )Q z Z(x k )

[0108] Among them, Z(x k ) is about x k The column vector of Z(x k )=[1,x 1,k ,x 2,k ,x 3,k ], x 1,k ,x 2,k ,x 3,k Both are system status x k The state variable in Z T (x k ) is Z(x k ), Q z is a symmetric matrix, and Q z ≥0.

[0109] The other steps and parameters are the same as those in the first or second embodiment.

[0110] Specific implementation method 4: This implementation method is different from any one of the specific implementation methods 1 to 3 in that the control obstacle function-based design is used to solve the optimization problem of the control strategy, and the optimization problem is specifically:

[0111]

[0112] Δh j (x k )+ηh j (x k )-I(x k )h j (x k )∈Τ SOS

[0113] P j-1 -P j ≥0

[0114] -h j (x k )+q i (x k )J i (x k )∈Τ SOS

[0115] in, γ is the weight coefficient, yes The transpose of Representation Matrix The trace of x0 is the system state at the initial moment, η is a constant, Q and R are weight matrices, Q ≥ 0, R > 0, and the intermediate variable Δh j (x k )=h j (x k+1 )-h j (x k ), SOS represents the sum of positive squares, Pj represents the matrix obtained at the jth iteration, Pj-1 represents the matrix obtained at the j-1th iteration, I(x k )=Z T (x k )J P Z(x k ), J P is the semidefinite programming (SDP) variable matrix, That is, the present invention ignores the angle variable in the system state and only considers the robot position state variable (x 1,k and x 2,k ), K j represents the control strategy obtained in the jth iteration;

[0116] J i (x k ) is a polynomial, and J i (x k )satisfy:

[0117] X u ={x k ∈X|J i (x k )≤0,i=1,...,N}

[0118] Among them, X is the state set, X u is the set of unsafe states, and N is the number of unsafe states.

[0119] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.

[0120] The optimization problem designed in this embodiment is applicable to the case where the model parameters are known. When stability conflicts with security, the method of the present invention does not need to sacrifice stability to give priority to security.

[0121] Specific implementation method 5: This implementation method is different from the specific implementation methods 1 to 4 in that the control strategy and the safety attraction region estimation result are obtained by iteratively solving the design optimization problem, and the controller is designed according to the obtained control strategy; specifically:

[0122] Step 31: Initialize the control obstacle function According to (A-BK0) T P0(A-BK0)-P0+Q+K0 T RK0≤0, select an initialized control strategy K0;

[0123] Where c is The upper bound of is the initialized symmetric matrix;

[0124] Step 32, initialize the number of iterations j = 1;

[0125] Step 3: Solve the optimization problem (the present invention adopts the reinforcement learning method to solve it) and obtain the matrix P obtained in the jth iteration. j and According to the matrix P j Calculate the control strategy K j+1 :

[0126] K j+1 =(R+B T P j B) -1 B T P j A

[0127] Among them, the superscript -1 represents the inverse of the matrix;

[0128] Step 34: Determine whether |P is satisfied j -P j-1 |≤ε2, |·| represents the value of the determinant of the calculation matrix, and ε2 is the threshold;

[0129] If |P j -P j-1 |≤ε2, then the control strategy K j+1 As the final control strategy According to the control strategy Designing the controller At the same time according to Get the estimated result of the safe attraction domain

[0130] Otherwise |P j -P j-1 |>ε2, then set j=j+1 and return to execute step 33.

[0131] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.

[0132] Specific implementation method six: Combination Figure 1 This embodiment describes a method for estimating and controlling a secure attraction domain based on reinforcement learning, and the method specifically comprises the following steps:

[0133] Step 1: discretize the kinematic model of the wheeled robot to obtain a linear discrete system model;

[0134] Step 2: Design the control obstacle function h(x k );

[0135] Step 3: Based on the control obstacle function, the optimization problem of the control strategy is designed to be solved, the designed optimization problem is iteratively solved to obtain the control strategy and the safety attraction domain estimation results, and the controller is designed according to the obtained control strategy.

[0136] Specific implementation method 7: This implementation method is different from specific implementation method 6 in that the specific process of step 1 is as follows:

[0137] The kinematic model of the wheeled robot is:

[0138]

[0139] Among them, (x, y) represents the position of the robot, represents the first-order derivative of x, represents the first-order derivative of y, θ represents the heading angle of the robot, represents the first-order derivative of θ, v represents the linear velocity of the robot, and ω represents the angular velocity of the robot;

[0140] The kinematic model of the wheeled robot is discretized to obtain a linear discrete system model:

[0141] x k+1 =A j x k +B(u k +K j x k )

[0142] Among them, x k is the system state at time k, that is, x k is composed of the robot's position and heading angle at time k, x k+1 is the system state at time k+1, u k is the system input at time k, the matrix A j =A-BK j , j ≥ 0, Ts represents the sampling interval, v r is the reference linear velocity of the robot, w r is the reference angular velocity of the robot.

[0143] The other steps and parameters are the same as those in the sixth embodiment.

[0144] Specific implementation eight: This implementation differs from specific implementation six or seven in that the control obstacle function h(x k )for:

[0145] h(x k )=Z T (x k )Q z Z(x k )

[0146] Among them, Z(x k ) is about x k The column vector of Z(x k )=[1,x 1,k ,x 2,k ,x 3,k ], x 1,k ,x 2,k ,x 3,k Both are system status x k The state variable in Z T (x k ) is Z(x k ), Q z is a symmetric matrix, and Q z ≥0.

[0147] The other steps and parameters are the same as those in the sixth or seventh embodiment.

[0148] Specific implementation method 9: This implementation method is different from any one of specific implementation methods 6 to 8 in that the control obstacle function-based design is used to solve the optimization problem of the control strategy, and the optimization problem is specifically:

[0149]

[0150] stΘ j π=Φ j vec(P j+1 )+Ψ j

[0151]

[0152] S j ≥0

[0153]

[0154] P j -P j+1 ≥0

[0155] -h j+1 (x k )+q i (x k )J i (x k )∈Τ SOS

[0156] in, γ is the weight coefficient, yes The transpose of Representation Matrix The trace of x0 is the system state at the initial moment, P j+1 represents the matrix obtained at the jth iteration, represents the positive definite matrix obtained at the jth iteration, I(x k )=Z T (x k )J P Z(x k ), J P is the semidefinite programming (SDP) variable matrix, That is, the present invention ignores the angle variable in the system state and only considers the robot position state variable (x 1,k and x 2,k ), η is a constant;

[0157] Intermediate variable matrices π, Ψ j , Θ j and Φ j for:

[0158]

[0159]

[0160] Where: vec(B T Pj +1 A) represents the matrix B T P j+1 The elements in A are sorted by columns, such as but K j represents the control strategy obtained in the jth iteration, stands for Kronecker product, S j =(A-BK j ) T P j+1 (A-BK j )-P j+1 +Q+Kj T R j , v ≥ n 2 +m 2 +nm, m is the system state x k The dimension of n is the control input u k Dimensions;

[0161]

[0162] Among them, x k+l-1 is the system state at time k+l-1, u k+l-1 is the system input at time k+l-1, l=k,k+1,…,v,

[0163]

[0164] S j =(A-BK j ) T P j+1 (A-BK j )-P j+1 +Q+K j T R j

[0165] in, n1 is a constant, and its specific value can be set according to actual conditions;

[0166] J i (x k ) is a polynomial, and J i (x k )satisfy:

[0167] X u ={x k ∈X|J i (x k )≤0,i=1,...,N}

[0168] Among them, X is the state set, X u is the set of unsafe states, and N is the number of unsafe states.

[0169] The other steps and parameters are the same as those in any one of the sixth to eighth embodiments.

[0170] The optimization problem designed in this embodiment is applicable to the case where the model parameters are unknown. When stability conflicts with security, the method of the present invention does not need to sacrifice stability to give priority to security.

[0171] Specific implementation method ten: This implementation method is different from any one of specific implementation methods six to nine in that the control strategy is obtained by iteratively solving the optimization problem of the design, and the controller is designed according to the obtained control strategy; specifically:

[0172] Step 31: Initialize the control obstacle function According to (A-BK0) T P0(A-BK0)-P0+Q+K0 T RK0≤0, select an initialized control strategy K0;

[0173] Where c is The upper bound of is the initialized symmetric matrix;

[0174] Step 32: Initialize the number of iterations j=0;

[0175] Step 3. Solve the optimization problem and obtain the matrix P obtained at the jth iteration. j+1 and According to the matrix P j+1 Calculate the control strategy K j+1 :

[0176] K j+1 =(R+B T P j+1 B) -1 B T P j+1 A

[0177] Among them, the superscript -1 represents the inverse of the matrix;

[0178] Step 34: Determine whether |P is satisfied j+1 -P j |≤ε3, |·| represents the value of the determinant of the calculation matrix, and ε3 is the threshold;

[0179] If |P j+1 -P j |≤ε3, then the control strategy K j+1 As the final control strategy, according to the control strategy K j+1 Design controller u k =-K k+1 x k , and according to Get the estimated result of the safe attraction domain

[0180] Otherwise |P j+1 -P j |>ε3, then set j=j+1 and return to execute step 33.

[0181] The other steps and parameters are the same as those in Specific Embodiments 6 to 9.

[0182] The method of the present invention is further described in detail below:

[0183] 1. Optimization problem proposal

[0184] The present invention considers the linear discrete system model to be in the following form:

[0185] x k+1 =Ax k +Bu k (1)

[0186] Among them, x k is the system status, u k is the system input. A and B are matrices with appropriate dimensions.

[0187] For the system of formula (1), the optimal controller can be expressed as u k =-Kx k , where K = (B T PB+R) -1 B T PA, where P can be obtained by solving formula (2).

[0188] A T PA-P+QA T PB(R+B T PB) -1 B T PA=0 (2)

[0189] Where Q≥0,R>0 is the weight matrix.

[0190] Definition 1 (Definition of safe set): Define X and X0 as the state set and the initial state set, and define the unsafe state set as X u ,in For x0∈X0, Status Satisfaction The system is safe.

[0191] The control barrier function is used to ensure the safety of the system, and the safety set is denoted as ξ. The internal area and boundary of the safety set are defined as follows:

[0192] ζ={x k ∈Xh(x k )≥0},

[0193] Int(ζ)={x k ∈X|h(x k )>0},

[0194]

[0195] h(x k ):R n →R is a continuous function.

[0196] Definition 2 (definition of control obstacle function): h(x k ) is a discrete-time control barrier function. For x∈ζ, if there exists a controller u k And the local Lipschitz functions β1, β2 and η satisfy:

[0197]

[0198] Where Δh(x k ,u k )=h(x k+1 ,u k )-h(x k ,u k ).

[0199] By Int(ζ), And formula (3), there exists h(x k ) meets the following conditions:

[0200]

[0201] Δh(x k ,u k )+η(h(x k ))≥0 means that for any h(x0)>0, h(x k )>0. Control barrier function h(x k ,u k ) ensures that the security set ξ is forward invariant, where ξ={x k ∈X|h(x k )≥0}.

[0202] Assume that the control barrier function can be expressed in the following quadratic form: h(x k )=Z T (x k )Q z Z(x k ), where Z(x k ) is about x k Column vector, symmetric matrix Q z ≥ 0. The unsafe region is defined as a polynomial form J i (x k ), the unsafe set is represented as:

[0203] X u ={x k ∈X|Ji (x k )≤0,i=1,...,N} (4)

[0204] Where N is the number of unsafe areas.

[0205] In order to ensure the safety of the system, a safety attraction domain is proposed. The most permissible safety attraction domain evaluation is equivalent to maximizing h(x k )=Z T (x k )Q z Z(x k ) capacity, that is

[0206]

[0207] Where h(x k )>0,Δh(x k ,u k )+η(h(x k ))≥0.

[0208] Through the above brief description of the control system and the introduction of related definitions, the problems to be solved by the present invention can be summarized as follows:

[0209] Problem 1: Finding a safe optimal controller and the maximum trace(Q z ), so that in the unsafe set X u Under the condition that h(x k )>0 and ΔV(x k )<0, where ΔV(x k )=V(x k+1 )-V(x k ), is the Lyapunov function.

[0210] Problem 2: Find a learning-based algorithm to obtain the optimal controller without knowing the precise information of the system

[0211] 2. Design of safe and optimal controller

[0212] We describe how to formulate the optimization problem for safe optimal controller design in a unified framework. Then, we design a learning-based algorithm to solve the formulated problem.

[0213] 2.1 Model-based safe optimal control

[0214] Considering that the equation (2) cannot satisfy problem 1, the optimal control gain K is solved * And get the maximum trace (Q z), the present invention proposes a relaxed algebraic Riccati equation as follows.

[0215] Lemma 1: The relaxed Riccati equation in equation (6) is equal to the equation in equation (2),

[0216]

[0217] Satisfy constraints (A-BK) T P(A-BK)-P+Q+K T RK≤0.

[0218] Based on Lemma 1, the optimization problem of Problem 1 can be expressed as:

[0219]

[0220] The optimization problem satisfies the constraints of inequality (8) and inequality (9), where:

[0221] (A-BK) T P(A-BK)-P+Q+K T RK≤0 (8)

[0222] Δh(x k ,u k )+η(h(x k ))≥0 (9)

[0223] Among them, γ is a weight coefficient.

[0224] Inequalities (8) and (9) are used as stability constraints and safety constraints of the system, respectively. When the optimization problem of equation (7) has a solution, the solution of problem 1 can also be obtained. It is worth noting that due to the use of inequality constraints, the solution obtained is a suboptimal solution. The following Theorem 1 will prove that the optimization problem of equation (7) has a solution.

[0225] Theorem 1: If the matrix (A, B) in the system of equation (1) is controllable, the starting point of the system is within the safe set ξ, the solution to the optimal problem of equation (7) is non-empty, and h * (x k ) and K * can be solved simultaneously.

[0226] Proof Theorem 1: Choose a matrix H(P0)≤0 to satisfy inequality (8). If there exists a controller u k =-(B T P0B+R) -1 B T P0X kIf the constraints of inequality (9) are satisfied, then the optimal control problem of equation (7) has a solution. k =-(B T P0B+R) -1 B T P0X k Under the action of , the system of formula (1) can remain stable, then there exists a set υ(c) satisfying υ(c) = {x k ∈R n |V0(x k )≤c}, where Then an initial control obstacle function can be expressed as h0(x k )=c-V0(x k ), and substituting it into inequality (9) we can get:

[0227]

[0228] Considering the constraints of inequality (8), we have in, Established.

[0229] Will Substituting into the above inequality, we can get

[0230] Δh0(x k ,u k )+η(h0(x k ))≥0 (10)

[0231] Inequality (10) shows that when the initial controller u k =-(B T P0B+R) -1 B T P0X k Under this condition, the constraint of inequality (9) can be satisfied.

[0232] In summary, (P0,h0(x k )) is a feasible solution to the optimal control problem of equation (7), h * (x k ) and K * can be solved simultaneously.

[0233] Although the optimal control problem has been formulated, due to the existence of the constraints of inequality (9), in order to avoid verifying inequality (9) state by state, the square sum programming is introduced to transform the constraints of inequality (9) into square sum constraints. Before reformulating the optimization problem, the positive definiteness lemma is provided in Lemma 2.

[0234] Lemma 2: Considering the polynomial b(x k ), And the following set Y = {x k ∈R n |l i (x k )≥0}. If there exists z1,...z N ∈Τ SOS , then for b(x k )>0, satisfy

[0235] Using Lemma 2, Algorithm 1 in Table 1 can solve the optimization problem of Equation (7). Theorem 2 shows that Algorithm 1 can solve stability and security at the same time.

[0236] Theorem 2: Considering the unsafe set X defined in equation (4) u , the controller learned by Algorithm 1 can ensure the stability of the system of formula (1), and for state

[0237] Proof of Theorem 2: From Theorem 1, it is easy to see that Theorem 2 is true, so the detailed proof is omitted.

[0238] Since (11b) and (11d) are bilinear decision variables, Algorithm 1 cannot be implemented directly. The policy evaluation step can be divided into several square sum procedures and an iterative search algorithm is used to solve it.

[0239] Table 1

[0240]

[0241] 2.2 Learning-based safe optimal control

[0242] Algorithm 2 is proposed to solve the above problem 2. The difficulty of Algorithm 2 lies in how to express the constraints of inequalities (8) and (9) in the optimization problem of equation (7) when the system model information is unknown.

[0243] An off-policy reinforcement learning algorithm is proposed to solve the problem that the constraints of inequality (8) are difficult to describe when the model information is unknown. The system of equation (1) is rewritten as:

[0244] x k+1 =A j x k +B(u k +K j x k ) (12)

[0245] Among them A j =A-BK j , j ≥ 0, u kAs the behavior strategy to collect data, the target strategy is expressed as

[0246] Since the constraint of equation (8) is an inequality, it cannot be solved directly as an equality equation. A relaxed positive definite matrix S ≥ 0 rewrites the constraint of equation (8) as H(P) = -S. For a fixed strategy have

[0247]

[0248] Substituting into equation (12), It is expressed as:

[0249]

[0250] Substituting H(P)=-S, equation (14) can be further expressed as:

[0251]

[0252] The system of formula (1) and A j =A-BK j Substituting into formula (15) we get:

[0253]

[0254] Among them, vec(B T P j+1 A)、vec(B T P j+1 B) vec(S j ) is the unknown parameter to be learned. vec(P j+1 ) is the decision variable to be optimized.

[0255] In formula (16), at least unknown parameters. Therefore, in each iteration, at least v (v ≥ n 2 +m 2 +nm) data.

[0256] The collected data is defined as

[0257]

[0258] in:

[0259]

[0260] Equation (16) can be reformulated as:

[0261]

[0262] To ensure Full rank, detection noise is added. Using the least squares method, the unknown parameters can be expressed as:

[0263]

[0264] Safety control gain K j+1 =(B T P j+1 B+R) -1 B T P j+1 A can be obtained by learning the parameters vec(B T P j+1 A), vec(B T P j+1 B) and vec(S j ) is updated.

[0265] Next, we will explain how to use data to express the constraints of inequality (9). k )) can be simply expressed as ηh(x k ), where η>0. Because the control barrier function h(x k ) is a polynomial, so the constraint of inequality (9) can be approximately expressed as:

[0266]

[0267] in, is an unknown vector, n 0,d (x k ) is a state variable x k Vector composed of.

[0268] Combined with h(x k )=Z T (x k )Q z Z(x k ) can be obtained:

[0269]

[0270] In equation (17), Q z is a matrix to be optimized, L C There are n1 unknown parameters in . In order to use the least squares method, n1 data need to be collected, and equation (17) can be simplified to:

[0271] Ξ z vec(Q z )=Ω d L C , (18)

[0272] in,

[0273]

[0274] L C can be expressed as:

[0275]

[0276] According to the above description, Algorithm 2 in Table 2 is designed to learn a safe optimal controller without exact system knowledge. All constraints in Algorithm 2 do not depend on exact system knowledge. Specifically, the constraints of Equations (20a), (20c), and (20e) are equivalent to Equations (11a) and (11c) in Algorithm 1, which are used to ensure stability. The constraints of Equations (20b) and (20d) are equivalent to Equation (11b), which are used to ensure that the safety set is forward invariant, and the constraint of Equation (20f) is to ensure safety. When Algorithm 2 is implemented, the control barrier function can be obtained, thereby estimating a safe attraction domain. In order to avoid the conflict between stability and safety, the initial state of the target system can be selected from the estimated safe attraction domain, and the system state can evolve safely starting from these initial states.

[0277] Table 2

[0278]

[0279] Experimental Section

[0280] Given a wheeled robot system, its kinematic model is expressed as:

[0281]

[0282] Among them, (x, y) represents the position of the robot, θ represents the heading angle. (v, w) represent the linear velocity and angular velocity respectively. The tracking error model of the robot is expressed as:

[0283]

[0284] Among them, (x e ,y e ) represents the position error, θ e Represents the robot’s heading angle error, v r and w r is the linear velocity and angular velocity of the reference robot. In order to adapt to the discrete time algorithm proposed in the present invention, the continuous model is discretized into the system form of formula (1), and

[0285]

[0286] Among them, T s =0.1s represents the sampling interval, vr =1.0m / s,w r =0.1rad / s.

[0287] The initial parameters in Algorithm 2 are defined as:

[0288]

[0289] The weight matrix is ​​Q = diag(1,1,1), R = diag(1,1). Using Algorithm 1, we can get

[0290]

[0291] Taking into account the tracking accuracy, the unsafe set is defined as the following polynomial form:

[0292]

[0293] Considering the predefined unsafe area and P0, the initial control obstacle function is Where c = 7.84. By using Algorithm 1, we get:

[0294]

[0295] Figures 2 to 4 The simulation results under Algorithm 2 are shown. Specifically, Figure 2 The expected trajectory and actual trajectory are described in , where two different initial conditions are given (same position but different heading angles). Inappropriate initial conditions will affect the tracking performance and lead to unsafe situations. Figure 3 The unsafe region, the region describing the sub-level set of the initial Lyapunov function, and the estimated safe region are shown. The tracking error for different initial conditions is also described. Figure 4 for Figure 3 It provides a different perspective. Simulation results show that the learned safety controller can satisfy both stability and safety when the initial conditions are selected from the safety region.

[0296] The above calculation examples of the present invention are only used to explain the calculation model and calculation process of the present invention in detail, and are not intended to limit the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.

Claims

1. A safety attraction domain estimation and safety control method based on reinforcement learning, characterized in that: The method specifically comprises the following steps: Step 1: discretize the kinematic model of the wheeled robot to obtain a linear discrete system model; Step 2: Design the control obstacle function h(x k ); Step 3: Based on the control obstacle function, the optimization problem of the control strategy is designed to be solved, the designed optimization problem is iteratively solved to obtain the control strategy and the safety attraction domain estimation results, and the controller is designed according to the obtained control strategy.

2. According to the method of security attraction domain estimation and security control based on reinforcement learning in claim 1, it is characterized in that: The specific process of step one is: The kinematic model of the wheeled robot is: Among them, (x, y) represents the position of the robot, represents the first-order derivative of x, represents the first-order derivative of y, θ represents the heading angle of the robot, represents the first-order derivative of θ, v represents the linear velocity of the robot, and ω represents the angular velocity of the robot; The kinematic model of the wheeled robot is discretized to obtain a linear discrete system model: x k+1 =Ax k +Bu k Among them, x k is the system state at time k, that is, x k is composed of the robot's position and heading angle at time k, x k+1 is the system state at time k+1, u k is the system input at time k, the matrix T s represents the sampling interval, v r is the reference linear velocity of the robot, ω r is the reference angular velocity of the robot.

3. According to the reinforcement learning-based security attraction domain estimation and security control method of claim 2, it is characterized in that: The control obstacle function h(x k )for: h(x k )=Z T (x k )Q z Z(x k ) Among them, Z(x k )=[1,x 1,k ,x 2,k ,x 3,k ], x 1,k ,x 2,k ,x 3,k Both are system states x k The state variable in Z T (x k ) is Z(x k ), Q z is a symmetric matrix, and Q z ≥0.

4. According to the method of security attraction domain estimation and security control based on reinforcement learning in claim 3, it is characterized in that: The control obstacle function-based design is used to solve the optimization problem of the control strategy, and the optimization problem is specifically: Δh j (x k )+ηh j (x k )-I(x k )h j (x k )∈Τ SOS P j-1 -P j ≥0 -h j (x k )+q i (x k )J i (x k )∈Τ SOS in, γ is the weight coefficient, yes The transpose of Representation Matrix The trace of x0 is the system state at the initial moment, η is a constant, Q and R are weight matrices, Q ≥ 0, R > 0, and the intermediate variable Δh j (x k )=h j (x k+1 )-h j (x k ), SOS represents the positive sum of squares, P j represents the matrix obtained at the jth iteration, P j-1 represents the matrix obtained at the j-1th iteration, I(x k )=Z T (x k )J P Z(x k ), J P is the semidefinite programming variable matrix, K j represents the control strategy obtained in the jth iteration; J i (x k ) is a polynomial, and J i (x k )satisfy: X u ={x k ∈X|J i (x k )≤0,i=1,…,N} Among them, X is the state set, X u is the set of unsafe states, and N is the number of unsafe states.

5. According to the method of security attraction domain estimation and security control based on reinforcement learning in claim 4, it is characterized in that: The optimization problem of the design is iteratively solved to obtain the control strategy and the safety attraction region estimation result, and the controller is designed according to the obtained control strategy; specifically: Step 31: Initialize the control obstacle function According to (A-BK0) T P0(A-BK0)-P0+Q+K0 T RK0≤0, select an initialized control strategy K0; Where c is The upper bound of is the initialized symmetric matrix; Step 32, initialize the number of iterations j = 1; Step 3. Solve the optimization problem and obtain the matrix P obtained at the jth iteration. j and According to the matrix P j Calculate the control strategy K j+1 : K j+1 =(R+B T P j B) -1 B T P j A Among them, the superscript -1 represents the inverse of the matrix; Step 34: Determine whether |P is satisfied j -P j-1 |≤ε2, |·| represents the value of the determinant of the calculation matrix, and ε2 is the threshold; If |P j -P j-1 |≤ε2, then the control strategy K j+1 As the final control strategy According to the control strategy Designing the controller At the same time according to Get the estimated result of the safe attraction domain Otherwise |P j -P j-1 |>ε2, then set j=j+1 and return to execute step 33.

6. A safety attraction domain estimation and safety control method based on reinforcement learning, characterized in that: The method specifically comprises the following steps: Step 1: discretize the kinematic model of the wheeled robot to obtain a linear discrete system model; Step 2: Design the control obstacle function h(x k ); Step 3: Based on the control obstacle function, the optimization problem of the control strategy is designed to be solved, the designed optimization problem is iteratively solved to obtain the control strategy and the safety attraction domain estimation results, and the controller is designed according to the obtained control strategy.

7. The method for estimating and controlling a safety attraction domain based on reinforcement learning according to claim 6 is characterized in that: The specific process of step one is: The kinematic model of the wheeled robot is: Among them, (x, y) represents the position of the robot, represents the first-order derivative of x, represents the first-order derivative of y, θ represents the heading angle of the robot, represents the first-order derivative of θ, v represents the linear velocity of the robot, and ω represents the angular velocity of the robot; The kinematic model of the wheeled robot is discretized to obtain a linear discrete system model: x k+1 =A j x k +B(u k +K j x k ) Among them, x k is the system state at time k, that is, x k is composed of the robot's position and heading angle at time k, x k+1 is the system state at time k+1, u k is the system input at time k, the matrix A j =A-BK j , j ≥ 0, T s represents the sampling interval, v r is the reference linear velocity of the robot, w r is the reference angular velocity of the robot.

8. The method for estimating and controlling a safety domain of attraction based on reinforcement learning according to claim 7 is characterized in that: The control obstacle function h(x k )for: h(x k )=Z T (x k )Q z Z(x k ) Among them, Z(x k )=[1,x 1,k ,x 2,k ,x 3,k ], x 1,k ,x 2,k ,x 3,k Both are system status x k The state variables in Z T (x k ) is Z(x k ), Q z is a symmetric matrix, and Q z ≥0.

9. The method for estimating and controlling a safety attraction domain based on reinforcement learning according to claim 8, characterized in that: The control obstacle function-based design is used to solve the optimization problem of the control strategy, and the optimization problem is specifically: stΘ j p=Φ j vec(P j+1 )+Ψ j S j ≥0 P j -P j+1 ≥0 -h j+1 (x k )+q i (x k )J i (x k )∈Τ SOS in, γ is the weight coefficient, yes The transpose of Representation Matrix The trace of x0 is the system state at the initial moment, P j+1 represents the matrix obtained at the jth iteration, represents the positive definite matrix obtained at the jth iteration, I(x k )=Z T (x k )J P Z(x k ), J P is the semidefinite programming variable matrix, η is a constant; Intermediate variable matrices π, Ψ j , Θ j and Φ j for: Where: vec(B T Pj +1 A) represents the matrix B T P j+1 The elements in A are sorted by columns, Kj represents the control strategy obtained in the jth iteration, stands for Kronecker product, S j =(A-BK j ) T P j+1 (A-BK j )-P j+1 +Q+K j T R j , v ≥ n 2 +m 2 +nm, m is the system state x k The dimension of n is the control input u k Dimensions; Among them, x k+l-1 is the system state at time k+l-1, u k+l-1 is the system input at time k+l-1, l=k,k+1,…,v, S j =(A-BK j ) T P j+1 (A-BK j )-P j+1 +Q+K j T RK j in, n1 is a constant; J i (x k ) is a polynomial, and J i (x k )satisfy: X u ={x k ∈X|J i (x k )≤0,i=1,…,N} Among them, X is the state set, X u is the set of unsafe states, and N is the number of unsafe states.

10. The method for estimating and controlling a safety attraction domain based on reinforcement learning according to claim 9, characterized in that: The optimization problem of the design is iteratively solved to obtain a control strategy, and a controller is designed according to the obtained control strategy; specifically: Step 31: Initialize the control obstacle function According to (A-BK0) T P0(A-BK0)-P0+Q+K0 T RK0≤0, select an initialized control strategy K0; Where c is The upper bound of is the initialized symmetric matrix; Step 32: Initialize the number of iterations j=0; Step 3. Solve the optimization problem and obtain the matrix P obtained at the jth iteration. j+1 and According to the matrix P j+1 Calculate the control strategy K j+1 : K j+1 =(R+B T P j+1 B) -1 B T P j+1 A Among them, the superscript -1 represents the inverse of the matrix; Step 34: Determine whether |P is satisfied j+1 -P j |≤ε3, |·| represents the value of the determinant of the calculation matrix, and ε3 is the threshold; If |P j+1 -P j |≤ε3, then the control strategy K j+1 As the final control strategy, according to the control strategy K j+1 Design controller u k =-K k+1 x k , and according to Get the estimated result of the safe attraction domain Otherwise |P j+1 -P j |>ε3, then set j=j+1 and return to execute step 33.