Detailed Description
The invention will now be described in detail with reference to the accompanying drawings and specific examples.
For convenience of subsequent description, the coordinate system and the contracted symbols of the underwater vehicle are introduced.
As shown in fig. 2, the attitude angle and position of the underwater vehicle are defined under a geographic coordinate system. Wherein x represents displacement in the x-axis, y represents displacement in the y-axis, and z represents displacement in the z-axis, wherein phi represents the angle of rotation about the x-axis, theta represents the angle of rotation about the y-axis, and ψ represents the angle of rotation about the z-axis.
The compact matrix is written as a pose matrix eta= [ x, y, z, phi, theta, phi ] T.
Under the body coordinate system, the linear velocity and the angular velocity of the underwater vehicle are defined. Where μ represents displacement in the x-axis, v represents displacement in the y-axis, w represents displacement in the z-axis, where p represents angular velocity of rotation about the x-axis, q represents angular velocity of rotation about the y-axis, and r represents angular velocity of rotation about the z-axis.
The compact matrix is written as a velocity matrix v= [ μ, v, w, p, q, r ] T. The underwater vehicle has a mass m and an inertial tensor mThe diagonal elements I x,Iy,Iz are the moment of inertia on the x, y, z axes, respectively, and the remaining non-diagonal elements are the corresponding products of inertia. (x G,yG,zG) is the centroid coordinates of the underwater vehicle.
In addition, the external force and the external moment applied to the underwater vehicle in the X, Y and Z axes are (X, Y, Z) and (K, M, N), respectively.
According to the related deduction content of the first chapter in Marine Control System written by Fossen, a kinetic model in the form of an underwater vehicle matrix can be obtained as follows:
(1) Where m=m RB+MA is the quality matrix
M RB and M A represent a rigid body inertial matrix and an additional mass matrix, respectively. Wherein the rigid body inertial matrix is used for generating a rigid body inertial matrix,
And for the underwater autonomous robot which is approximately triaxial-symmetrical in whole and has low navigational speed, the additional mass matrix is a diagonal matrix.
The diagonal elements correspond to additional masses or additional moments of inertia in six degrees of freedom, respectively.
(2) Wherein C (v) =c RB+CA is coriolis Li Juzhen
(3) Wherein D (v) =d L+DNL is a fluid resistance matrix
DL=diag(Xu,Yv,Zw,Kp,Mq,Nr)
DNL=diag(Xu|u||u|,Yv|v||v|,Zw|w||w|,Kp|p||p|,Mq|q||q|,Nr|r||r|)
D L is a diagonal matrix called linear drag matrix, the diagonal elements are linear drag coefficients in six degrees of freedom, D NL is also a diagonal matrix called nonlinear drag matrix, the diagonal elements are the product of the nonlinear drag coefficients in six degrees of freedom and the absolute value of velocity (or angular velocity).
(4) Wherein g (eta) is a restoring force matrix
W is the gravity of the underwater vehicle, and B is the buoyancy of the underwater vehicle.
(5) Wherein τ= [ X, Y, Z, K, M, N ] T is an external force matrix to which the underwater vehicle is subjected.
The invention relates to a method for tracking and controlling a motion path of a side-moving of an autonomous underwater robot, which comprises the following steps:
First, selecting proper state vectors and input vectors according to a dynamics model of the autonomous underwater robot, and designing two model prediction controllers, namely a forward-steering motion controller C1 and a transverse motion controller C2.
The basic design method of the model predictive controller can refer to the contents of chapter five and chapter six of model predictive control written by Chen Hong, and the dynamics model of the autonomous underwater robot is described above. The forward-steering motion controller and the transverse motion controller are based on the same dynamic model, and only different state vectors and corresponding input vectors are selected in the dynamic model according to specific control targets in the design process, so that a model used in the specific model prediction controller can be formed. The method specifically comprises the following steps:
(a) From the dynamics model and the state vector, the input vector gets the model needed by the model predictive controller:
wherein the state vector is x (t) ∈r n, the input vector is u (t) ∈r n,x0 is the initial state, and the input and state constraints are:
u is a finite set formed by input vector constraints, and X is a finite set formed by state vector constraints;
(b) The optimization problem is determined as follows:
The constraint conditions are satisfied:
Wherein, the
T p is the prediction time domain, Q epsilon R n×n and R epsilon R m×m are positive symmetry weighting matrixes, J is the objective cost function of the control problem, and U and x are input constraint and state constraint sets respectively; The model predictive controller predicts the system state variables and input variables in the process, Ω being the set of system states including the balance point.
(C) After the state vector and the input vector are selected, the optimal control input is obtained through the model predictive controller:
Positive definite symmetric matrix P calculation
Linearizing the model at the equilibrium point can result in:
Wherein, the
If the linearization system is controllable, a linear feedback u=kx can be found such that the system is closed loop
A K =a+bk is asymptotically stable, there must be a unique symmetric positive definite matrix P that satisfies:
(d) To this end, by solving the above-described optimization problem at each sampling timing, the optimal control sequence U * can be obtained, and the optimal control input at that sampling timing is the first element of U * (t), that is, U *=U* (t).
Examples:
(1) In the state of the autonomous underwater robot dynamics model, the state vector x 1 is formed by selecting the quantity related to forward-steering motion from a velocity matrix and a pose matrix, such as forward speed u, z-axis rotation angular speed r and the like, the input vector u 1 is formed by selecting the corresponding component in an external force matrix, and the model required by the forward-steering motion controller C1 can be obtained according to the dynamics model assuming that the target cost function of the forward-steering motion control problem is J 1:
Where x 1 is the initial state of the device, Representing the derivative of x 1 (t), f 1 represents a second order continuous differentiable function associated with x 1,u1.
By solving the constraint optimization problem:
Constraint:
can obtain the optimal input vector
In the above formula:
T p is the prediction horizon, U represents the input constraint set, X represents the state constraint set, Representing the variables of the intra-controller prediction system,Is a positively-defined symmetric weighting matrix,Is a positive definite symmetric matrix, n 1 is the length of the state vector x 1, and m 1 is the length of the input vector u 1.For the model predictive controller to predict system state variables and input variables in the process, Ω 1 is the set of system states including the balance point.
(2) In the state of the dynamics model of the autonomous underwater robot, selecting the quantities related to transverse motion, such as transverse velocity v, transverse displacement y and the like, from a velocity matrix and a pose matrix to form a state vector x 2, selecting the corresponding components in an external force matrix to form an input vector u 2, setting the objective cost function of the transverse motion control problem to be J 2, and obtaining the model required by the transverse motion controller C2 according to the dynamics model:
where x 2 is the initial state of the device, Representing the derivative of x 2 (t), f 2 represents a second order continuous differentiable function associated with x 2,u2.
By solving the constraint optimization problem:
Constraint:
can obtain the optimal input vector
In the above formula:
T p is the prediction horizon, U represents the input constraint set, X represents the state constraint set, Representing the variables of the intra-controller prediction system,Is a positively-defined symmetric weighting matrix,Is a positive definite symmetric matrix, n 2 is the length of the state vector x 2, and m 2 is the length of the input vector u 2.For the model predictive controller to predict system state variables and input variables in the process, Ω 2 is the set of system states including the balance point.
And secondly, setting a plurality of target waypoints and final waypoints which pass through in the course according to a pre-planned autonomous underwater robot path, and setting a transverse error threshold delta l and a navigation angle error threshold delta Ψ of the autonomous underwater robot in the course of movement along the course. The method specifically comprises the following steps:
(a) Determining a navigation route of the autonomous underwater vehicle according to an actual task, setting a discrete navigation point obtained by sampling in advance as a target navigation point in a tracking process, wherein the set of all target navigation points is as follows:
{(x1,y1),(x2.y2),(x3,y3),...,(xn,yn)}
Wherein, (x n,yn) is the final waypoint;
(b) And setting a transverse error threshold delta l and an angle error threshold delta Ψ according to the size and control requirements of the autonomous underwater robot.
Thirdly, the current position (x, y) and the current target waypoint (x k,yk) of the autonomous underwater robot are obtained, the distance L between the current position (x, y) and the current target waypoint (x k,yk) is calculated, and the critical radius R of the waypoint switching is calculated to judge whether the current target waypoint is reached. And if the current target waypoint is not reached, the fifth step is executed. The method specifically comprises the following steps:
(a) Calculating the distance L between the current position (x, y) and the current target waypoint (x k,yk):
(b) The calculation formula of the critical radius is as follows:
Wherein R min,Rmax is the minimum and maximum value of critical radius, u is the current speed, theta p is the included angle between two continuous paths, l is the radial length of the underwater robot, and k u,kθ is the speed influence factor and the angle influence factor, respectively.
(C) When the distance L is less than or equal to the critical radius R, the current target waypoint is considered to be reached, and the following fourth step is performed.
(D) When the distance L is greater than the critical radius R, the current target waypoint has not been reached yet, and the following fifth step is performed.
Fourth, the current target waypoint (x k,yk) is compared with the final waypoint set in the second step. And if the target waypoint is not the final waypoint, updating the position information of the current target waypoint according to the target waypoint sequence set in the second step, and continuously executing the fifth step. The method specifically comprises the following steps:
(a) Acquiring the values of a current target navigation point (x k,yk) and a final navigation point (x n,yn);
(b) If x k=xn and y k=yn, it is stated that the final waypoint is reached, all tasks are ended.
(C) If x k≠xn or y k≠yn, indicating that the final waypoint has not been reached, updating the current target waypoint to be the next target waypoint in the target waypoint sequence.
Fifthly, acquiring data of specific position information of a current course angle ψ, a target course point (x k,yk) and a next target course point (x k+1,yk+1), and simultaneously calculating a current lateral error dl and a course angle error dψ, if the lateral error and the course angle error are smaller than a set threshold value, calculating an expected course angle ψ d and a lateral displacement y d, and starting an advancing-steering motion controller C1 and a lateral motion controller C2, otherwise, only calculating an expected course angle ψ d, and starting the advancing-steering motion controller C1, wherein the method specifically comprises the following steps:
(a) Calculating the current lateral error dl:
firstly, calculating a linear equation of a current path point (x k,yk) and a next path point (x k+1,yk+1):
Ax+By=C
Wherein:
A=yk+1-yk
B=xk-xk+1
C=xk(yk-yk+1)-yk(xk-xk+1)
According to the current position (x, y), there is a lateral error:
(b) Calculating a heading angle error dψ:
First, the direction of the target path is calculated according to the current path point (x k,yk) and the next path point (x k+1,yk+1):
Then, based on the current heading angle ψ, the heading angle error can be calculated as:
dΨ=|Ψ-θroad|
(c) Determine whether to activate the lateral motion controller C2
When the lateral error dl is smaller than the lateral error threshold delta l and the heading angle error dψ is smaller than the heading angle error threshold delta Ψ, the forward-steering motion controller C1 and the lateral motion controller C2 are required to be started, otherwise, only the forward-steering motion controller C1 is required to be started, and the lateral motion controller C2 is not required to be started;
(d) When the lateral motion controller C2 needs to be activated, the expected heading angle and the expected lateral motion displacement are calculated as follows:
the expected heading angle calculation formula is:
the expected lateral motion displacement is:
(e) When the lateral motion controller C2 does not need to be activated, the expected heading angle is calculated as follows:
Firstly, setting a look-ahead distance d, and solving an intermediate waypoint (x temp,ytemp) which is close to the next target waypoint on the current path, wherein the intermediate waypoint (x temp,ytemp) meets the following requirements:
Axtemp+Bytemp=C
(xtemp-x)2+(ytemp-y)2=dl2+d2
The expected heading angle is calculated as follows:
and the desired lateral displacement need not be designed.
And sixthly, respectively starting the forward-steering motion controller C1 and the transverse motion controller C2 to calculate the control quantity according to the judging result of the previous step, and then respectively sending control instructions to the forward propeller or the lateral propeller to control the autonomous underwater robot to approach the target waypoint. The method specifically comprises the following steps:
(a) If in the fifth step it is determined that the lateral motion controller C2 needs to be activated, the expected heading angle ψ d is input first, and the control amount is calculated by the forward-steering controller C1 The forward propeller is sent out a control command to control the current course angle to approach the expected course angle, and simultaneously, the expected lateral displacement is input, and the control quantity is calculated by using a lateral motion controller C2And a control instruction is sent to the lateral propeller to control the current lateral displacement to approach the expected lateral displacement.
(B) If in the fifth step, it is determined that the lateral motion controller C2 is not required to be activated, only the expected heading angle ψ d is input, and the control amount is calculated by the forward-steering controller C1A control instruction is sent to the forward propeller to control the current course angle to approach the expected course angle;
Seventh, according to the acquired sampling data a x,ay of the accelerometer and the acquired sampling data v x,vy of the doppler log, performing kalman fusion filtering according to the flow shown in fig. 4, and estimating the current position (x, y), specifically including:
(a) After executing the control instruction of the controller in the sixth step, acquiring the sampling data a x,ay of the accelerometer and the sampling data v x,vy of the Doppler log;
(b) Giving a measurement error E m of the Doppler log;
(c) Judging whether the fusion filtering is the first fusion filtering or not, and respectively calculating to obtain a filtering gain k x,ky;
if the first fusion filtering is performed, k x=ky =0.5;
if not, the first fusion filtering is calculated by the following two formulas:
kx=Ex/(Ex+Em)
ky=Ey/(Ey+Em)
Wherein E x,Ey is the estimated error obtained by the last filtering.
(D) Calculating a filtered velocity valueAndThe calculation formula is as follows:
(e) The estimation errors E x and E y are calculated as follows:
(f) The final position (x, y) is output and the calculation formula is as follows:
(g) Returning to the operation content of the third step.
And eighth step, repeating the operation contents of the third step to the seventh step, so that the autonomous underwater robot can realize efficient and stable motion control in the running process and accurately track the target path.
A more specific example of application:
One specific implementation of the invention will now be described in connection with an autonomous underwater vehicle of the rotor type. The rotor type autonomous underwater vehicle has four vertical thrusters and two horizontal thrusters, and has six degrees of freedom control capability. The force analysis schematic diagram is shown in fig. 3, and F 1,F2,...,F6 is the thrust of 6 propellers respectively. The method for tracking and controlling the calculated side-moving motion path of the autonomous underwater robot comprises the following steps:
1. The forward-steering controller and the lateral motion controller are designed.
Combining the above-mentioned water power motion equation of the aircraft, selecting the state vector x 1=[x,y,ψ,u,v,r]T and the input vector u 1=[F5,F6]T to derive the model of the forward-steering model predictive controller of the rotor-type autonomous underwater robot, namely, self-adaptiveThe deployment is as follows:
Wherein l is the axial length of the rotor type autonomous underwater robot.
The forward-steering controller C1 can be obtained in combination with the model predictive control design method described above.
Similarly, the state variable x 2=[y,φ,v,p]T is selected, and the input variable u 2=[F1,F2,F3,F4]T can be deduced to obtain the model of the transverse motion model predictive controller of the rotor type autonomous underwater robot, namely The deployment is as follows:
the lateral motion controller C2 can be obtained by combining the model predictive control design method described above.
It should be noted that the input vectors of the two model predictive controllers C1 and C2 are composed of the thrust of the propeller, so that the final controller obtains the optimal thrust of each propeller, and the propeller thrust has a fixed functional relationship with the propeller rotation speed, so that the rotation speed of the propeller can be reversely pushed out through the optimal thrust, and further the required propeller instruction is obtained.
2. And determining a target waypoint. In this example, the waypoints are as follows:
{(3,0),(3,15),(13,15),(13,5),(23,5),(23,15),(33,15)}
Determining a lateral error threshold Δl=0.5m and an angular error threshold
3. The calculation contents of the third to eighth steps are completed by means of a computer simulation program according to the method described above.
In order to embody the effectiveness of the method, the applicant also makes a comparison simulation experiment under the same condition by using the method and a common sight line method respectively. Wherein, fig. 5 shows the comparison of the results of the method of the present invention and the normal sight line method waypoint tracking when turning right a large angle, and fig. 6 shows the comparison of the results of the method of the present invention and the normal sight line method waypoint tracking when turning left a large angle, it can be seen that the method of the present invention can track the path more quickly when turning right a large angle.
Fig. 7 further shows the comparison result of the tracking error of the method and the normal line-of-sight method, and it is obvious that the tracking error of the method is smaller than that of the normal line-of-sight method on the whole path by comparing the two curves. Therefore, the method of the present invention has significant advantages in reducing tracking errors.
Finally, it should be noted that the above examples merely illustrate the method of applying the present invention to a specific rotor type autonomous underwater robot, and in practice, the present invention is not only applicable to the rotor type autonomous underwater robot illustrated in the above examples, but also can implement a practical control system for any autonomous underwater robot with six degrees of freedom being fully controllable according to the present invention.