# MViDO: A High Performance Monocular Vision-Based System for Docking A Hovering AUV
## 6 Simulation Results: Guidance Law  
The performance of the proposed law was tested in a simulation environment--simulink/Matlab. We consider here a first-order model for the closed-loop behavior of the AUV in the horizontal plane \(\rho\) and a first-order model for the closed-loop behavior of the AUV in the vertical coordinate \(z\). Once we propose a guidance law that can ensure a much faster convergence of \(\rho\) to zero that of \(z\) to zero, the best way to test this law was to consider the horizontal behavior slower than the vertical one. That means that for a first simulation, the relation between the pole of the horizontal model \(\frac{P(s)}{P_{ref}(s)}\), and the pole of the vertical model \(\frac{Z(s)}{Z_{ref}(s)}\), is:  
\[p_{z}>p_{h}. \tag{60}\]  
The Figure 37 presents the trajectories in the \((\rho,z)\) plane considering three different situations: \(p_{z}=2p_{h}\); \(p_{z}=4p_{h}\); \(p_{z}=8p_{h}\). If instead we consider that the behaviour in the horizontal plane is faster than the vertical one, \(p_{z}<p_{h}\), the resultant trajectories are those shown in the Figure 38 considering three different situations: \(p_{z}=\frac{p_{h}}{2}\); \(p_{z}=\frac{p_{h}}{4}\); \(p_{z}=\frac{p_{h}}{8}\). Going back to the case where \(p_{z}>p_{x}\), if we considered that the initial \(rho_{0}\) is farther from the reference \(rho_{ref}=0\) than the initial \(z_{0}\) from reference \(z_{ref}=0\), the resultant trajectory obtained is that shown in Figure 39.  
Considering now a realistic hypothesis that motion in the horizontal plane presents behavioural differences between \(x\) axis and \(y\) axis. In this case, instead of assuming a single model for horizontal behaviour, \(\frac{P(s)}{P_{ref}(s)}\), different behaviours were assumed for \(x\) and \(y\), and for that we used two first order models for the closed loop horizontal behaviour of the AUV, i.e.,  
\[\frac{X(s)}{X_{ref}(s)}=\frac{p_{x}}{s+p_{x}} \tag{61}\]  
\[\frac{Y(s)}{Y_{ref}(s)}=\frac{p_{y}}{s+p_{y}}. \tag{62}\]  
Figure 36: Outlier zone: this graph is a detail of the graph of the Figure 32, from the frame 44 to frame 108, here we can compare the estimation in the outlier zone with and without the use of the filter and adding the color constraints to the filter. The black curve is the estimation without filter, the red curve is the estimation with filter and the green curve is the estimation using the filter with color constraints of the target. The frame 44 was renumbered with the number 1. Figure 37: Trajectories in the \((\rho,z)\) plane for starting points \((\rho_{0},z_{0})=(1,-1)\) and considering \(p_{z}=2p_{h}\); \(p_{z}=4p_{h}\); \(p_{z}=8p_{h}\). Even at the situation at which the horizontal behaviour is the slowest one there is a faster convergence from \(\rho_{0}\) to zero than from \(z_{0}\) to zero as intended. Figure 38: Trajectories in the \((\rho,z)\) plane for starting points \((\rho_{0},z_{0})=(1,-1)\) and considering \(p_{z}=\frac{p_{h}}{2}\); \(p_{z}=\frac{p_{h}}{4}\); \(p_{z}=\frac{p_{h}}{8}\). Even at the situation at which the vertical behaviour is the slowest one, the motion remains tangent to the vertical axis. Figure 39: Trajectories in the \((\rho,z)\) plane for starting points \((\rho_{0},z_{0})=(7.1,-1)\) and \(p_{z}>ph\). The trajectory illustrate the motion remains tangent to the vertical axis. In the horizontal plane, the result of assuming a slower behaviour in \(y\) coordinate than for \(x\) coordinate, i.e., \(p_{x}>p_{y}\), is illustrated in Figure 40.  
Applying the guidance law that we propose, in 3D space, and assuming now that there is a difference in behavior between the horizontal plane axes, where \(p_{x}>p_{y}\), we obtain the trajectories presented in Figure 41. Note that in Figure 41 we considered that the behavior in the vertical coordinate \(z\) is faster than the behavior in the horizontal plane. Analyzing the Figures 40 and 41, when considering a slower behavior on the y coordinate, the vehicle behaves as if it is under the action of a disturbance in the direction of that coordinate.