#### Abstract

During a constant depth maneuver of an autonomous underwater vehicle (AUV), its pitch attitude and stern plane deflections create forces and moments to achieve equilibrium in the vertical plane. If an AUV has a proportional controller only in its depth control loop, then different weights or centers of gravity will cause different steady-state depth errors at trimmed conditions. In general, a steady-state depth error can be eliminated by adding an integral controller in the depth control loop. However, an improper integrator may lead to a bad transient response, even though the steady-state depth error can finally be eliminated. To remove the steady-state depth error, this study proposes methods that adjust the depth command and add a switching integral controller in the depth control loop. Simulation results demonstrate that the steady-state depth error can be eliminated and the transient response can be improved.

#### 1. Introduction

Autonomous underwater vehicles (AUVs) are self-contained vehicles with enough self-power that can carry out tasks with minimal human interventions. In recent years, more and more AUVs have been used for different applications, such as research, business, and military operations.

In general, an AUV’s buoyancy is almost equal to its weight. For safety considerations, it is common to design an AUV to be positively buoyant to ensure that in case power fails or a mission is completed it will float to the surface. AUV shapes are varied depending on their purposes. In general, a slender and streamlined AUV looks like a submarine or a torpedo. Because control surfaces are ineffective if the forward speed of the streamlined AUV is low, the AUV must move forward at a sufficient speed so as to maneuver stably and maintain suitable control performance [1]. However, if a slender-shaped AUV is not equipped with vertical and horizontal thrusters but equipped with a variable buoyancy system (VBS) [2–4] or a moving mass actuator (MMA) [1], then it can hover at low forward speeds.

The dynamics of an AUV is complex and highly nonlinear [5], especially when subject to environmental disturbances, such as ocean currents and waves. In conventional designs of proportional-integral-derivative (PID) controllers, we first simplify the nonlinear dynamics of a system to linear dynamics about an operating point to obtain the transfer functions of the system and then design the controllers. Healey and Lienard [6] suggested that 6-degree-of-freedom (DOF) linear equations of motion for an underwater vehicle can be divided into four noninteracting (or lightly interacting) subsystems for speed, steering, diving, and roll control. Controllers are, in turn, designed for each subsystem separately. Fossen [7] linearized models of the vehicles to obtain the transfer function for steering and pitch controllers. Shi [8] introduced an integral controller applied in a sliding mode control law to eliminate the steady-state error. To eliminate the steady-state error of an AUV, Hong et al. [9] proposed a dual loop design with inner sliding mode control with an integrator effect and outer proportional control with a feedforward controller. Woods et al. [10] reduced the steady-state depth error and pitch angle error by proposing a variable ballast system controller to shift the center of gravity along a body-fixed axis.

In industry, PID is the most commonly used controller scheme, which has been popularly applied in process control. More than 95% of the control loops are of PID type [11]. In general, steady-state errors in a control system can be eliminated by the integral controller. However, it suffers significant loss of performance due to integrator windup with actuator saturation. The conventional antiwindup methods include back-calculation (in which the difference between the actual process input and the controller output is fed back to the integral term), which is the classical method; conditional-integration (in which the value of the integrator is frozen when certain conditions are satisfied); hybrid scheme of back-calculation and conditional-integration [12]. The back-calculation dynamically reduces the integral term if the output of integral controller saturates. Therefore, if the output of integral term is smaller than the saturation value, the antiwindup method by using the back-calculation method will not work. However, not only integral windup but also the output of the integral term when it is smaller than the saturation value can cause the response overshoot. Accordingly, for reducing the overshoot, the conditional-integration method, which switches off the integral action when certain conditions are satisfied, seems to be more suitable than the back-calculation method.

Much work has been done for an AUV depth control; however, in our impressions, there is no literature published on eliminating the steady-state depth error for an AUV subject to different payloads. This study is primarily concerned with the diving subsystem of an AUV and the objectives are to improve the transient response and to eliminate the steady-state depth error of the AUV by modifying its depth control loop.

This paper is arranged as follows: AUV motion modeling in the vertical plane is presented in Section 2. AUV depth and pitch control architecture is discussed in Section 3. Sea trial and 6-DOF simulation results of the AUV depth control are presented in Section 4. Modifications of the depth control loop for eliminating the steady-state depth error are proposed in Section 5. Simulation results are presented in Section 6. Finally, Section 7 concludes this paper.

#### 2. AUV Motion Modeling in Vertical Plane

As shown in Figure 1, two coordinate frames are used to model the AUV motion, which are Earth-fixed frame and body-fixed frame . The position and orientation of an AUV are described with respect to the Earth-fixed frame. Euler angles including roll , pitch , and yaw are described by defining the orientation of the body-fixed frame with respect to the Earth-fixed frame. The linear and angular velocities of an AUV are described by in the body-fixed frame. Figure 1 also shows the force and moment diagram of an AUV in the vertical plane. The buoyancy acts at the center of buoyancy (CB). The gravitational force acts at the center of gravity (CG). and are hydrodynamic forces. represents a force due to the main propeller. represents a moment induced from the hydrodynamics. captures the effects of a stern plane with deflection . represents a moment induced from deflection in the stern plane. denotes the angle of attack.

The restoring force and moment vectors of an AUV in the body-fixed coordinate system are written as If the gravitation and buoyancy forces are computed at CB, (1) is reduced to where , , and denote CG distances from CB in the body-fixed frame. When an AUV is at the trimmed condition, that is, and , (2) becomes Equation (3) shows that the restoring force and moment in the horizontal plane are zero, but the restoring force and moment cannot be neglected in the vertical plane.

In the vertical plane, the restoring force and moment of an AUV are and , respectively. If the magnitude of is greater than , a positive net buoyancy will induce an upward heave motion. Thus, in order to maintain depth, the AUV has to pitch down a certain angle nearly equal to the angle of attack. The restoring moment acting on the vehicle will depend on the distance between CG and CB. Hence, different payloads will induce different force and moment effects in the vertical plane. On the other hand, if the net buoyancy is negative, the AUV has to pitch up at a certain angle (nearly equal to the angle of attack) to maintain a constant depth. As a result, regardless of whether the net buoyancy is positive or negative, there must be force and moment equilibrium in the vertical plane when the AUV is at the trimmed condition.

In order to reduce the hydrodynamic resistance during navigation, when the AUV maintains a constant depth, the angle of attack and the stern plane deflection should be as small as possible (so as to decrease the resistance induced from the hydrodynamics and to increase the operation range of the stern plane). Kinematic equations of an AUV motion for heave and pitch are written as

In order to determine a depth plane equation of motion, all unrelated terms , , , , and are set to zero. Using Newton’s law, the system equations of AUV motion for heave and pitch are obtained as [13] where where is a moment induced from , which denotes propulsion from propellers. and denote propulsion inclination angles with respect to pitch and yaw in the body-fixed frame, respectively. and denote acting positions of propulsion in the body-fixed frame.

It is difficult to design the controller directly from the above equations because the dynamic equations of an AUV are nonlinear and coupled. Therefore, it is necessary to simplify them at the operating point based on assumptions, which are as follows.(1)The AUV navigates at a constant speed and depth. The pitch angle is small enough to be ignored.(2)The roll angle and roll angle rate are under control and near zero, such that terms concerning rolling can be neglected.(3)The roll, pitch, and yaw control loops are designed to be independent. Since AUV body is symmetric, the products of inertia are treated as zero.

During an AUV’s constant depth maneuver with assumptions of small pitch angle and small roll angle , (4) can be linearized as

From the dynamic analysis in the vertical plane with respect to CB and with assumptions of small pitch angle and small roll angle , (6) becomes In addition, if there is no inclination of propulsion (, , and ), (7) becomes Assuming that , , and , by employing (10) and (11), (5) is linearized to become Equation (12) can be rewritten as where Taking Laplace transforms of (12) yields From (15), the AUV transfer function is expressed by where

#### 3. AUV Depth and Pitch Control Architecture

As depicted in Figure 2, the control block diagram represents a dual loop control methodology with an inner pitch control loop and an outer depth control loop, which is commonly used in AUV depth control. The depth controller generates a desired pitch angle , which becomes the input to the pitch control loop. The pitch controller results in the stern plane deflection based on the pitch angle difference .

In Figure 2, a proportional depth controller is adopted and the pitch controller can be a traditional PID controller [9, 14] or a sliding mode controller [4, 10]. In this paper, the pitch controller is designed with root locus and pole-zero assignment methods [15]. The pitch controller is expressed as in terms of Laplace variable . Therefore, the DC gain of the pitch control loop is .

When an AUV is at the trimmed condition, it achieves the force and moment equilibrium in the vertical plane under specific stern plane deflection and pitch attitude . According to Figure 2, the pitch command and the stern plane deflection when trimmed can be written as where denotes the depth feedback from the depth gauge, denotes the depth command, and denotes the depth error. From (18) and (19), one has

The ideal case in depth control is , which means that the steady-state error is zero; that is, . DC gain of the pitch control loop. However, the DC gain of the pitch control loop is constant; therefore, when the AUV is subject to different payloads, the force and moment equilibrium in the vertical plane is varied. Thus, the pitch attitude and the stern plane deflection must vary so as to make the force and moment achieve equilibrium in the vertical plane. As shown in (19), the pitch command and pitch attitude will determine the stern plane deflection in equilibrium, which is needed to maintain the AUV at the trimmed condition. Its pitch attitude is determined by the net buoyancy and a specific stern plane deflection, which will keep its force and moment equilibrium in the vertical plane. Under such circumstances, the AUV is forced to keep a constant depth with a steady-state error which can be calculated by (20). If an AUV undergoes a constant depth maneuver at a constant speed, the velocity and angular terms of motion in the vertical plane are considered null. Thus, and . Therefore, (11) can be rewritten as Equation (21) results in Combining (20) and (22) leads to Therefore, the stern plane deflection at the trimming condition can be determined by (22). Equation (23) shows that and affect the steady-state depth error under the control architecture as shown in Figure 2. If and in (22) are not altered, the steady-state error in (23) will remain constant; that is, the AUV will keep a constant depth run with a depth offset . In order to reduce the stern plane deflection when trimmed, either or in (22) must be altered. If or decreases, the restoring pitch moment from the center of gravity also decreases. As a consequence, the stern plane (22) and depth offset (23) will decrease.

#### 4. Sea Trial and 6-DOF Simulation Results of AUV Depth Control

Figures 3 and 4 show the sea trial results of an AUV developed by Chung Shan Institute of Science and Technology (CSIST) in April 2011. The AUV was navigated at 6.17 m/s. Its depth control architecture is shown in Figure 2 and the depth command is 9 m in this time interval. However, its actual depth is deeper than the depth command; that is, the steady-state depth error cannot be eliminated, which verifies that there exists the steady-state depth error derived from the previous section in (23). It means that the AUV is forced to keep force and moment equilibriums in the vertical plane under the control architecture shown in Figure 2. The mean stern plane deflection remains the same value as shown in (22). Thus, the stern plane deflection seems to be stuck at this trimming condition, and the steady-state depth error cannot be reduced. After the sea trial, we tried to tune the hydrodynamic coefficients and simulated the sea trial with a 6-DOF simulation program again. Simulation results depicted in Figures 3 and 4 show that the depth remains deeper than the command even if time increases. Similarly, the pitch command is also greater than the pitch angle and the mean stern plane deflection almost keeps constant as the sea trial result did. Figures 3 and 4 also show that the differences between the mean values of the sea trial and the 6-DOF model are small. Accordingly, the phenomenon that happened in the sea trial can reappear when using the 6-DOF simulation program. This result validates that the 6-DOF simulation program, taking into account AUV dynamics, is useful before sea trials.

#### 5. Modifications of Depth Control Loop for Eliminating the Steady-State Depth Error

In the previous section, it has been shown that an AUV with only a proportional` depth controller may generate a steady-state depth error. In order to eliminate the steady-state error, a common approach is adding an integrator in the depth control loop as shown in Figure 5, where is prescribed as 2.6 to avoid overshoot in the depth response. However, the stern plane servo may contain a relay nonlinearity, which would cause limit cycles if an integrator is included [14] and the control performance will be dramatically influenced by the gain of the integrator. Different will yield different depth responses. Figure 6 shows simulation results of depth control under different . This study prescribes to eliminate the steady-state error successfully without affecting the transient response. But an improper leads to a bad transient response, which causes a large overshoot when the AUV changes its depth. When the actual depth of the AUV is consistent with the desired depth, the pitch command cannot be zero immediately due to the integral term in the depth control loop. The pitch command also cannot reverse its value immediately when the AUV crosses the desired depth. Consequently, the pitch command will keep its original tendency to lead to the overshoot in depth. Therefore, it is important to use a proper to reduce the steady-state error without worsening the transient response.

In this section, two methods that modify the depth control loop are proposed to eliminate the steady-state error.

##### 5.1. Method 1: Altering Depth Command from Different Steady-State Depth Errors

During an AUV’s constant depth run, it is necessary to achieve the force and moment equilibrium in the vertical plane under a specific pitch attitude and stern plane deflection. From (23), in order to reduce the steady-state depth error, there are two ways that can be adopted by changing the design of depth and pitch control loop. One is keeping the depth command but changing the stern plane deflection so as to change the force and moment equilibrium. However, this way cannot be done if the depth controller keeps the same value and the DC gain of the depth controller is fixed. Another way is changing the depth command.

We first define the depth error as the mean value of depth minus the depth command. On one hand, if the steady-state depth error is positive, it means that the AUV’s pitch attitude and stern plane deflection make the force and moment equilibrium in deeper water. Since the steady-state depth error can be seen as an offset, we can deduct it from the original depth command. The new depth command will be thus smaller than the original. As a result, the pitch command will increase such that the stern plane deflection will also increase to vary the force and moment equilibriums in the vertical plane. Finally, the AUV will ascend to a shallower depth. On the other hand, if the steady-state depth error is negative, it means that the AUV pitch attitude and stern plane deflection make the force and moment equilibriums at shallower water. Since the steady-state depth error can be seen as an offset, we can again subtract it from the original depth command and thus the new depth command will be larger than the original one. As a consequence, the pitch command will decrease such that the stern plane deflection will also decrease to change the force and moment equilibrium state in the vertical plane and the AUV will descend to a deeper depth.

Equation (23) can be rewritten as Let Substituting (25) into (23) leads to Therefore, the new depth feedback of an AUV under the depth offset deducted from the original depth command will be equal to the desired depth at a trimmed condition.

According to (22) and the dynamics view point, because the weight and CG of the AUV are not varied, the pitch attitude and the stern plane deflection will keep the same values as before the depth command was varied. Figure 7 shows the new depth and pitch control loops. All the designs are the same as Figure 2 except that the depth command is changed by deducting a depth offset ().

##### 5.2. Method 2: Modifying Depth Control Loop by Adding a Conditional Integrator to Pitch Command

As mentioned in the previous section, the depth overshoot in the step response is caused by an improper gain of the integrator in the depth control loop. If the depth error is too large, an improper integrator will lead to a large pitch command, which cannot reverse immediately when the AUV crosses the desired depth. The output of the integrator can then be assumed as a very large value. Consequently, it will lead to a big depth overshoot in the transient response, which requires time to return to the desired depth. In order to improve the transient response, we modify the acting timing of the integrator to avoid too large output from the integral term. Instead of integrating the depth error all the time as shown in Figure 5, Figure 8 shows that the integrator is modified to provide integral action only inside a threshold by adding a switching action, which switches off the integrator if the depth error exceeds a certain threshold, that is, only “conditionally.” Hence, the steady-state depth error can be reduced by the integral effect and the depth overshoot is decreased by reducing the pitch command contributed from the integral term. The modified block diagram for adding a conditional integrator in the depth control loop is depicted in Figure 8, in which the integral term is actuated by a switch when the depth error is equal to or less than the threshold.

#### 6. Simulation Results

This study carries out computer simulations for a 6-DOF AUV. Assuming that the streamlined AUV is symmetric, that is, all the products of inertia are zero, the AUV parameters are listed in Table 1.

In this study, only 6.17 m/s is considered and all the simulations are carried out at this speed. Assume that the mass of the AUV is 183.6 kg. Hydrodynamic parameters used in simulation are

From (13) and (14), the linear system of the AUV at 6.17 m/s in the form of without driving inputs is written as where Two symmetric positive definite matrices and are prescribed as where and satisfy the Lyapunov equation A Lyapunov function for the linear system can be expressed by Hence, the linear system is asymptotically stable.

The plant stability can also be investigated based on the transfer function depicted in (16). The transfer function of the AUV at 6.17 m/s is Accordingly, the poles are −2.66 and −7.53, which are all located in the open left-half complex plane. Therefore, this plant in the vertical plane is strictly stable.

The pitch controller in Figure 2 is designed with root locus and pole-zero assignment methods. The pitch controller is , where , , , , and . The DC gain of the pitch control loop is written as . The value of will be adjusted according to different forward speeds of the AUV with interpolation by gain scheduling [16].

Assume that the transfer function of the pitch sensor is (with the form of , rad/s, and ). Thus, the characteristic equation of the inner closed loop is From (35), the numerator of the characteristic equation is written as

The stability of the control system at 6.17 m/s can be investigated by using the Routh-Hurwitz stability criterion [15]. Routh’s array is written as

3.7 | 32711.05 | 1344933.87 | 1082935.8 | |

488.69 | 321297.82 | 2325374.93 | 0 | |

30278.42 | 1327327.85 | 10082935.8 | 0 | |

299874.91 | 2307896.48 | 0 | ||

1094299.16 | 1082935.80 | 0 | ||

2011135.51 | 0 | |||

1082935.8 |

Since there are no sign changes in the first column of this array, the roots are all in the left-half complex plane, and the closed loop system is stable.

In this paper, suppose that the weight and distance between the center of gravity and center of buoyancy are varied with different payloads, which are shown in Table 2.

Table 3 shows the depth command of the AUV. Table 4 shows the corresponding mean steady-state depth errors of AUV under different payloads.

Figure 9(a) shows the resulting depth control performance. Figures 9(b), 9(c), and 9(d) depict the pitch angle, stern plane deflection, and pitch command with three different payloads under the same control loop as shown in Figure 5. Figures 9(a) and 9(b) depict that the pitch angle is very close to the pitch command and the steady-state depth error is 0.09 m. Figures 9(a) and 9(c) depict that the pitch command is smaller than the pitch angle (the stern plane deflection will be negative) and the AUV’s depth is shallower than the depth command for 0.75 m. Figures 9(a) and 9(d) depict that the pitch command is bigger than the pitch angle (the stern plane deflection will be positive) and the depth is deeper than the depth command for 0.73 m. It is evident that the proportional controller is more suitable for payload 1 than for payload 2 and payload 3. When the AUV is in steady-state condition, whether there exists a steady-state error or not, there must be force and moment equilibrium in the vertical plane.

**(a)**

**(b)**

**(c)**

**(d)**

In this section, we will demonstrate that the steady-state performance can be improved by the methods proposed in Section 4. The mean steady-state depth error is calculated at 50 s in this study.

##### 6.1. Method 1: Altering Depth Command from Different Steady-State Depth Errors

From (23), it can be seen that the bigger the , the smaller the steady-state depth error. However, the steady-state depth error still exists no matter what value of is chosen. In Figure 6, it can be seen that, no matter what value of is chosen, the steady-state depth error can be finally eliminated by modifying the depth command according to (25). In simulation, the depth command is modified after 60 s with this method and Figure 10 shows that the steady-state depth error is immediately eliminated under different payloads and different values.

##### 6.2. Method 2: Modifying Depth Control Loop by Adding a Conditional Integrator to Pitch Command

The modified integral control loop, as shown in Figure 8, acts only when the depth error is below a certain threshold. In simulation, the pitch command limitation is 45 deg and the stern plane deflection limitation is 18 deg. However, if the threshold is selected smaller than the steady-state depth error, the integrator will not work. Therefore, to ensure that the threshold is selected adequately, a threshold larger than the steady-state depth error is necessary. In this paper, we set it to be 1.2 times the mean steady-state depth error. In simulation, the mean steady-state depth error can be obtained at 50 s. Figure 11(a) shows the depth response under different conditions. The blue solid curve depicts the desired depth and the black solid curve depicts the depth response of proportional control and integral control with payload 3 under the control architecture as shown in Figure 5. The other curves are simulated under the control architecture as shown in Figure 8. Comparing the black solid curve and the pink solid curve, it is obvious that the overshoot or undershoot caused by the integrator in the black solid curve is dramatically decreased in the pink solid curve. The other curves show that the transient responses are improved and the steady-state depth errors can be eliminated through the conditional-integration, as shown in Figure 8.

**(a)**

**(b)**

Figure 11(b) depicts the depth response and pitch command of an AUV with different types of integrators. Depth overshoot or undershoot caused by the integrator can be dramatically reduced by a conditional integrator and the pitch command can be reduced as well. Figure 11(b) also shows that the pitch commands do not exceed the pitch command limitation; this means that integral windup does not happen during the AUV depth control. Therefore, the overshoot or undershoot of the depth response caused by the integrator will not be reduced if a traditional back-calculation scheme is used in the depth control loop. Simulation results show that, by using a conditional integrator, not only can the overshoot be reduced but also the steady-state depth error is eliminated.

Figures 12(a) and 12(b) depict the pitch angle and the stern plane deflection, respectively, for an AUV with the two different methods used to eliminate the steady-state depth error (with payload 2). The blue dashed curve depicts with a proportional controller only. The green solid curve depicts the results using method 1 . The red dotted curve shows the results from method 2 ,. Because the weight and buoyancy of the AUV are not altered, simulation results demonstrate that the pitch angles and the stern plane deflections remain the same, which validates (22).

**(a)**

**(b)**

#### 7. Conclusion

In this study, two methods have been proposed to eliminate the steady-state depth errors by modifying the depth control loop for AUVs. The first method deducts the mean steady-state depth error that is regarded as an offset from the depth command. The depth response thus will not suffer oscillatory motion due to the effect of any integrator term. The second method uses a switching integrator to replace a conventional integrator, which acts only when the depth error is below a certain threshold. In this study, the threshold is set greater than the mean depth error to ensure that the integrator can actually act. Accordingly, overshoot or undershoot in the transient response caused by the integral effect can be avoided. The effectiveness of the proposed methods considering an AUV subject to different payloads has been validated in simulation. Its transient response can be improved and the steady-state depth error can be eliminated effectively.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.