An Efﬁcient Chicken Search Optimization Algorithm for the Optimal Design of Fuzzy Controllers

: A proposed architecture to design the optimal parameters of Membership Functions (MFs) of Type-1 Fuzzy Logic Systems (T1FLSs) using the Chicken Search Optimization (CSO) is applied to three Fuzzy Logic Controllers (FLCs) in this paper. Two types of MFs are considered in the study: triangular and trapezoidal ones. The performance and efﬁciency of the CSO algorithm are particularly good when perturbations are added during the execution in each control problem. Two benchmark control problems: Water Tank Controller and Inverted Pendulum Controller are considered for testing the proposed approach. Also, the optimal design of a fuzzy controller for trajectory tracking of an Autonomous Mobile Robot (AMR) is considered to test the CSO. The main goal is to highlight the efﬁciency of CSO algorithm in ﬁnding optimal fuzzy controllers of non-linear plants. Two types of perturbations are considered in each control problem. Results show that the CSO algorithm presents excellent results in the ﬁeld of Fuzzy Logic Controllers. Two types of Fuzzy Inference Systems: Takagi-Sugeno and Mamdani FLSs, are implemented in this paper. The most important metrics usually applied in control are used in this paper, such as: Integral Time Absolute Error (ITAE), Integral Time Squared Error (ITSE), Integral Absolute Error (IAE), Integral Square Error (ISE), Mean Square Error (MSE), and Root Mean Square Error (RMSE).


Introduction
In recent decades the Chicken Search Optimization (CSO) algorithm has shown good results and the efficiency of this bio-inspired algorithm has been verified in different problems. For example, in [1], Al Shayokh et al. presented a bio inspired distributed Wireless Sensor Network (WSN) localization based on chicken swarm optimization; in [2], Banerjee et al. presented an improved serially concatenated convolution turbo code (SCCTC) using chicken swarm optimization; in [3], Chen et al. presented a penalty function with a modified chicken swarm optimization for constrained optimization; in [4], Deb  Optimization. In addition, in [8], Kurozawa et al. showed an optimization of the enzymatic hydrolysis of chicken meat using response surface methodology; in [9], Lin et al. presented a robust recurrent wavelet neural network controller with improved particle swarm optimization for linear synchronous motor drive; in [10], Qu et al. presented a Chicken Swarm Optimization based on elite opposition-based learning; in [11], Wang et al. showed an improved Chicken Swarm Algorithm based on chaos theory and its application in wind power interval prediction; and in [12], Wu et al. presented an improved Chicken Swarm Optimization. Further, in [13], Wu et al. presented a convergence analysis and improvement of the Chicken Swarm Optimization Algorithm; and in [14], Wu et al. showed an application of improved Chicken Swarm Optimization for Maximum Power Point Tracking (MTTP) in photovoltaic system. Finally, in [15] Yaseen et al. presented a Hybrid Invasive Weed Optimization Algorithm with Chicken Swarm Optimization Algorithm to solve Global Optimization Problems; in [16], Zarlis et al. presented a framework of training Adaptive Neuro-Fuzzy Inference System (ANFIS) using Chicken Swarm Optimization for solving classification problems, and in [17] Liang et al. presented a fast Synthetic Aperture Radar (SAR) image segmentation method based on an improved Chicken Swarm Optimization Algorithm. All these previous works allow us to observe that the CSO algorithm shows efficiency in various fields of study.
Other important contributions in which CSO algorithm has had an important presence is on the medical area. Some works include [18], where a comparative study of bio-inspired algorithms applied in the optimization of fuzzy systems is presented by Miramontes et al.,and [19], where a prediction of cervical cancer using Chicken Swarm Optimization is presented by Tripathi et al. Control is a study area of much interest for several authors; for example, in [20] the authors focused on a constrained population extremal optimization-based robust load frequency control of multi-area interconnected power system; ref [21] based their study in design of fractional order Proportional Integral Derivative (PID) controller for automatic regulator voltage system based on multi-objective extremal optimization; ref [22] presents an understanding edge computing focused on engineering evolution with artificial intelligence; ref [23] studied an improvement of Maximum Power Point Tracking (MPPT) control performance using fuzzy control and Variable Gain Proportional Integral (VGPI) in the Photovoltaic (PV) system for micro grid; ref [24] presents an optimization of fuzzy trajectory tracking in autonomous mobile robots based on bio-inspired algorithms; and in [25] they analyzed an optimization design and test bed of fuzzy control rule base for a PV system MPPT in a micro grid.
In the field of control, the CSO algorithm has also proven to be a good algorithm. For example, in [26], Li et al. showed a chicken swarm-based method for ascent trajectory optimization of hypersonic vehicles; in [27], Amador-Angulo et al. presented an optimal design of fuzzy logic systems through a Chicken Search Optimization Algorithm applied to a benchmark problem; in [28], Liang et al. presented an improved Chicken Swarm Optimization Algorithm and its application in robot path planning; in [29], Mu et al. presented an optimal trajectory planning for robotic manipulators using chicken swarm optimization; and in [30], Wu et al. presented an improved Chicken Swarm Optimization method for reentry trajectory optimization.
Bio-inspired algorithms are based on the natural behavior of species that have allowed them to be used in solving complex problems. A wide variety of algorithms have been developed in the field of control. Some related works are mentioned as follows: two applications of Bee Colony Optimization (BCO) are presented in [31,32], a Salp Swarm Algorithm (SWA) is studied in [33], a Bio-inspired Chaotic Fruit Fly Algorithm (FFA) is presented in [34], a Particle Swarm Optimization (PSO) is presented in [35], a Flower Pollination Algorithm (FPA) is presented in [36], a Cuckoo Search Algorithm (CSA) is presented in [37], a Grey Wolf Algorithm (GWA) is presented in [38], a Bat Algorithm (BA) is presented in [39], a Black Hole Algorithm (BHA) is presented in [40], a Firefly Algorithm (FA) is presented in [41], some bio-inspired algorithms are analyzed and presented in [42], a Cat Swarm Optimization (CSO) Algorithm is presented in [43], and an Ant Colony Optimization (ACO) algorithm is presented in [44]. For this reason, in this paper some benchmark control problems are studied and analyzed with Chicken Search Optimization Algorithm (CSO) for solving problems and demonstrated the efficiency in this algorithm in control problems. The benchmark problems have proven to be a good technique for testing the performance of a bio-inspired algorithm; for example, in [45], a design of a sliding mode controller for a water tank liquid level control system is presented; in [46], a controller design for rotary inverted pendulum system using evolutionary algorithms is presented; in [47], a fuzzy controller for a benchmark problem related to computing with words approach is presented. Also, controlling the stabilization and trajectory in a robot is another interesting field in control problems; for example, in [24,31,48,49] an autonomous system to control a mobile robot is presented; in [50], a fuzzy controller in AC servo motor drive is presented; and in [51], a bio-inspired decentralized autonomous robot mobile navigation control for multi agent systems is presented. In the existing literature it is shown that the CSO method is applied as the solution of different types of problems at present time, because it is a precise and solid method for optimization problems. For this reason, the main contribution is to make use of this algorithm in the optimization of control problems.
The main motivation in this paper is to demonstrate the efficiency and performance of the Chicken Search Optimization Algorithms in control problems. Specifically, two benchmark problems are implemented, which are the water tank controller, and the inverted pendulum. Also, an autonomous mobile robot for stabilization of trajectory is implemented. Another important contribution is the statistical comparison with other meta-heuristics algorithms. Many works of the CSO algorithm have been presented in control problems, but in this paper, the more important contribution is to find the optimal design of the Membership Functions (MFs) of a Type-1 Fuzzy Logic System (T1FLS) applied to control problems. Also, all the problems were executed with perturbations in the model with the goal of analyzing the behavior that CSO algorithm when levels of noise are added in the model.
The organization of this paper is as follows. Section 2 describes the chicken search optimization algorithm. Section 3 describes each of the three control problems, the structure, equations and characteristics. Section 4 describes the proposed structure of the Type-1 Fuzzy Logic System (T1FLS) for each control problem. In Section 5 the simulation results are presented and analyzed. In Section 6 a comparative and discussion of results are presented. Finally, Section 7 presents some relevant conclusions and future works in this paper.

Chicken Search Optimization Algorithm
The interesting bio-inspired algorithm that this paper considers to analyze and explore is called the Chicken Swarm Optimization (CSO) based on the behaviors of cocks, hens and chicks in finding food. The main idea in this algorithm was created by Meng, Liu, Gao and Zhang in 2014 [52]. BCO algorithm uses the chicken swarm in the searching space which is mapped a specific particle individual. Also, three types of chicken are used in the swarms: Cock swarm, chick swarm and hen swarm for the whole chicken swarm. Each role has a different weight in the CSO algorithm; for example, in the methodology of this algorithm, cock swarms present a highest fitness and the chick swarms present lowest fitness. The role (hen, chick and cock) is assigned during the execution of the algorithm depends of its fitness value. In the implementation of CSO algorithm in each control problem, a chicken represents a possible solution for the control problem [52]. The CSO algorithm has as objective error minimization in each control problem. The proposed idea is represented by Figure 1.
In this algorithm each particle represented a possible solution in the problem. For example, in the case of the first control problem called water tank controller, the proposed fuzzy logic system (FLS) has triangular membership functions (MF) at the inputs and outputs. Two type of MFs are implemented in this paper. The first is a triangular MF that depends on three parameters, which are a, b and c as given by the Equation (1), where a and c represents the feet of the triangle and the b locates the peak, and the second is a trapezoidal MF that depends on four parameters which are a, b, c and d, as given by Equation (2). This triangular and trapezoidal MFs are represented graphically in Figure 2a,b, respectively.

Figures 3 and 4 show the points (parameters) that make up each input and output triangular membership function.
A Type-1 FLS was optimized with the CSO algorithm, and it is necessary to have a particle (cock, hen or chick) with a size to optimize the membership functions (MFs). In this case it is called a vector representing the possible best distribution in the MFs for the first study case called water tank controller, as shown in Figure 5. The vector has 33 positions to optimize, because this control problem has two inputs each with three triangular MFs, and one output with five triangular MFs.    Table 1 shows the total size of the vectors in each control problem and the type of membership function that CSO algorithm to find and optimize. The dynamism of CSO algorithm is represented in the following equations. For all the particles, the particle with best fitness is called with the role of cock particle swarm; this selection is represented by Equation (3): where t represents the generations, and x t+1 i,j and x t i,j indicate the position of jth dimension of a chicken in t + 1. The function randn 0, σ 2 is implemented as a random of Gaussian distribution in Equation (4) to find the variance: where i, k ∈ [1, rsize] and i = k. In each control problem, rsize indicates the number of cock swarms, and the size of the swarm is 30 values. Also, a cock particle represents the number of values for the design of the MF for the Fuzzy Logic System in this paper; for each control problem the values of the MFs are different (see Table 1). f it i and f it k are the fitness values of cock particle i and k, respectively; ε is an important value that represents a number which is used to avoid zero-division-error, is the smallest constant in the computer. Otherwise, for CSO algorithm, hen swarm was selected with good fitness. Its random search is found by Equation (5) that is performed via cocks of hen population and that of others.
where x t i,j and x t r2.j is used in the position of the cock individual r1 in the population of hen xi and cock individual r2 in the other population, respectively. rand is a function that represents a uniform random number with the range of [0, 1]. Equation (6) calculates the values of S1 and S2: where r1 ( f it r1 ) represents the fitness value of the cock individual in the population of hen xi, and r2 ( f it r2 ) represents the fitness value for the cock individual, respectively. In CSO algorithm all individuals, except for the cock and hen swarm, are defined as a chick swarm. Equation (7) shows this search mode follows that of the hen swarm: In the CSO algorithm, the chick would follow its mother to forage for food, therefore x t m,j , is the position of jth dimension of particle m in t + 1, t indicate the generation, then, this characteristic is represented by parameter FL. Hence, m represents the position of the ith chick's mother (m ∈ [1, N]), where N indicates the size of swarm (population). Algorithm 1 illustrates the pseudocode of the CSO algorithm. With the goal to illustrate each step in the CSO algorithm, with a total of 9 steps, Figure 6 shows the Flowchart of the mechanism in this algorithm.

Control Problems
For performance evaluation of the CSO algorithm a total of three control problems are implemented in this work. Two are benchmark problems and the other is to control the stabilization in an autonomous mobile robot (AMR). These control problems allow to analyze the behavior of proposed method to find the optimal design for the MFs through an efficient CSO algorithm. The general description of each control problem is presented in the following subsections.

Water Tank Controller
The first problem has the goal of filling the water tank, therefore, based on the actual water level in the tank the controller has to be able to provide the proper activation of the valve. Figure 7 illustrates the variables involved so that the valve opening operates, and Equation (8) shows the mathematical functions in this problem.
where Vol is the volume of water in the tank, A is the cross-sectional area of the tank, b is a constant related to the flow rate into the tank, and a is a constant related to the flow rate out of the tank. The equation describes the height of water H as a function of time, due to the difference between flow rates into and out of the tank.

Inverted Pendulum Controller
The second problem consists of controlling a pendulum given a force F that is applied horizontally (in x) to a cart. The pendulum moves horizontally towards a dynamic point at the base and the goal is to get to that point quickly and with greatest balance or stability that the vertical bar (pendulum) can present. Figure 8 graphically shows the idea for this problem.

Autonomous Mobile Robot Controller
The last control problem consists of a unicycle mobile robot [24], which has two driving wheels located on the same axis and a front free wheel, and Figure 9 shows a graphical description of the robot model.  The robot model assumes that the motion of the free wheel can be ignored in its dynamics, as shown by Equations (9) and (10).

M(q)
. v + C q, where q = (x, y, θ) T is the vector of the configuration coordinates, v = (v,) T is the vector of velocities, τ = (τ 1, τ 2 ) is the vector of torques applied to the wheels of the robot where τ 1, and τ 2 denote the torques of the right and left wheel, P ∈ R 2 is the uniformly bounded disturbance vector, M(q) ∈ R 2X2 is the positive-definite inertia matrix, C q, . q ϑ is the vector of centripetal and Coriolis forces, and D ∈ R 2X2 is a diagonal positive-definite damping matrix.
The kinematic system is represented by Equation (10).
where (x,y) is the position in the X − Y (world) reference frame, θ is the angle between the heading direction and the x-axis, v and ω are the linear and angular velocities. Furthermore, Equation (11) shows the non-holonomic constraint, which this system has, which corresponds to a no-slip wheel condition preventing the robot from moving sideways.
x sin θ = 0 (11) The system fails to meet Brockett's necessary condition for feedback stabilization, which implies that no continuous static state-feedback controller exists that can stabilize the closed-loop system around the equilibrium point.

Fuzzy Logic System
A fuzzy logic system (FLS) that is defined entirely in terms of Type-1 fuzzy sets, is known as Type-1 Fuzzy Logic System (Type-1 FLS), and its elements are defined in the following Figure 10   A type-1 fuzzy set in the universe x is characterized by a membership function µ A (x) taking values on the interval [0, 1] and can be represented as a set of ordered pairs of an element and the membership degree of an element to the set and are defined by Equation (12) [53,54]:

Fuzzy Logic Controller
The general idea of a Fuzzy Logic Controller (FLC) was created by Mamdani in 1976. An important work of FLC is in [55] describing an application of fuzzy algorithms for control of simple dynamic plant. Another variant for the inferences in FLS is Takagi-Sugeno (in this paper the inverted pendulum control problem is of type Takagi-Sugeno), and the works in [56,57] apply this approach in the inference form of Takagi-Sugeno and Mamdani for the Type-1 FLS. Figure 11 shows the general representation of the FLCs. An important aspect in the evaluation of the FLCs is the disturbance in the feedback phase. This block allows the bio-inspired algorithm, in this case CSO, to demonstrate its efficiency in the optimization of the control problem. Some works where the behavior of the problem with level of noise in the model is analyzed are [31,[58][59][60][61][62][63][64]. In this paper, two type of disturbances are considered in each model.

Proposed Structure of the Type-1 FLS
The proposed structures of the Type-1 FLS for each control problem are described in the following subsections.

Water Tank Controller
The first control problem has a proposed structure of two inputs called level and rate, each with three triangular MFs, and only one output called valve with five triangular MFs. A total of five rules are necessary to control the filling of the water tank. Figure 12 illustrates the Fuzzy Inference System (FIS) (a) and the inferences rules (b). Also, Figure 13 shows the FLC model that is implemented in the executions by CSO algorithm.  Two type of perturbations are added in the model, specifically to block the error: a pulse generator (a) and a band-limited (b) [58], for each control problem, with the goal to visualize the efficiency of CSO algorithm when disturbance is present.

Inverted Pendulum Controller
The second control problem has a proposed structure of four inputs called in1, in2, in3 and in4, each with two trapezoidal MFs. This FIS is of Takagi-Sugeno type. A total of 16 rules are necessary for stabilization of the pendulum. Figure 14 illustrates the Fuzzy Inference System (FIS) (a) and the inferences rules (b). Also, Figure 15 shows the FLC model for this second control problem.

Autonomous Mobile Robot Controller
The third control problem has the structure of two inputs called e v (error in the linear velocity), and e w (error in the angular velocity). Each input has three MFs of which in the extremes are trapezoidal MFs and in the middle a triangular MF, for each input. Regarding the outputs, it has two, called T1 (Torque 1) and T1 (Torque 2) with three triangular MFs, respectively. Figure 16 illustrates the Fuzzy Inference System (FIS) (a) and the inferences rules (b). Also, Figure 17 shows the FLC model for this third control problem.

Simulations Results
The analysis of results is presented in this section for each control problem. The setting of parameters for CSO algorithm is presented in Tables 2 and 3.  The main reason for the decision to decrease the values in Population (N) and Generations only for third control problem is because it is not a benchmark problem, also, with previous experiments, it was analyzed that a maximum number of generations is not necessary for good errors to be found by the CSO algorithm. To The fitness function of CSO algorithm is the MSE (see Equation (18)), and this means that the best individual in each execution is the particle that has the lowest value of MSE of the entire population. Each FLC shown in Figures 13, 15 and 17 has two references. The first one indicates the desired reference trajectory, which is Y i (estimated value) and the second one represents the trajectory created by the optimized fuzzy controller, in this case the observed value, which is Y i (signal value), and n represents the total number of observed samples.
A total of 30 experiments were realized in each non-linear plant without perturbation, with perturbation of pulse generator with values of amplitude of 1, period (seconds) of 10, pulse with (% of period) of 30 and phase delay (seconds) of 100, with a second perturbation of noise limited with value of noise power of 0.5 and sample time of 0.8. Table 4 shows the results for each model, and the average result for minimum values to find by CSO algorithm of the six-performance indexes and problem Without Perturbation (Not Applied Perturbation (Not AP), With Pulse Generator Perturbation (Type-1 Perturbation), and with Band-Limited Perturbation (Type-2 Perturbation) is presented.
Results on Table 4 show that when a certain level of noise is added in, the model CSO algorithm presents a stable behavior in the metrics of error. For example, in the first control problem, the Integral Square Error without noise the average of the error is 2.77 × 10 +3 , with the noise pulse generator is 3.00 × 10 +3 and with the noise band-limited is 3.38 × 10 +3 . Thus, errors remain similar even when a high level of noise is added; this is possible due to the exploitation ability that CSO algorithm presents. In the case of the third control problem the best average in RMSE is with the noise of band-limited perturbation. Table 5 shows the results for each model, best result of the fitness function MSE to find by CSO algorithm with the metrics of best, worst, average, standard deviation, and Without Perturbation (Not Applied Perturbation (Not AP), With Pulse Generator Perturbation (Type-1 Perturbation), and with Band-Limited Perturbation (Type-2 Perturbation) is presented.  Results on Table 5 shows an stabilization when level of noise are added in two control problems; inverted pendulum and autonomous mobile robot. For example, in the second control problem the average with band-limited perturbation is 8.59 × 10 −1 compared to the average without perturbation is 2.29 × 10 0 ; similarly, for the third control problem the average value is 6.99 × 10 −2 with band-limited perturbation more stable that the value of 1.79 × 10 −1 with pulse generator perturbation and the value of 1.35 × 10 −1 without perturbation in the model.
With the goal to analyze the convergence in each control problem, Figure 18 shows the best results in fitness function that the CSO algorithm finds in the results. The best distribution in the MFs for the FLS that the CSO algorithm finds for each control problem is presented in Figures 19-21, respectively.

Comparative Analysis and Discussion of Results
This section presents a comparative analysis of the results when perturbations are added in the model. Also, a visualization of the different metrics that were used in this paper to evaluate the performance of the CSO algorithm is analyzed.    The results of Figure 22 show a better behavior without perturbation in the model, in this case this benchmark problem is considering a simple control problem. For the second case in the inverted pendulum (Figure 23), for both metrics when the band-limited perturbation is added the better results are found by CSO algorithm. This benchmark problem presents an efficient stabilization with the proposed implementation of CSO algorithm. Finally, the control problem of controlling the trajectory in an autonomous mobile robot shows a similar behavior even when perturbation is added in the model (Figure 24), whereby, this result allows evaluation of the efficiency and excellent performance of the CSO algorithms in the stabilization of fuzzy controllers. Figure 25 shows the best trajectory of the autonomous mobile robot found by CSO algorithm in the design of the MFs of the FLS simulated for each type of experiment; without perturbation, with pulse generator and with band-limited perturbation, respectively.   Figure 25 shows the efficiency of the CSO Algorithm when perturbation is added in the model, a stabilization of the fuzzy controller is illustrated when band-limited perturbation is added. Table 6 shows a comparative with the BCO algorithm for the Water Tank Controller and Autonomous Mobile Robot Controller, the minimum and maximum values for the Fitness Function of MSE are presented, and the average RMSE is shown. This comparison was realized for 30 experiments in both works. Results in Table 6 show minimal errors in the simulations with CSO algorithm. For example, in the case of water tank controller the minimal error is 8.22 × 10 −4 and for BCO algorithm is 5.50 × 10 −2 .

Conclusions
An efficient implementation of the CSO algorithm for the design of the Membership Functions for three control problems is presented in this paper. The proposed structure to find the optimal distribution of the MFs in each control problem demonstrates that when perturbation is added in the model, the CSO algorithm allows controlling a stabilization in three control problems; water tank, inverted pendulum and autonomous mobile robot controllers. The exploration and exploitation abilities in the CSO algorithm are an important aspect that is analyzed and reflected in the good results obtained. Several metrics were implemented, including ITAE, ITSE, ISE, IAE, MSE and RMSE, to evaluate of performance of the CSO algorithm.
The proposed implementation of CSO algorithm shows that it can be an excellent tool to find an optimal design in the MFs for the FLS to control and stabilize fuzzy controllers. Results in Tables 4 and 5 show minimal errors in the simulations. Figures 22-24 show that the convergence of CSO algorithm is fast and the minimal errors are obtained with few generations, this is due to its capacity of exploitation that presents this algorithm.
An interesting future work in this paper could be the implementation in the design of the MFs for an interval type-2 FLS. Also, it can be used for other fuzzy controllers; for example, flight simulations, and dynamic trajectories in autonomous mobile robots.