1 Introduction

Maritime Autonomous Surface Ships (MASS) have drawn more attention due to their huge potential in commercial, civilian, and military applications. In 2017, the International Maritime Organization (IMO) defined MASS based on various names, e.g. “autonomous ships”, “unmanned surface vessels (USVs)”, and “unmanned cargo ships”, among others [1]. At present, the research focus in MASS is primarily on small-scale USVs [2], utilized for tasks such as ocean surveying, environmental monitoring, and resource exploration. Nevertheless, there is limited research on large-scale MASS (e.g. unmanned cargo ships). Considering the inherent characteristics of large-scale ships such as large inertia and signal delay, it is still challenging work to control them accurately and effectively, especially in dense traffic areas, such as harbours and narrow channels. To achieve full autonomy a possibility, the development of a powerful control system for large-scale autonomous ships is deemed necessary. Path following control is a crucial application in ocean engineering, and to enhance tracking capacity for completing more complex missions, further investigation into path following controllers is essential.

In recent decades, path following controllers have gone through technological evolution, ranging from the classical proportional integral derivative (PID) controller [3] to more advanced adaptive and robust controllers [4]; for instance, adaptive PID controller [5, 6], H∞ adaptive controller [7], linear quadratic Gaussian (LQG) controller [8, 9]. Thereafter, more sophisticated controllers have been proposed, such as fuzzy controller [10, 11], genetic algorithm (GA) controller [12], neural network (NN) controller [13, 14], etc. The state-of-the-art control systems for MASS have been presented by [15, 16]. However, a common trend in the literature shows that most studies focus on the complex theoretical algorithms involving numerous formula calculations, resulting in problems like “explosion of complexity” and “curse of dimensionality” [17, 18]. These problems hinder the practical application of controllers, on the contrary, concise, robust, and adaptive control algorithms are needed for practical engineering.

To evaluate the performance of the developed theoretical algorithms, controllers are typically tested in simulation environments. However, there are still some gaps between simulations and real applications, highlighting the need to evaluate controller applicability in real scenarios and validate numerical results. To the authors’ best knowledge, only a limited number of studies have been performed to investigate the performance of path following controllers via experiments, where most experimental studies focused on small-sized ships in deep water. There is a paucity of data on large-sized ships navigating in shallow water, which in fact demands more control actions. Any ship will sooner or later manoeuvre in a port area, which by definition is a restricted area. For instance, the port of Zeebrugge (Belgium) has an LNG terminal in shallow water, where limited water depth reduces the UKC, hence changes the ship’s hydrodynamics and increases the control difficulty, even resulting in accidents (e.g. the blocking of the Suez Canal by the Ever Given in March 2021). Consequently, it is essential to develop practical path following controllers and assess their performance for large-sized ships in shallow water.

Motivated by the above discussion, the main contributions of this article are summarized as follows:

  1. 1.

    A novel adaptive PID controller is proposed to address speed-dependent issues of the controller’s parameters.

  2. 2.

    The proposed controller’s path following ability in shallow water is examined through both simulation and experiment.

  3. 3.

    Simulations are conducted using a 6 DOF shallow water mathematical model and towing tank tests are performed to validate the numerical results.

  4. 4.

    The applicability of the designed controller is investigated by simulating the ship’s transit through the Panama Canal, including the consideration of bank effects.

2 Simulation and experimental program

2.1 Simulation program

The ship manoeuvring simulator is one of the common techniques for checking new navigation areas, assessing channel safety, training purposes, etc. Two types of simulators are available at Flanders Hydraulics Research (FHR): the real time simulator and the fast time simulator (Fig. 1). During real time simulation studies, experienced captains or pilots take command of a virtual ship, which allows him/her to get acquainted with the future situation, while his/her experience can be incorporated into the study. During fast time simulation runs, on the other hand, the human factor is eliminated and replaced by a control algorithm. This offers a number of advantages: no visuals have to be developed, the simulations do not need to be performed at a full mission bridge simulator, and the computer controller does not have to perform the simulations in real time, so that many runs can be performed in a much shorter time span. Hence, the fast time simulator is used to conduct simulation studies and check the performance of controllers.

Fig. 1
figure 1

Numerical simulation study platforms: real time simulator and fast time simulator

In the simulator, two coordinate systems are used (Fig. 2), the earth-bound coordinate system \({O}_{0}{x}_{0}{y}_{0}{z}_{0}\) and the ship-bound coordinate system \(Oxyz\). The \({O}_{0}{x}_{0}{y}_{0}{z}_{0}\) is fixed to earth surface with its axes \({O}_{0}{x}_{0}\), \({O}_{0}{y}_{0}\), and \({O}_{0}{z}_{0}\) pointing north, east and down of the earth’s tangent plane, respectively. The \({O}_{0}{x}_{0}{y}_{0}\) plane coincides with the mean water level. The \(Oxyz\) is fixed to the ship surface. The origin is located at amidships, with its \(x\)-axis positive to bow, \(y\)-axis positive to starboard, \(z\)-axis positive to down.

Fig. 2
figure 2

Ship-bound and earth-bound coordinate systems: projections on the \({x}_{0}{y}_{0}\)-plane

The simulator comprises various components, where the mathematical model is the calculating core behind ship motions. In this study, a 6 DOF shallow water manoeuvring model is used in the fast time simulator. The coefficients highlighted in blue are determined through captive model tests conducted with varying UKC in the towing tank. A new set of coefficients is derived for each UKC to include the shallow water effect. More details can be found in our previous work [19]. The inertia and centrifugal terms are expressed by the following equations:

$${X}_{{\text{IC}}}=\left({X}_{\dot{u}}-m\right)\dot{u}+\left({X}_{\dot{q}}-m{z}_{{\text{G}}}\right)\dot{q}+m\left(vr-wq\right)+{mx}_{{\text{G}}}\left({r}^{2}+{q}^{2}\right)-m{z}_{{\text{G}}}pr$$
(1)
$${Y}_{{\text{IC}}}=\left({Y}_{\dot{v}}-m\right)\dot{v}+\left({Y}_{\dot{p}}+m{z}_{{\text{G}}}\right)\dot{p}+\left({Y}_{\dot{r}}-m{x}_{{\text{G}}}\right)\dot{r}+m\left(wp-ur\right)-m{x}_{{\text{G}}}pq-m{z}_{{\text{G}}}qr$$
(2)
$${Z}_{{\text{IC}}}=\left({Z}_{\dot{w}}-m\right)\dot{w}+\left({Z}_{\dot{q}}+m{x}_{G}\right)\dot{q}+m\left(vp-uq\right)-m{x}_{{\text{G}}}pr+{mz}_{G}\left({p}^{2}+{q}^{2}\right)$$
(3)
$${K}_{{\text{IC}}}=\left({K}_{\dot{v}}+m{z}_{{\text{G}}}\right)\dot{v}+\left({K}_{\dot{p}}-{I}_{xx}\right)\dot{p}+\left({K}_{\dot{r}}+{I}_{xz}\right)\dot{r}+{I}_{xz}pq-\left({I}_{zz}-{I}_{yy}\right)qr+{mz}_{G}\left(ur-wp\right)$$
(4)
$${M}_{{\text{IC}}}=\left({M}_{\dot{u}}-m{z}_{{\text{G}}}\right)\dot{u}+\left({M}_{\dot{w}}+m{x}_{{\text{G}}}\right)\dot{w}+\left({M}_{\dot{q}}-{I}_{yy}\right)\dot{q}-\left({I}_{xx}-{I}_{zz}\right)pr-{I}_{xz}\left({p}^{2}-{r}^{2}\right)+{mx}_{{\text{G}}}\left(vp-uq\right)-{mz}_{{\text{G}}}\left(wq-vr\right)$$
(5)
$${N}_{{\text{IC}}}=\left({N}_{\dot{v}}-m{x}_{{\text{G}}}\right)\dot{v}+\left({N}_{\dot{p}}+{I}_{xz}\right)\dot{p}+\left({N}_{\dot{r}}-{I}_{zz}\right)\dot{r}-{I}_{xz}qr-\left({I}_{yy}-{I}_{xx}\right)pq-{mx}_{{\text{G}}}\left(ur-wp\right)$$
(6)

The hull forces are calculated according to the following equations:

$${X}_{{\text{H}}}={X}_{{\text{IC}}}+\frac{1}{2}\rho LT\left({u}^{2}+{v}^{2}\right){X}^{{\prime}\left(\beta \right)}+\frac{1}{2}\rho LT\left({u}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){X}^{{\prime}\left(\gamma \right)}+\frac{1}{2}\rho LT\left({v}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){X}^{{\prime}\left(\chi \right)}$$
(7)
$${Y}_{{\text{H}}}={Y}_{{\text{IC}}}+\frac{1}{2}\rho LT\left({u}^{2}+{v}^{2}\right){Y}^{{\prime}\left(\beta \right)}+\frac{1}{2}\rho LT\left({u}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){Y}^{{\prime}\left(\gamma \right)}+\frac{1}{2}\rho LT\left({v}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){Y}^{{\prime}\left(\chi \right)}$$
(8)
$${Z}_{{\text{H}}}={Z}_{{\text{IC}}}+{Z}_{\dot{u}}\dot{u}+{Z}_{\dot{v}}\left|\dot{v}\right|+{Z}_{\dot{r}}\left|\dot{r}\right|-\rho g{A}_{{\text{W}}}z+\Delta T{u}_{h}{Z}^{{\prime}\left(\beta \right)}+\frac{1}{2}\rho LT\left({u}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){Z}^{{\prime}\left(\gamma \right)}+\frac{1}{2}\rho LT\left({v}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){Z}^{{\prime}\left(\chi \right)}+{Z}_{{\text{w}}}w+{Z}_{q}q$$
(9)
$${K}_{{\text{H}}}={K}_{{\text{IC}}}-\Delta \overline{G{M }_{T}}\varphi +\frac{1}{2}\rho L{T}^{2}\left({u}^{2}+{v}^{2}\right){K}^{{\prime}\left(\beta \right)}+\frac{1}{2}\rho L{T}^{2}\left({u}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){K}^{{\prime}\left(\gamma \right)}+\frac{1}{2}\rho L{T}^{2}\left({v}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){K}^{{\prime}\left(\chi \right)}+\left[{K}_{{\text{p}}}-\left|\varphi \right|\sqrt{\Delta \overline{G{M }_{T}}\left({I}_{xx}-{K}_{\dot{p}}\right)}\right]p+{K}_{up}up$$
(10)
$${M}_{{\text{H}}}={M}_{{\text{IC}}}+{M}_{\dot{v}}\left|\dot{v}\right|+{M}_{\dot{r}}\left|\dot{r}\right|-\Delta \overline{G{M }_{T}}\theta +\Delta LT{u}_{h}{M}^{{\prime}\left(\beta \right)}+\frac{1}{2}\rho {L}^{2}T\left({u}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){M}^{{\prime}\left(\gamma \right)}+\frac{1}{2}\rho {L}^{2}T\left({v}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){M}^{{\prime}\left(\chi \right)}+{M}_{{\text{w}}}w+{M}_{q}q$$
(11)
$${N}_{{\text{H}}}={N}_{{\text{IC}}}+\frac{1}{2}\rho {L}^{2}T\left({u}^{2}+{v}^{2}\right){N}^{{\prime}\left(\beta \right)}+\frac{1}{2}\rho {L}^{2}T\left({u}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){N}^{{\prime}\left(\gamma \right)}+\frac{1}{2}\rho {L}^{2}T\left({v}^{2}+{\left(\frac{1}{2}rL\right)}^{2}\right){N}^{{\prime}\left(\chi \right)}$$
(12)

The propulsion forces are represented by the following equations:

$${X}_{{\text{P}}}=\left(1-t\left({\varepsilon }^{*},{\varphi }^{*},{\gamma }^{*}\right)\right){T}_{{\text{P}}}$$
(13)
$${Y}_{{\text{P}}}=\left|\frac{n}{{n}_{{\text{MAX}}}}\right|\left[{Y}_{\dot{v}}^{n}\dot{v}+{Y}_{\dot{r}}^{n}\dot{r}\right]+\left[{K}_{1}\left[{Y}_{{\text{PT}}}\left(\beta ,{\varepsilon }^{*}\right)+{Y}_{{\text{PT}}}\left(\gamma ,{\varepsilon }^{*}\right)\right]+{K}_{2}{Y}_{{\text{PTA}}}\left({\varepsilon }^{*}\right){\text{cos}}\left(\omega \left({\varepsilon }^{*}\right)t+{\varphi }_{Y}\left({\varepsilon }^{*}\right)\right)\right]{T}_{{\text{P}}}\left({\varepsilon }^{*}\right)$$
(14)
$${Z}_{{\text{P}}}=\left[{K}_{3}\left[{Z}_{{\text{PT}}}\left(\beta ,{\varepsilon }^{*}\right)+{Z}_{{\text{PT}}}\left(\gamma ,{\varepsilon }^{*}\right)\right]+{K}_{2}{Z}_{{\text{PTA}}}\left({\varepsilon }^{*}\right){\text{cos}}\left(\omega \left({\varepsilon }^{*}\right)t+{\varphi }_{z}\left({\varepsilon }^{*}\right)\right)\right]{T}_{{\text{P}}}\left({\varepsilon }^{*}\right)$$
(15)
$${K}_{{\text{P}}}=\left|\frac{n}{{n}_{{\text{MAX}}}}\right|\left[{K}_{\dot{v}}^{n}\dot{v}+{K}_{\dot{r}}^{n}\dot{r}\right]+\left[\left[{K}_{{\text{PT}}}\left(\beta ,{\varepsilon }^{*}\right)+{K}_{{\text{PT}}}\left(\gamma ,{\varepsilon }^{*}\right)\right]+{K}_{2}{K}_{{\text{PTA}}}\left({\varepsilon }^{*}\right){\text{cos}}\left(\omega \left({\varepsilon }^{*}\right)t+{\varphi }_{{\text{K}}}\left({\varepsilon }^{*}\right)\right)\right]T{T}_{{\text{P}}}\left({\varepsilon }^{*}\right)$$
(16)
$${M}_{{\text{P}}}=\left[{M}_{{\text{PT}}}\left(\beta ,{\varepsilon }^{*}\right)+{M}_{{\text{PT}}}\left(\gamma ,{\varepsilon }^{*}\right)+{K}_{2}{M}_{{\text{PTA}}}\left({\varepsilon }^{*}\right){\text{cos}}\left(\omega \left({\varepsilon }^{*}\right)t+{\varphi }_{{\text{M}}}\left({\varepsilon }^{*}\right)\right)\right]{LT}_{{\text{P}}}\left({\varepsilon }^{*}\right)$$
(17)
$${N}_{{\text{P}}}=\left|\frac{n}{{n}_{{\text{MAX}}}}\right|\left[{N}_{\dot{v}}^{n}\dot{v}+{N}_{\dot{r}}^{n}\dot{r}\right]+\left[\left[{N}_{{\text{PT}}}\left(\beta ,{\varepsilon }^{*}\right)+{N}_{{\text{PT}}}\left(\gamma ,{\varepsilon }^{*}\right)\right]+{K}_{2}{N}_{{\text{PTA}}}\left({\varepsilon }^{*}\right){\text{cos}}\left(\omega \left({\varepsilon }^{*}\right)t+{\varphi }_{{\text{N}}}\left({\varepsilon }^{*}\right)\right)\right]L{T}_{{\text{P}}}\left({\varepsilon }^{*}\right)$$
(18)

The rudder forces are expressed according to the following equations:

$${X}_{{\text{R}}}=\frac{1}{2}\rho {A}_{{\text{R}}}{V}_{{\text{R}}}^{2}\left({C}_{{\text{L}}}{\text{sin}}{\beta }_{{\text{R}}}+{C}_{{\text{D}}}{\text{sin}}{\beta }_{{\text{R}}}\right)$$
(19)
$${Y}_{{\text{R}}}=\left(1+{a}_{{\text{H}}}\left({\varepsilon }^{*},\beta \right)\right)\frac{1}{2}\rho {A}_{{\text{R}}}{V}_{{\text{R}}}^{2}\left({C}_{{\text{L}}}{\text{cos}}{\beta }_{{\text{R}}}-{C}_{{\text{D}}}{\text{sin}}{\beta }_{{\text{R}}}\right)$$
(20)
$${Z}_{{\text{R}}}=0$$
(21)
$${K}_{{\text{R}}}=-\left({z}_{{\text{R}}}+{a}_{{\text{H}}}\left({\varepsilon }^{*},\beta \right){z}_{{\text{H}}}\left(\beta \right)\right)\frac{1}{2}\rho {A}_{{\text{R}}}{V}_{{\text{R}}}^{2}\left({C}_{{\text{L}}}{\text{cos}}{\beta }_{{\text{R}}}-{C}_{D}{\text{sin}}{\beta }_{{\text{R}}}\right)$$
(22)
$${M}_{{\text{R}}}=\frac{1}{2}\rho {A}_{{\text{R}}}{V}_{{\text{R}}}^{2}\left({C}_{{\text{L}}}{\text{sin}}{\beta }_{{\text{R}}}+{C}_{{\text{D}}}{\text{sin}}{\beta }_{{\text{R}}}\right){z}_{{\text{HX}}}\left(\beta \right)$$
(23)
$${N}_{{\text{R}}}=\left({x}_{{\text{R}}}+{a}_{{\text{H}}}\left({\varepsilon }^{*},\beta \right){x}_{{\text{H}}}\left(\beta \right)\right)\frac{1}{2}\rho {A}_{{\text{R}}}{V}_{{\text{R}}}^{2}\left({C}_{{\text{L}}}{\text{cos}}{\beta }_{{\text{R}}}-{C}_{{\text{D}}}{\text{sin}}{\beta }_{{\text{R}}}\right)$$
(24)

The ship’s model used in this work is a Liquefied Natural Gas (LNG) ship. Figure 3a shows the ship’s main particulars on full scale, and 3D views of the LNG ship model (taken from the FHR simulator database) are shown in Fig. 3b–d.

Fig. 3
figure 3

3D view of the LNG ship model: a ship’s particulars; b side view; c bow view; d top view

2.2 Experimental program

The validation of ship mathematical models and controllers were conducted in the Towing Tank for Manoeuvres in Confined Water at Flanders Hydraulics Research cooperated with Ghent University. The tank has a total length of 87.5 m, a width of 7.0 m, and a maximum water depth of 0.5 m (Fig. 4). Owing to the presence of a wave maker and a harbour, the useful dimensions of the towing tank are limited to 68.0 by 7.0 m [20].

Fig. 4
figure 4

Layout of towing tank for manoeuvres in confined water

Experiments were carried out in free-running mode using the corresponding physical model. It is a 1/75 scale model of the LNG carrier (Fig. 5), equipped with two propellers and two rudders. Each rudder can be operated separately, but the coupled mode was used in the present work. The maximum rudder angle and rudder rate allowed were set as 35° and 22.5° s−1 (model scale), respectively.

Fig. 5
figure 5

Scale model of the LNG carrier

2.3 Simulation and experimental conditions

Both numerical and experimental investigations have been conducted with the same settings at speeds from 4 to 16 knots (full scale) and UKC from 10 to 100%. Table 1 exhibits the test matrix, and Fig. 6 shows a sample photo for different experimental water depths. The test water depth ranges from medium deep water (100% UKC) to shallow water (35% UKC), and very shallow water (10% and 20% UKCs).

Table 1 Forward speeds, propeller rates, and water depth Froude numbers at different UKCs
Fig. 6
figure 6

Sample photo (side view) for different experimental water depths

2.4 Ship mathematical model validation

To verify the accuracy of the ship mathematical model, comparisons are executed between the simulated and experimental 20°/5° zigzag trials at the largest speed of 100%, 20% and 10% UKC (see Table 1 for a value of these). Figure 7 shows an example of the comparison between the simulated and experimental zigzag manoeuvre at 11 knots and 20% UKC. As shown in Fig. 7, the period (defined as the time between the 2nd and 4th zero crossings of the heading angle) of the simulated zigzag is around 190 s, which is very close to the experimental period (189 s). Moreover, the first and the second overshoot angles obtained by the simulation are similar to those of the experimental results. More comparisons for other water depths are shown in Table 2. According to the zigzag results, the steering performance of the ship mathematical model matches well with the corresponding physical model. Hence the accuracy of the ship math model is proved and satisfactory for further simulations.

Fig. 7
figure 7

Comparison of the simulated (Sim.) and experimental (Exp.) 20°/5° zigzag manoeuvre at 11 knots and 20% UKC

Table 2 Statistics of the simulated (Sim.) and experimental (Exp.) 20°/5° zigzag at the largest speed of 100%, 20%, and 10% UKC

3 Control system design

3.1 Overview

Figure 8 displays the schematic of the path following control system. It is mainly constructed by a Guidance system, a Navigation system, and a Control system (GNC). The Fast Marching Method (FMM) based path planning module is adopted to find an optimal path and generate desired waypoints using for the guidance system [21]. The Line-Of-Sight (LOS) guidance algorithm is used to continuously compute the desired course angle [22]. The task of LOS is to force the ship position \(P\left(x,y\right)\) to converge to a desired path by aligning the course angle with the LOS angle \({\Psi }_{{\text{los}}}\), which is defined as the desired course angle \({\Psi }_{{\text{d}}}\):

$${{\Psi }_{{\text{d}}}=\Psi }_{{\text{los}}}=a{\text{tan}}\frac{{y}_{{\text{los}}}-y}{{x}_{{\text{los}}}-x}$$
(25)
$${x}_{{\text{los}}}={x}_{{\text{A}}}+\frac{{x}_{k}-{x}_{k-1}}{\sqrt{{\left({x}_{k}-{x}_{k-1}\right)}^{2}+{\left({y}_{k}-{y}_{k-1}\right)}^{2}}}{L}_{{\text{A}}}$$
(26)
$${y}_{{\text{los}}}={y}_{{\text{A}}}+\frac{{y}_{k}-{y}_{k-1}}{\sqrt{{\left({x}_{k}-{x}_{k-1}\right)}^{2}+{\left({y}_{k}-{y}_{k-1}\right)}^{2}}}{L}_{{\text{A}}}$$
(27)

where \(\left({x}_{{\text{los}}},{y}_{{\text{los}}}\right)\) refers to the target point along the path; \(\left({x}_{{\text{A}}},{y}_{{\text{A}}}\right)\) is the orthogonal projection position on the path between the previous waypoint \({P}_{k-1}=\left({x}_{k-1},{y}_{k-1}\right)\) and the current waypoint \({P}_{k}=\left({x}_{k},{y}_{k}\right)\); \({L}_{{\text{A}}}\) represents the look ahead distance. The control system is used to calculate the required rudder deflections and propeller rate to steer the ship along the planned path.

Fig. 8
figure 8

Schematic of IMC-based adaptive path following control system

3.2 Internal model control

The internal model control (IMC) structure is presented in Fig. 9, where \({\Psi }_{{\text{d}}}\) is the reference input, \(Q\) is the design transfer function, \(\delta\) is the control input, \(G\) is the plant to be controlled, \(\widehat{G}\) is the plant model, \(\Psi\) is the system output, \({d}_{1}\) and \({d}_{2}\) are the disturbances. The actual controller is described in the dash line box. Due to the plant model \(\widehat{G}\) is embedded in the controller, it is so-called the internal model control.

Fig. 9
figure 9

Internal model control structure

The IMC controller in Fig. 9a can be simplified to a transfer function form (Fig. 9b):

$$C=Q/\left(1-Q\widehat{G}\right)$$
(28)

where \(Q\) is the transfer function, \(\widehat{G}\) is the plant model. According to [23], the transfer function \(Q\) can be expressed:

$$Q\left(s\right)=\frac{3{\beta }_{{\text{c}}}s+1}{{\left(1+{\beta }_{{\text{c}}}s\right)}^{3}}\frac{s\left(1+Ts\right)}{K}$$
(29)

where \({\beta }_{{\text{c}}}\) is the designed parameter, \(s\) is the Laplace operator, \(K\) and \(T\) are the gain and time constant of Nomoto model.

The plant model \(\widehat{G}\) is considered as the Nomoto model [24]:

$$\widehat{G}=\frac{K}{s\left(1+Ts\right)}$$
(30)

Substituting Eq. (29) and Eq. (30) in Eq. (28) yields the IMC control law:

$$C\left(s\right)=\frac{3{\beta }_{{\text{c}}}T{s}^{2}+\left(3{\beta }_{c}+T\right)s+1}{{{\beta }_{{\text{c}}}}^{3}K{s}^{2}+3{{\beta }_{{\text{c}}}}^{2}Ks}$$
(31)

3.3 IMC-based adaptive controller

The above-described controller can be further expressed into a PID format:

$$C\left(s\right)={K}_{{\text{p}}}+\frac{{K}_{i}}{s}+\frac{{K}_{{\text{d}}}s}{\gamma s+1}=\frac{\left({{K}_{p}\gamma +K}_{d}\right){s}^{2}+\left({K}_{p}+{K}_{i}\gamma \right)s+{K}_{{\text{i}}}}{s\left(\gamma s+1\right)}$$
(32)

where \({K}_{{\text{p}}}\), \({K}_{{\text{i}}}\), and \({K}_{{\text{d}}}\) are the proportional, integral and derivative coefficients; \(1/\left(\gamma s+1\right)\) is used to eliminate the unwanted differentiating influence in the high frequency region.

Assume \(\gamma ={\beta }_{{\text{c}}}/3\) and substitute Eq. (32) into Eq. (31), the PID constants yield:

$${K}_{{\text{p}}}=\frac{\left(8/3\right){\beta }_{c}+T}{3{\beta }_{c}^{2}K}$$
(33)
$${K}_{{\text{i}}}=\frac{1}{3{\beta }_{c}^{2}K}$$
(34)
$${K}_{{\text{d}}}=\frac{\left(8/3\right){\beta }_{{\text{c}}}T-\left(8/9\right){{\beta }_{{\text{c}}}}^{2}}{3{\beta }_{{\text{c}}}^{2}K}$$
(35)

One can find that Eqs. (33)–(35) can express their PID constants as a function of the time constant \(T\), the gain \(K\), and the parameter \({\beta }_{{\text{c}}}\). The determination of \(T\), \(K\), and \({\beta }_{{\text{c}}}\) are crucial. In present work, the \(T\) and \(K\) were identified from zigzag tests by a system identification method in [25]. The \({\beta }_{{\text{c}}}\) was determined by testing different options, and a value of \({\beta }_{{\text{c}}}\) that led to satisfactory results was directly used in further studies. During model tests, the value of \({\beta }_{{\text{c}}}\) between (1, 10) was used. The \({\beta }_{{\text{c}}}\) should be transferred to a value on full scale for simulation studies. It is worth mentioning that the response of rudder depends on the ship’s forward speed, even more on the propeller rate. Because the propeller rate has direct influence on the inflow towards the rudders and thus the manoeuvring force created. A smaller propeller rate may give a larger response time \(T\) and a smaller \(K\), which can be confirmed by experimental results in Fig. 10, in other words:

Fig. 10
figure 10

Obtained the time constant \(T\), gain \(K\) and parameter \({\beta }_{{\text{c}}}\) based on 20°/5° zigzag model tests at 20% and 35% UKC for different propeller rates (\(n\)): a \(T\) versus \({n}^{-1}\); b \(K\) versus \(n\); c \({\beta }_{{\text{c}}}\) versus \({n}^{-1}\)

$$T\sim {n}^{-1}$$
(36)
$$K\sim n$$
(37)

According to [23], a smaller \({\beta }_{{\text{c}}}\) corresponds to a faster system response (a smaller \(T\)). Based on Eq. (36), it is straightforward to see that a larger propeller rate will likely give a smaller \({\beta }_{{\text{c}}}\), which can be confirmed by experimental results in Fig. 10c, f:

$${\beta }_{{\text{c}}}\sim {n}^{-1}$$
(38)

Returning to the relationships between PID constants and \(T\), \(K\), \({\beta }_{{\text{c}}}\) (Eqs. (33)–(35)), this implies that:

$${K}_{{\text{p}}}\sim \frac{\left(8/3\right){n}^{-1}+{n}^{-1}}{3{n}^{-2}n}\sim {n}^{0}$$
(39)
$${K}_{{\text{i}}}\sim \frac{1}{3{n}^{-2}n}\sim {n}^{1}$$
(40)
$${K}_{{\text{d}}}\sim \frac{\left(8/3\right){n}^{-1}{n}^{-1}-\left(8/9\right){n}^{-2}}{3{n}^{-2}n}\sim {n}^{-1}$$
(41)

Equations (39)–(41) can be rewritten as:

$${K}_{{\text{p}}}={K}_{{\text{p}}n}{n}^{0}$$
(42)
$${K}_{{\text{i}}}={K}_{{\text{i}}n}{n}^{1}$$
(43)
$${K}_{{\text{d}}}={K}_{{\text{d}}n}{n}^{-1}$$
(44)

where \({K}_{{\text{pn}}}\), \({K}_{{\text{i}}n}\), and \({K}_{{\text{d}}n}\) are the propeller rate adaptive proportional, integral, and derivative coefficients. It can be observed from Eqs. (39)–(41) that \({K}_{{\text{p}}}\) is free of \(n\) (constant value), \({K}_{{\text{i}}}\) is proportional to \(n\), and \({K}_{{\text{d}}}\) is inversely proportional to \(n\). The above relationship can be illustrated by experimental results in Fig. 11. Then, the adaptive coefficients for 20% UKC are: \({K}_{{\text{p}}n}\) = 3.7075; \({K}_{{\text{i}}n}\) = 0.0324;\({K}_{{\text{d}}n}\) = 43.177; the adaptive coefficients for 35% UKC are: \({K}_{{\text{p}}n}\) = 4.7529; \({K}_{{\text{i}}n}\) = 0.0475; \({K}_{{\text{d}}n}\) = 95.445. By realizing this, the PID constants only need to be determined for one forward speed, and the PID values at other speeds can be automatically calculated according to Eqs. (42)–(44). Hence, the speed dependency problem of the PID values is solved.

Fig. 11
figure 11

Determined proportional coefficient \({K}_{{\text{p}}}\), integral coefficient \({K}_{{\text{i}}}\) and derivative coefficient \({K}_{{\text{d}}}\) at different propeller rate \(n\) for 20% and 35% UKC: a \({K}_{{\text{p}}}\) versus \(n\); b \({K}_{{\text{i}}}\) versus \(n\); c \({K}_{{\text{d}}}\) versus \({n}^{-1}\)

3.4 Evaluation criteria

To assess the tracking capacity of designed controller, five evaluation indexes are introduced:

  • Mean track error integral (\({\text{mTEI}}\)):

    $${\text{mTEI}}=\frac{1}{{t}_{\infty }-{t}_{0}}{\int }_{{t}_{0}}^{{t}_{\infty }}\left|{T}_{{\text{e}}}\left(t\right)\right|{\text{d}}t$$
    (45)
  • Maximum track error (\({\text{MTE}}\)):

    $${\text{MTE}}={\text{Max}}\left|{T}_{{\text{e}}}\left(t\right)\right|$$
    (46)
  • Mean heading error integral (\({\text{mHEI}}\)):

    $${\text{mHEI}}=\frac{1}{{t}_{\infty }-{t}_{0}}{\int }_{{t}_{0}}^{{t}_{\infty }}\left|{\Psi }_{e}\left(t\right)\right|dt$$
    (47)
  • Mean rudder integral (\({\text{mRI}}\)):

    $${\text{mRI}}=\frac{1}{{t}_{\infty }-{t}_{0}}{\int }_{{t}_{0}}^{{t}_{\infty }}\left|\delta \left(t\right)\right|dt$$
    (48)
  • Mean rudder total variation (\({\text{mRTV}}\)):

    $${\text{mRTV}}=\frac{1}{{t}_{\infty }-{t}_{0}}{\int }_{{t}_{0}}^{{t}_{\infty }}\left|\delta \left(t\right)-\delta \left(t-1\right)\right|{\text{d}}t$$
    (49)

    where \({T}_{{\text{e}}}\) is the cross track error, \(\delta\) is the rudder angle, \({\Psi }_{{\text{e}}}\) is the heading angle error. \({\text{mTEI}}\) and \({\text{MTE}}\) are used to measure the mean and maximum of cross track error. \({\text{mHEI}}\) represents the mean heading angle error, while \({\text{mRI}}\) and \({\text{mRTV}}\) are employed to describe the amplitude and smoothness of the rudder angle.

4 Results and discussions

4.1 Overview

The results will be presented from the following three steps (Fig. 12): (1) The developed control system is first tested in virtual replica of towing tank built-in fast time simulator to ensure the effectiveness of the relevant algorithms (Sect. 4.2), note that virtual towing tank is fast time computation, not the CFD free-running computation; (2) Then, the system is validated in the towing tank (Sect. 4.3); (3) Finally, the system is applied in the fast time simulator to run simulations of the ship transiting the Panama Canal with realistic environment (Sect. 4.4).

Fig. 12
figure 12

Strategy of this research: (1) testing in the virtual towing tank built-in a fast time simulator; (2) validation in the towing tank; (3) applying in the simulator to run navigation simulations on Panama Canal

4.2 Simulation results in virtual towing tank

To demonstrate the tracking capability of the designed controller, it is evaluated by controlling the ship following a curve path with four virtual obstacles in the virtual towing tank (Fig. 13). In this section, the results at 8 knots and 20% UKC are presented as a representative example. The parameters of adaptive PID controller are: \({K}_{{\text{p}}n}\) = 3.71, \({K}_{{\text{i}}n}\) = 0.03, \({K}_{{\text{d}}n}\) = 43.18. Mind that simulations are performed in prototype based on Froude scaling only, without corrections for frictional resistance. Simulation results (full scale) are scaled down to towing tank scale here to enable further comparison with model tests.

Fig. 13
figure 13

Performance of adaptive PID controller: a reference and simulated trajectories; b cross track error; c rudder angle

Figure 13a exhibits the reference and simulated trajectories. It can be seen from Fig. 13a that the ship can converge well to the desired path and succeed to avoid the obstacles with moderate rudder angles (Fig. 13a, c). The tracking errors fluctuate within 0.2 m (~ 30% ship’s breadth, Fig. 13b), note that most deviations appear near curve bends. These small errors indicate good tracking capacity of the proposed controller.

4.3 Experimental results

4.3.1 Validation of simulation results

To validate the simulation results, experimental studies are performed with the same settings as the simulations. Figure 14 compares the simulation (Sim.) and experimental (Exp.) performance of the adaptive PID controller. The simulated trajectory shows satisfactory agreement with the experimental trajectory despite small discrepancies near bends (Fig. 14a). In both scenarios, the cross track error fluctuates within 0.21 m (~ 31% ship’s breadth). The maximum track error of the experiment is slightly larger than that of the simulation (Fig. 14b). In terms of rudder deflection (Fig. 14c) and heading angle (Fig. 14d), the numerical and experimental results show a similar trend and amplitude with slight difference.

Fig. 14
figure 14

Comparisons of numerical and experimental performance of adaptive PID controller: a trajectories; b cross track error; c rudder deflection; d heading angle

To better compare the simulation and experimental results, the evaluation mechanism in Sect. 3.4 is adopted. The statistics of evaluation indexes are summarized in Table 3. In general, the numerical results agree well with the experimental results, especially for the mean (mTEI) and maximum (MTE) tracking errors and heading deviation (mHEI). In terms of the above three indexes, there is less than 10.90% difference between numerical and experimental results. However, discrepancies are observed in the rudder behaviour. Compared with experimental results, the simulation runs use smaller and smoother rudders (mRI, mRTV). This phenomenon may be attributed to during experiments the environmental disturbance, sensor error, measurement noise, etc. Another probable reason is that the maximum steering torque is set in the simulator. Despite some differences in rudder performance, these slight discrepancies are acceptable.

Table 3 Comparisons of numerical and experimental performance of adaptive PID controller

To further validate the performance of the controller in different water depths, Table 4 shows the statistics of numerical and experimental results at 8 knots and UKC from 10 to 100%. Figure 15 displays the performance of the adaptive PID controller at different UKCs. The same conclusions can be drawn for different UKCs as previous discussions, in which the numerical results show satisfactory agreement with the experimental results despite the acceptable discrepancies are observed.

Table 4 Statistics of numerical and experimental results of adaptive PID controller for curve path at different UKCs
Fig. 15
figure 15

Comparison of numerical and experimental performance of the adaptive PID controller at different UKCs: a 10% UKC; b 20% UKC; c 35% UKC; d 100% UKC

Through the simulations and the experimental validation, the results imply that the proposed controller can control the ship following the desired path and avoid obstacles. Satisfactory control effects indicate it can be used in the fast time simulator with high tracking capacity.

4.3.2 Comparisons of different controllers

To demonstrate characteristics of the proposed controller, based on model test results, this section compares the performance of PID, IMC, fuzzy, and adaptive PID controllers following the curve path at 6 knots and 20% UKC. The coefficients of PID controller are derived from the research in [26], where \({K}_{{\text{p}}}{\prime}={\omega }_{n}^{2}T/K\), \({K}_{i}{\prime}={\omega }_{n}^{3}T/10K\), \({K}_{{\text{d}}}{\prime}=\left(2{\upzeta \omega }_{n}T-1\right)/K\). For the IMC and adaptive PID controllers, their parameters are determined using Eqs. (33)–(35) and Eqs. (42)–(44), respectively. The performance of fuzzy controller depends on the maximum heading angle deviation \({\Psi }_{{\text{e}}}^{{\text{max}}}\) and the maximum change in time of this deviation \({\text{d}}{\Psi }_{{\text{e}}}^{{\text{max}}}/{\text{d}}t\). The range of \({\Psi }_{{\text{e}}}^{{\text{max}}}\) and \({\text{d}}{\Psi }_{{\text{e}}}^{{\text{max}}}/{\text{d}}t\) are specified between 8°–10° and 4°–5° s−1, respectively. It is worth mentioning that the controller parameters were carefully selected to achieve optimal performance, and comparisons of their respective optimal performance were conducted.

Figure 16 presents their experimental trajectories. One can observe that four controllers are able to follow the reference trajectory, but the trajectory obtained by the adaptive PID is closer to the reference one than the other three controllers (Fig. 16), especially near bends. The mean track error of the adaptive PID controller is 0.045 m, which is increased to 0.083 m for the PID controller, 0.050 m for the IMC controller, and 0.082 m for the fuzzy controller, see Fig. 17a. Furthermore, it can be seen in Fig. 17b that the rudder angles of the PID controller fluctuate at higher frequencies, while those of the IMC, fuzzy and adaptive PID controllers show a relatively smooth evolution. This phenomenon may be due to different ways to calculate the controller parameters. Another possible reason may be attributed to the constant bandwidth frequency (\({\omega }_{n}\)) used by the PID controller. Hence, the adaptive PID present a better tracking capacity with smaller track errors.

Fig. 16
figure 16

Reference and experimental trajectories of PID, IMC, fuzzy and adaptive PID controllers for curve path at 6 knots and 20% UKC

Fig. 17
figure 17

Cross track error and rudder angle of PID, IMC, fuzzy and adaptive PID controllers at 6 knots and 20% UKC

Except for the above case study, around 5000 towing tank tests at different speed and water depth were conducted to further compare controllers’ performance. These tests included multiple path following scenarios such as straight line, step line, folding line, and path with virtual obstacles (Fig. 18). During the tests, controllers were compared under same condition, and the best performing controller for each condition was selected. The frequencies of each controller achieving the best performance at all experimental conditions are summarized in Fig. 19. Statistical results reveals that the adaptive PID performed the best in most experiments (36%), followed by the fuzzy (30%) and IMC (29%) controllers while the PID controller presented the worst control effect (5%). The inferior performance of the PID controller may be attributed to its constant bandwidth frequency employed during the tests. In contrast, the adaptive PID controller solved speed-dependent problems of PID values, ensuring proper track keeping behaviour even in the presence of speed changes during manoeuvring.

Fig. 18
figure 18

Reference experimental trajectories

Fig. 19
figure 19

Frequencies for each controller obtaining the best performance at all test conditions

4.4 Application

4.4.1 Application in Panama Canal

To study the applicability of the developed controller in real and more complex scenarios, the controller is assessed through simulations of the ship transiting the Panama Canal. Figure 20 shows the information of Panama Canal between the Gatún Lake and the Pacific Locks. The main part of the Canal has a width of 218 m at full depth, which is increased in the bends on the reaches between Chagres River Crossing and the bifurcation. The Canal environment has been modelled where the cross sections are simplified to a symmetric trapezium with slopes of 3:2 (56°) and a constant water depth of 14.4 m, as shown in Fig. 21.

Fig. 20
figure 20

Location of the Panama Canal (©Google Maps)

Fig. 21
figure 21

Simplified cross section with slopes of 56° on both sides and a width on full depth of 218 m, and a ship with \(B\)  × \({T}_{{\text{M}}}\) of 50 × 12.0 m2

Simulations are conducted at 8 knots and 20% UKC, Fig. 22 exhibits the reference and simulated trajectories in the canal, see the enlarged image in Fig. 22 for better understanding. It can be observed in Fig. 22 that the controller can keep the ship on the desired trajectory in the canal. The maximum cross track error is around 15.1 m (30% ship’s breadth) (Fig. 23a). According to the safety criteria of a ship sailing in the canal [27], the maximum track deviation from the desired trajectory should not be greater than 50% of the own ship’s breadth. Therefore, the fast time simulation runs meet the corresponding criteria and can obtain satisfactory control effects.

Fig. 22
figure 22

Tracking capability of adaptive PID controller on the Panama Canal

Fig. 23
figure 23

Motion response of the adaptive PID controller on the Panama Canal: a cross track error; b rudder angle

4.4.2 Bank effects on controller’s performance

Due to the proximity of a bank, the ship tends to be attracted to it (lateral suction force) and her bow is pushed away (bow away moment). This phenomenon is known as the bank effect. These bank induced lateral force and moment can be expressed as a lateral force \({Y}_{{\text{A}}}\) applied at the aft perpendicular and a lateral force \({Y}_{{\text{F}}}\) applied at the fore perpendicular as follows:

$${Y}_{{\text{A}}}={\xi }_{\rho }\Delta {d2b}^{-1}{Tu}_{m}\left({V}_{{\text{eq}}}\right)$$
(50)
$${Y}_{{\text{F}}}={\xi }_{\rho }\Delta {d2b}^{-1}{Tu}_{m}\left({V}_{{\text{eq}}}\right)f\left(h,T,{\text{Fr}},{\xi }_{hT},{\xi }_{h}\right)$$
(51)

Equation (50) consists of four coefficients, while Eq. (51) consists of six independent coefficients of which two can be identical with the mathematical model for \({Y}_{{\text{A}}}\) for the same ship at the same initial draft condition. More details of the mathematical model for bank effects have been discussed elsewhere [28, 29]. To investigate the bank effects on the controller’s performance on the Panama Canal, four case studies have been considered, where the ship is set at a different distance to the bank (\(d2b\)) and the corresponding positions of the ship are shown in Fig. 24.

Fig. 24
figure 24

Positions of ship at different distances to bank (or buoy line)

To demonstrate the bank effects, for each aforementioned case study the simulations are carried out in two scenarios: with bank effects and without bank effects. For illustration purposes, the results of adaptive PID controller at 8 knots and 20% UKC are presented as case studies (case 1, 3, 4 are considered as examples, and all results (case 1–4) are summarized in Table 5).

Table 5 Comparisons of the adaptive PID controller’ performance at 8 knots and 20 UKC with and without considering bank effects

When the ship is in the middle of the canal (case 1), the performance of the adaptive PID controller is shown in Fig. 25. It can be seen that there is little difference for the trajectories obtained from simulations with and without bank effects, and their average tracking errors between the desired path and simulated ones are 0.02 m and 0.01 m, respectively. Figure 25e plots the trajectories obtained by the adaptive PID controller with and without considering bank effects. The trajectories overlap together and there is no visible difference. This may be because the ship sails in the middle of the channel, thus the bank effects from each side compensate each other, and the bank effects are not obvious.

Fig. 25
figure 25

Performance of the adaptive PID controller with and without considering bank effects when the ship sailed in the middle of canal (case 1): a trajectories; b cross track error; c Y force from bank; d yaw moment from bank; e trajectories in the canal (overlap in this case)

Case 3 is selected to show the performance of the adaptive PID controller when the ship is located at 65 m to the bank. Slight difference between the simulated trajectories with and without bank effects can be seen in Fig. 26. When the bank effects are considered, the maximum and mean track errors are 10.95 m and 5.29 m, which are obviously larger than the sense without considering bank effects (Table 5). This can be attributed to the forces on the ship due to bank effects to instantaneously change from zero to quite large values, causing the vessel to deviate (Fig. 26). But the deviations are in a reasonable range, and the results are acceptable.

Fig. 26
figure 26

Performance of the adaptive PID controller with and without considering bank effects when the ship sailed case 3 position in the canal: a trajectories; b cross track error; c Y force from bank; d yaw moment from bank; e trajectories in the canal

The forces and moment on the ship due to bank effects do not always lead to the expected results, as shown in Fig. 27. When the distance between the ship and the bank is too small (case 4), the bank effects become obvious. Because the size of the ship is large (\({L}_{{\text{PP}}}\) × \(B\), 309 m × 50 m), there is not enough manoeuvring space for the ship to get back on track. In such scenarios, these forces and moments caused by bank effects are too large, which result in a too large deviation of the ship and crashing into the bank.

Fig. 27
figure 27

Performance of the adaptive PID controller with and without considering bank effects when the ship sailed in the middle of canal (case 4): a trajectories; b cross track error; c Y force from bank; d yaw moment from bank; e trajectories in the canal

Table 5 and Fig. 28 present the influence of bank effects on the cross track error, lateral force, and yaw moment. One can observe that there is almost no influence due to bank elements at a distance far away from the vessel (case 1). The adaptive PID controller can give acceptable results when a reasonable ship-bank distance is considered (Case 2 and Case 3). However, when this ship-bank distance is too small, it is difficult to control the ship due to bank effects (case 4). One also can find that the tracking error, lateral force and yaw moment show increasing trends with smaller ship-bank distance (\(d2b\)).

Fig. 28
figure 28

Influence of bank effects on the adaptive PID controller's performance at 8 knots and 20% UKC

5 Conclusions

In the present work, the path following capacity of the proposed controller in shallow water is explored by numerical and experimental studies. To conclude:

According to the numerical analysis, the designed controller is capable of successfully steering the ship along the desired path and avoiding obstacles in shallow water. The controller can achieve satisfactory control effects with acceptable track deviations.

Despite a slight discrepancy in rudder behaviour, the numerical results match well with the experimental results, and the effectiveness of simulation results are validated by experimental investigations. Moreover, compared with traditional PID, IMC and fuzzy controllers, the adaptive PID presents better tracking ability.

The applicability of the controller in real scenarios is verified by simulations on Panama Canal. The results indicate that the designed controller can be used in the simulator. Bank effects have an influence on the controller’s performance including tracking errors, rudder deflection, etc. A reasonable ship-bank distance should be considered when the ship manoeuvres in shallow or confined water.