Keywords

1 Introduction

The simplicity of the PID controllers makes it an excellent choice for applications in the control systems, but the tuning of its parameters is still a cumbersome process. The tuning of parameters also does not guarantee satisfactory performance due to process changes and aging effect. This requires the controller parameters to be tuned regularly to get the satisfactory performance from the controller, which is a time consuming and impractical approach. Most of the real industrial systems are nonlinear and multi-input and multi-output in nature. These nonlinearities and the interactive behavior among the variables make the limited use of conventional PID controller. The neural networks (NNs) are the powerful tools in controlling such systems due to their universal function approximation capabilities, learning, and generalization properties [1]. The NNs can be used in one of the two ways, either the parameters of PID controller can be adjusted using them [2, 3] or it can act as intelligent controller used for modifying the parameters by using some rules, similar as the idea of an control engineer.

There exist various articles in the literature that used BP algorithm for updating the weights of the NNs, but due to the inherent limitation of the algorithm it suffers from the problem of slow convergence and local optima [4, 5]. Researchers have suggested possible ways to make it faster to overcome the problem of slow convergence [6, 7]. A momentum term has been included in the weight updating method to accelerate the learning procedure. The initial weights in the standard BP and its variants are generated randomly. The sensitivity of these algorithms for the initial weight is very high; therefore, initial weights choice could affect the convergence rate of the algorithm.

Particle swarm optimization (PSO) is similar to other metaheuristics-based algorithms, e.g., genetic algorithm, differential evolution algorithm. In general, the computation power required by these algorithms is huge which motivates the researchers to develop the efficient optimization techniques. PSO is also an evolutionary algorithm which is based on social behavior of animals such as bird flocking, fish schooling, and swarm theory. In this algorithm, in every iterations, the velocity updating of the particle is dependent on three factors, i.e., previous velocity, cognition component, and social component. The idea of PSO is easier to understand, and it has been used for finding the optimal solution to various complex problems [8, 9]. It has motivated the researchers to use it as a tool for optimizing the parameters of NN [10,11,12].

DPSO is a variant of PSO which is proposed by Nitin Saxena [13], it meets the two prime objectives of the population-based algorithm, i.e., the speed of the convergence and the mechanism for avoiding the local minima, which is difficult to achieve because of contradiction in both the objectives. The basic PSO [14] updates the velocity of the particles by using the global best which also influences the position of the particles and leads to faster convergence, due to which it becomes vulnerable to the problem of local optima especially in the case of multimodal problems [15, 16]. The DPSO variant overcomes the problem of stagnation and local optima and at the same time maintains the fast convergence rate.

This paper presents the use of DPSO algorithm for optimizing the free parameters of NN, i.e., weights. The use of evolutionary programming technique along with NN overcomes the issue of convergence in the NN-PID controller for MIMO systems. Rest of the paper is organized as follows: Sect. 2 describes the structure of NN-PID controller, and further, the input–output relationship of P, I, and D neurons has been defined, Sect. 3 briefs about the concept of classical back propagation algorithm and BP algorithm with momentum constant, Sect. 4 describes the PSO algorithm and its shortcomings, Sects. 5 and 6 describe the DPSO algorithm and procedure of weight optimization using DPSO algorithm, Sect. 7 shows the simulation results, and finally, paper is finished by a conclusions are drawn in last section.

2 NN-Based MIMO PID Controller

The structure of the NN-based PID controller for the MIMO systems is shown in the Fig. 1 [4]. For nth order system, the whole network is divided into n subnet where each subnet has one input, hidden and output layer. The input layer has two neurons, and the hidden layer has three neurons that mimic the behavior of Proportional, Integral, and Derivative actions and considered as P-neuron, I-neuron, and D-neuron, respectively, and finally, the output layer has one neuron. The input–output characteristics of the P-neuron, I-neuron, and D-neuron are defined as follows:

Fig. 1
figure 1

NN-PID controller for MIMO-coupled systems

  1. A.

    P-neuron

The input for jth P-neuron at instant k is as follows:

$$u_{pj} \left( k \right)\, = \,\sum\limits_{i = 1}^{N} {w_{ij} \cdot x_{i} \left( k \right)}$$
(1)

where i (1, 2), j (= 1, 2, 3), x i (k) are the outputs of N-connected input nodes in input layer and w ij is the weight matrix between input and hidden layer. The relationship between input and output of P-neuron is given as (2)

$$x_{pj} \left( k \right) = u_{pj} \left( k \right)$$
(2)

where x Pj (k) is the output of P-neuron.

  1. B.

    I-neuron

Similarly, relationship of input and output of I-neuron is defined as

$$x_{Ij} \left( {k + 1} \right) = x_{Ij} \left( k \right) + u_{Ij} \left( k \right)$$
(3)

where x Ij (k) is the I-neuron output.

  1. C.

    D-Neuron

With compliance to derivative action, the characteristic of D-neuron is defined as

$$x_{Dj} \left( k \right) = u_{Dj} \left( k \right) - u_{Dj} \left( {k - 1} \right)$$
(4)

where x Dj (k) is the D-neuron output.

Consequence the output of subnet Un is as follows:

$$U_{n} = w_{jk}^{n} \cdot X$$
(5)

where X = \(\left[ {x_{p}^{1} x_{1}^{1} x_{D}^{1} \ldots .\,x_{P}^{n} x_{1}^{n} x_{D}^{n} } \right]\) and \(w_{jk}^{n}\) is the network weights between hidden and output layer for nth subnet.

3 Comparative Study

In order to validate the results obtained from the proposed DPSO-based NN-PID controller for MIMO systems, the following algorithms have been considered for comparison.

  1. A.

    BP algorithm

The main objective of BP learning algorithm in the NN-PID controller for MIMO systems is to minimize the function given by (6)

$$J = \sum\limits_{h = 1}^{n} {E_{h} } = \frac{1}{n}\sum\limits_{h = 1}^{n} {\sum\limits_{h = 1}^{n} {\left[ {i_{h} \left( k \right) - o_{h} \left( k \right)} \right]^{2} } }$$
(6)

where i h (k) and o h (k) are input and output of the system, respectively. Standard BP algorithm is used for modifying the weights of this controller. After the forward pass, the weights between hidden layer and output layer are modified by:

$$w_{sjh} \left( {n + 1} \right) = w_{sjh} \left( n \right) - \eta \frac{\partial J}{{\partial w_{sjh} }}$$
(7)

where

$$\frac{\partial J}{{\partial w_{sjh} }} = - \frac{2}{n}\sum\limits_{k = 1}^{n} {\left[ {i_{h} \left( k \right) - o_{h} \left( k \right)} \right]\frac{{o_{h} \left( {k + 1} \right) - o_{h} \left( k \right)}}{{u_{h} \left( k \right) - u_{h} \left( {k - 1} \right)}}x_{sj} \left( k \right)} = - \frac{2}{n}\sum\limits_{k = 1}^{n} {\partial_{h} \left( k \right)x_{sj} \left( k \right)}$$
(8)

where η represents the learning rate, the serial number of output variables is given by h (= 1, 2…n), serial number of hidden neurons in every subnet is given by j (= 1, 2, 3), the serial number of the subnet is given by s (= 1, 2…n), the training step instant is k, and output of hidden layer neuron is given as x sj . The weights updating law between the input and hidden layer is given by:

$$w_{sij} \left( {n + 1} \right) = w_{sij} \left( n \right) - \eta \frac{\partial J}{{\partial w_{sij} }}$$
(9)

where

$$\frac{\partial J}{\partial w}_{sij} = - \frac{1}{n}\sum\limits_{h = 1}^{n} {\sum\limits_{k = 1}^{n} {\partial_{h} \left( k \right)w_{shj} \frac{{u_{sj} \left( {k + 1} \right) - u_{sj} \left( k \right)}}{{s_{sj} \left( k \right) - s_{sj} \left( {k - 1} \right)}}x_{si} \left( k \right) = - \frac{1}{n}\sum\limits_{k = 1}^{n} {\partial_{sj} \left( k \right)x_{si} \left( k \right)} } }$$

where the serial number of input neurons in every subnet is i (= 1, 2) and xsi is the output of input layer’s neurons.

  1. B.

    BP algorithm with momentum term

The standard BP algorithm despite its popularity has the major drawback of slow convergence rate. To improve the convergence rate, several modifications several modifications have been suggested by researchers. One of the modifications is the addition of the momentum term into standard BP algorithm. The modified weight updating rules [17] are as follows

$$w_{sjh} \left( {n + 1} \right) = w_{sjh} \left( n \right) - \eta \frac{\partial J}{{\partial w_{sij} }} + \alpha \left( {w_{sjh} \left( n \right) - w_{sjh} \left( {n - 1} \right)} \right)$$
(10)
$$w_{sij} \left( {n + 1} \right) = w_{sij} \left( n \right) - \eta \frac{\partial J}{{\partial w_{sij} }} + \alpha \left( {w_{sij} \left( n \right) - w_{sij} \left( {n - 1} \right)} \right)$$
(11)

where α is the momentum constant which lies between 0 and 1 which represents a rational changes in previous weight to current weight into the current weight change. The addition of this term helps to smoothen the path of decent by controlling the extreme change in the gradient.

4 PSO Algorithm

The objective of any optimization algorithm is to calculate or determine the optimal (i.e., best suited) solution for the given problem under a given set of constraints. Kennedy and Eberhart in the mid-1990s proposed an algorithm which does not require any gradient information and rather works by emulating the collective behavior of bird flocking, particles, and socio-cognition [18] which was named as PSO [18, 19].

PSO is a multi-agent parallel search technique, in which particles are considered as conceptual entities which fly through the multi-dimensional search space. Individual particle in the swarm can be defined on the basis of its position and velocity.

The initial values for \(pxbest_{j}\) and \(gxbest\) are taken as \(pxbest_{j} \left( 0 \right)\) and \(gxbest\left( 0 \right)\) for all the particles. The velocity and new position of jth particle in the swarm can be calculated using (12) and (13) after each particle knows the best individual particle position in the swarm.

$$v_{j}^{k + 1} = w + v_{j}^{k} + c_{1} \tau_{1} \left( {pxbest_{j} - x_{j}^{k} } \right) + c_{2} \tau_{2} \left( {gxbest - x_{j}^{k} } \right)$$
(12)
$$x_{j}^{k + 1} = x_{j}^{k} + v_{j}^{k + 1}$$
(13)

where \(v_{j}^{k}\) and \(x_{j}^{k}\) are the velocity and position of the jth particle at time k, respectively. The individual best position of the jth particle and the global best position of the jth particle in the swarm is given as \(pxbest_{j}\) and \(gxbest\), respectively. \(\tau_{1}\) and \(\tau_{2}\) are uniformly distributed numbers within interval [0 1] that determines the impact of \(pxbest_{j}\) and \(gxbest\) on the velocity update formula. \(c_{1}\) and \(c_{2}\) are constant terms, namely “self-confidence” and “swarm-confidence”, respectively. Initial values of \(c_{1}\) and \(c_{2}\) are considered as \(c_{1} = c_{2} = 2\). w is the inertial weight and can be determined using (14).

$$w = w_{\hbox{max} } - \left( {w_{\hbox{max} } - w_{\hbox{min} } } \right)Num/Num_{\hbox{max} }$$
(14)

where \(w_{\hbox{min} }\) and \(w_{\hbox{max} }\) are the minimum and maximum values of the w, \(Num_{\hbox{max} }\) is the maximum iteration time of the algorithm, and Num is the current iteration of the algorithm.

5 DPSO Algorithm

The new variant of PSO was proposed by Nitin Saxena [13] which overcomes the two prime objectives of the population-based algorithm, i.e., the speed of the convergence and the method for avoiding the local minima, which is difficult to achieve because of contradiction in both the objectives. The basic PSO [14] updates the velocity of the particles by using the global best (gbest) which also influences the position of the particles and leads to faster convergence, due to which it becomes vulnerable to the problem of local optima specially in the case of multimodal problems [15, 16]. Researchers have come up with solution to this problem and proposed various variants of PSO which enhances the performance of algorithm by balancing the parameters [13, 20].

The DPSO variant overcomes the problem of stagnation and local optima and at the same time maintains the fast convergence rate. DPSO does it by keeping the track of the change in the personal best positions of the particles, i.e., pbest, the algorithm tracks time for which the position pbest is not updated and at the same time it also keeps a track of the iteration for which the gbest had not changed. If the pbest and gbest do not change for a predefined number of iterations, then they are replaced by the best positions that they have attained previously.

The pbest and gbest are again monitored to see whether they are able to improve the targets or not if they are able to improve the targets then the replaced values are made permanent, otherwise the original previous values were restored. The repetition of the process is done until the value reaches an optimum point or termination condition is reached. Table 1 shows the different parameters of the DPSO algorithm.

Table 1 Parameters used in DPSO algorithm

6 Procedure of Weight Initialization of NN-PID Controller Using DPSO Algorithm

The procedure of weight optimization using DPSO is as follows:

  1. 1.

    Initialize randomly the location and speed of every element within the n-dimensionally exploration space. The counter for pBest_counti and pBest_chance_counti is set to 0 and −1, respectively. Similarly, the gBest_count and gBest_chance_count are initialized to 0 and −1 for counting the successive generations for which gBest and gBest_temp have not improved.

  2. 2.

    The fitness of each particle is calculated, and the initial location vector is assigned as pBesti and location creating best fitness value as gBest.

  3. 3.

    The speed of each particle is updated using the (12), and thereafter, the position is updated using (13).

  4. 4.

    The most potential regions identified upti gBest_h_maxcount are identified in the form of gBest and preserved as historic overall best as gBest_h.

  5. 5.

    The suitability of each element is computed again with the restructured location; if it improves the personal best of particle, then pBesti get updated to the Xi, and likewise, if the global best location of present reiteration is superior to gBest, then it gets restructured.

  6. 6.

    If the pBesti are not improved from the previous generation, then the count pBest_counti is incremented by 1 or else reset to 0. Likewise, if the gBest does not improve from the previous generation, then the count gBest_count is incremented by 1.

  7. 7.

    If for any particle the counts pBest_counti or gBest_count reache the threshold values, i.e., pBest_iter_thresh and gBest_iter_thresh correspondingly, then go to next step otherwise check for cessation condition.

  8. 8.

    If the elements whose pBest_counti and gBest_count have reached the threshold, then their pBesti and gBest are restructured as pBest_tempi and gBest_temp, respectively.

  9. 9.

    If the elements whose personal best, i.e., pBest, is restructured, their pBesti are changed provisionally to pBest_tempi for pBest_chance_max number of iterations and checked for improvement as compared to the value before replacement, if it shows improvement, the value is made permanent otherwise it is restored with the original value before exchange. Similarly, process is done for the gBest, it is changed with the gBest_temp for gBest_chance_max iterations.

  10. 10.

    The algorithm is terminated if the total number of iterations exceeds the maximum allowed iterations otherwise the process is repeated from step 3.

7 Simulation, Results, and Discussion

In order to test the proposed approach, two case studies of discrete time nonlinear interactive MIMO systems have been presented. All simulations have been performed on MATLAB platform with Intel Core 2 duo processor running at 1.86 GHz and 1 GB of RAM.

Case Study I: A 2 × 2 discrete time nonlinear-coupled MIMO system [12] is modeled as shown in (15) and (16). A negative unity feedback control topology has been tested to track the set point changes.

$$y_{1} \left( k \right) = \frac{1}{{\left( {1 + y_{1} \left( {k + 1} \right)} \right)^{2} }}\left( {0.8y_{1} \left( {k - 1} \right) + u_{1} \left( {k - 2} \right) + 0.2u_{2} \left( {k - 3} \right)} \right)$$
(15)
$$y_{2} \left( k \right)\frac{1}{{\left( {1 + y_{2} \left( {k - 1} \right)} \right)^{2} }}\left( {0.9y_{2} \left( {k - 1} \right) + 0.3u_{1} \left( {k - 3} \right) + 0.2u_{2} \left( {k - 2} \right)} \right)$$
(16)

The main objective is to design a NN-PID controller for the discrete time, nonlinear, coupled MIMO system with faster convergence rate for the set point changes.

The parameters of DPSO are initialized as follows:

  • The population size is taken as 30

  • Fix inertia weight (w) is taken as 0.783

  • The acceleration coefficients c 1 and c 2 are taken as c 1  = c 2  = 1.367

  • Maximum number of iterations is taken as 100

  • Maximum number of gBest stored as history in gBest_h = 10*m, pBest_iter_thresh = gBest_iter_thresh = 5*m (dimension).

A control topology with negative feedback has been implemented using NN-PID controller where objective is to track the set point of 0.7 and 0.4 for input-1 and input-2, respectively, with respect to time (seconds). Initially, weights have been generated randomly between 0 and 1 and learning rate and momentum constant are chosen, 0.40 and 0.04, respectively. Parameters of PID controller Kp 1  = 0.10, Ki 1  = 0.05, Kd 1  = 0.001 and Kp 2  = 0.10, Ki 2  = 0.05, Kd 2  = 0.001 are chosen.

The training of the NN-PID controller is done using four different techniques. Firstly, standard BP algorithm is used for initializing the network weights randomly. Secondly, standard BP algorithm with random initialization is used but the outputs of P-neuron, I-neuron and D-neuron have been multiplied by constant factors of 1, 10, and 1.5, respectively. Thirdly, standard BP algorithm with momentum constant with random initialization has been used, and finally, standard BP algorithm with DPSO-based initialization has been chosen and tested.

Figures 2 and 3 show the step responses of the system for the input-1 and input-2, and corresponding controlled inputs have been shown in Figs. 4 and 5. It is evident from these figures that with the controlled inputs the proposed scheme tracks the set point changes faster than the other existing techniques. Significant improvement is also seen in the square error convergence with the use of DPSO algorithm for weight initialization which is shown in Fig. 6. The improvement in rise time and settling time is also very clearly visible in the simulation results.

Fig. 2
figure 2

System response for set point change in input 1 (case study I)

Fig. 3
figure 3

System response for set point change in input 2 (case study I)

Fig. 4
figure 4

Controlled input 1 (case study I)

Fig. 5
figure 5

Controlled input 2 (case study I)

Fig. 6
figure 6

Convergence of mean square error (case study I)

Case Study II: A 3 × 3 discrete time nonlinear-coupled MIMO system whose input–output relation is given by (17)–(19)

$$y_{1} (k) = 0. 4 {\text{y}}_{ 1} ( {\text{k}} - 1 )+ \frac{{{\text{u}}_{ 1} ( {\text{k}} - 1 )}}{{ 1+ {\text{u}}_{ 1}^{ 2} ( {\text{k}} - 1 )}} + 0.2u_{1}^{3} (k - 1) + 0.5u_{2} (k - 1) + 0.3{\text{y}}_{ 2} ( {\text{k}} - 1 )$$
(17)
$$y_{2} (k) = 0. 2 {\text{y}}_{ 2} ( {\text{k}} - 1 )+ \frac{{{\text{u}}_{ 2} ( {\text{k}} - 1 )}}{{ 1 {\text{ + u}}_{ 2}^{ 2} ( {\text{k}} - 1 )}} + 0.4u_{2}^{3} (k - 1) + 0.2u_{1} (k - 1) + 0.3{\text{y}}_{ 3} ( {\text{k}} - 1 )$$
(18)
$$y_{3} (k) = 0. 2 {\text{y}}_{ 3} ( {\text{k}} - 1 )+ \frac{{{\text{u}}_{ 3} ( {\text{k}} - 1 )}}{{ 1+ {\text{u}}_{ 3}^{ 2} ( {\text{k}} - 1 )}} + 0.4u_{3}^{3} (k - 1) + 0.4u_{2} (k - 1) + 0.3{\text{y}}_{ 1} ( {\text{k}} - 1 )$$
(19)

The objective here is same as the earlier case study. Set points of 0.2, 0.4, and 0.7 are used for input-1, input-2, and input-3, respectively. Initial weights have been generated randomly between 0 and 1, and learning rate and momentum constant are same as case study I. Controller parameters (Kp 1 = 0.3, Ki 1 = 0.15, Kd 1 = 0.1, Kp 2 = 0.3, Ki 2 = 0.15, Kd 2 = 0.1, Kp 3 = 0.3, Ki 3 = 0.15, Kd 3 = 0.1) have been chosen, and ten hidden neurons have been determined by observing the performance measure.

The parameters of DPSO algorithm that are adopted earlier remain unchanged. The responses of the system for step change to all the inputs are shown in Figs. 7, 8, and 9. The step response of the system to the controlled inputs is shown in Figs. 10, 11 and 12. It is observed from the results that with feasible-controlled inputs, the NN-based PID controller trained with BP algorithm using DPSO-based weights initialization is capable of tracking the set point changes faster with least steady error. The rise time and settling time have also been significantly improved (Fig. 13).

Fig. 7
figure 7

System responses for input 1 (case study II)

Fig. 8
figure 8

System responses for input 2 (case study II)

Fig. 9
figure 9

System response for input 3 (case study II)

Fig. 10
figure 10

Controlled input 1 (case study II)

Fig. 11
figure 11

Controlled input 2 (case study II)

Fig. 12
figure 12

Controlled input 3 (case study II)

Fig. 13
figure 13

Convergence of square errors (case study II)

In the case study II, it is clearly observed that the transient response and rate of convergence have been improved significantly with feasible-controlled inputs.

8 Conclusion

The structure of NN-based PID controller using P-neuron, I-neuron, and D-neuron has been explored for controlling the nonlinear-coupled MIMO systems. The training of the NN-based controller is done by using standard BP algorithm, and with momentum term added to BP algorithm. The initial weights of the network were chosen randomly. The convergence of the BP algorithm is further improved by utilizing the DPSO algorithm for optimizing the weights of the NN-based PID controller. The case studies of two discrete nonlinear-coupled MIMO systems are presented, and the simulated results are fairly compared with the results of the other existing techniques. On the basis of results, it is concluded that proposed approach not only provides better control of the nonlinear-coupled MIMO systems but also satisfies the minimum mean square error criteria with lesser settling and rise time. The convergence rate of the proposed algorithm is found to be better than both standard BP and BP with momentum term.