A predictive control method
By combining model predictive control and reinforcement learning algorithms in UVMS, the problem of control failure caused by dynamic model mismatch and external disturbance is solved, efficient real-time optimal control is achieved, and the stable operation of the robotic arm is ensured when dynamics change. .
Patent Information
- Application Number
- CN202211573521.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-08
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-12-08
AI Technical Summary
When the existing technology controls UVMS, dynamic model mismatch and external disturbance lead to control failure, low computational efficiency, inability to provide real-time optimal control actions, and insufficient consideration of mechanical limitations and state constraints.
Model predictive control (MPC) combined with quadratic programming (QP) is used to quickly solve the problem, compensate for external disturbances, and use a controller update strategy based on reinforcement learning to maintain the stability of the robotic arm when the dynamic model changes through state mapping and action migration technology. Ideal end effector state.
It improves the calculation efficiency of model predictive control, provides real-time optimal control actions, ensures that accurate control strategies can still be given when the dynamic model changes, and meets high-frequency control requirements.
Smart Images

Figure CN115946112B
Abstract
Description
Technical Field
[0001] The present invention relates to a predictive control method, in particular to a predictive control method for keeping a mechanical arm on a mobile platform in an ideal end effector state under the conditions of large disturbance and mismatch of dynamic models. Background Art
[0002] The main difficulties in controlling UVMS are: uncertainty in UVMS modeling; external interference; and measurement noise. At the same time, it is required that the input and state of the control should be limited within the constraints of position, velocity, and acceleration to provide real-time control actions.
[0003] In view of the above points, P.S.Londhe et al. used robust nonlinear PID control to overcome external disturbances and uncertainty of dynamic models. X.Liu et al. used adaptive fault-tolerant controllers to overcome uncertainty of dynamic models, external disturbances and measurement noise at the same time. C.Yu et al. used fuzzy logic and neural networks to overcome uncertainty of dynamic models and external disturbances. However, the problem with the above studies is that the control law is fixed and mechanical limitations or state constraints are not considered. D.Q.Mayne et al. applied model control prediction (MPC) to multi-degree-of-freedom constraint tracking control of UVMS, providing the optimal disturbance suppression control strategy for complex constraint control dynamic systems. However, the optimization problem of MPC cost function is complex, which increases the calculation time and cannot provide real-time optimal control actions. W.Gan et al. used the MPC method based on quantum behavior particle swarm optimization (QPSO-MPC) to solve the trajectory tracking problem of underwater automatic vehicles (AUVs) with six degrees of freedom, effectively improving the calculation time efficiency, but the uncertainty of the dynamic model and external disturbances affected the effect of MPC. Z.Sun et al. proposed an improved tubular MPC framework, which uses nominal conventional MPC control and a feedback rate designed according to the deviation between the actual state and the nominal state to overcome the uncertainty and external disturbance of the dynamic model, but still has the problem of low computational efficiency. GPIncremona et al. decoupled each degree of freedom and used MPC for each of them separately, which improved the computational efficiency, but resulted in a decrease in the robustness and optimality of all degrees of freedom.
[0004] The defects in the existing technology are mainly concentrated in: 1) The research remains at the kinematic level, and the research on dynamics is insufficient, which makes it difficult to apply to actual systems; 2) Model predictive control is adopted for the system, but there is a lack of a more accurate system model, which causes control failure; 3) When model predictive control is adopted for a more accurate dynamic model, the calculation time efficiency is low and it is difficult to meet the demand for control frequency; 4) When model predictive control is performed on UVMS, mechanical limitations or state constraints are not sufficiently considered, or the calculation efficiency is reduced when subject to multiple constraints, and real-time optimal control actions cannot be provided; 5) The control strategy based on dynamics is highly correlated with the actual system, and the system dynamics model is changed due to disturbances, loads or system performance degradation, which makes it difficult to adjust parameters. Summary of the invention
[0005] The main purpose of the present invention is to provide a predictive control method to solve many deficiencies of the prior art.
[0006] In order to achieve the above main purpose, the present invention provides a predictive control method for an underwater robot system equipped with a mechanical arm, so that the mechanical arm on the mobile platform maintains an ideal end effector state; the predictive control method comprises the following steps:
[0007] Step S10, modeling the mobile platform and the mechanical arm in the underwater robot system;
[0008] Step S20: Model predictive control (MPC) is used for the constructed model, kinematic feasibility is considered, quadratic programming (QP) is used for rapid solution, external disturbances are compensated, and the future corrected postures of the mobile platform and the robotic arm are obtained;
[0009] Step S30: A controller based on reinforcement learning (RL) algorithm is used for the mobile platform and the end effector; the controller selects and executes actions according to the initial control strategy, updates the control strategy according to the predefined reward function and the acquired real-time environmental signal, and determines whether it is the optimal strategy; if it is the optimal control strategy, the current learning is terminated and the corresponding action is executed, otherwise the learning process is repeated until the optimal control strategy is reached; the reward function is:
[0010]
[0011] Where d∈R 3 is the distance between the subject and the target point in the x, y, and z axes; v∈R 4 is the current velocity of the subject, including the linear velocity in the x, y, and z directions and the angular velocity around the z axis; a∈R 4 is the subject’s current control strategy, and α is the corresponding coefficient;
[0012] Step S40: When the underwater robot system is subject to a large disturbance and the dynamic model does not match, the control strategy is migrated to keep the robot arm on the mobile platform in an ideal end effector state.
[0013] According to a specific implementation of the present invention, in step S10,
[0014] The dynamic equation of the mobile platform is:
[0015] Wherein, v is the velocity matrix of the mobile platform, M is the inertia matrix including the additional mass, C is the centrifugal force and Coriolis force matrix, D is the hydrodynamic damping matrix, g is the vector of the combined moment of gravity and buoyancy, η is the position attitude information matrix of the mobile platform, and τ is the thrust output matrix of the propeller;
[0016] In the mobile platform coordinate system, the dynamic equation of the robot arm is:
[0017]
[0018] Among them, ξ v =[v(t),η(t)] T is the position and posture of the mobile platform, is the Jacobian matrix of the manipulator in the inertial system, τ 2 is the driving torque matrix of each joint of the robot arm, M m is the inertia matrix, C m is the Coriolis force and centrifugal force matrix, G m is the gravity matrix, f ext It is the interaction force exerted by the target environment on the end effector when the robot arm interacts with the target.
[0019] According to a specific implementation of the present invention, in step S10,
[0020] Step S11: define the controller of the mobile platform as:
[0021]
[0022] Among them, μ d ∈R 3 is the linear velocity required for the mobile platform, ω d ∈R 3 is the angular velocity required for the mobile platform, are the vector components of the quaternion error, is the scalar component of the quaternion error, E v =∫e v dt∈R 3 is the integral of the mobile platform position error, E η =∫e ηt∈R 3 is the integral of the mobile platform direction error, K v , K η ∈R 3×3 is the gain matrix, ψ 1 (·) is the control strategy of the mobile platform, τ 1 (t) is the thrust output by the mobile platform;
[0023] Step S12: define the controller of the end effector as:
[0024]
[0025] Among them, v d ∈R 3 is the required linear velocity of the end effector, is the required angular velocity of the end effector, are the vector components of the quaternion error, is the scalar component of the quaternion error, E p =∫e p dt∈R 3 is the integral of the end effector position error, E 0 =∫e o dt∈R 3 is the integral of the end effector direction error, K p , K i ∈R 3×3 is the gain matrix.
[0026] According to a specific implementation of the present invention, in step S20,
[0027] Step S21: predict the motion of the mobile platform and model the motion of the mobile platform as a linear time-invariant system with affine perturbation: 3 (t+1)=Ax 3 (t)+Bu(t), where x 3 The state vector of the mobile platform, u is the interference to the mobile platform, Propagate the control action from velocity to displacement, Give the distinction between sequential perturbations;
[0028] Unify disturbance observation and state prediction into state estimation, use historical state data, and adopt autoregressive model (AR) to estimate and predict future state;
[0029] Step S22, decomposing the tracking of the target point in the inertial system into the movement of the mobile platform in the inertial system and the movement of the robot arm in the mobile platform coordinate system, so as to eliminate the interference of the mobile platform movement on the end effector;
[0030] Step S23: predict the motion of the end effector and control the desired position of the end effector by the position of the end effector at any time and the control input:
[0031]
[0032] Among them, x 4 (t+i)∈R 3 is the desired position of the end effector, x 4 (t) is the known position of the end effector at any time, v∈R 3 is the discrete control input for each time step, Δt -1 To control the frequency.
[0033] According to a specific implementation of the present invention, in step S30,
[0034] At each time step t, the system receives a state observation s t =[d t , v t ], take action t , and receive reward r t ; The payoff of a state is defined as the sum of discounted future rewards Discount factor γ∈[0,1], reinforcement learning based on the initial distribution To maximize expected returns;
[0035] Define the value function Q π (s t , a t ), describing the state s t Take action in t The expected return after and the subsequent strategy π is:
[0036] Using the recursive relationship of the Bellman equation, we get:
[0037]
[0038] Use the greedy strategy μ(s, a) = argmax a Q(s, a) and Q μ Parameterized function approximator, defining the function μ(s|θ μ ) is used to deterministically map states to specific actions to specify the current strategy; the discounted state display distribution of strategy π is represented as ρ π , β is a randomly generated different strategy;
[0039] Repeatedly update μ(s|θ μ ) function, get the current optimal strategy π and the action a taken t .
[0040] According to a specific implementation of the present invention, the method of policy migration in step S40 is:
[0041] The system is in the source domain D x The trajectory on System in target domain The trajectory on where x∈R m1 The source domain D x The state of Target Domain The state on a, a∈R n1 The source domain D x The action on , u∈R n2 Target Domain The action on the , t is the time step, m 1 and m 2 is the dimension of the state, n 1 and n 2 The dimension of action;
[0042] The source domain and target domain of states and actions have the following mapping: 1 =m 2 , n 1 =n 2 , H(x,a)=u,
[0043] definition is the state mapping function between the source domain and the target domain, and is the inverse action mapping function between the source domain and the target domain. The positive dynamics model F(x t , a t )=x t+1 , respectively collect state and action data on the source domain and target domain Use supervised learning to train the model and define the objective function as:
[0044]
[0045]
[0046]
[0047] Among them, ||.|| 1 is 1 norm; the state mapping function G and the action mapping function P convert the state in the target domain at a certain moment With action u t Map to the source domain and get the state in the source domain With action As the input of the positive dynamics model F on the source domain; the state mapping function G transforms the target domain state Map it to the source domain and get the state value of the next time step in the source domain Fixed model F, through the training of P, makes the output of F approximately equal to Models F, P, and H are all trained using fully connected neural networks. Model F is trained first, then model F is fixed and model P is trained, and then model P is fixed and model H is trained.
[0048] The present invention has the following beneficial effects:
[0049] The present invention adopts a model predictive control algorithm to compensate for the movement of the end effector to reduce its tracking error; at the same time, it can improve the computational efficiency of the model predictive control algorithm in processing multi-degree-of-freedom and multi-constraint systems and increase the control frequency; in addition, the present invention adopts a transfer reinforcement learning method to give a more accurate system model, especially after the system dynamics model is changed by changes in load, degradation of system performance, etc., a more accurate system model can still be given to form effective control.
[0050] In order to more clearly illustrate the purpose, technical solutions and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is a schematic diagram of the control framework of the present invention. Figure 1 ;
[0052] Figure 2 This is a schematic diagram of the control framework of the present invention. Figure 2 ;
[0053] Figure 3 is a schematic diagram of two coordinate systems and motion representation of the mobile platform of the present invention;
[0054] Figure 4 It is a framework diagram of the model predictive control algorithm of the present invention;
[0055] Figure 5 It is a schematic diagram showing how a fixed target becomes a moving target relative to an inertial reference frame;
[0056] Figure 6 It is a framework diagram of the reinforcement learning algorithm of the present invention;
[0057] Figure 7 It is the learning mechanism of reinforcement learning of the present invention;
[0058] Figure 8 It is a framework diagram of the state alignment of the original environment and the new environment of the present invention;
[0059] Fig. 9 It is a framework diagram of the control strategy transfer of the present invention;
[0060] Fig.10 It is a schematic diagram of the corresponding relationship between the state and the action between the source domain and the target domain of the present invention;
[0061] Fig.11 It is a schematic diagram of the policy migration process between the source domain and the target domain of the present invention. DETAILED DESCRIPTION
[0062] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0063] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0064] The embodiment of the present invention provides a predictive control method for an underwater robot system equipped with a robotic arm, so that the robotic arm on a mobile platform maintains an ideal end effector state; Figure 1-2 As shown, the predictive control method includes the following steps:
[0065] Step S10, modeling the mobile platform and the mechanical arm in the underwater robot system;
[0066] Among them, Figure 1 As shown in the figure, the desired posture p(t) of the end effector is input and decomposed into the desired posture x of the mobile platform 1 (t) and the desired posture x of the robot arm 2 (t):
[0067] p(t)=x 1 (t)+x 2 (t);
[0068] Step S11, establishing a model of the mobile platform and defining a controller of the mobile platform;
[0069] Expected pose for mobile platform x 1 (t), we have: x 1 (t) = [η μ τ];
[0070] η=[x,y,z,ψ] T
[0071] μ=[u,v,w,r] T
[0072] In the fixed reference system: τ=[F u , F v , F w , T r ] T
[0073] Among them, η is the position and direction information of the origin of the mobile platform relative to the fixed reference system, μ is the description of the origin velocity in this coordinate system, and τ represents the force and torque acting on the mobile platform in this coordinate system, as shown in Figure 3 shown.
[0074] In still water, the dynamic equation for a moving platform is:
[0075]
[0076] Among them, v is the velocity matrix of the mobile platform, M is the inertia matrix including the additional mass, C is the centrifugal force and Coriolis force matrix, D is the hydrodynamic damping matrix, g is the vector of the combined torque of gravity and buoyancy, η is the position attitude information matrix of the mobile platform, and τ is the thrust output matrix of the thruster.
[0077] Convert the continuous time model to a discrete time model and rewrite the equation using the first-order Taylor expansion as follows:
[0078] f(v(t), η(t))=C(v(t))v(t)+D(v(t))v(t)+g(η(t))
[0079]
[0080] v(t+1)=v(t)+M -1 τ(t)Δt-M -1 f(v(t),η(t))Δt
[0081] Define the controller for the mobile platform as:
[0082]
[0083] Among them, μ d ∈R 3 is the linear velocity required for the mobile platform, ω d ∈R 3 is the angular velocity required for the mobile platform, are the vector components of the quaternion error, is the scalar component of the quaternion error, E v =∫e v dt∈R 3 is the integral of the mobile platform position error, Eη =∫e η dt∈R 3 is the integral of the mobile platform direction error, K ν , K η ∈R 3×3 is the gain matrix, ψ 1 (·) is the control strategy of the mobile platform, τ 1 (t) is the thrust output by the mobile platform.
[0084] Step S12: Establish a model of the robot arm and define a controller of the end effector;
[0085] The desired posture x of the robot arm (six degrees of freedom) 2 (t), there are:
[0086] x 2 (t) = [θ 1 θ 2 θ 3 θ 4 θ 5 θ 6 ];
[0087] The Cartesian coordinate system is used to describe the position and posture of the robot arm:
[0088]
[0089] The upper left corner 3×3 is the spatial rotation matrix, which is determined by the Euler angle. The first column is the yaw angle, which represents the rotation around x. 0 The second column is the pitch angle, which means the rotation angle around the y axis. 0 The third column is the roll angle, which indicates the rotation angle around the z axis. 0 The right side is the length mapping on the coordinate system, p x 、p y With p z are the length components of point p in the x-axis, y-axis, and z-axis directions.
[0090] The rotation matrix for rotating θ around the x-axis, y-axis, and z-axis is:
[0091]
[0092]
[0093]
[0094] The transformation matrix between each coordinate system obtained by the DH modeling method is:
[0095]
[0096] in, represents the total homogeneous transformation matrix from the i-1 joint coordinate system to the i joint coordinate system, α i-1 is the joint twist angle, a i-1 is the length of the connecting rod, d i is the offset of the connecting rod, θ i It refers to the rotation angle of the joint.
[0097] The total transformation matrix of the end effector position parameters relative to the underwater robot body coordinate system is:
[0098]
[0099] The rotation angle of each joint is solved by the inverse matrix of the homogeneous transformation:
[0100]
[0101]
[0102]
[0103]
[0104] θ 4 =θ 234 -θ 2 -θ 3
[0105]
[0106]
[0107] The resultant force F of each link i of the robot arm i and moment M i for:
[0108]
[0109]
[0110] Among them, m i is the mass of connecting rod i, I i is the inertia matrix of link i, the linear acceleration of the center of mass of link i Angular acceleration of connecting rod i for:
[0111]
[0112] in, is a constant matrix, is the angular velocity of joint i, is the angular acceleration of joint i, Zi is the unit vector of the connecting rod in the z-axis direction, i-1 p i is the position of the origin of the coordinate system of joint i in the coordinate system of joint (i-1), i p ci. is the coordinate of the center of mass of connecting rod i, i f i and i n i represents the force and torque applied by link (i-1) on link i in the link i coordinate system, then the joint driving torque τ of each link i i for:
[0113]
[0114] When the current state is known, there are no obstacles in the environment, and the given end-effector posture is achievable, the dynamic equation of the robot arm in the mobile platform coordinate system is expressed as:
[0115]
[0116] Among them, ξ v =[v(t),η(t)] T is the position and posture of the mobile platform, is the Jacobian matrix of the manipulator in the inertial system, τ 2 is the driving torque matrix of each joint of the robot arm, M m is the inertia matrix, C m is the Coriolis force and centrifugal force matrix, G m is the gravity matrix, f ext It is the interaction force that the target environment exerts on the end effector when the robotic arm interacts with the target. It is the interaction force that the target environment exerts on the end effector when the robotic arm interacts with the target.
[0117] The controller of the end effector is defined as:
[0118]
[0119] Among them, v d ∈R 3 is the required linear velocity of the end effector, is the required angular velocity of the end effector, are the vector components of the quaternion error, is the scalar component of the quaternion error, E p =∫e p dt∈R 3 is the integral of the end effector position error, E 0 =∫e o dt∈R3 is the integral of the end effector direction error, K p , K i ∈R 3×3 is the gain matrix.
[0120] Step S20: Model predictive control (MPC) is used for the constructed model, kinematic feasibility is considered, quadratic programming (QP) is used for rapid solution, external disturbances are compensated, and the future corrected posture of the mobile platform and the robotic arm is obtained; Figure 4 As shown, the details are as follows:
[0121] Step S21: predict the motion of the mobile platform and model the motion of the mobile platform as a linear time-invariant system with affine perturbation: 3 (t+1)=Ax 3 (t)+Bu(t), where x 3 The state vector of the mobile platform, u is the interference to the mobile platform, Propagate the control action from velocity to displacement, Give the distinction between sequential perturbations;
[0122] Prediction of future states from any time node N for:
[0123]
[0124] in, is the estimated value of the disturbance;
[0125] Unify disturbance observation and state prediction into an estimate of the state, use historical state data, and use an autoregressive model (AR) to estimate and predict future states for:
[0126]
[0127] Among them, y t is the state matrix, i is the ordinal number of data sampling, and p is the number of items.
[0128] Step S22, decomposing the tracking of the target point in the inertial system into the movement of the mobile platform in the inertial system and the movement of the robot arm in the mobile platform coordinate system, so as to eliminate the interference of the mobile platform movement on the end effector;
[0129] To expand on this, a stationary point relative to a fixed coordinate system will appear as a moving point relative to a moving coordinate system. The problem of a mobile robot maintaining a fixed end effector pose in an inertial coordinate system is transformed into a trajectory tracking problem studied from the perspective of the robot. It follows that tracking a trajectory in an inertial coordinate system involves tracking a transformed trajectory relative to the robot. By predicting the motion of the mobile platform, a future trajectory can be generated for the robot to follow. By tracking the transformed trajectory, interference with the end effector, such as Figure 5 shown.
[0130] Convert the posture of the mobile platform relative to the fixed coordinate system {B} to the inertial coordinate system { / } with the mobile platform as the origin:
[0131]
[0132] in, is the posture of the mobile platform in the inertial coordinate system, The rotation matrix representing the relative orientation of the mobile platform in the inertial coordinate system, Represents the position of the mobile platform in the inertial coordinate system.
[0133] Given the predicted pose of the mobile platform at time step i ahead The motion posture of the end effector relative to the mobile platform (inertial coordinate system) Converted into the motion posture of the end effector relative to the fixed coordinate system
[0134]
[0135] Step S23: predict the motion of the end effector and control the desired position of the end effector by the position of the end effector at any time and the control input:
[0136]
[0137] Among them, x 4 (t+i)∈R 3 is the desired position of the end effector, x 4 (t) is the known position of the end effector at any time, v∈R 3 is the discrete control input for each time step, Δt -1 To control the frequency.
[0138] In the fixed coordinate system, the current end effector position with the desired position of the future end effector The deviation between It is expressed as:
[0139]
[0140] The error is expressed as:
[0141]
[0142] in, is the expected direction of the end effector at future time step i, is the conjugate of the current direction of the end effector, η∈R is the scalar component of the quaternion, ε∈R 3 are the vector components of the quaternion.
[0143] Similarly, the error between the desired angle of the end effector and the current angle It is expressed as:
[0144]
[0145] Among them, ω∈R 3 is the required angular velocity of the end effector.
[0146] Use the convex cost function c 1 Represents the deviation of the end effector posture:
[0147]
[0148] in, is the deviation vector between the current posture of the end effector and the expected posture; is the predicted posture deviation vector at future time step i, is the vector of the end effector velocity within the prediction range, is the linear velocity and angular velocity required by the end effector at the future time step J, Propagate the control action from velocity to displacement, I∈R 6×6 is the identity matrix, G∈R 6N×6N is a positive definite weight matrix.
[0149] Add cost function c 2 Control the motion in a minimal sequence to minimize the acceleration of the end effector:
[0150]
[0151] in, Contains the controller's previous control operations, Given the distinction between sequential control actions, Q∈R 6N×6N is a positive definite weight matrix.
[0152] Constrained by the kinematic feasibility of the joint, the control behavior is limited to a feasible region within the entire predictive control range, and the constraint solution needs to be solved:
[0153]
[0154] Where i=1,...,N-1, and are the lower and upper limits of the joint velocity.
[0155] The joint positions are propagated throughout the control range in a recursive, nonlinear manner:
[0156]
[0157] Given the current state θ(t) of the joint, and considering kinematic feasibility, the following QP problem is proposed to provide a fast solution:
[0158]
[0159]
[0160] Consider the propagation of joint states within the predictive control context:
[0161]
[0162] like The solution of is feasible, and θ(t+1|t) is also feasible. After updating the controller state in the next control loop, the joint state becomes:
[0163] θ(t+1|t+1)=θ(t+1|t)
[0164] For any i, θ(t+i|t+i) is always feasible, that is, the trajectory of the joints of the robot arm is always feasible.
[0165] Step S30: A controller based on reinforcement learning (RL) is used for the mobile platform and the end effector; when the dynamic model changes, the strategy trained in the source domain is adjusted accordingly to make it more suitable for the target domain, such as Figure 6-7 shown.
[0166] The reward functions of the reinforcement learning algorithm (RL) are defined for the mobile platform and the end effector respectively as:
[0167]
[0168] Where d∈R 3 is the distance between the subject and the target point in the x, y, and z axes; v∈R 4is the current velocity of the subject, including the linear velocity in the x, y, and z directions and the angular velocity around the z axis; a∈R 4 is the subject’s current control strategy, and α is the corresponding coefficient;
[0169] At each time step t, the system receives a state observation s t =[d t , v t ], take action t , and receive reward r t ; The payoff of a state is defined as the sum of discounted future rewards Discount factor γ∈[0,1], reinforcement learning based on the initial distribution To maximize expected returns;
[0170] Define the value function Q π (s t , a t ), describing the state s t Take action in t The expected return after and the subsequent strategy π is:
[0171] Using the recursive relationship of the Bellman equation, we get:
[0172]
[0173] Use the greedy strategy μ(s, a) = argmax a Q(s, a) and Q μ Parameterized function approximator, defining the function μ(s|θ μ ) is used to deterministically map states to specific actions to specify the current strategy; the discounted state display distribution of strategy π is represented as ρ π , β is a randomly generated different strategy;
[0174] Update μ(s|θ μ )function:
[0175]
[0176]
[0177] Repeatedly update μ(s|θ μ ) function, get the current optimal strategy π and the action a taken t .
[0178] The controller selects and executes actions based on the initial control strategy, updates the control strategy based on the pre-defined reward function and the real-time environmental signals obtained, and determines whether it is the optimal strategy; if it is the optimal control strategy, the current learning is terminated and the corresponding action is executed, otherwise the learning process is repeated until the optimal control strategy is reached, thereby achieving the optimal control effect.
[0179] Step S40: When the underwater robot system is subject to a large disturbance and the dynamic model does not match, the control strategy is migrated to keep the robot arm on the mobile platform in an ideal end effector state.
[0180] like Figure 8-11 As shown, the system is in the source domain D x The trajectory on System in target domain The trajectory on where x∈R m1 The source domain D x The state of Target Domain The state on a, a∈R n1 The source domain D x The action on , u∈R n2 Target Domain The action on the , t is the time step, m 1 and m 2 is the dimension of the state, n 1 and n 2 The dimension of action;
[0181] To make the strategy transfer feasible, the source domain and target domain of the state and action have the following mapping: 1 =m 2 , n 1 =n 2 , H(x,a)=u,
[0182] definition is the state mapping function between the source domain and the target domain, and is the inverse action mapping function between the source domain and the target domain. The positive dynamics model F(x t , a t )=x t+1 , respectively collect state and action data on the source domain and target domain Use supervised learning to train the model and define the objective function as:
[0183]
[0184]
[0185]
[0186] Among them, ||.|| 1 is 1 norm; the state mapping function G and the action mapping function P convert the state in the target domain at a certain moment With action u t Map to the source domain and get the state in the source domain With action As the input of the positive dynamics model F on the source domain; the state mapping function G transforms the target domain state Map it to the source domain and get the state value of the next time step in the source domain Fixed model F, through the training of P, makes the output of F approximately equal to Models F, P, and H are all trained using fully connected neural networks. Model F is trained first, then model F is fixed and model P is trained, and then model P is fixed and model H is trained.
[0187] Although the present invention is disclosed as above with specific embodiments, these specific embodiments are not intended to limit the scope of the present invention. Any person skilled in the art may make some changes / modifications without departing from the scope of the present invention, that is, any equivalent changes / modifications made according to the present invention should be covered by the protection scope of the present invention.
Claims
1. A predictive control method for an underwater robot system equipped with a robotic arm, which enables the robotic arm on a mobile platform to maintain an ideal end effector state. It is characterized in that The predictive control method comprises the following steps: Step S10, modeling the mobile platform and the mechanical arm in the underwater robot system; Step S20: Model predictive control (MPC) is used for the constructed model, kinematic feasibility is considered, quadratic programming (QP) is used for rapid solution, external disturbances are compensated, and the future corrected postures of the mobile platform and the robotic arm are obtained; Step S30: A controller based on reinforcement learning (RL) algorithm is used for the mobile platform and the end effector; the controller selects and executes actions according to the initial control strategy, updates the control strategy according to the predefined reward function and the acquired real-time environmental signal, and determines whether it is the optimal strategy; if it is the optimal control strategy, the current learning is terminated and the corresponding action is executed, otherwise the learning process is repeated until the optimal control strategy is reached; the reward function is: Where d∈R 3 is the distance between the subject and the target point in the x, y, and z axes; v∈R 4 is the current velocity of the subject, including the linear velocity in the x, y, and z directions and the angular velocity around the z axis; a∈R 4 is the subject’s current control strategy, and α is the corresponding coefficient; Step S40: When the underwater robot system is subject to a large disturbance and the dynamic model does not match, the control strategy is migrated so that the robot arm on the mobile platform maintains an ideal end effector state; Wherein, step S20 includes the following: Step S21: predict the motion of the mobile platform and model the motion of the mobile platform as a linear time-invariant system with affine perturbation: 3 (t+1)=Ax 3 (t)+Bu(t), where x 3 The state vector of the mobile platform, u is the interference to the mobile platform, Propagate control actions from velocity to displacement Give the distinction between sequential perturbations; Unify disturbance observation and state prediction into state estimation, use historical state data, and adopt autoregressive model (AR) to estimate and predict future state; Step S22, decomposing the tracking of the target point in the inertial system into the movement of the mobile platform in the inertial system and the movement of the robot arm in the mobile platform coordinate system, so as to eliminate the interference of the mobile platform movement on the end effector; Step S23: predict the motion of the end effector and control the desired position of the end effector by the position of the end effector at any time and the control input: Among them, x 4 (t+i)∈R 3 is the desired position of the end effector, x 4 (t) is the known position of the end effector at any time, v∈R 3 is the discrete control input for each time step, Δt -1 To control the frequency; The method of policy migration in step S40 is: The system is in the source domain D x The trajectory on System in target domain The trajectory on where x∈R m1 The source domain D x The state of Target Domain The state on a, a∈R n1 The source domain D x The action on , u∈R n2 Target Domain The action on the , t is the time step, m 1 and m 2 is the dimension of the state, n 1 and n 2 The dimension of action; The source domain and target domain of states and actions have the following mapping: 1 =m 2 , n 1 =n 2 , H(x,a)=u, definition is the state mapping function between the source domain and the target domain, and is the inverse action mapping function between the source domain and the target domain. The positive dynamics model F(x t , a t )=x t+1 , respectively collect state and action data on the source domain and target domain Use supervised learning to train the model and define the objective function as: Among them, ||·|| 1 is 1 norm; the state mapping function G and the action mapping function P convert the state in the target domain at a certain moment With action u t Map to the source domain and get the state in the source domain With action As the input of the positive dynamics model F on the source domain; the state mapping function G transforms the target domain state Map it to the source domain and get the state value of the next time step in the source domain Fixed model F, through the training of P, makes the output of F approximately equal to Models F, P, and H are all trained using fully connected neural networks. Model F is trained first, then model F is fixed and model P is trained, and then model P is fixed and model H is trained.
2. The predictive control method according to claim 1, Features: In step S10, The dynamic equation of the mobile platform is: Wherein, v is the velocity matrix of the mobile platform, M is the inertia matrix including the additional mass, C is the centrifugal force and Coriolis force matrix, D is the hydrodynamic damping matrix, g is the vector of the combined moment of gravity and buoyancy, η is the position attitude information matrix of the mobile platform, and τ is the thrust output matrix of the propeller; In the mobile platform coordinate system, the dynamic equation of the robot arm is: Among them, ξ v =[v(t),η(t)] T is the position and posture of the mobile platform, is the Jacobian matrix of the manipulator in the inertial system, τ 2 is the driving torque matrix of each joint of the robot arm, M m is the inertia matrix, C m is the Coriolis force and centrifugal force matrix, G m is the gravity matrix, f ext It is the interaction force exerted by the target environment on the end effector when the robot arm interacts with the target.
3. The predictive control method according to claim 2, Features: In step S10, Step S11: define the controller of the mobile platform as: Among them, μ d ∈R 3 is the linear velocity required for the mobile platform, ω d ∈R 3 is the angular velocity required for the mobile platform, are the vector components of the quaternion error, is the scalar component of the quaternion error, Ev = ∫e v dt∈R 3 is the integral of the mobile platform position error, E η =∫e η dt∈R 3 is the integral of the mobile platform direction error, K v , K η ∈R 3×3 is the gain matrix, ψ 1 (.) is the control strategy of the mobile platform, τ 1 (t) is the thrust output by the mobile platform; Step S12: define the controller of the end effector as: Among them, v d ∈R 3 is the required linear velocity of the end effector, is the required angular velocity of the end effector, are the vector components of the quaternion error, is the scalar component of the quaternion error, E p =∫e p dt∈R 3 is the integral of the end effector position error, E 0 =∫e o dt∈R 3 is the integral of the end effector direction error, K p′ K i ∈R 3×3 is the gain matrix.
4. The predictive control method according to claim 3, Features: In step S30, At each time step t, the system receives a state observation s t =[d t , v t ], take action t , and receive reward r t ; The payoff of a state is defined as the sum of discounted future rewards Discount factor γ∈[0,1], reinforcement learning based on the initial distribution To maximize expected returns; Define the value function Q π (s t , a t ), describing the state s t Take action in t The expected return after and the subsequent strategy π is: Using the recursive relationship of the Bellman equation, we get: Use the greedy strategy μ(s, a) = argmax a Q(s, a) and Q μ Parameterized function approximator, defining the function μ(s|θ μ ) is used to deterministically map states to specific actions to specify the current policy; the discounted state display distribution of policy π is represented as p π , β is a randomly generated different strategy; Repeatedly update μ(s|θ μ ) function, get the current optimal strategy π and the action a taken t .
