{'fraction_non_alphanumeric': 0.03648907627443465, 'fraction_numerical': 0.018167880413951707, 'mean_word_length': 4.587152034261242, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Genetic Design of an Interval Type-2 Fuzzy Controller for Velocity Regulation in a DC Motor

This paper proposes the design of a Type-2 Fuzzy Logic Controller (T2-FLC) using Genetic Algorithms (GAs). The T2-FLC was tested with different levels of uncertainty to regulate velocity in a Direct Current (DC) motor. The T2-FLC was synthesized in Very High Description Language (VHDL) code for a Field-programmable Gate Array (FPGA), using the Xilinx System Generator (XSG) of Xilinx ISE and Matlab-Simulink. Comparisons were made between the Type-1 Fuzzy Logic Controller and the T2-FLC in VHDL code and a Proportional Integral Differential (PID) Controller so as to regulate the velocity of a DC motor and evaluate the difference in performance of the three types of controllers, using the t-student test statistic.


Introduction
The use of classical control techniques such as PID control in some cases provides a good alternative for controlling certain systems. However, the higher the accuracy required in the system control, the more difficult the adjustment becomes as they are quite sensitive to noise signals and sometimes introduce variations when there are delays in the system. This kind of subjectivity has implications for modelling these systems through fuzzy logic.
There is great interest in the research and development of fuzzy systems -especially those based on type-2 fuzzy logic -due to their advantages in the management of uncertainty, which is why there are high expectations regarding their use in control systems as a possible way to compensate for errors due to instrumentation systems, among others. However, these systems require large computing resources which can be a difficultly for personal computers and so the investigation of different alternatives for their implementation is a topic of current research, such as fuzzy control implemented in programmable logic devices.
There are some works related to the optimization of fuzzy inference systems for a particular problem. In [2], a review of the methods used in the design of interval type-2 fuzzy controllers is presented. The fundamental focus of the work is based on the basic reasons for optimizing type-2 fuzzy controllers for different areas of application. They consider the application of genetic algorithms, particle swarm optimization and ant colony optimization as three different paradigms that help in the design of optimal type-2 fuzzy controllers. In [3], they present a hybrid architecture which combines type-1 or type-2 fuzzy logic systems and genetic algorithms for the optimization of the membership function's parameters in order to solve the output regulation problem of a servomechanism with nonlinear backlash. The simulation results show the effectiveness of the optimized closedloop system. This paper is organized as follows: in Section 2, a general description of type-1 and type-2 fuzzy inference systems, FPGA and GAs is provided. The designs of T1-FLC, T2-FLC and PID controllers for regulating the velocity of a DC motor are given in Section 3. The testing and results of the comparisons of T1-FLC and T2-FLC compared with PID for regulating the velocity of a DC motor are provided in Section 4. Finally, Section 5 presents the conclusions drawn in this work.

Preliminaries
Fuzzy logic controllers tolerate imprecise information and can be used to model nonlinear functions of arbitrary complexity. They have been used successfully in many application areas, such as [14], [20]. A fuzzy inference system (T1-FIS) consists of three stages: fuzzification, inference and defuzzification [7], [23]. In Figure 1, the fuzzy system information processing is shown. The T1-FIS uses exact membership functions while type-2 fuzzy systems are described by membership functions with uncertainty. The Type-2 fuzzy logic systems are used increasingly due to their ability in relation to uncertain information [1]. Uncertainty is an attribute of information, which may be incomplete, inaccurate, vague, weak or contradictory, etc. [22].
Type-2 fuzzy systems consist of four stages: fuzzification, inference, type Reduction and defuzzification. We describe these stages below. The fuzzification maps a numeric value x=(x1, …, xp) T  X1× X2 ×… × Xp=X onto a type-2 fuzzy set Ax in X. Ax is a singleton fuzzy set if μAx =1/1 for x=x' and μAx=1/0 for all others x ≠ x' [10]. The inference stage consists of two blocks -the rules and the inference engine. It works in the same way as for type-1 fuzzy systems except that the antecedent fuzzy sets and the consequent are represented by type-2 fuzzy sets. The process consists of combining the rules and mapping the input to the output (type-2 fuzzy sets), using the Join and Meet operations. A type reductor is used to convert all of the type-2 fuzzy sets to type-1 fuzzy intervals on the output. There are several methods for calculating the reduced set, such as joint centre, centre of sums and height, among others [10]. The defuzzification stage consists of obtaining a numeric value for the output. Using the centre of sets type reductor, the defuzzification is an average value since the range is given by [yl,yr] [10].
In Figure 2, the type-2 fuzzy system's information processing is shown. A type-2 fuzzy system can be implemented on a general purpose computer or else by the specific use of a microelectronics realization, such as a FPGA.
A FPGA is a semiconductor device that contains such interior components as gates, multiplexers, etc. These are interconnected with each other according to a given design. These devices use the VHDL programming language, which is an acronym that represents the combination of VHSIC (Very High Speed Integrated Circuit) and HDL (Hardware Description Language).
FPGAs can be used to implement specific architectures in order to accelerate a particular algorithm. Applications that require a great number of simple operations are suitable for implementation on a FPGA. A processing element can be designed to perform this operation and several instances of it can be used to perform parallel processing [18], [21].
These systems are based on rules incorporating linguistic variables, linguistic terms and fuzzy rules. The acquisition of these rules is not an easy task for the expert and it is of vital importance in the operation of the controller. There are methods to optimize these elements, such as genetic algorithms (GAs) [4].
A GA is a st the natural principle pro successfully as control an The notion natural selec likely to be Here, the G evolution. T optimal solu final winner cycle.   [13]. The inference works with the max-min composition [19] and the defuzzification with the heights method. Figure 6 shows the block diagram of the average T2-FIS for regulating the velocity of a DC motor. The system's inputs are the error (x1) and change of error (x2). The system has only one output (y). The T2-FIS has two inputs and one output. Each input and each output contains three membership functions, two trapezoidal and one triangular. Figure 7 shows the type-2 triangular and trapezoidal membership functions (T2-MFs) that are used. For the optimization of the T2-FLC using GAs, one must define the chromosome that represents the information of the individual, which in this case is related to the universe of discourse and the linguistic terms. Figure 8 shows the chromosome used for the GA.   For example, the a2U parameter should be within the range of 0-128. If we consider that is 100, then the a2L parameter must be greater than 100 and less than 128; these conditions are necessary to achieve the upper and lower of the T2-MF.
The GA design only moves twenty-four of the sixty-six parameters to optimize, of which eight are parameters for each input and output (a2U, a2L, b0U, b0L, b2U, b2L, a1U and a1L) while the remaining forty-two parameters are fixed and, therefore, not considered for the chromosome's design. Figure 9 shows the input of the T2-FIS with fixed and variable parameters. Each input and output has a size of 8 bits. The GA is a multi-objective GA [8] for the T1-FLC and T2-FLC, which means that in order to determine the best individual three evaluations are performed: where y(t) is the output of the system and r is reference.
The T1-FLC and T2-FLC linguistic terms were optimized with the GA but the fuzzy rules are not changed. The process of the GA is described as follows: generate the initial population, fitness evaluation (o1, o2, sse), selection, crossover, mutation, reinsert and, finally, simulation using the XSG platform in Matlab-Simulink.
For the PID controller's design, we used the Ziegler-Nichols tuning method [24]. This method has the following steps: 1. Using only proportional control starting with a small gain value, increase the gain until the loop begins to oscillate. 2. Record the controller critical gain Kp=Kc and oscillation period of the controller output Pc. 3. Adjust the controller parameters according to Table 3.

Tests and results for the comparisons with T2-FLC and T1-FLC in FPGA and PID controllers
The T1-FLC, T2-FLC and PID controllers were analysed; each was given a level of uncertainty and a comparison was made among them. The results were evaluated using t-student statistics.
To test the T2-FLC and T1-FLC, the speed control was simulated using a mathematical model of the plant in Matlab-Simulink. Figure 10 shows the T1-FLC and T2-FLC for regulating the velocity of a DC motor, the fuzzy incremental control model is used [6]. The T1-FLC and T2-FLC have the inputs, error (e(t)) and change of error (eʹ(t)), and the output is the control signal (y(t)), the control objective AT2-FLC is: where t is the sampling time.
The inputs are calculated as follows: The reference signal r(t), is given by: The uncertainty block represents an external perturbation, the goal is to disrupt the AT2-FLC and then the AT2-FLC retrieves its desired path. The uncertainty is represented by: The PID controller model is shown in Figure 11, the uncertainty block is used to test the PID controllers with different levels of noise. The input is calculated as (5), where the reference signal is (7).
In We analyse statistically the performance of the three controllers using the t-student test. Table 5 shows the statistical results of the three controllers.

Controller comparison t-student
T1-FLC Vs T2-FLC 8.22 T2-FLC Vs PID 6.93 Table 5. T1-FLC, T2-FLC versus PID results for regulate the velocity of a dc motor As shown in Table 5, the T2-FLC has better performance compared with the T1-FLC and PID, with a degree of confidence of more than 95 percent. Figure 12 shows the velocities obtained with the three controllers with no level of uncertainty (x=0). Figure 13 shows the velocities obtained with the three controllers with a particular level of uncertainty (x=1).
As shown in Figure 13, it is very difficult to determine which controller has better performance, for that reason we decided to test t-student statistics, as shown in Table  5, which illustrate that the T2-FLC is better compared to T1-FLC and PID controllers.

Conclusions
We propose a tuning PID controller and the genetic optimization of T1-FLC and T2-FLC for regulating the velocity of a DC motor, where three triangular and trapezoidal membership functions for the two inputs and one output are used in the optimization. We propose the GA optimization for the T1-FLC and T2-FLC, the goal being to achieve an optimized T1-FLC and T2-FLC with a small runtime, and for this reason the fuzzy rules are not changed and we propose an optimization for T1-MFs and T2-MFs, where only some of these parameters are modified. The objective function of GA considers three characteristics: overshoot, undershoot and steady state error, so that makes it a multi-objective GA.
The T1-FLC and T2-FLC are codified in VHDL code for FPGA implementation. For the T1-FLC and T2-FLC implementation, the fuzzification, inference and defuzzification stages are performed in parallel.
Each T1-FIS is simulated in a T1-FLC for regulating the velocity of the DC motor. The best T1-FLC was obtained in 70 generations with 85% crossover (crossover single point) and 10% mutation, with an error of convergence of 7.34x10 -4 , in a runtime of 19.35 minutes with a 15 rpm of velocity.
The best T2-FLC was obtained in 30 generations with 85% crossover (crossover single point) and 10% mutation, with an error of convergence of 9.55x10 -4 , in a runtime of 30.0088 minutes with a 15rpm of velocity.
The PID controller tuning was obtained with Ziegler-Nichols method, and the values of the constants obtained are kp=0.5, ki=0.2 and kd=0.025.
Comparisons were made between the T1-FLC versus T2-FLC in VHDL code and T2-FLC versus PID controller, to regulate the velocity of a DC motor, to evaluate the difference in performance of three types of controllers, using the t-student statistical test, giving better results for the T2-FLC when there is uncertainty present.
Matlab-Simulink and XSG were used to perform the simulations in all cases.