Switched Finite-Time Source Seeking of an Underactuated Ship

In this paper, a switched finite-time source-seeking strategy is proposed for underactuated ships with a signal sensor. In practical application, for sensors in some complex environment, due to the lack of the ability to perceive the location of the source or its own position, we use the nonmodel gradient estimation of extremum seeking algorithm. This paper presents a three-step switching control method for the first time. In the first step, we prove that the closed-loop system of the underactuated ship is stable in a finite time with a constant yaw angular acceleration. In the second step, under the yaw angle acceleration controller, one of the position coordinates of the underactuated ship sensor is realized to be close to the center of the signal source through the average method. The third step is to drive the other position coordinates of the underactuated ship sensor to the center of the signal source under the action of the surge line speed controller. Simulation results show the effectiveness of the proposed strategy.


Introduction
A lot of research has been done in the field of source tracking. In caves or urban environments without GPS or where INS systems are too expensive to use, extreme search source control can provide a better solution to direct vehicles to signal source. As in [1], a nonholonomic source search method based on rotational angular velocity is proposed. e controller uses nonmodel-based gradient estimation to drive the aircraft to the source direction by combining the motion of the aircraft sensor in space with the estimated gradient.
is is a search method based on the constant forward speed of a single sensor.
In [2], a nonholonomic source-seeking method without position measurement is proposed. By adjusting its forward speed, the extremum source finding strategy is adopted. Some groups have also discussed the control law for obtaining the extremum of a three-dimensional scalar potential field on the basis of the two-dimensional rule in [3]. In view of the limitations of the source search results of unicycles, some research groups proposed to combine the two control laws existing in [4], which are effective when approaching the source with good behavior. For the control of an underactuated ship, there are many tracking and control results [5][6][7]. In [7], an innovative method combining backstepping technology and appropriate sway speed filter is proposed. e design of the controller enables the ship to travel on the track at an adjustable forward speed. In order to avoid the singularity problem that may occur in the design of antithrust control, some researchers have introduced a concept of asymptotic direction correction in [3], which transformed tracking kinematics and dynamics of the ship into some form of nonlinear feedback. In [5], a dynamic surface control (DSC) method and a global tracking control method for underactuated ships with input constraints and speed constraints are proposed, and global tracking control under input constraints and speed constraints is realized. In another article [6], according to the characteristics of the underactuated system of hovercraft with the friction disturbance, the author creatively put forward pseudo-force and the pseudo-heading angle for tracking control and disturbance compensation. at three attitude variables of the hovercraft can converge to the reference variable by two control inputs. In the performance index of the control system, the convergence performance is a key index. In most control systems, infinite time stability is considered. However, in recent years, it has been found that the finite-time convergence control system has good robustness and antidisturbance and is a better choice for time optimization. In [8], an improved Chua oscillator is added to the base station and sensor nodes to generate chaotic signals. Lyapunov stability theory is used to realize the finite-time chaotic synchronization by using the control law. Sliding mode controller is applied to wireless sensor network to improve the robustness of the controller. In other studies, some scholars designed a robust terminal sliding mode controller based on the Lyapunov stability theory and the concept of finite-time synchronization and proposed a chaotic secure communication system between base station and mobile devices [9]. In [10], some scholars found that the adaptive finite-time tuning law eliminated the requirement of disturbance boundary information and proposed an adaptive finite-time stabilization technique based on global sliding mode for disturbed chaotic flow at a single unstable node. A new chaotic system with regular motion and chaotic motion is proposed in [11]. In this paper, the dynamic characteristics of the chaotic system are analyzed theoretically, and a new random number generator and encryption algorithm are designed. In [12], an adaptive terminal sliding mode tracking method with fast approaching condition is designed to synchronize the chaotic system at the transmitter and receiver in a finite time.
en, a chaotic cryptographic system with synchronous chaotic system as key generator is proposed to improve the security of medical image transmission and storage. In this context, our research group has carried out a series of studies on finite-time stability. Our research group has considered two decoupled subsystems and combined the finite-time stability control theory with the design strategy without buffeting sliding mode, proposing an anti-interference controller in the presence of uncertainty, nonlinearity, and perturbation in [13]. In addition, we also study the finite-time tracking problem of a nonholonomic mobile robot to the moving target via switching controller in [14]. e piecewise continuous bounded control law is proposed by applying the multistep switching control strategy and the finite-time stability theory to drive the nonholonomic robot to the moving target in a finite time [15,16].
However, the above nonholonomic source search [1,2,4,17] is carried out under certain constraints, most of which are controlled by a single nonholonomic robot sensor to achieve the purpose of source seeking. ese methods of source-seeking control can meet the requirements of general land demand. However, in the working environment with water such as ocean rescue and river pollutant cleaning, due to the different environmental constraints and vehicle movement mode, similar nonholonomic source search is difficult to meet the requirements of source search. For existing source-seeking algorithms of underactuated ships, there are usually some hypothetical constraints on forward speed or yaw angular speed. e related research studies from 2019 to 2021 mostly adopted the two-step switching control strategy. On this basis, this paper adopted the nonmodel gradient estimation extremum seeking algorithm and proposed a three-step switching control method. With the help of the switch, the center of the underactuated ship sensor controller can be closer to the signal source more effectively.
Based on the improvement of the source finding method of nonholonomic mobile robot and combining with the existing work in the classroom, this paper creatively proposes a finite-time source-seeking method suitable for underactuated ship.
e main innovations and contributions of our research can be summarized as the following three points in this paper: (1) Most of the existing underactuated ship source search algorithms have assumed constraints on forward velocity or yaw angular velocity. In this paper, according to the surge line velocity and yaw acceleration of the underactuated ship when approaching the source, a finite-time switching controller is set and the tracking error converges to zero in a finite time. (2) In this paper, the great difference between the dynamic and kinematic constraints of ships and the classical nonholonomic robots is fully considered. e traditional extremum search method based on nonmodel gradient estimation is improved, and the source finding robot is extended from the nonholonomic robot to the underactuated ship which can be applied in the working environment with water.
(3) e rigorous mathematical formula proves the reliability of the finite-time control law proposed in this paper. Further numerical simulation results also verify the effectiveness of the control law.
is paper is organized as follows. Section 2 gives a formalization of the problem considered in this paper. Section 3 introduces the three-step switching design process of the underactuated ships. e simulation results of this method are given in Section 4. Finally, the conclusion is given in Section 5.

Problem Statement
In this paper, the classical underactuated ship model [18] is adopted, that is, the general six-degree-of-freedom underactuated ship, as shown in Figure 1. e ship model can be simplified to surge, swing, and yaw motion control. Degree of freedom must be considered in the control design of the the dynamics of the underactuated kinematic device, and it is assumed that the driven degree of freedom is controlled by the internal control loop. e following is the kinematic and dynamic model of the underactuated ship given by us: where (x c , y c ) is the center of the ship, φ is the yaw angle of the ship in the geodetic coordinate system reference, the fixed initial angle is 0, u and v are surge linear velocity and swing velocity, and r is yaw angular velocity. e two mechanical coefficients of the dynamic equation are c > 0 and k > 0. e degree of freedom driven in this paper will be controlled by the corresponding u, r, and v. At the same time, we assume that the ship is equipped with a sensor that cannot measure the position of the signal source and its own position, and the coordinates of the reference geodetic coordinate system are (x s , y s ), and its distance from the center is d. It can be obtained that In order to improve the accuracy of source search and some design requirements, it is generally taken that d ≥ 0.
We assume that the source center of the signal field is the strongest and the signal field gradually decreases from the source center. It is assumed that the tracked signal source is distributed in an unknown nonlinear mapping J � f(x, y), which has an isolated local maximum value , which is the source of the signal field. Our goal is to converge to the maximum region without knowing the shape of f (x, y). For nonholonomic vehicles, it cannot be directly guided in the horizontal direction, and all its movements must be generated by the forward and angular velocity inputs. Because the controller of the underactuated ship is more complex than that of a single robot, the corresponding surge speed and yaw angular velocity u and r should be taken as control input, which makes the source search more challenging.
Here, we give the distribution of the signal source.
where (x * , y * ) is maximizer, f * � f(x * , y * ) is an unknown maximum, and q x q y is unknown positive number. For the next operation, we define the output error variable as follows: And after the filter processing, it can be expressed as follows: In this paper, the task of our control design is to approach the signal field source of an underactuated ship in a finite-time using switched controllers. We divide the process into three steps. In the first step, the controller u is designed to stabilize the ship's dynamic equation in a finite time and make the swing velocity v go to zero. In the second step, the controller r is designed, and our goal is to make the y-direction position of the underactuated ship close to the corresponding position y * of the source in a finite time under the action of the controller u and r. In the last step, design the controller u again to make the x-direction position of the underactuated ship tend to corresponding position x * of the source. At this point, the whole seeking process is completed.

Main Results
In this section, we will show how the underactuated ship can achieve the source-seeking objective in a finite time by switching controllers. First, we will introduce some lemmas which will be used in the later parts.

Switching Controllers Design.
In order to solve the problem of source seeking, we simplify the control procedure and divide it into three steps by using switching controllers. Finally, the senior position coordinates (x s , y s ) of the underactuated ship are close to the signal source (x * , y * ).
Step 1. Take the control law as follows: in which we consider v as a positive function with respect to time t and c as an unknown constant.
Sensor r Body Figure 1: 6-DOF coordinate system of the underactuated ship.

Mathematical Problems in Engineering 3
In order to facilitate the calculation, we do the coefficient transformation cr � k 1 and k � k 2 of the known underactuated ship dynamics equation (2), and it can be obtained that Theorem 1. e state v in system (2) can always be stabilized to the origin in a finite time under the control law (8).
Proof. Substituting (8) into (9), it can be obtained that Here, we consider the Lyapunov decision function, S � (1/2)v 2 , because v is a function of time and S is also a function of time.
Taking the derivative of S with respect to time, It is easy to get From (11), it can be seen that S is a decreasing function of time, and then (11) can be converted to Integrating both sides, After simplification, Since ��� � S(t) ≥ 0, we have ��� � S(t) � 0, t ≥ T 0 . It can be found from (14) that when t converges to T 0 � − ( � 2 √ /k 1 )(S(0)) (1/2) , S converges to zero. According to Lemma [5,6], it can be seen that the time function S converges to zero in a finite time and then time function v also converges to zero in a finite time.
So, in the later step, v ≡ 0 as t ≥ T 0 , and we will design the controllers u and r directly.

□
Step 2. Because v converges to zero, the underactuated ship model is relatively simplified. We use the extremum seeking algorithm of nonmodel gradient estimation and take the control law to achieve that the underactuated ship sensor y s also approaches to y * .
where α, ω, c, and b are control parameters. In order to clearly represent the process of extremum seeking, we give Figure 2.
Proof. We start this part by defining the shifted variables.
where Υ c is the center of the underactuated ship and Υ * is the strongest source of the signal field represented in complex fields.
And, a new parameter r * is given by We next define variables Υ c and r that are the distance to the source and the difference between the ship's optimal heading and heading as follows: Motivated from [1], the dynamics system for the above variables is as follows: Δ � − q r d 2 + Υ 2 c − 2dΥ c cos(r + a sin(τ)) + e , (22) where q r is the representation of parameters q x and q y in complex fields and d is the distance between the center and the sensor. Next, the average system of (19)- (21) can be obtained as follows: 4 Mathematical Problems in Engineering G 0 (a) and G 1 (a) are the first kind of Bessel function, and the appropriate parameter a is selected so that G 0 (a), G 1 (a) > 0. And, sensor reading G(t) converges exponentially to a periodic function within O(1/ω) of ere are two equilibria of the average system (23)-(25), respectively.
According to the Hurwitz criterion, these two equilibria (27) and (28) are stable when each coefficient is greater than zero and satisfy some assumption from [1]. And then, we conclude that there are two stable periodic solutions within O(1/ω) of the equilibria (27) and (28) by applying eorem 10.4 from [21].
So, the center of the ship's trajectory converges locally and remains in the very small annular region near the signal source.
at is, erefore, it can be obtained by (4) that It can be obtained that As long as ω is large enough and d is small enough, the underactuated ship can converge in the area near the signal source.
Step 3. Take the control law as follows: e nonmodel extremum seeking along the gradient is carried out. In order to clearly represent the extremum seeking process, we give Figure 3.
After the completion of Step 3, we can realize that the underactuated ship can approach the maximum of the signal field as a whole, namely, the signal source.

Theorem 2.
Under the control law r � 0, the result that the sensor y s can approach to y * is still valid after Step 2. Proof.
e sensor position of the underactuated ship is controlled by the following functions from (4): Assume that the sensor coordinate y s approaches the signal source coordinate y * at T 0 and ϕ keeps the initial zero state. When Step 3 control law is met, it can be obtained that When the control law r � 0 is taken, it is available form (2).
It is easy to know that v � e − kt+c′ , k > 0.
So, there is a number ε 1 � e − kT 0 +c′ that satisfies lim t⟶T 0 | _ y s − 0| ≤ ε 1 , and the function of y coordinate stays in the same state in Step 2; that is, y s is still close enough to the surrounding area of signal source coordinate y * .
Lemma 3 (see [2]). As the extremum seeking process of Figure 3, when a position function f (x) is averaged and the averaged system is locally exponentially stable, then there is a w for all 1/w ∈ (1, 1/w) satisfying that there is a unique exponential stable periodic solution x 2π/w of the system equation in the period 2π/w. And, the solution satisfies Theorem 3. e senor coordinate x s of the underactuated ship is also approaching x * under the control law so that it can be obtained that f(x s , y s ) converges to f(x * , y * ).
Proof. First of all, we can make a new coordinate transformation as follows: And then, at the time scale τ � ωt, it can be obtained that System (43) can be averaged as long as (1/ω) is guaranteed small enough. Next, we average system (43) in a large period of 2πk as follows: 6 Mathematical Problems in Engineering After a series of calculations, it can be obtained that e equilibrium point of the averaged system (45) can be obtained as follows: We can obtain the Jacobian of the averaged system at x e avg as follows: Considering that the extreme value is the maximum, we give a positive number q x and select positive parameters α and c, and according to the Hurwitz criterion, we can obtain that the equilibrium of the equalizing system is locally exponential stable.
According to Lemma 3, then, So, we can get that erefore, as long as the vibration frequency is large enough and the vibration amplitude and sensor distance are small enough, the underactuated ship can be limited to a small enough area around the signal source. In order to represent the whole process clearly, we make a flow chart, as shown in Figure 4.

Simulation
In the following simulations, we will verify the inference of the above three steps to illustrate the reliability of the conclusions of this paper.
First, we use control low in (8) to demonstrate that the speed v of the underactuated ship will tend to zero for a limited time. We set the parameters of the sourcing system as k 1 � 3, k 2 � 4, u 0 � 1, and v 0 � 3. Images of speed v that change over time are shown in Figure 5.
In the second step, we use the nonlinear extremum search algorithm to realize that y s of the underactuated ship approaches y * in a limited time. And, there are some integers ζ, which make |y s − y * | ≤ ζ. In this simulation, we take the parameters as x * � 3, y * � 0, J * � 0, q x � 0.5, q y � 0.25, ω � 40, a � 0.5, h � 1, c � 100, and d � 10 and initial point [x s , y s ] � [5,15]. Using the control law (15), y s gradually tends to y * , as shown in the images of Figure 6. An unknown nonlinear signal J � f(x s , y s ) varies over time, and the picture is shown in Figure 7.
rough these two graphs, it is clear that in a limited period of time, y s progressively trend the source y * , the conclusion is evidenced.
When y s is stable near y * (at 6 seconds), under the control law in (36), the underactuated ship conducts a nonmodel extremum search along the gradient. As x s is stable at x * for a limited time, the underactuated ship is also stable at the signal field extreme value, i.e., the sourcing control is completed. In this simulation, we take the completion state of the second step as the initial state, the parameters of filter and others remain unchanged, Figure 8 indicates that x s finally stabilizes near x * (at 18 seconds), and the algorithm described in this paper is effective.
In [24], the performance of using the REMUS AUV under the control law of the NMPC algorithm to find the maximum point in the chemical signal field is simulated. After about 16 iterations of the algorithm, the AUV reaches around the signal field maximum. e advantage of this method is that the ship does not have to sail too far to accomplish its goal. However, this algorithm is gradient based and requires an estimate of the gradient, which is more of a requirement for the computing chip embedded on the ship. In addition, [24] does not take into account the execution time of the algorithm in the simulation. In this paper, the method used is relatively simple and requires a relatively
Design u and r Make v → 0 Step 2.
Design u and r Make v = 0 and y s → y * Step 3.
Design u and r Make v = 0, y s → y * and x s → x * Whether y → y * or not  small workload. In the simulations in this paper, the focus is on the time required to find the source rather than number of times the algorithm is cycled.

Conclusion
In this paper, the source-seeking problem of underactuated ship in finite time is studied by switching controller. Based on the nongradient extremum seeking method, the underactuated ship is approached to the source step by step by a switching controller. Compared with the traditional nonholonomic source-seeking method, in this paper, we successfully simplify the control of the 6-DO underactuated ship and ensure that the seeking error converges to a zero neighborhood in a finite time. e source-seeking algorithm in each step is proved theoretically and verified by simulation. e dynamic source has not been lucubrated in this paper and will be the focus in the future study.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest. Mathematical Problems in Engineering 9