## 3 Tracking Control Laws
### Depth Control Not Considering Fuel Consumption  
First, consider the case where the current depth of the vehicle is deeper than the target depth. In this case, the pitch is aligned in the case where it is a positive value. We control the elevators to change the depth of the vehicle. We set the elevator command to  
\[\mathrm{u}_{1}=\Big{[}\,\delta_{\mathrm{f}1},\ \sim\,\delta_{\mathrm{f}3},\ \sim,\Delta+\delta_{\mathrm{cav}_{\mathrm{pitch}}}\Big{]} \tag{5}\]  
In this equation, \(\Delta>0\) is a constant. In (5), \(\sim\) implies that the associated inputs (inputs associated to rudders) are used to make the roll of the vehicle converge to zero. Section 3.6 presents how to set the rudder command. Compared to \(\mathrm{u}_{0}\) in (4), we slightly change the cavitator pitch angle to give the vehicle a torque to change its pitch. After maintaining the elevator command as \(\mathrm{u}_{1}\) for \(\mathrm{d}\approx 0\,s\), we check whether the pitch is aligned. \(\mathrm{d}\) is the minimum dwell time for \(\mathrm{u}_{1}\). This implies that \(\mathrm{u}_{1}\) is set as our elevator command for \(\mathrm{d}\) seconds, whether the pitch is aligned or not. As long as the pitch is not aligned, we maintain the elevator command as \(\mathrm{u}_{1}\). Once the pitch is aligned, we set the elevator command to the following \(\mathrm{u}_{\mathrm{A}}\). \[\mathrm{u}_{\mathrm{A}}=\Big{[}\,\delta_{\mathrm{f}1},\ \sim\,\delta_{ \mathrm{f}3},\ \sim,\delta_{\mathrm{cav}_{\mathrm{pitch}}}\Big{]} \tag{6}\]  
At the instant when we switch to \(\mathrm{u}_{\mathrm{A}}\), the pitch is aligned. We further show that at the instant when we switch to \(\mathrm{u}_{\mathrm{A}}\), the pitch is almost zero. The duration of \(\mathrm{u}_{1}\) is bigger than or equal to \(\mathrm{d}\) seconds. Consider the case where the duration of \(\mathrm{u}_{1}\) is \(\mathrm{d}\) seconds. Since \(\mathrm{d}\approx 0\), the pitch is almost zero at the instant when we switch back to \(\mathrm{u}_{\mathrm{A}}\). Next, consider the case where the duration of \(\mathrm{u}_{1}\) is bigger than \(\mathrm{d}\) seconds. The elevator command changes to \(\mathrm{u}_{\mathrm{A}}\) at the instant when the sign of the pitch changes. Hence, the pitch is almost zero at this instant. Using Theorem 1, the rotation of the vehicle about the CG is zero under the trim input \(\mathrm{u}_{\mathrm{A}}\) in the full cavity state. Since the pitch is aligned, the vehicle will reach the target depth in finite time. There may be a case where maintaining the elevator command as \(\mathrm{u}_{1}\) does not lead to aligned pitch in finite time. In this case, we need to give more torque to the vehicle. Thus, if the duration of applying \(\mathrm{u}_{1}\) is longer than a certain threshold, say \(\mathrm{D}>\mathrm{d}\), then we use \(\Delta+\varepsilon\) instead of \(\Delta\) in (5). Here, \(\varepsilon>0\). In this way, we update \(\mathrm{u}_{1}\). Next, consider the case where the current depth of the vehicle is shallower than the target depth. The pitch is aligned in the case where it is a negative value. We set the elevator command to  
\[\mathrm{u}_{2}=\Big{[}\,\delta_{\mathrm{f}1},\ \sim\,\delta_{\mathrm{f}3},\ \sim,-\Delta+\delta_{\mathrm{cav}_{\mathrm{pitch}}}\Big{]}. \tag{7}\]  
See that we slightly change the cavitator pitch angle to give the vehicle a torque to change its pitch. \(\mathrm{u}_{2}\) is set as our elevator command for \(\mathrm{d}\) seconds, whether the pitch is aligned or not. Aftermaintaining the elevator command as \(u_{2}\) for d seconds, we check whether the pitch is aligned. As long as the pitch is not aligned, we maintain the elevator command as \(u_{2}\). Once the pitch is aligned, we set the elevator command back to \(u_{A}\). At the instant when we switch to \(u_{A}\), the pitch is aligned. We further show that at the instant when we switch back to \(u_{A}\), the pitch is almost zero. The duration of \(u_{2}\) is bigger than or equal to d seconds. Consider the case where the duration of \(u_{2}\) is d seconds.