## 4 The Yaw Tracking Control System  
The steering dynamics for a vessel sailing in restricted waters is described by the following Nomoto equations  
\[\left\{ \begin{array}{l}\dot{\psi}=r,\\ \dot{r}=a_{v}v+a_{r}r+a_{y}y+b\delta+\Lambda(v,r,y,\delta),\end{array} \right. \tag{40}\]  
where \(a_{v}\), \(a_{r}\) and \(a_{y}\) are the linear hydrodynamic coefficients; \(y\) is the lateral distance off the original course line, to present the bow outward moment due to the vessel-bank interaction. When a vessel sails close to a bank, the vessel moves with its bow being repelled from the bank. It is hard to obtain precise motion models for a vessel sailing in restricted waters, not to mention the external disturbances. The item \(\Lambda(\cdot)\) is used to denote the combination of model uncertainties and external disturbances, which meets \(|\Lambda(\cdot)|\leq\Lambda_{0}\), where \(\Lambda_{0}\) is the upper bound of \(\Lambda(\cdot)\). The rudder angle \(\delta\) acts as the only control input for the system (40). The sliding mode control (SMC) is a well-known robust method to control nonlinear and uncertain systems. To achieve the objective of \(\lim\limits_{t\rightarrow\infty}\widetilde{\psi}=\lim\limits_{t\rightarrow\infty }(\psi-\psi_{d})=0\), the sliding surface in the standard SMC is selected as  
\[s_{0}=\lambda\widetilde{\psi}+\dot{\widetilde{\psi}}, \tag{41}\]  
where \(\lambda>0\). It is clear that if a control law is designed to make the trajectories of the closed-loop system (40) driving on and evolving along the sliding surface (41), the stabilization goal \(\lim\limits_{t\rightarrow\infty}\widetilde{\psi}=0\) can be reached. To accomplish it, the reaching law is chosen  
\[\dot{s}_{0}=-\tau_{0}s_{0}+\Lambda(\cdot)-\rho_{0}\text{sgn}(s_{0}), \tag{42}\]where \(\tau_{0}>0\), the reaching law can guarantee the convergence of the trajectory of the closed-loop system [28]. With this reaching law, the control law can be obtained  
\[\delta_{0}=-\frac{1}{b}\Big{(}\lambda r-\lambda\dot{\Psi}_{d}+a_{v}v+a_{r}r+a_{y }y-\ddot{\Psi}_{d}+\tau_{0}s_{0}+\rho_{0}\text{sgn}(s_{0})\Big{)} \tag{43}\]  
where \(\rho_{0}>\Lambda_{0}\). Consider the following Lyapunov function candidate  
\[V_{3}=\frac{1}{2}{s_{0}}^{2} \tag{44}\]  
Its time derivative is  
\[ \begin{array}{l}\dot{V}_{3}=s_{0}\dot{s}_{0}\\ =s_{0}[-\tau_{0}s_{0}+\Lambda(\cdot)-\rho_{0}\text{sgn}(s_{0})]<0.\end{array}  \tag{45}\]  
Thus the control objective \(\lim\limits_{t\to\infty}\widetilde{\psi}=0\) can be achieved. However, the standard SMC has two drawbacks. One is that the model coefficients (\(a_{v}\), \(a_{r}\) and \(a_{y}\)), the control coefficient \(b\) and the bound of uncertainty \(\Lambda(\cdot)\) cannot be precisely known in advance. The other one is that the expressions for \(\dot{\Psi}_{d}\) and \(\ddot{\Psi}_{d}\) in Equation (43) are complicated, which makes the control law hard to be applied in the real system. To overcome these difficulties, an adaptive PI SMC is proposed in this paper. To design the adaptive PI SMC, the steering dynamics in Equation (40) are reconstructed as  
\[\left\{ \begin{array}{l}\dot{\psi}=r,\\ \dot{J}r=\alpha_{v}v+\alpha_{r}r+\alpha_{y}y+\delta+\Gamma(v,r,y,\delta),\end{array} \right. \tag{46}\]  
where \(J=\frac{1}{b}\), \(\alpha_{v}=\frac{a_{v}}{b}\), \(\alpha_{r}=\frac{a_{r}}{b}\) and \(\alpha_{y}=\frac{a_{y}}{b}\), they are unknown in advance; \(\Gamma(\cdot)=\frac{\Lambda(\cdot)}{b}\) meets \(|\Gamma(\cdot)|\leq\Gamma_{0}\), where \(\Gamma_{0}\) is the upper bound of \(\Gamma(\cdot)\) which is unknown in advance. **Remark 1**. : Equation (46) is derived from Equation (40) assuming that \(b\
eq 0\). It is easily met for the real vessel. In the proposed adaptive PI SMC, the sliding surface is selected as  
\[s_{a}=\lambda_{1}\int\widetilde{\psi}dt+\lambda_{2}\psi+r, \tag{47}\]  
where \(\lambda_{1}>0\), \(\lambda_{2}>0\), which fulfill that the eigenvalues of \(\
abla^{2}+\lambda_{2}\
abla+\lambda_{1}=0\) (\(\
abla\) is Laplace operator) are in the left half complex plane.