Open access peer-reviewed chapter

PID Control for Takagi-Sugeno Fuzzy Model

Written By

Taieb Adel and Chaari Abdelkader

Submitted: May 29th, 2017 Reviewed: January 23rd, 2018 Published: September 12th, 2018

DOI: 10.5772/intechopen.74295

Chapter metrics overview

900 Chapter Downloads

View Full Metrics


In this chapter, we deal with the problem of controlling Takagi-Sugeno (TS) fuzzy model by PID controllers using the particle swarm optimization (PSO). Therefore, a new algorithm is proposed. This algorithm relies on the use of a new objective function taking into account both the performance indices and the error signal. The advantages of this approach are discussed through simulations on a numerical example.


  • nonlinear system
  • TS fuzzy model
  • PID
  • self-tuning of PID controller
  • PSO

1. T-S fuzzy model

The theory of modeling based on multiple models has evolved greatly. Indeed, several techniques have been developed in the literature. The common feature of all these modeling techniques is the decomposition of the dynamic behavior of the system into a number of operating zones. Each zone is characterized by a local linear model. Fuzzy logic based on the use of linguistic rules, heuristic strategies and the operator’s know-how. Subsequently, it has undergone a major evolution mainly in Japan where it has been applied in several industrial applications. This type of model proposed by Takagi and Sugeno (1985) makes it possible to express a nonlinear system in several locally linear subsystems. The validity of each local model is defined by a weighting function with bounded support.

The TS model is built on a set of rules of type:

  • Ri: “IF premises THEN consequence”

where the premises are obtained from the linguistic propositions allowing the evaluation of the weighting functions and where the consequences corresponding to the local models.

We consider a class of nonlinear systems defined by:


with the regressor vector Xtis:


where krepresents the discrete time, nand mdenote, respectively, the number of delayed output and the number of delayed input. The function fxtis approximated by a TS fuzzy model which is charities by consequent rules that are local linear function of the input variables [1]. The fuzzy rules of the TS model take the following general form:


where Ridenotes the ithIF-THEN rule, ris the number of rules, Ajij=1zis the fuzzy subset, utis the system input variable, ytis the system output, θi=ai1ai2aizbi0is the parameter vector of the corresponding local linear model. Let μiXtis the normalized membership function of the inferred fuzzy set Ai, where Ai=Πj=1zAji. The final output is calculated as the average of the outputs corresponding to the rules Ri, weighted by the normalized degree of completion (membership), according to the following expression:


The membership values μithave to satisfy the following conditions:


Once the parameters of the premises are fixed, the parameters of the consequent for each rule can be obtained using the recursive weighted least squares technique, using the values of the membership degrees of the fuzzy partition matrix of the classification process as weights [2]:

The steps of the WRLS method are summarized in the following algorithm:

Initialize: θig0=0and Pi0=αiI.

for g=1,,ci


with k=1,,N,Pit1Mi+1×Mi+1and LitMi+1.

end for


2. PID control by pole placement

This section is intended to model the digital PID controller in a new form RST. The control structure RST is the establishment of three polynomials Rq1, Sq1and Tq1. According to the first section, the local linear systems can be represented by:


Indeed, the vector xktakes the following form: xk=yk1yk2yknuk1ukm. This form is heard when determining PID controller parameters by the method of poles placement. Figure 1 shows the standard form of RST controller.

Figure 1.

Standard form of RST.

In this chapter, we consider only two branches Rand S, as shown in Figure 2, that is to say:


Figure 2.

RST structure.

The transfer function in a closed loop is given by:






For a characteristic polynomial P1q1, the poles of the closed loop transfer function are imposed to arrive at the performances required by the follow-up of the specifications.

This problem boils down to solving the following equation:


From the after Scheme 4, the equation of regulator is written by:


To simplify Eq. (17), we substitute:


from which we obtain the following standard form:


The parameters of the digital PID regulator (r0, r1, r2and s1) are chosen according to the desired poles defined by the polynomial Pq1.

The characteristic polynomial can be in the following form:


The values of p1and p2are chosen from the specifications imposed by the specifications (rise time, damping, overshoot, etc.) defined in general by comparing the behavior of the process to that of continuous system of second order.


where zetais a damping coefficient and wnis a pulsation. We wrote:


By identification, we find:


The control law is:


From where:


The structure of the corrector is the standard structure discretized by the approximation upper rectangles, and to find the values of the PID parameters will take the following expression:


3. PID controller based on PSO

3.1. PSO algorithm

Particle swarm optimization (PSO) is a stochastic technique based on collective intelligence, inspired by nature. It was developed by Kennedy and Eberhart [3]. The PSO algorithm is inspired by collective behavior in certain social animals such as fish and migratory birds. This algorithm shares many similarities with evolutionary computational techniques such as genetic algorithms. Indeed, the latter are initialized with random solutions and search for optimums by updating generations involved. However, the PSO has no evolutionary operator such as the crossing and the mutation in the image of genetic algorithms.

In the PSO, each individual of the population is called particle, while the population is known as swarm. It should be noted that a particle can benefit from the movements of other particles in the same population to adjust its position and velocity during the optimization process. Each individual uses local information to which he can access the movement of his nearest neighbors to decide his own move. Very simple rules like “staying close to other people,” “going in the same direction” and “going at the same speed” are enough to maintain the cohesion of the whole group. At each displacement, the performance of each particle is measured by its position and velocity by minimizing a performance function called fitness [4].

The PSO’s basic algorithm works on a population called a swarm of possible solutions, which are called particles. These particles are placed randomly in the search space of the objective function. At each iteration, the particles move, taking into account their best position (selfish displacement) but also the best position of its vicinity. In fact, the new speed is calculated from the following formula [3]:


In this equality, tis the number of iteration, Vidtand xidtstand for separately the speed of the particle iat its ttimes and the d-dimension quantity of its position, c1and c2are the acceleration coefficients, r1and r2are two random numbers drawn uniformly in 01. pidand pgdare, respectively, the best position reached and the best position of the vicinity reached of the particle iand wis an inertial coefficient defined by:


where itermaxis the maximum of iteration in evolution process, wminand wmaxare the minimum and maximum values of w, respectively, and iteris the current value of iteration. The position of the particle can then be determined by the speed that we have just calculated:


We generate Vid0and xid0at the beginning of our algorithm. The PSO algorithm stops if one of these convergence criteria is reached:

  • the maximum number of iterations tmaxis reached;

  • the speed variation tends to zero; and

  • the fitness function is satisfied.

3.2. Tuning of PID using PSO optimization

The PSO optimization module complete the self-tuning of PID parameters with a microprocessor that achieves the optimum of PID parameters. These parameters are used to retune the PID controller in PID controller module. To seek the optimum parameters kp,kiand kdof PID controller, PSO program should search in D-dimensional search space. The function optimization problem can be viewed as a 3-dimensional space in this chapter. That is, tuning of PID controller parameters is to search optimization value in kp, kiand kd, the 3-dimensionsal search spaces. With the optimized parameters based on PSO algorithm, the PID controller can achieve the optimal properties, that is, a fast system with a minimum of overrun, there is a compromise between performance and minimum energy [5].

In most cases, PID controller work with an error signal (e) that is calculated from the process variable (y) and setpoint (yr). The error represents the deviation of the process variable from the setpoint. Then, the error signal is described as:


A PID controller optimized with PSO algorithm was developed for a TS Fuzzy system. It was also called the PSO-PID controller. PSO algorithm is mainly utilized to determine three optimal PID gains.

Adjusting the parameters of a PID controller can be considered as an optimization problem where it is a matter of finding the optimal solution of the gains of the controller in a predefined search space in order to allow the system to have certain desired performances. In this context, the PSO algorithm can be applied to find the optimal combination of the proportional, integral and derivative gains of the PID controller. During the application of the PSO, the initial population will be created randomly with Np individuals containing three decision variables: kp, kiand kd. To evaluate the individuals, we inject these gains into the PID controller and measure the parameters of the corresponding system output using the parameters of the TS model. The choice of the cost function is determined by the objective to be achieved. These objectives are determined by the performance defined in the specifications. Typically, this is static error, rise time, stabilization time and maximum allowed exceedance.

In the literature, we can find a multitude of performance indices. Most of these indices are based on the optimization error. The integrated square error (ISE) is given by:


Another fitness function is integrated time weight square error (ITSE), which is given as follows:


It seems simpler, yet it is hard to get the ideal time response too. Another widely used fitness function is:


where etand utrepresent, respectively, the system error and the output of controller, the utilization of this second item is to limited energy (Figure 3).

Figure 3.

Block diagram of a PID-PSO algorithm.

Since, more than the error signal, the performance indices in the time domain are also the overshoot (D%), steady-state error (Ess) the settling time (Ts) and the rise time (Tr). The performance criteria must include all these performances. Therefore, we proposed a new objective function and it is described by the following equation:


The framework of online parameter self-tuning for nonlinear system based on TS Fuzzy model is depicted in Figure 3.


4. Simulation results

This section presents a simulation example to show an application of the proposed control algorithm and its satisfactory performance.

The nonlinear system is characterized by this equation [6]:


with a1=0.4; a2=0.3; a3=0.1; b1=0.6; and b2=1.8. Here, ykis the output and ukis the input which is uniformly bounded in the region 22.

We choose yk1yk2uk1uk2as inputs variables, and the number of fuzzy rules is four. The setup applied in this work was the following: the population size was 20, the stopping criterion was 30 generations, wmin=0.5, wmax=0.9and c1=c2=2.

We simulated two experimental cases. In case 1, the simulation result of the control pole placement for the nonlinear system is shown in Figure 4.

Figure 4.

Output signal: PID-pole placement method.

It can be seen from Figure 4, we note that the output of command has an important overshooting. In case 2, the PSO algorithm is adding to PID control. Figure 5 shows simulation results of the output signal of the control system.

Figure 5.

Output signal: PID-optimization of PSO.

We make a comparative study of PID control by pole placement method and the optimization algorithm of PSO (Table 1).

Pole placement methodOptimization of PSO

Table 1.

Result of PID parameters and PID-PSO.

We note though, the advantage of optimizing the parameters of PID controller by PSO compared with the method of pole placement quality control, we observed that the overshoot decreases and the algorithm converges in minimum time.


5. Conclusion

We studied the PID control of a nonlinear system of Takagi-Sugeno for a square input signal using pole placement technique. With this method, we obtain results with an important overshooting. To solve this problem, we have compiled the PID control algorithm with PSO optimization algorithm that it has given good results.


  1. 1. Lagrat I, Ouakka H, Boumhidi I. Adaptive control of a class of nonlinear systems based on Takagi-Sugeno fuzzy model. In: Information and Communication Technologies International Symposium (ICTIS’07); Fez, Morocco. 2007. pp. 3-5
  2. 2. Kung CC, Su JY. Affine Takagi-Sugeno fuzzy modelling algorithm by fuzzy cregression models clustering with a novel cluster validity criterion. IET Control Theory Application. 2007;1(5):1255-1265
  3. 3. Kennedy J, Eberhart RC. Particle swarm optimization. In: Proceedings of IEEE International Conference on Neural Networks; Perth, Australia. 1995. pp. 1942-1948
  4. 4. Clerc M, Kennedy J. The particle swarm: Explosion, stability, and convergence in multi-dimension complex space. IEEE Transactions on Evolutionary Computation. 2002;16(1):58-73
  5. 5. Aggarwal V, Mao M, O’Reilly U-M. A self-tuning analog proportional-integral-derivative (PID) controller. In: Adaptive Hardware and Systems. 2006. pp. 12-19
  6. 6. Gomm JB, Yu DL, Williams D. A new model structure selection method for non-linear systems in neural modeling. International Conference in Control IEEE Transaction. 1996;4(27):752-757

Written By

Taieb Adel and Chaari Abdelkader

Submitted: May 29th, 2017 Reviewed: January 23rd, 2018 Published: September 12th, 2018