Control of Non-linear Equation of Submarine Using PI-like Fuzzy Controller

— This paper presents a methodology to facilitate the development of a Fuzzy Logic Controller (FLC). The process is done through the use of model rule base, in addition to the adjustment of the membership functions and the universe of discourse related to the system variables. This adjustment is accomplished by refinement rules similar to those used in a classical control technique. In this way, PID control system designers can use their knowledge of parameter tuning to obtain the desired performance in the Fuzzy system. This knowledge allied to the model rule base contributes to decrease the controller development time. Therefore, as an application of the method, a non-linear model of a submarine is used to evaluate the performance of the FLC. A model rule base developed by MacVicar-Whelan and the basic rules of refinement elaborated by Procyk and Mandani are applied for the development of the FLC. The simulations are performed through MATLAB software and the FLC is developed with the Fuzzy Logic Toolbox.


I. INTRODUCTION
Artificial Neural Networks (ANN) and Fuzzy Logic have been successfully used in several types of applications [1], such as the control of pollutant emissions by internal combustion engines [2], temperature control in incubators [3], speed control of an induction motor [4], petrochemical cracking [5], among others. Fuzzy logic controllers (FLCs) are rules-based systems that use fuzzy linguistic variables to model human approaches, in order to solve problems without a mathematical modeling [6]. However, for its construction, the rule base is crucial, being the most difficult aspect of the FLC project, since there is no systematic tool for the creation of the rule base [7]. In this context, there are two main methods for building the rule base. The first one is based on the intuition and experience of the designer, where the FLC is designed as a specialist system, allowing the addition of custom rules by experience in the control strategy. Usually, it is difficult to extract the operator control skills that can be used to build the FLC rule base. Besides, there is no reason to believe that these rules are the best control strategy. Then, most FLCs combine an approach based on operator experience with a good understanding of the system and control theory [7]. The second way to build the FLC rule base is based on the use of a model rule base, which is considered as a basic tool that combines common sense engineering and experience in FLC controllers. Thus, with this method, the implementation of a Fuzzy Logic Controller could be similar to a traditional PID Controller, in addition to maintaining the simplicity of PID controller implementation with the performance of a non-linear controller [7]. The dynamics of a submarine is non-linear and complex, whose operating conditions change according to sea currents, depth variation, among other factors [8]. Some works as in [8,9] provide intelligent control techniques applied to submarine control, such as the fuzzy controller, which is used in [8] for submarine steering control, and in [9] for control of the submarine depth. Based on this context, the objective of this project is to implement a FLC that is effective and robust, through the use of a model rule base and techniques for controller improvement that resemble those used in PID tuning, with the advantage of perform a non-linear controller. The FLC is developed to control the speed of a submarine represented by a non-linear equation. The methodology for implementing the controller is detailed to allow its use in other types of models and systems as a guide, since each type of application requires specific adjustments. In general, the developed FLC presented satisfactory results in relation to speed control and disturbance tolerance in the submarine case. The work is organized as follows. Section II shows the structure of FLC controller. Section III describes the FLC adjustments and simulation of the submarine's non-linear equation.In section IV it is presented the conclusions about this work, as well as, its limitations and future works.

II. STRUCTURE OF FUZZY LOGIC CONTROLLER
The control law of FLC is described as a knowledge base composed of IF...THEN rules with vague characteristics and an inference mechanism based on Fuzzy logic. The rule base is the most important part of the controller, since it is formed by a family of logic rules that describe the relations between input ( ) and output ( )of the controller. The rule base suggested by MacVicar-Whelan [10] is a good example of a model rule base, being developed in order to complete the traditional rule base focused on the designer's experience. In addition, with the MacVicar-Whelan rule base it is possible to add special situations. This expansion of the rule base is governed by the three fundamentals described below [7,11]: 1. If the error ( )and the change of error∆ ( ) have their values at zero, then the present control is maintained; 2. If the error ( ) tends to zero at a satisfactory rate, then the present control is maintained; 3. If the error ( ) is not self correcting, then the change of control action ∆ ( ) is not zero and depends on the signal and magnitude of ( )and ∆ ( ). The error ( ) is defined as the difference between the desired value ( ) and the output value ( )of the control plant, as shown in (1). where notation ( − 1)indicates the previous value or sample. The input variables of the FLC are error ( ) and error change ∆ ( ). The output variable is the change in the control action ∆ ( ). This controller is similar to the PI controller, since an integrator is added to the output of the controller to obtain the control action ( )through ∆ ( ). Fig.1 shows the structure of the Mandani FLC controller used in this project. The MacVicar-Whelan rule base extracted from [10] and used in this work is presented in Table 1. The first column and row are the linguistic variables for the system error ( ) and error change  ( ), respectively. The relationship between ( ) and  ( )with the control action change  ( )is done by the following logic: R1: If error ( ) is A and change of error  ( ) is B, then change of control action  ( ) is C.
In R1,A, B and C are the linguistic variables present in Table 1. The intensityAis a value of the first row, B is a value of the first column and C is the intersection between the row and column equivalent to values A and B, that results in the intensity of the control action ( ). The relationship between the notation and the meaning of each linguistic variable is shown in Table 2.

III. SIMULATION AND CONTROLLER ADJUSTMENT
The non-linear model for the velocity response of the submarine in relation to the applied acceleration or thrust is illustrated in (4) (4) and the controller structure defined in Section II, it is necessary to select the operating range for each system variable. The variable ( ) must have an operating range of [-50, +50], because the adopted velocity is 50 m/s and the initial velocity could be zero. Thus, it is necessary that the variable ( ) is at least in this operating range, according to (1). For the error change∆ ( ) the same range of error ( ) could be considered, but as we use a sample rate of 0.1 seconds, there is no need for such a large operating range. Therefore, a smaller range of [-10, +10] is adopted. For the change of acceleration ∆ ( ), an operating range of [-10, +10] has been defined so that there is no high rise time in the system response. Normalizing the operation ranges for [-1, 1], we obtain the following normalization coefficients: = 1 50 ⁄ for ( ), = 1 10 ⁄ for ∆ ( ) and = 10 for ∆ ( ).However, these coefficients are used only for the appliance of the refinement rules based on [12]. The changes in the variables operating ranges are performed based on these coefficients, but without the normalization in the FLC variables. The control system developed in MATLAB for the submarine is illustrated in Fig.2, where ( )is the setpoint defined by the operator, ( ) is the speed of the submarine and ( ) is the disturbance applied to the system. With the control system developed in MATLAB software, it is simulated and its performance is refined until an acceptable solution is found, but it probably is not the best one. In addition, the initial condition considered is initial velocity and acceleration equal to zero or v(0) = 0and T(0) = 0, respectively. The parameters used to evaluate the FLC controller are the same as those used in the classical PID control. In this project, the FLC refinement method in relation to the speed response is applied by analyzing the following parameters: rise time ( ), settling time ( ), overshoot ( ), maximum peak over setpoint ( ), Integral of Time multiplied by Absolute of the Error (ITAE) and Integral Absolute Error (IAE). For the settling time, a tolerance band was defined around ± 2% of the setpoint. In addition, the calculation of is performed by subtracting the largest value from the response (maximum peak) in relation to the setpoint. Therefore, this value represents the excess speed corresponding to the overshoot percentage. For the first simulation scenario (C1), the membership functions for each input and output variables were equally distributed within the operating range, according to the linguistic variables defined in Table 1. Fig. 3, 4 and 5, present the membership functions for ( ), ∆ ( ) and ∆ ( ), respectively. Then, simulating the system for this scenario, we obtained the answers presented in the charts of Fig. 6a.   Based on the charts shown in Fig. 6a, it can be verified that the speed response of the system presents great overshoot and high settling time, according to the calculated parameters in the second column of Table 3. Then, as a way of improving it, some basic rules of refinement developed by Procyk   Based on the refinement rules, we can perform the increase of , as in scenario 2. In this way, the value of is changed from 10 to 20, resulting in a universe of discourse of [-20, 20] for ∆ ( ). Simulating the response of the system again (Scenario C2), we obtained the responses of the submarine behavior shown in Fig. 6b, where the values of the refinement parameters are in the third column of Table 3. Based on these values, there are smaller values for overshoot, settling time, ITAE and IAE, which indicates that the refinement action was effective in improving the system response. In order to improve this response again, however, without changing the obtained characteristics and increasing its stability, it is necessary to change the membership functions of the error variable ( ) as shown in Fig.7a.  Fig. 7: Scenario 3: (a)

membership functions of the error variable e(k); (b) System responses.
After the changes in the error variable, the system was simulated again (Scenario 3), in which the answers obtained are in Fig. 7b and the results for the evaluation parameters are in the second column of Table 4. In comparison with the responses of the scenario 2, there was a lower overshoot, shorter settling time, lower ITAE and IAE, but the rise time was higher. So, as a refinement action to improve the simulation response in Scenario 4, the peaks of the membership functions ∆ ( ) are displaced, as shown in Fig. 8a. The results of the simulation are presented in Fig. 8b and the evaluation parameters are in Table 4 (third column).  /dx.doi.org/10.22161/ijaers.4.12.15  ISSN: 2349-6495(P) | 2456-1908 In comparison with Scenario 3, the system response in relation to speed presented a small improvement in all the calculated parameters, with a reduction of 2.85% in overshoot. As a refinement action to improve the response to Scenario 5 and eliminate overshoot, it is necessary to increase the value of from 1/10 to 1/5, in other words, reduce the interval from∆ ( )to [-5, 5], as shown in Fig.  9a. The simulation result is shown in Fig. 9b and the calculated parameters are in the second column of Table  5. According to the parameters obtained and Fig. 9b, the response for velocity has a high rise time and presents an overdamped characteristic. An interesting factor is that ∆ ( ) influences the acceleration in this project. The change of the error ∆ ( ) with sample time of 0.1 s produces a triangle where the opposite leg is ∆ ( ) and the adjacent leg is the sample time. The tangent of this angle is the speed change rate that results in the acceleration ( ). Thus, it is possible to avoid overshoot by decreasing the discourse universe of ∆ ( ), which limits the acceleration rise. However, with this limitation the system presents a slow response. Therefore, to increase the system speed response, the peaks of the membership functions of the ∆ ( ) variable must be displaced, as shown in Fig. 10a. After performing this change, the system is simulated in Scenario 6. The evaluation parameters for the scenario 6 are in the third column of Table 5.Therefore, there was a significant improvement in settling time, and the characteristics desired by the designer were reached. A smaller rise time would result in a higher power value, which is not acceptable for the motors in our hypothetical scenario. Finally, the system is simulated with a disturbance ( ) which may be a sea current, or something that collides against the submarine's hull. For this, a random disturbance with a maximum amplitude of ± 1 m/s 2 was inserted and the result is shown in Fig. 11. In general, the system tends to correct the disturbances and to maintain the submarine speed in 50 m/s.  Table 6 are all the simulation scenarios performed, as well as the parameters obtained and the indication of the refinement action applied for the subsequent scenario. Fig. 12 shows the evolution of the speed response for each scenario. Finally, Fig. 13 shows the Fuzzy surface obtained through the controller rules base, where the x and y axes represent the operating range of the input variables ( )and ∆ ( ). In the z-axis, the operating range for ∆ ( )is displayed.

IV. CONCLUSION
The FLC development using the model rules base suggested by MacVicar-Whelan proved to be effective for the control of the system, besides being a practical approach, since it is not necessary to create the rule base. The refinement techniques proposed by Procyk and Mandani were also effective in refining the submarine velocity response due to ease of understanding and application, making the implementation of the FLC similar to the application of a classical PID system. The FLC satisfactorily controlled the non-linear model of the submarine and proved to be robust in the presence of noise. The main difficulties and limitations in the development of a FLC methodology are related to the kind of the analyzed system. Although the use of a model rule base facilitates the process, each system presents different characteristics related to its behavior. Therefore, it is not possible to develop a generalist method that will work with all types of systems. But in this work, with the submarine example, a notion is presented in how the changes in the membership functions and operating ranges of the controller variables can influence the system responses, according to the refinement rules. In this way, the development of this work can be used as a guide in the construction of FLCs for other types of applications. As future work, it is intended to apply this methodology to build a PI-like Fuzzy controller to control a DC motor in simulation and in the real system, in addition to comparing the control with a classical control technique, such as the Proportional Integral (PI) control.