# Event-Based Path-Planning and Path-Following
## 3 Two-Level Control System
### Path-Following Controller  
The path-following control laws for tracking the VT's motion is designed, as follows (cf. [34]):  
\[\begin{array}{c}\mathcal{F}(t)=\mathcal{F}_{c}(t_{k})+\mathcal{F}_{s}(t_{k }),\quad\mathcal{G}(t)=\mathcal{G}_{c}(t_{k})+\mathcal{G}_{s}(t_{k}),\quad t \in T_{k}=[t_{k},t_{k+1}),\quad k=1,2,\ldots\\ \mathcal{F}_{c}(t_{k})=d_{u}(t_{k})+(m_{ur}u(t_{k})\hat{r}(t_{k})+d_{v}(t_{k}) )\tan\beta(t_{k})\frac{m_{ur}}{m_{ur}},\quad\mathcal{G}_{c}(t_{k})=d_{r}(t_{k} )+m_{r}(\hat{r}_{0}(t_{k})-\hat{\beta}(t_{k})),\\ \mathcal{F}_{s}(t_{k})=\text{sat}(k_{1}(t_{k})s_{e}(t_{k})+k_{2}(t_{k})\triangle v _{t}(t_{k}),\overline{\mathcal{F}}_{s}),\\ \mathcal{G}_{s}=\text{sat}(k_{3}(t_{k})y_{e}(t_{k})+k_{4}(t_{k})\psi(t_{k})+k_ {5}(t_{k})\triangle\hat{r}(t_{k}),\overline{\mathcal{G}}_{s}).\end{array} \tag{7}\]  
where \(\mathcal{F}_{c}\), \(\mathcal{G}_{c}\) are the feedforward control terms aimed to cancel disturbances and to track the VT's heading direction; \(\mathcal{F}_{s}\), \(\mathcal{G}_{s}\) are the feedback control terms that were calculated on the basis of discrete measurements of variables \(s_{e}\), \(y_{e}\), \(\psi\), \(\triangle v_{t}=v_{t}-u_{0}\) and \(\triangle\hat{r}=r+\hat{\beta}-\hat{r}_{0}\) to stabilize the AUV's position along the path, \(\overline{\mathcal{F}}_{s}\), \(\overline{\mathcal{G}}_{s}\) are the control resources in force and torque aimed at stabilization; and, \(\text{sat}(\sigma,\bar{\sigma})=\text{sign}(\sigma)\min(|\sigma|,\bar{\sigma})\) is the saturation function. The acceleration \(\hat{\beta}_{i}\) is evaluated using the direct measurement of \(u\), \(v\) and their derivatives [23].  
In order to reduce the negative effect of discontinuity of \(r_{0}\) on the performance of the closed-loop system, we use discrete observers for variables \(r_{0}\) and \(\dot{r}_{0}\), defined as  
\[\left\{\begin{array}{l}\hat{r}_{0}(t_{k})=\hat{r}_{0}(t_{k-1})+\hat{r}_{0}(t _{k-1})h,\\ \hat{r}_{0}(t_{k})=-k_{0}\text{sat}(\hat{r}_{0}(t_{k}),\hat{r}_{0}),\quad\hat {r}_{0}(t_{k})=(\hat{r}_{0}(t_{k})-r_{0}(t_{k}))/h.\end{array}\right. \tag{8}\]  
The parameter-varying feedback controllers are built using the gain-scheduling methodology [35]. The feedback gains are scheduled as functions of the VT's angular speed \(r_{0}\), as  
\[k_{j}(t_{k})=k_{j}(\hat{r}_{0}(t_{k}))=k_{j}^{i},\quad\hat{r}_{0}(t_{k})\in R _{0i}=[r_{0}^{i-1},r_{0}^{i}),\quad i=\overline{1,n_{r}},\quad j=\overline{1, 5},\]  
where \(R_{0i}\) are operation regions that form an operation envelope, \(n_{r}\) is the number of regions. As the speed \(u_{0}\) is assumed to be constant and there is a constraint \(R_{\min}\) on the turning radius, we have \(|r_{0}(t)|\leq u_{0}/R_{\min}\); therefore, we can take \(r_{0}^{0}=-u_{0}/R_{\min}\) and \(r_{0}^{n_{r}}=u_{0}/R_{\min}\) when obtaining operation regions \(R_{0i}\).  
In order to synthesize feedback gains for each operation region \(R_{0i}\), we transform the closed-loop system given by (4) and (6)-(8) to a sampled-data representation with uncertainties and then apply control design algorithms that are based on the sublinear vector Lyapunov functions [36; 37] to determine feedback gains. The synthesis objective is to minimize the weighted sum of estimates of steady-state tracking errors \(s_{e}^{\infty}\), \(y_{e}^{\infty}\), \(\psi^{\infty}\) and \(v_{t}^{\infty}\). When designing gains, we took measurement errors, control saturation, and the size of operation regions \(R_{0i}\) into account. The design steps are described in detail in [34], where a cooperative path-following controller for multiple AUV is synthesized. Section 4 provides feedback gains determined for the path-following controller considered in the paper.