FPGA BASED P/PI/PD/PID-LIKE INTERVAL TYPE -2 FLC DESIGN FOR CONTROL SYSTEMS

Type-2iFuzzyilogicicontrol contains footprint of uncertainty (FOUi) that is able to handle the numerical uncertainties, nonlinearities, and linguistic associated with the inputs and outputs. This paper presents the structure of P/PI/PD/PID-like Interval Type-2 Fuzzy Logic Controller (IT2-FLC) that is designed and simulated using MATLAB SIMULINK. This controller is designed by combining the advantages of fuzzy inference and different structures of controller. The type of the controller is selected using two bits control inputs. The inputs to the controller are: input-output gains, set-point, and the actual output. Karnick-Mendel (KM) algorithm is used to implement the IT2-FLC. IT2FLC has two triangular shaped membership functions. The range of the universe of discourse ( −1.5 𝑡𝑜 1.5 ) is selected for each input and output. The defuzzification technique is selected as Centroid method. The sampling time is (0.01), and the choice of rules is by using trial and error. The programs are written in MATLAB SIMULINK and converted into VHDL and Verilog languages. The program generated must achieve small FPGA size and as a result less execution time must achieve vs. acceptable accuracy. Linear and nonlinear models were used to test the Controller. Trial and error method was used to tune the gain factors to obtain the best response with minimum overshoot, minimum settling time, minimum Root Mean Squared Error (RMSE), and minimum structure


INTRODUCTION
Interval Type-2 fuzzy logic controller has a significant interest because it is deal with the uncertainties and non-linear ties in three dimensions, it has the ability for handling the problem of uncertainty parameters (Biglarbegian et al., 2010). Hassan and Sharif, (2007), presented the PID-like fuzzy logic controller (PIDFLC). On FPGA chip. This design is aimed to combine the type-1 fuzzy logic algorithm with the aid of conventional PID control. Maldonado et al., (2011) have used Genetic algorithm in order to reach the optimization in the design of membership functions (triangular and trapezoidal) of a fuzzy logic that was implemented in FPGA chip. Mani and Barjeev, (2011) used Fuzzy Logic Controller (FLC) and have developed as one of the most promising areas for Industrial Applications. The simulation results of the Fuzzy Logic Controller that is implemented on FPGA chip have been compared with the simulation results of the PID Controller and Fuzzy Logic Controller using MATLAB SIMULINK. Maldonado et al., (2013) have used Particle Swarm Optimization (PSO) method and they have applied for react to optimum design of IT-2 FLC and they have used VHDL code for a Xilinx Spartan FPGA. The results were compared with the IT2 FLC designed using genetic algorithms as well. Maldonado et al., (2014) have presented the IT2 FLC to control and regulate the speed of a DC motor. They were used an FPGA chip which provides implementation in real time. Mehmet. et al., (2014) presented a Boundary Function (BF) based type reduction and defuzzification method for IntervaliType-2 Fuzzy logic with PID controller (IT-2 PID). Jun. et al., (2015) presented a new controller to control the feed water under the automatic power regulating system for an advanced boiling water reactor. This controller was designed and implemented on FPGA device.
In this work, the design of P/PI/PD/PID-like Interval Type-2 Fuzzy Logic Controller (IT2-FLC) is explained. The general layout of the controller chip is shown in Fig. 1. The type of the controller is selected using two bits control inputs. This P/PI/PD/PID-like IT2FLC design in this paper is combining the advantages of type-2 fuzzy algorithm and different structures of controller. For controlling efficiently to the real systems and to achieved small FPGA size and as a result less execution time must be achieved vs. acceptable accuracy. Simulations of the linear and nonlinear models are explained.
Kufa Journal of Engineering, Vol. 9, No. 3, July 2018 167 Fig. 1. Layout of the proposed controller in a unity feedback control system.

INTERVAL TYPE-2 FLC
Type-2iFuzzyisetsimembership function are fuzzy and contain the footprint of uncertainty FOU as shown in Fig. 2.that is handle and model the uncertainties. nonlinearities and linguistic related with the inputs and output of the fuzzy logic control by modeling them and reducing their effect. FOU is the area between lower membership and upper membership. Allowing each input to have two membership grade values related with it; an upper ( UMF(xi)) and lower (LMF(xi)) There are two types of T2FLC: Mamdani type and the Takagi Sugeno Kang (TSK) type. The difference between the two types. The Sugeno output membership function is linear or constant and the Mamdani output is shape the membership. Furthermore the Mamdani type needs type reducer method while the Takagi Sugeno type doesn't need type reduction operation. The structure of the Interval Type-2 Fuzzy Logic Control (IT-2FLC) is shown in Fig. 3; (Mendel et al., 2006;and Karnik et al., 1999).

COMPUTATIONS OF IT2-FLC
An interval type two fuzzy logic control containing at least one interval fuzzy set. Without loss of generality. consider if an IT2 FLC consisting of N rules. The rule base has the following form: is an interval that can be understood as the centroid of a consequent IT2 fuzzy set. or the simplest Takagi-Sugeno-Kang (TSK) model. Each rule consequent is represented by a crisp number in many applications (Wu and Tan, 2006).
For an input vector ′ = ( ′ 1 . ′ 2 . …... ′ ) . typicalicomputations inian interval type two fuzzy logic control include the following steps (Wu and Tan, 2006): 2) Calculate the firing interval of the ℎ irule. : 3) The third step is that Perform type-reduction. The most commonly used one is the center of sets type reducer: In equation (2) and equation (3) is a potential switchipoint. In an complete search method all in [1 . − 1] need to be calculated until the correct switchipoint is recognized. Fortunately. and . as shown in Fig. 2 can also be calculated more efficientlyiby the KM algorithmiintroduced in the next subsection.
respectively. Furthermore.i in (2) and in (3) can be re expressed as (Wu and Tan, 2006): where L and R are switch points satisfying y L ≤ y l < y L+1 9 The KM Algorithm for Computing and are specified in Table 1. The main idea is to find the switch points for and . increases along the horizontal axis from the left to the right.
for computing switch from the upper firing level to the lower firing level. and switch from the lower firing level to the upper firing level for Computing as shown   If ′ = , stop and set = and R= ; Otherwise. set = ′ and go to step 2.

STRUCTURE OF THE PROPOSED CONTROLLER
It is a PID-like IT2FLC. This controller is designed in discrete form with minimum structure form of the conventional PID controller. In order to designiaiPID-likeiIT2FLC. it is required to design a fuzzy inference system with three inputs that represent the proportional, derivative, and integral components. A fuzzy controller with three inputs may not be preferred because it is very difficult to design and needs too much work. For example. If eight fuzzy sets are used for each input. Then a (8*8*8=512) rules will be required for the controller. Instead, PID-Kufa Journal of Engineering, Vol. 9, No. 3, July 2018 171 likeiIT2FLC can be designed as a parallel structure of a PD-like IT2FLC and a PI-like IT2FLC and the output of the PID-like IT2FLC is formed by algebraically adding the outputs of the two fuzzy control blocks. However, a PD-like IT2FLC may be employed to serve as PI-like IT2FLC in incremental form. Equation (11) shows a PD-like IT2FLC obtained in position form, while (12) shows a PI-like IT2FLC in incremental form (Biglarbegian et al., 2010;and Hassan and Sharif, 2007): This method will reduce the number of rules required to 8*8+8*8=128 rules only, as shown in output. Since each PD-like IT2FLC has its own gains and rules. The final design could act as a P -like IT2FLC a PD-like IT2FLC, a PI -like IT2FLC, and a PID -like IT2FLC depending on the two input selection lines c1 and c2. As shown in Table 2 (Wu and Tan, 2006).

Membership functions
The parameters of the P/PI/PD/PID-like IT2FLC use two triangular shaped membership functions as shown in Fig. 6. The universe of discourse (−1. 1) are selected for each inputs and output. The defuzzification technique is selected to be Centroid method.

Rule base
The rule base and rule consequent for computing the output is listed in Table 3. The choice of rules is by using trial and error.
First rule : 1 when is 11 and ̇ is 21 .
Second rule: 2 when is 11 and ̇ is 22 Third rule : 3 when is 12 and ̇ is 21 Fourth rule: 4 when is 12 and ̇ is 22

Scaling factors
In this paper the P/PI/PD/PID -like IT2FLC scaling factors are tuned manually and a set of gains are obtained. The SIMULINK Top level view of the P/PI/PD/PID-like IT2FL structure simulated in MATLAB SIMULINK environment, as shown in Fig. 7.

SIMULATIONS RESULTS OF THE PROPOSED CONTROLLER
The SIMULINK structure of P/PI/PD/PID-like IT2FLC is shown in Fig. 8. the type of the controller is selected using two bits control input (c1 and c2). In order to reach minimum overshoot, minimum undershoot, minimum settling time, minimum steady state error and minimum structure design trial and error method was used to tune the gain factors to obtain the best response. The programs are written in MATLAB and converted to VHDL and Verilog formats. This proposed controller requires FPGA size with (67) multipliers. (894) adders / subtractors.
(2) registers. and (678) multiplexers, as shown in Fig. 9. In order to examine this proposed controller. Linear and nonlinear models are used.

Linear Model
The choice of linear model is selected as an example and represented by the following discrete equation: The step response of this model using P/PI/PD-like IT2FLC is shown in Fig. 10. The step response of this model using PID-like IT2FLC is shown in Fig. 11. The PID-like IT2FLC has the best response with the performance index root mean squared error (MSE) is equal to 0.5093.
Kufa Journal of Engineering, Vol. 9, No. 3, July 2018 175 The rise time is equal to 0.85. The overshoot is equal to zero and the settling time is equal to 0.9.

Nonlinear servo motor model
The DC motor is a particular sort of motors, which is classified as one of the principal machines to generate mechanical power from electrical power. mathematical modeling of servo actuator system is represented by a second order dynamic system with friction (Xie, 2007).
Where the moment of inertia is represented by ; the acceleration is represented by . The control input torque is represented by . is the friction torque and is the load torque.The frictionitorque is represented by static friction phenomena, which include: coulomb friction.
Stiction friction. and the viscous friction. i.e. (Xie, 2007). Where: the coulomb friction is represented by . the stiction friction isirepresented byi . the stribeck velocity is represented by ̇. and is the viscous friction coefficient.
The step response of this model using PID-like IT2FLC is shown in Fig. 12. a) The simulation without applying disturbance to the system with the performance index Root Mean. Squared error (RMS) is equal to 0.5352. The rise time is equal to 1.5 and the overshoot is equal zero.
b) The simulation with applying uncertainty parameters to the system equal to 0.2 with the performance index RMS is equal to 0.5502. The rise time is equal to 2 and the overshoot is equal to zero.

CONCLUSION
In this paper The P/PI/PD/PID-like IT2FLC with six gain factors on FPGA chip have been designed. This proposed controller was designed to control linear and nonlinear models that including the nonlinearity and uncertainty parameters and to reduce FPGA size and as a result less execution time must achieve vs. acceptable accuracy. The type of the controller is selected using two bits control input. The simulation results show that the step response of nonlinear model controlled by the proposed controller after changing the uncertainty parameters with 20% was close to response of the same model before this changing.