Design of Fuzzy Controller for Robot Manipulators Using Bacterial Foraging Optimization Algorithm

Trial and error method can be used to find a suitable design of a fuzzy controller. However, there are many options including fuzzy rules, Membership Functions (MFs) and scaling factors to achieve a desired performance. An optimization algorithm facilitates this process and finds an optimal design to provide a desired performance. This paper presents a novel application of the Bacterial Foraging Optimization algorithm (BFO) to design a fuzzy controller for tracking control of a robot manipulator driven by permanent magnet DC motors. We use efficiently the BFO algorithm to form the rule base and MFs. The BFO algorithm is compared with a Particle Swarm Optimization algorithm (PSO). Performance of the controller in the joint space and in the Cartesian space is evaluated. Simulation results show superiority of the BFO algorithm to the PSO algorithm.


Introduction
A wide variety of control strategies were proposed to control robot manipulators.PID controls are certainly the most widely adopted control strategy in industry because of its simple structure and robust performance in a wide range of operating conditions.Although PID control offers the simplest and yet most efficient solution to many real world control problems [1], optimally tuning gain is quite difficult [2].Alternatively, fuzzy control as a modelfree approach is simply designed to control complicated systems [3].To form fuzzy rules, an exact knowledge of model is not required.Fuzzy controller is an intelligent controller using linguistic fuzzy rules to include information from experts.Consequently, fuzzy control of robot manipulators has attracted a great deal of researches to overcome uncertainty, nonlinearity and coupling by providing a model free control [4].To design a Fuzzy Logic Controller (FLC), a major task is to determine fuzzy rules, Membership Functions (MFs) and scaling factors.Therefore, the controller is tuned until a desired performance is achieved.The evolutionary algorithms such as Bacterial Foraging Optimization (BFO), Particle Swarm Optimization (PSO), Genetic algorithm (GA), and Simulated Annealing (SA) are getting popular because of their abilities to find the global minima in both continuous and non-continuous domains.
Since a foraging organism takes a necessary action to maximize the energy per unit time under considering all the constraints such as sensing and cognitive capabilities, natural foraging strategy can be applied to real-world optimization problems.Based on such evolutionary idea, Passino proposed BFO as an optimization algorithm [5].BFO algorithm is a new evolutionary computation technique, which also includes powerful optimization techniques like PSO [6] and ant colony optimization [7].To improve BFO search performance, several researchers have extended the basic BFO to deal with multi-modal and high dimensional functions [8][9][10].BFO algorithm has also been combined with other evolutionary algorithms [11] in order to reduce the convergence time and enhance the accuracy.Over certain real-world optimization problems, BFO has been reported to outperform many powerful optimization algorithms like GA [12] and PSO algorithms [13].
The PSO algorithm proposed by Kennedy and Eberhart [6], has proved to be very effective for solving complex optimization problems.The underlying motivation for the development of PSO algorithm was social behavior of animals such as bird flocking and fish schooling.Generally, PSO is characterized as a simple concept, easy to implement, and computationally efficient.Unlike the other heuristic techniques, PSO has a flexible and well-balanced mechanism to enhance the global and local exploration abilities [14].
Trial and error method is a major task to find a suitable design of a fuzzy controller.We may use an optimization algorithm to achieve an optimal design.This paper presents a BFO algorithm to design a fuzzy PID controller for trajectory tracking control of a robot manipulator driven by permanent magnet DC motors.Performance of the BFO algorithm is compared with a PSO algorithm in terms of Integral Time Absolute Error (ITAE) in the joint space and Integral Square Error (ISE) in the Cartesian space.This paper is organized as follows: Section 2 introduces dynamics of the robotic system.Section 3 designs a fuzzy PD + I controller.Section 4 applies the BFO and PSO algorithms for tuning the fuzzy PD + I controller.Section 5 presents simulation results and Finally Section 6 concludes the paper.

Manipulator Dynamics
Robust control of robot manipulators is difficult because of complexity robot dynamics.The dynamics of an n-link robotic manipulator driven by permanent magnet dc motors is characterized by a set of highly nonlinear and strongly coupled second order differential equation [15] as where is a vector of generalized joint positions, is the inertia matrix, is a vector of centripetal and Coriolis generalized forces, is a vector of generalized gravitational forces, is a vector of motor voltages, m m , , are constant diagonal matrices of torque constant, back emf constant, resistance, inertia, damping and reduction gear ratio of motors, respectively.Position of the MF is specified by spacing parameter where one indicates an even spacing, while any value larger than unity indicates that the MFs are close together in the center of the range and more spaced out at the extremes as shown in Figure 2.This method of designing the MFs is introduced in [16].

Fuzzy PD + I Controller
The rule-base also is designed based on the ideas pre-  sented in [16].In specifying a rule base, characteristic spacing parameter for each variable and characteristic angle for each input variable are used to construct the rules.The characteristic spacing parameters and the characteristic angle determine how the space is partitioned.The angle determines the slope of a line through the origin on which seed points are placed.The positioning of the seed points is determined by a similar spacing method as was used to determine the centers of the MFs as illustrated in Figure 3 where seed points are blue circles and grid-points are red circles.The lines on the graph delineate the different regions corresponding to different consequents.The parameters for this example are 1 for both input spacing, 0.85 for the output spacing and 40˚ for the angle.Table 1 shows the derived fuzzy rules.

Bacterial Foraging Optimization Algorithm
The BFO algorithm can be explained by four processes namely, chemotaxis, swarming, reproduction, and elimination-dispersal [6].Below we briefly describe each of these processes.Chemotaxis: This process simulates the swimming and tumbling movements of an E. coli cell by a set of rigid flagella.An E. coli bacterium can move in two different ways.It can swim for a period of time in the same direction or it may tumble, and alternate between these two modes of operation for the entire lifetime.This alternation between the two modes enables the bacterium to move in random directions and search for nutrients.Suppose

 
, , i j k l  represents i-th bacterium at j-th chemotactic, k-th reproductive and l-th elimination-dispersal step.C(i) is the run length which is a constant in basic BFO algorithm.In computational chemotaxis, the movement of the bacterium is represented as where  indicates a vector in the random direction whose elements lie in [-1, 1].Swarming: It is always desired that when any one of the bacteria reaches the better location, try to attract other bacteria so that they reach the desired place more rapidly.The effect of swarming is to make the bacteria congregate into groups and move as concentric patterns with high bacterial density.Mathematically, swarming can be represented by where J cc (h,P(j,k,l)) represents the objective function value to be added to the actual objective function (to be minimized) to present a time varying objective function, S is the total number of bacteria, p is the number of variables to be optimized, which are present in each bacterium and 1 2 , , , is a point in the p-dimensional search domain.d attractant , w attractant , h repellant , w repellant are different coefficients that should be chosen properly.
Reproduction: The least healthy bacteria eventually die while each of the healthier bacteria (each with the lower cost function) asexually split into two bacteria, which are then placed in the same location.Thus, the population size after reproduction is maintained constant.
Elimination and dispersal: A gradual or sudden changes in the location where a bacterium population lives may occur due to noxious substance, the temperature rises abruptly in the area or some other influence.Events can kill or disperse all the bacteria in a region.This reduces the chances of convergence at local optima location.To simulate this phenomenon in BFO algorithm, some bac-teria are chosen, according to apreset probability P ed , to be dispersed and moved to another position within the environment.
The BFO algorithm parameters are denoted as p, S, N c , N s , N re , N ed , P ed , where p is dimension of the search space, S is the total number of bacteria in the population, N c is number of chemotactic steps, N s is swimming length, N re is number of reproduction steps, N ed is number of elimination-dispersal events, P ed is elimination-dispersal probability.The parameters selected for the proposed BFO algorithm are shown in Table 2.
It is certainly impossible to explore all the potential uses of BFO in this single article, but we briefly point to the some of them.It should seem at least plausible that there are applications of the methods to optimization, optimal control, adaptive estimation and control, and model predictive control.

Particle Swarm Optimization
PSO is a population-based optimization method inspired by the social behavior of animals such as bird flocking and fish schooling.Like evolutionary algorithms, PSO algorithm conducts search using a population of particles, corresponding to individuals.Each particle has a velocity vector v i and a position vector x i to represent a possible solution to the optimization problem.The first positions and velocities of a PSO algorithm are randomly initialized within a population.At the next iteration, position and velocity of each particle are updated by the two values.The first value, pbest, is the personal best position of particle that it has achieved so far.The other, gbest, is obtained by choosing the overall best value from all particles.The new velocity for each particle is updated by the following equation where , 1 and 2 c are called the coefficient of inertia, cognitive and society study, respectively.The 1 and is uniformly distributed random numbers in [0, 1].
Changing velocity enables every particle to search around its individual best position and global best position.Based on the updated velocities, each particle changes its position as following where e(kj) is the system error at k-th sampling instant for j-th joint.Tuning process of FLC parameters with PSO is similar to BFO algorithm.

Simulation Results
The objective of this section is to verify the performances of the Fuzzy-BFO based controller and the Fuzzy-PSO based controller.Results of the tuning methods are tested in terms of ITAE in joint space and ISE in Cartesian space.The desired Cartesian space trajectory is a spiral path.Integral Square Errors ISEX, ISEY and ISEZ are calculated to compare controller performance stated as follows where  are desired and output Cartesian space points at k-th sampling instant.The ability of control system for rejecting disturbances is simulated.For checking the robustness of controller a disturbance torque D is applied as an example in the form of Initial angles of all three joints are set to zero, however spiral trajectory is starting from a non-zero value in Figure 6.Fitness function curve of PSO tuning is shown in Figure 5. Performance of the second joint for tracking spiral trajectory and corresponding error are shown in Figures 6 and 7, respectively.We can see a good tracking, where the tracking error of the joint is very small.Tables 3 and 4 give the values of the two cost functions, ISE and ITAE, with and without disturbance for the controllers.As can be seen, the Fuzzy-BFO based controller

Conclusion
In this paper, we have presented a comparison study of using BFO and PSO algorithms for a design of a fuzzy PID controller to tracking control.Performances of controllers in the cases of with and without disturbances are    compared for the above approaches in joint space, as well as in Cartesian space.The simulation results show that BFO algorithm is superior to PSO algorithm in term of accuracy of response.An improvement of this work can be made by designing an online adaptive controller based on BFO algorithm.

Fuzzy
PID controller is implemented as fuzzy PD + I controller as shown in Figure 1.Each fuzzy set consists of a number of MFs to describe the heuristic variables in a mathematical manner.The motor voltage is the output of fuzzy controller while the joint position error and its derivative are its inputs.MFs for the inputs and output of the controller are five fuzzy sets namely NB (Negative Big), NM (Negative Medium), Z (Zero), PM (Positive Medium) and PB (Positive Big).The following assumptions are given to design the FLC:  MFs are triangular specified with three points. The physical range of inputs are scaled between [-1, 1]. Axes of the first and the last MF are at -1 and 1, respectively. Number of fuzzy sets is an odd integer greater than one. MFs are arranged such that the second point of each MF is coincident with the third point of the left one and the first point of the right one.Then, number and position of second point of MFs are selected as two design parameters.

Figure 2 .
Figure 2. Effect of spacing parameter on MFs.

Figure 4 .
Figure 4. Tuning of FLC parameters by BFO algorithm.

Figure 7 .
Figure 7. Joint space error of second joint.