# Event-Based Path-Planning and Path-Following
## 4 Simulation Results
Without these disturbances, the errors asymptotically tend to zero as well as velocities \(u\) and \(r\) tend to the desired values \(u_{0}=1\) m/\(s\) and \(r_{0}=c_{c}u_{0}\). The horizontal sections of lines that are shown in Figures 10 and 11 correspond to a motion without disturbances. Figure 12 shows that the developed path-following controller, combating the curvature-induced disturbances, may cause saturation of the torque \(\mathcal{G}\) (maximum torque \(\mathcal{G}_{\rm max}=300\) N \(\cdot\) m). The reason for this is that the feedback gains of the controller were synthesized in order to minimize the steady-state errors for \(s_{e}\) and \(y_{e}\). It should be noted that other requirements to the lower level controller, specified in terms of direct indicators of dynamic quality, can be satisfied using the VLF-based tool employed in this paper for tuning feedback gains. For example, the aim of synthesis may be to maximize the size of the region of attraction. Note also that the path-following errors can be reduced by regulating the forward speed \(u_{0}\) of the VT, or transforming the generated path into a smoother one, or reducing the control interval \(h\). Figure 9: Simulation results for Scenario 1: sharp-edged obstacle environment. On the left, the blue area corresponds to the obstacle on the \((x,y)\) plane, the red line represents the AUV’s reference path, and the blue line represents the actual trajectory obtained by the simulation; marks on the red line are points connecting two adjacent segments of the reference path. On the right, the blue line shows the change in the state of the designed discrete event system and red marks on the line indicate moments when a new path is generated. Figure 11: AUV velocities for Scenario 1: forward velocity (left-hand part) and yaw velocity (right-hand part). Figure 12: Control activity for Scenario 1: force (left-hand part) and torque (right-hand part). Figure 10: Path-following errors for Scenario 1: along path error \(s_{e}\) (left-hand part) and across path error \(y_{e}\) (right-hand part). Figures 14 and 15 show the simulation results for Scenarios 2 and 3, respectively. We do not display all results for these scenarios because the missed data do not provide new information about the performance of the designed path-following controller and are quite similar to the simulation results of Scenario 1. In particular, the path curvature is bounded by constant \(c_{\max}=0.05\); the path-following errors \(s_{e}\) and \(y_{e}\) increase significantly when the path curvature changes with a jump, and then, passing through a transient phase, tend to the neighbourhood of zero; \(u\) and \(r\) behave similarly, with the only difference being that they tend to \(u_{0}\) and \(r_{0}\) respectively; force \(\mathcal{F}\) and torque \(\mathcal{G}\) do not exceed the maximum allowed limits \(\mathcal{F}_{\max}\) and \(\mathcal{G}_{\max}\), respectively. As shown in Figure 14, being in path-following mode mPF, the AUV activates obstacle avoidance mode mDOR twice: at the very beginning and on the 250 th s of Scenario 2. Following the right-hand rule that was implemented in the developed DES, the AUV does not change the chosen avoidance direction until it returns to the reference path. During the obstacle bypass, mode mDOR alternates with mode mSOL. The last is activated when the AUV reaches the end of the avoidance path, and no obstacles are detected on the left. Elementary event eRRPR, which is monitored in mode mDOR, determines whether the AUV is ready to return to the reference path: the AUV is ready if event eRRPR can be detected. This event is introduced to exclude situations when the AUV repeatedly travel along the same reference path segment. In Scenario 2, when the AUV gets out of the U-shaped obstacle trap, the fact that event eRRPR does not occur prevents the AUV from returning to the part of the reference path that it has already passed.