Motion Control for Autonomous Navigation in Blue and Narrow Waters Using Switched Controllers

Autonomous ships represent one of the new frontiers of technological innovation in marine engineering, which demand the development of innovative control systems to guarantee efficient and safe navigation of vessels. A convenient control system should be able to command the several actuators installed on board in different conditions—for instance, during oceanic navigation, harbor approach, narrow channels, and crowed areas. Such tasks are accomplished by different switching controllers for high and low speed motion, which have to be orchestrated to ensure an effective maneuvering. An approach to the design of hierarchies of controllers for maneuvering and navigation of ships equipped with a standard propulsion configuration in both blue and narrow water is proposed. Different levels of control, from global to local, are defined and integrated to steer the vessel in such a way to increase the maneuvering capability in various scenarios.


Introduction
The challenges posed by modern ships are attracting attention by the research community owing to the increased on-board connectivity as well as availability of electronic sensors and computational resources, likewise recently occurred for autonomous vehicles such as cars, planes, helicopters, and trains [1]. The core of such challenges consists of developing new control systems and design paradigms, which are the subject of the present paper.
The control of low speed motions has become a topic of investigation since the early 1970s, when dynamic positioning has assumed a crucial importance for the oil industry. The scientific evolution of dynamic positioning over the years is illustrated in [2,3]. A complete overview of the main technological advances in the design of control systems for low speed motions, carried out during more than thirty years of research and development, is reported in [4]. Nonetheless, a complete analysis of this problem is presented from different points of view in [5,6]. When referring to the need for particular maneuvers [7,8], the definition of the control logics becomes an important aspect in the design process, in order to evaluate the functional features and compare possible different solutions. The methodologies proposed in this work have been inspired from the last results reported in literature (see, e.g., [9,10]) and concern not only the study of the structure of the main controllers but also of the various allocation strategies of forces and moments.
Guidance systems have been developed together with the increasing diffusion of inertial navigation systems [11]. Guidance is nowadays of crucial importance for autonomous ships and demands for the use of different motion models [12]. The performances during transient phases associated with the achievement of more and more sophisticated control objectives need to be taken into account for the effectiveness of the resulting maneuvering, [13].
Path-following is one of the typical control scenarios and regards following a predefined path independent of time, i.e., without constraints on the travel time along the path [14][15][16]. Path-planning consists of devising the route to take when moving from a point to another one. A popular approach is based on selecting a sequence of fixed points in space, called waypoints, and construct the desired path as the sum of the successive straight lines that link such waypoints. In general, it is not possible to achieve a smooth transition between two successive straight lines. This problem can be overcome by considering straight-line paths between the waypoints and relaxing the problem in such a way to make the turning be achieved by inscribing a circle between the two consecutive lines to form a curved path [6].
This paper is focused on the problem of achieving sufficient smooth behaviors when orchestrating the switching among different controllers in a complex maneuvering operation. Specifically, four tasks will be considered: • smart pilot: autopilot and speed pilot are simultaneously active; • drift-free track: high-speed path-following able to compensate drift; • change position: low-speed path-following; • dynamic positioning.
Concerning such topics, previous experiences have been gained with successful results (see, e.g., [17][18][19]). In this paper, the focus is on the integration of known control schemes and the analysis of the performances of such a combination since the ship exhibits completely different dynamical behaviors over a wide operational range. Therefore, switching between different models and controllers is well-suited to accounting for a realistic response of the vessel and instrumental to performance improvement.
The paper is organized as follows. The maneuvering scenario that motivates the investigation of a convenient control system is described in Section 2. The proposed controllers are presented in Sections 3 and 4, together with the related simulation results. Sections 5 and 6 describe the switching logic and illustrate results. The conclusions are drawn in Section 7.

Motivations and Goals
In several marine applications, steering a ship through a fixed path with a certain level of automation is of primary importance. The desired path is usually defined in terms of waypoints and, often, it is required that the ship maintains a given speed between consecutive waypoints. Moreover, it can be required that the vessel keeps a constant heading during the maneuver. Clearly, this demands control systems of increased complexity with open problems that need to be addressed, as it will be pointed out in the following.
One of the tasks that will be required in advanced ship automation systems is the capability to steer automatically a vessel from blue to narrow water. The present case study refers to a vessel, fitted with standard propulsion configuration, specifically two propellers with rudders and a bow thruster. Such a vessel is supposed to navigate with both autopilot and speed pilot active and needs to approach a narrow water area, following a desired path up to stationing in a fixed location. In particular, the vessel is required to follow a path, defined by means of suitable waypoints, to be covered with fixed speed and heading. The maneuvers of surface units are characterized by speed, heading, and position setpoints depending on the specific tasks, i.e., (i) smart pilot: the vessel advances with constant heading and speed; (ii) drift-free track: the vessel proceeds with constant heading and speed by compensating the drift; (iii) change position: the vessel steers by tracking a given path with a fixed heading at a constant speed; (iv) dynamic positioning: the vessel keeps a fixed position.
Within this general framework, a standard scenario envisages that the ship starts from the navigation condition, in deep sea, with both course control and speed pilot in operation. Later, the ship approaches the entrance of a given harbor by slowing down to reach the allowed speed. At the harbor entrance, the commands switch to a course keeping with drift-compensation controller. Then, the vessel is required to reach a series of given waypoints with a fixed heading angle and, eventually, to station in a fixed location. In order to accomplish this task, low and high speed vessel motions control logics have to be designed in different operating configurations. The first step concerns the definition of all the involved controllers, their main features, and ways of use. Firstly, the control logic are analyzed and validated in stand-alone mode. Secondly, their integration is studied in order to carry out the maneuver described above.
The controllers are schematized as two different types: (i) low-speed controllers, which account for the three plane motions of the ship (surge, drift, and yaw) named 3-DOF; and (ii) high-speed controllers, which deal with course and speed, named 2-DOF. As shown in Figure 1, the actuator setpoints are the same for all four defined controllers, while the controllers' input differs. In more detail, [x set , y set , ψ set ] are the coordinates of the position and the bow angle to be maintained during positioning; [ẋ set ,ẏ set ;ψ set ] denote the required velocities; P set is the vector identifying the waypoints that the ship must reach during change positioning maneuvers and course-keeping; V set is the required speed between one waypoint and another; a set andṙ set denote the accelerations required during change position maneuvers.
The next sections present and discuss the main features of both 2-DOF and 3-DOF controllers needed to fulfill the above tasks.

Layout of the 2-DOF Controller
The controllers with 2-DOF use propellers and rudders in autpilot mode with the possibility of activating also the bow thruster in drift-free track condition. In such a case, the control is articulated in two regulation steps: a first regulator that generates the moment needed to correct the heading error and a second one that regulates the speed. Such controllers rely on the speed pilot presented in [18].
The control of the course is based on the so-called line-of-sight approach [14,15,20]. Figure 2 draws the logic for identifying the bow angle required for maintaining the desired path, ψ des , namely the angle able to allow the vessel to regain track within a user-defined number n of vessel lengths. The guidance law deals with couples of points and update the setpoint anytime the vessel crosses the green region, as shown in Figure 2, where P k = (x k , y k ) and V k (with k = 1, . . .) denotes the waypoints and the correspondent desired speeds for each straight line connecting two consecutive waypoints, respectively. Moreover, R is the radius of the circle around each waypoint that provides the admitted tolerance, and P O = (x O , y O ) the vessel position. In order to properly define the guidance system, three frames have been introduced: {Ω, n 1 , n 2 , n 3 } the earth-fixed reference frame, {P O , b 1 , b 2 , b 3 } the body-fixed reference frame, and {P k , e 1 , e 2 , e 3 } a path-fixed reference frame. In the following, transformations between frames are illustrated: Therefore, the desired heading ψ des is given by where with e denoting the lateral signed distance of the vessel from the path. In order to allow the vessel to regain course within the desired number of vessel length, ∆ is evaluated with the following criterion: The aforesaid logic is based on the idea of finding the intersection point between a circle of radius nL BP and the line joining the two waypoints in charge of the algorithm, i.e., by solving the system of equations where the first equation represents the circle and the second is the line path. Note also that the signed distance defined in (3) is negative if the vessel is on the left of the line joining P k and P k+1 and positive on the right. Whenever the ship is too far from the ideal trajectory, the required heading drives the ship to point directly to the next waypoint.
In the case of demanding environmental conditions (in which the controller is not required to guarantee the design performances) or in the event that the waypoints present some irregularities with respect to the vessel maneuvering capability, it is possible that the unit is not able to reach the point within the selected tolerance (in Figure 2 the green circle identified by the radius R). A switching criterion of the waypoint pairs in charge of the guidance system has been studied. As shown in Figure 3, such a rule is based on the position of the vessel with respect to the waypoint P k+1 . In particular, if the vessel overtakes the waypoint and this latter is in the unit stern quadrants (w.r.t. the body-fixed reference frame), the algorithm takes the pair of next waypoints by re-routing the vessel in the next straight line.
The main idea is to contemplate the possibility that the ship may have passed the waypoint without ever entering the green zone and therefore must take charge of a new route. Therefore, the following relation is evaluated as a further parameter for the criterion for overtaking pairs of waypoints: where the algorithm updates the setpoints when m = −1.

The Allocation Logic
A PD controller has been chosen identical to that proposed in [18] fed with tracking error e ψ = ψ − ψ des according to (2). The allocation logic provides for the use of the two coupled rudders and bow thruster. The proposed (non standard) logic has been studied for particular situations in which the unit must be controlled even at low speeds. In such circumstances, low speeds reduce the rudder performance; for this reason, the bow thruster is also activated. The proposed algorithm provides for the choice of whether or not to activate the bow thruster during the maneuver and to fairly allocate the required moment between rudders and bow thruster. The allocation logic has been conceived in accordance with the following two principles: • rudder angle saturations are functions of the vessel speed; • the bow thruster provides the moment that the rudders are not able to generate at low speeds, when their efficiency is minimal.
In view of the simplifications due to the symmetry of the problem, the implemented equation governing the request of moment is given by where (x i , y i ) and (X i , Y i ) with i = pt, sb, bow are the locations and the thrust components of portside rudder, starboard rudder and bow thruster, respectively. 5 show some simulation results for a non-trivial blue water maneuver of coursekeeping in the presence of environmental disturbances. The wind is assumed to come from 90 • North with an average speed of 30 knots and gusts (up to 50 knots) taken into account by using a Davenport model, while the current is supposed to be 0.5 knots aligned with wind and waves forces are not taken into account at this stage. In Figure 4, the desired waypoints are reported in blue stars. The red line describes the ship trajectory, whereas the two green circles represent the switching area between the autopilot and the drift-free track mode. In Figure 5, the setpoint data and the actual position and heading are compared in non-dimensional form. For confidential reasons due to a company contract, the time is normalized over the total manoeuvre duration and the trajectories are non-dimensional with respect to the ship length. The switching between autopilot and drift-free track occurs at simulation time 0.15, whereas the autopilot is activated again at simulation time 0.85. In particular, in Figure 5, up to the simulation instant 0.15, the only smart pilot is active (i.e., the requirements of heading are constant), whereas, after switching, the controller receives a new input setpoint to compensate the drift. The effects of the switch are shown in Figure 4, where before switching the drift is not compensated (the same occurs after the second switching). All the errors of positions and attitude are within the design requirements.

Layout of the 3-DOF Controller
3-DOF controllers usually refer to motions at low speed. In particular, this section presents the control logic allowing the vessel to reach a series of waypoints P i (i = 1, . . . , n) with a defined (low) speed law and with a fixed heading angle. Concerning the required heading, two scenarios can be figured out: • keeping a constant heading w.r.t. the North for the entire maneuver; • maintaining a relative heading w.r.t. the trajectory.
Both scenarios require taking into account the possibility that, when the ship reaches a desired waypoint, it can stop and change the heading or, instead, point directly to the next waypoint. For such a reason, the control logic exploits a dynamic positioning system, contemplating the possibility that the vessel maintains a given position for a certain time interval.
The controller structure is based on the dynamic positioning system presented in [17,19] and composed of three main blocks: • error evaluation algorithm for computing position and velocity errors; • PID controller; • force allocation logic that converts the force and momentum demands, provided by the controller, in corresponding setpoints for propeller pitch, shaft speed, and rudder angles.
The tuning of the PID controller can be set by using linear matrix inequalities [18]. In the following, the main controller blocks and their interactions are detailed, with particular attention to the logic yielding suitable setpoints able to allow a single controller to manage both the stationing in a position and the tracking of assigned trajectories. The vessel is supposed stationing in an initial location; then, it is required to reach with a given constant acceleration the desired speed which is maintained for most of the path. Eventually, the vessel has to slow down until arriving near the next waypoint with zero speed. The choice of the speed, as well as of the constant accelerations and decelerations, generates a time history of setpoints that represent the speed and positions required at each instant. The input data for setting the maneuver are the following: the waypoints P i ; the heading angles ψ i that the ship must keep along each straight path; the speed V set to be reached during the maneuver; the constant acceleration a set to achieve the required speed; the maximum rotation speeḋ ψ set ; and the maximum rotation accelerationṙ set . The procedure yields the following position law: where P des = (x des , y des ) are the coordinates of the desired positions at each instant, ψ des are the desired angles corresponding to each waypoint and the functions f χ (t), f ψ (t) are defined as If the maneuver requires the heading to remain constant with respect to the North, each waypoint will correspond to the same heading, and, therefore, being ψ k+1 − ψ k = 0, it will result that ψ des = ψ i . Otherwise, when the target waypoint is reached, the heading will be requested to be updated and a forward angle setpoint sequence will be generated.
Regarding the speed setpoint, a trapezoidal speed profile, sketched in Figure 6, is provided by the following speed law:

Simulation Results
Figures 7-10 concern the simulation results of a maneuver in a restricted area, where the ship is required to follow a given path modifying the heading between one waypoint and another in the presence of moderate environmental disturbances. The maneuver is supposed to be performed in two control modes: first, the ship keeps its position at each waypoint, thanks to the dynamic position controller; then, the movement between two consecutive waypoints is ensured by the change positioning control mode. The presented maneuver highlights the capability to switch at any waypoint between change positioning, change heading, and dynamic positioning. Figures 7 and 8 show the desired and actuated paths, respectively. Details about position and velocity are plotted in Figures 9 and 10, showing the effectiveness of the proposed controller, since the errors are within the design constraints. Figure 11 shows results for vessel actuations from top portside rudder and propeller pitch and starboard actuation setpoint and simulated results. All results are reported as dimensionless quantities.

Switching Logic
As previously introduced, the regulator is based on two main controllers mutually switching between each other, as illustrated in Figure 12. Indeed, such a figure sketches the flowchart of the controller structure. The main switch is called (a) and it activates the 3-DOF controller any time the vessel speed is lower than a user defined low value V low : The 2-DOF controller is able to deal with smart pilots and the drift-free track. The main idea is to switch between setpoints instead of controllers, i.e., using switch (b) in Figure 12. Indeed, in the guidance system illustrated in Section 3, waypoints result in course requirements, whereas the surge is guaranteed by the speed pilot, which is always active in the loop. The switching criterion is the vessels speed The 3-DOF controller ensures performing both dynamic positioning and change positioning by evaluating the distance between the waypoints. Indeed, change positioning is always active and whenever P k+1 − P k = 0 and ψ k+1 − ψ k = 0 the desired speed is automatically set V des = 0 and dynamic positioning manoeuver starts, i.e., using switch (c) in Figure 12.  Figure 13 shows how the simulated vessel approaches the canal and steers to reach the dock with the green circle identifying the switching point between 2 and 3-DOF controllers. In the first part of the maneuver, the vessel motions are controlled by the free-drift track mode and, once the required vessel speed is lower than two knots, the controller switches to the change positioning mode. The latter automatically conducts the vessel throughout the waypoints till the ship reaches the quay, where the position is kept by the dynamic positioning controller. In order to constrain high bumps at the switching instant, the final outputs of the 2-DOF controller have been chosen as the initial conditions for the 3-DOF one; this switch happens at simulation time 0.05. Figures 14 and 15 allow for comparing position and speed setpoints and actual signals during the maneuver in order to assess the effectiveness of the proposed switching strategy.

Conclusions
The main purpose of this paper has been the validation of the proposed approach for the automatic steering of a vessel from blue to narrow water by switching from one controller to the other. Figure 13 is well suited to summarizing the results; it shows the performances of the vessel when it approaches the canal and steers to reach the dock. The four controllers we have adopted to accomplish the overall maneuver are based on different design goals and have been successfully combined, as shown via simulations. While solid theoretical findings are reported in the literature dealing with the closed-loop stability of each single proposed controller, very little is known about the stability that results from the switching among different controllers (see, to the authors' knowledge, only [21]). Such an issue together with the study of other control strategies for more complex maneuvers will be the topic of future investigations.

Conflicts of Interest:
The authors declare no conflict of interest.