A Self-Tuning Proportional-Integral-Derivative Controller for an Autonomous Underwater Vehicle, Based On Taguchi Method

Problem statement: Conventional Proportional-Integral-Derivative (PID) controllers 
exhibit moderately good performance once the PID gains are properly tuned. However, when the 
dynamic characteristics of the system are time dependent or the operating conditions of the system 
vary, it is necessary to retune the gains to obtain desired performance. This situation has renewed the 
interest of researchers and practitioners in PID control. Self-tuning of PID controllers has emerged as a 
new and active area of research with the advent and easy availability of algorithms and computers. 
This study discusses self-tuning (auto-tuning) algorithm for control of autonomous underwater 
vehicles. Approach: Self-tuning mechanism will avoid time consuming manual tuning of controllers 
and promises better results by providing optimal PID controller settings as the system dynamics or 
operating points change. Most of the self-tuning methods available in the literature were based on 
frequency response characteristics and search methods. In this study, we proposed a method based on Taguchi’s robust design method for self-tuning of an autonomous underwater vehicle controller. The algorithm, based on this method, tuned the controller gains optimally and robustly in real time with less computation effort by using desired and actual state variables. It can be used for the Single-Input Single-Output (SISO) systems as well as Multi-Input Multi-Output (MIMO) systems without mathematical models of plants. Results: A simulation study of the AUV control on the horizontal plane (yaw plane control) was used to demonstrate and validate the performance and effectiveness of the proposed scheme. Simulation results of the proposed self-tuning scheme are compared with the conventional PID controllers which are tuned by Ziegler-Nichols (ZN) and Taguchi’s tuning methods. These results showed that the Integral Square Error (ISE) is significantly reduced from the conventional controllers. The robustness of this proposed self-tuning method was verified and results are presented through numerical simulations using an experimental underwater vehicle model under different working conditions. Conclusion/Recommendations: By using this scheme, the PID controller gains are optimally adjusted automatically online with respect to the system dynamics or operating condition changes. This technique found to be more effective than conventional tuning methods and it is even very convenient when mathematical models of plants are not available. Computer simulations showed that the proposed method has very good tracking performance and robustness even in the presence of disturbances. The simple structure, robustness and ease of computation of the proposed method make it very attractive for real time implementation for controlling of underwater vehicle and it offers a chance to extend the same technique to the three dimensional vehicle tracking control as well.


INTRODUCTION
Modern developments in the field of control, sensing and communication have made increasingly complex and dedicated underwater vehicle systems a reality. Used in a highly hazardous and unknown environment, the autonomy and control of the vehicle is the key to mission success. Though the dynamics of underwater vehicle system is highly coupled and nonlinear in nature, decoupled linear control system strategy is widely used for practical applications. As autonomous underwater vehicle needs intelligent control system, it is necessary to develop control system that really takes into account the coupled and non-linear characteristics of the system. In addition, most of the AUVs are underactuated, i.e., they have fewer actuated inputs than the Degrees Of Freedom (DOF), imposing non-integrable acceleration constraints. A summary of the recent developments in this area can be found in (Fossen, 1994;Yuh, 2000). Dynamics and control of AUV in a constrained environment poses great challenges to designers. This, coupled with the uncertainty of hydrodynamic parameters, make the controller design an extremely tough task. Design, modeling and simulation of the vehicle are important key issues in controlling the vehicle and some of the recent works are summarized in the literature (Fossen, 1994). The control techniques proposed in literature can be broadly classified into two major categories: adaptive control and robust control (Yuh, 2000;Antonelli, 2007). In adaptive control the controller parameters are automatically varied to maintain a satisfactory level of performance when the system parameters are unknown and/or time varying. Robust control refers to the control of uncertain plants with unknown disturbance signals, uncertain dynamics and imprecisely known parameters making use of special fixed controllers. Among these, adaptive control is considered to be better for plant uncertainty. However, it is computationally intensive for higher order systems and requires exact knowledge of the dynamic parameters, apart from the computation of inverse Jacobian matrix. The robust control scheme provides a satisfactory performance with a simple control structure, but comes with undesired high control activity at steady state. On the other hand, the commonly used PID control (Perrier and Canudas-de-Wit, 1996;Santhakumar and Asokan, 2009) does not require any information of the plant dynamics and has a simple standard structure. Moreover, owing to modeling uncertainties a more sophisticated control scheme is not necessarily more efficient than a well-tuned PID controller. Alongside the advantages, however, the problem of tuning PID controllers has remained an active research area.
Tuning is the adjustment of the feedback controller parameters to obtain a specified closed-loop response. In conventional PID controllers, once well-tuned PID gains are obtained, these controllers usually exhibit good performance. However, when the dynamic characteristics of the system are time dependent or the operation conditions of the system vary, it is necessary that the PID gains must be tuned again. Castrillon et al. (2006) have reviewed twenty-four different tuning methods and has concluded that most of the controllers are tuned using frequency responses due to the advantages in expressing the modeling errors directly in the frequency domain. However, frequency response methods are difficult to implement in the MIMO systems. Ferrell and Reddivari (1995), believed that PID controllers are poorly tuned because of traditional methods of controller design and the tuning to achieve minimum variance requires the engineer to create a closed-form mathematical model of the system and controller dynamics. Tuning of controllers using Taguchi method was proposed by them to improve the controller performance. Though this was found to be very convenient, the controller gains were not optimal and noise factors were not considered. Santhakumar and Asokan (2009) have attempted tracking control of underwater vehicle using PID control. A preliminary effort was made by introducing a robust design method in the field of underwater vehicle control and the effect of noises was considered. This study mainly focused on depth control of a torpedo shaped underwater vehicle and it also compared other possible tuning methods.
Self-tuning of PID controllers has emerged as a new and active area of research and development with the advent and easy availability of algorithms and computers and is receiving more and more attention (Astrom and Hagglund, 1988;Bobal et al., 1999;Gawthrop, 1986;Yu, 2006;Liu, 2007;Huang and Lin, 2007). Self-tuning mechanism will avoid the timeconsuming manual tuning and promises better results by providing optimal PID controller settings automatically as the system dynamics or operating points change. Most of the self-tuning methods are based on frequency response characteristics and search methods. In this study, it is proposed to use Taguchi's robust design method based self-tuning scheme for an autonomous underwater vehicle.
The remaining part of the study is organized in the following manner: A brief discussion on the modeling of AUV is presented followed by the controller design details. A discussion on the proposed self-tuning scheme is presented in materials and methods. In the results and discussion, simulation results and robustness of the proposed controller are presented for an experimental AUV and a comparison of the results with that of a conventional PID controller is also provided. Finally, concluding remarks of the proposed method and it's the scope of future study are presented.

Modeling of AUV kinematics and dynamics:
In this study, we have considered an experimental autonomous underwater vehicle as a test platform for our experiments and analysis. This is a torpedo-shaped under actuated AUV, without any side thrusters to control the sway direction (this is not implemented because of economical and weight considerations) (Fig. 1). There are only two stern propellers which are offering control inputs as the force in the surge direction and the control torque in yaw direction in the horizontal plane (by differential mode operation of propellers). The following assumptions are made in developing the mathematical model for the AUV. Vehicle has an xz-plane of symmetry; surge is decoupled from sway and yaw; heave, pitch and roll modes and these axes terms are neglected.
Under these realistic assumptions, the motion of the vehicle in the yaw plane is described by the following ordinary differential equations (Fossen, 1994;Santhakumar and Asokan, 2010).
The kinematics of the vehicle on the horizontal plane is as given by (1): Where: The velocity vector with respect to body fixed frame J( ) ψ = The transformation matrix (Jacobian) and is given as: The dynamic model of the vehicle on the horizontal plane is as given by (3): where, M-inertia matrix, C(ν)-Coriolis and Centripetal matrix, D(ν)-Damping matrix and τ-input vector, the components of which are as follows: (x, y) are the surge and sway displacements, Ψ is the yaw angle in the earth fixed frame, u, v and r denote surge, sway and yaw velocities; (m 11 , m 22 , m 23 , m 32 , m 33 , l 11 , nl 11 , l 22 , nl 22 , l 23 , nl 23 , l 32 , nl 32 , l 33 , nl 33 ) > 0 denote the hydrodynamic damping and vehicle inertia including added mass, the controls τ u and τ r are the surge force and yaw moment. V s and V p are the thruster input voltages of starboard side thruster and portside thruster respectively. B is the input matrix.
where, K p , K i and K d are the proportional, integral and derivative gains of the controller respectively and the subscript e denotes the error. The PID control scheme is schematically depicted in Fig. 2. Detailed description and stability analysis of PID controller for an underactuated AUV are given in (Santhakumar and Asokan, 2010).
There are six controller gains in the yaw plane controller. These controller gains are to be tuned in such a way that the controller is optimal in nature.

MATERIALS AND METHODS
Self-tuning of PID controller using Taguchi's method: The proposed controller scheme for the AUV is shown in Fig. 3. The trajectory controller generates the desired trajectory from the user inputs. User inputs consist of start point, goal point, way points and vehicle speed or time duration. These desired values are compared with the actual values which are coming from the AUV dynamic model (sensor values in the real time). Comparator is giving tracking errors and these error values are fed into the PID controller and controller is generating necessary control signals, as per the control law. The self-tuning block calculates the optimal values of the controller gains to reduce the tracking errors. The real-time calculations of gains are achieved by implementing the Taguchi's robust optimization method. The variations in the input commands as well as the tracking error are used in arriving at the optimal gains. The methodology used in developing this self-tuning controller is explained below. Taguchi's robust tuning method: The Taguchi's robust parameter design is used to determine the levels of factors and to minimize the sensitivity to noise. That is, a parameter setting should be determined with the intention that the product response has minimum variation while its mean is close to the desired target.
Taguchi's method is based on statistical and sensitivity analysis for determining the optimal setting of parameters to achieve robust performance (Byrne and Taguchi, 1986). In setting up a framework for robust design, the classifications of the quantities at play in the design task are given below: • Design Variables (DV) are those quantities to be decided by the designer with the purpose of meeting performance specifications under given conditions • Design-Environment Parameters (DEP) is those quantities over which the designer has no control and that define the conditions of the environment under which the designed object will operate • Performance Functions (PF) are quantities used to represent the performance of the design in terms of design variables and design-environment parameters The responses at each setting of parameters are treated as a measure that would be indicative of not only the mean of some quality characteristic, but also the variance of the same characteristic. The mean and the variance are combined into a single performance measure known as the Signal-to-Noise (S/N) ratio (Byrne and Taguchi, 1986;Park, 1996). Taguchi classifies robust parameter design problems into different categories depending on the goal of the problem and for each category as follows: Smaller the better: The target value of y, that is, quality variable is zero. In this situation, S/N Ratio (SNR) is defined as follows: Larger the better: The target value of y, that is, quality variable is infinite and S/N ratio is defined as follows: Nominal the best: The certain target value (s) is given for y value. In this situation S/N ratio is defined as follows: In this study, smaller the better characteristic is used due to the requirement to minimize the position tracking error. Taguchi's method uses an Orthogonal Array (OA) and analysis of mean to study the effects of parameters based on statistical analysis of experiments. An OA is a fractional factorial matrix which assures a balanced comparison of levels of any factor or interaction of factors. It is a matrix of numbers arranged in rows and columns where each row represents the level of the factors in each run and each column represents a specific factor that can be changed from each run. The array is called orthogonal because all columns can be evaluated independently of one another (Park, 1996).
The design of yaw plane controller parameters is carried out using this technique. There are six controller gains (sway is an unactuated state, therefore sway and yaw are combined in order to get sway motion) and five levels of each gain are considered for the analysis, therefore an orthogonal array of L 25 [5 6 ] is chosen for the analysis (Park, 1996). The physical values of the controller parameters are chosen by considering experimental vehicle actuator and sensor system characteristics such as time delay, saturation limit and dead zone and its physical values are given in the Table 1. With the help of these physical values simulation experiments are conducted as per L 25 [5 6 ] OA. Objective of this analysis is to improve the controller performance by minimizing the error. In this analysis, measure of system performance is in the form of Integral Square Error (ISE) (by integrating the square of the error over a fixed interval of time) and from the simulations ISE is calculated and recorded as given in the Table 1. For example, the SNR for experiment 1 is calculated based on (6) (using smaller the better characteristics) and as given by (9): SNR for experiment 1 = − 10 log (1359.59 2 ) +80 = 17.33dB (9)    (80 dB is added to avoid negative values for SNR, to make comparisons easy). For identifying the optimal parameter combination, sum of the SNR of each factor and their each level values are calculated as shown in Table 2. For example, the sum of the S/N ratio for level 1 of the factor K dy (i.e., K dy = 0.2) is calculated with the help of SNR values presented in Table 1 as follows: Sum of the SNR for Level 1 of K dy = (17.33+66.96+68.59+66.50+66.38) dB = 285.76dB (10) Table 2 (Sum of SNR values) gives the optimum level of each parameter (gain). That is, the level which contains maximum value of sum of the SNR is the optimum level. From Table 2, it is found that the optimum levels (near optimal) of controller parameters K py , K dy , K iy , K pΨ , K dΨ and K iΨ are 3, 4, 2, 4, 4 and 1 respectively. The corresponding physical values of these particular levels are 15, 0.8, 10, 0.8, 0.4 and 1 respectively. For further fine tuning of the controller parameters, the same procedure can be repeated. In this study, discussion is limited only to illustrate the robust method for controller parameter adjustment. However the interaction effect between controller parameters as such is an important topic which is kept open for future research.
The optimal controller parameters are incorporated in the controller and simulated the vehicle closed loop behaviour in order to demonstrate the proposed technique. The closed loop response for this tuned controller is presented in Fig. 4, which confirms that Taguchi method tuned controller is giving good transient and steady state results with less overshoot, faster response and less steady state error.
In order to check the performance of the controller, vehicle performance has been investigated under various operating conditions such as 2 m step input, multiple step, ramp and sine inputs. Closed loop responses of these conditions are obtained from simulations and presented in Fig. 5.
From Fig. 5a, it is found that there is an overshoot of approximately 20% for the 2 m step input. Similar trend is seen in the case of multiple-step input also. Compared to the unit step input response, the settling time has also changed with the change in input command. In the case of time varying inputs such as ramp and sine inputs, the responses ( Fig. 5c and d) show that the initial tracking errors are high. These variations are mainly due to the fixed values of the controller gains for various input scenarios. The controller has to adapt the changes in the working conditions and/or system dynamics. The proposed self-tuning mechanism is developed using Taguchi's method to address this issue. This is developed by considering five different command input scenarios (unit step, negative step, multiple step, ramp and simple sine) and finding out the optimal controller parameters for each of these scenarios using Taguchi's method, as described earlier. Using linear regression analysis and curve fitting, the relationship between controller parameters (K py , K dy , K iy , K pΨ , K dΨ and K iΨ ) and the sway error (y e ) is developed from the above values of optimal parameters. A regression model is developed for each parameter using a confidence level of 99% and with the help of residuals and variances. For example, the optimal values of controller proportional gain K py are 15. 00, 15.03, 14.998, 14.958 and 15.001 for the corresponding input conditions. Applying linear regression analysis to the above values, the model is derived as given in (11). The relationship between sway error and proportional gain is also obtained and is presented in where, R 2 is the coefficient of determination (goodness of fit) and it provides a measure of how well future outcomes are likely to be predicted by the model. In other words, R 2 ×100% gives the percentage of corroboration and y e is the sway position tracking error.  Similar procedure was adopted to get the regression model for all other parameters. The selftuning mechanism consists of all the controller parameter models as given by (12). As seen from this equation, the controller tuning is directly related to the tracking error and the parameters are selected on the basis of the self-tuning law. Since the changes in system parameters or operating conditions are directly reflected in the closed loop tracking errors, controller can automatically adapt to any variations in these parameters by suitably adjusting the controller parameters: Experimental platform: For this study, Jubilee, a test bed AUV being developed at IITM, is selected as an experimental set-up. Figure 7 shows the first prototype of this AUV and the parameters used for the numerical simulations are given in Table 3.

RESULTS
In order to demonstrate and validate the performance and effectiveness of the proposed scheme, typical simulation results are presented. Simulation results for two input conditions such as 2 and 5 m step input, with and without self-tuning are presented in Fig. 8. The variations of controller parameters during self-tuning are shown in Fig. 9. The controller robustness is demonstrated by analyzing the performance of the self-tuned controller under four different operating conditions i.e., unit step input with non-zero initial error, multiple steps with random disturbances, multiple steps with parameter uncertainties and time varying input (sine) with random disturbances. The well known conventional Ziegler and Nichols (1993) method tuned PID is used for the comparison aspects.
One important issue in the underwater vehicle control is the initial error in position and orientation of the vehicle when the controller is switched on. Since most of the underwater vehicles are launched from the mother ship, there can be considerable amount of error in the position and orientation at the initial stage.
Any new controller needs to be analyzed for its ability to react to large initial errors. The proposed selftuning PID controller is subjected to a simulated initial error test to analyze its performance.

Closed loop responses for non-zero initial error:
Here, an initial error of 0.1 m in sway (y) position is assumed and the closed loop performance comparison of controllers is presented in Fig. 10. The closed loop responses of PID controllers (with and without self-tuning) for multiple step input in the presence of disturbances are presented in Fig. 11. Here, the effect of underwater current and other disturbing effects are assumed to be random values in the input side, with the magnitude of 5 N and ± 5 Nm in the force and moment respectively.
Simulation results for disturbance rejection in the case of varying input (sine input) in the presence of random disturbances are presented in Fig. 12.    Fig. 13. Here, the vehicle parameter variations are assumed to be 50% of the actual values for all the parameters. A comparison of performance measure of selftuning PID controller with respect to other controllers is provided in Table 4.

DISCUSSION
It can be seen from the results presented in Fig. 8 that the PID controller tuned for 2 m step is performing well for 2 m step, but shows deterioration in performance for 5 m step, with a large overshoot and settling time. Similar trend is seen for 5 m step also. On the other hand, self-tuning PID is performing well in both the step input conditions (Fig. 8). This is achieved through the retuning of the controller parameters, as shown in Fig. 9. This confirms that the proposed control scheme is adapting well to the variations in operating state.
The ability of the controller to effectively overcome the initial error is demonstrated in the results presented in Fig. 10. The initial errors are found to converge to its desired state of zero over a short period of time in the self-tuning scheme.
It is observed from Fig. 11 that the proposed controller has a good tracking performance in the presence of underwater current and other disturbances. Compared to other conventional controller responses, the overshoot and rise time have significantly reduced. Results provided in Fig. 12 show the ability of the controller to adapt well to varying inputs.
The effectiveness of the proposed controller in adapting to the parameter variations is demonstrated in Fig. 13. The results show that the scheme is superior to many other control schemes. The comparison results presented in Table 4 shows that the performance (in terms of ISE) of self-tuning controller is much better than the conventional controllers. The results presented above confirms the fact that the self-tuning PID scheme performs well in terms of smooth transient response, quick convergence of tracking errors to zero, robustness, disturbance rejection and adapting to parameter variations.

CONCLUSION
In this study, a new self-tuning PID control scheme for AUV control using Taguchi's method is presented. By using this scheme, the PID controller gains are optimally and robustly adjusted online with respect to the system dynamics and operating condition changes. This technique is found to be more effective than conventional tuning methods and it is even very convenient when mathematical models of plants are not available. This method can be easily extended to multiinput and multi-output systems from basic single-input and single-output systems. Computer simulations showed very good tracking performance and robustness of the proposed method even in the presence of disturbances. The simple structure, robustness and ease of computation of the proposed method make it very attractive for real time implementation for controlling of underwater vehicle and it offers a chance to extend the same technique to the three dimensional vehicle tracking control as well.