Keywords

1 Introduction

PID controllers in its different forms are mainly used in process industries due to their simple structures and ease of implementation [1]. The parallel form of the conventional PID controller (CPID) with three adjustable gain parameters is extensively studied [2, 3]. Such controllers can provide reasonably acceptable performances for first-order and second-order linear self-regulating processes. However, their performances for nonlinear and integrating systems are usually not satisfactory due to associated intolerably large overshoot [2, 4, 5]. Several attempts have been made to overcome this limitation [611] by developing adaptive PID controllers (APID) through nonlinear parameterization. However, most of the APID parameters are selected based on trial and error, or sometimes through heuristics [811]. Therefore, their performances may not be optimal. Keeping in mind this point, and the excellent optimization power of genetic algorithms (GA) [12], in this study, we attempt to develop GA-based adaptive PID (GA-APID) controller toward achieving optimum performance. Here, GA-APID design involves two steps—first we define the structure of the adaptive PID; then, GA is used to find its best set of parameters with respect to a given closed-loop performance index or objective function. Performances of the developed GA-APID for nonlinear and integrating systems with dead time are compared with other PID controllers. Considerably improved performance with respect to a large number of indices justifies the effectiveness of the developed GA-APID.

2 The Proposed PID Controller

2.1 The Conventional PID Controller

The discrete form of a conventional PID controller (CPID) can be expressed as

$$ \begin{aligned} u^{c} \left( k \right) & = K_{p} \left[ {e\left( k \right) + \frac{\Delta t}{{T_{i} }}\mathop \sum \limits_{i = 0}^{k} {\text{e}}\left( i \right) + \frac{{T_{d} }}{\Delta t}\Delta {\text{e}}\left( k \right)} \right] \\ {\text{or}}\quad u^{c} \left( k \right) & = K_{p} e\left( k \right) + K_{i} \mathop \sum \limits_{i = 0}^{k} e\left( i \right) + K_{d} \Delta e\left( k \right). \\ \end{aligned} $$
(1)

In (1), \( e\left( k \right) \, = r - y\left( k \right) \) is the process error, where r is the set point and y is process output, \( K_{p} \) is the proportional gain, \( K_{i} = K_{p} \left( {\frac{\Delta t}{{T_{i} }}} \right) \) is the integral gain, \( K_{d} = K_{p} \left( {\frac{{T_{d} }}{\Delta t}} \right) \) is the derivative gain, \( T_{i} \) is the integral time, \( T_{d } \) is the derivative time, and \( \Delta t \) is the sampling period. Proper selection of the three tuning parameters—\( K_{p} ,T_{i} , \) and \( T_{d } \)—is a critical task to attain the desired closed-loop performance. Through decades, various methods have been developed for the tuning of PID parameters [3]. Among them, Ziegler-Nichols (ZN) continuous cycling method [13] is most widely used by practicing engineers for the initial settings of PID parameters [3]. In this study also, we have used ZN continuous cycling method [4] for the initial settings of the PID parameters, i.e., \( K_{p} = 0.6K_{u} ,\quad T_{i} = 0.5t_{u} , \) and \( T_{d } = \frac{{t_{u} }}{8}, \) where \( K_{u} \) is the ultimate gain and \( t_{u} \) is the ultimate period.

2.2 The Adaptive PID Controller

We have already mentioned that CPID usually fail to provide acceptable performance for nonlinear and integrating systems. In order to overcome such limitations, a number of attempts have been made in [5, 811] for online adjustments of various gain parameters of CPID, thereby making it an APID, so that an overall improved performance is achieved. In this study, we will concentrate on the APID presented in [8], where the three gain constants, i.e., \( K_{P} , K_{i, } \,{\text{and}}\, K_{d} \), are continuously modified by an online updating factor alpha (α) with the following simple heuristic relations:

$$ K_{p}^{m} \left( k \right) = K_{p} \left( {1 + k_{1 } \left| {\alpha \left( k \right)} \right|} \right) $$
(2)
$$ K_{i}^{m} \left( k \right) = K_{i} (k_{ 2 } + k_{3 } \alpha (k) ) $$
(3)
$$ K_{d}^{m} \left( k \right) = K_{d} (1 + k_{4} |\alpha (k)| ). $$
(4)

Here,

$$ \alpha \left( k \right) = e_{N} \left( k \right) \times \Delta e_{N} (k), $$
(5)

where \( e_{N} \left( k \right) = \frac{e(k)}{|r|} ;\,{\text{and}}\, \Delta e_{N} \left( k \right) = e_{N} \left( k \right) - e_{N} \left( {k - 1} \right). \)

Now, the APID can be redefined as

$$ u^{m} \left( k \right) = K_{p}^{m} \left( k \right)e\left( k \right) + K_{i}^{m} \left( k \right)\mathop \sum \limits_{i = 0}^{k} {\text{e}}\left( i \right) + K_{d}^{m} \left( k \right)\Delta {\text{e}}\left( k \right) . $$
(6)

In Eq. (6), \( K_{p}^{m} \left( k \right), K_{i}^{m} \left( k \right)\,{\text{and}}\, K_{d}^{m} \left( k \right) \) are the modified proportional, integral, and derivative gains, respectively, at \( k{\text{th}} \) instant and \( u^{m} \left( k \right) \) is the corresponding control action. \( k_{1} , k_{2} , k_{3} , \,{\text{and}}\, k_{4} \) are the four additional positive constants. The objective behind such online gain adjustments as described by relations (2)–(4) is that when the process is moving toward the set point, control action will be less aggressive to avoid possible large overshoots and/or undershoots, and when the process is moving away from the set point, control action will be more aggressive to make a rapid convergence of the system. Following this gain-adaptive technique, in [8], a significantly improved performance of APID is found for high-order and nonlinear systems both in set point and load disturbance responses. However, out of the seven parameters of [8], i.e., \( K_{P} , K_{i } , K_{d} , k_{1} , k_{2} , k_{3} , \,{\text{and}}\, k_{4} , \), the first three constants, i.e., \( K_{P} ,K_{i } ,\,{\text{and}}\, K_{d} \), are selected based on ZN ultimate cycle rule, whereas the remaining four constants, i.e., \( k_{1} , k_{2} , k_{3} , \,{\text{and}}\, k_{4} \), are chosen by trial. Therefore, there is further scope to achieve improved performance if we can find the most appropriate settings of these parameters. Keeping in mind this objective and the GA as a powerful optimization tool, we are motivated to develop the proposed GA-APID. In the present work, all the seven parameters (i.e., \( K_{P} , K_{i } , K_{d} , k_{1} , k_{2} , k_{3} , \,{\text{and}}\, k_{4} \)) are selected through optimization using binary coded GA. In the next section, we will describe the optimization process.

2.3 GA-Optimized APID

2.3.1 Objective Function of the Genetic Algorithm

In the present optimization problem, integral absolute error (IAE) is defined as the objective function or fitness function. The IAE is calculated as \( IAE = \int_{0}^{\infty } {\left| {e(t)} \right|{\text{d}}t} \).

2.3.2 Different Operations Used in GA

Encoding—Here, the population size is 10. We use 4 bits for each of the 7 variables (i.e., \( K_{P} , K_{i} ,K_{d} ,k_{1} , k_{2} , k_{3} , \,{\text{and}}\,k_{4} \)) in a particular solution. So each chromosome has 28 bits. Here, we consider the following ranges of variables: \( K_{P} , K_{i } , K_{d} \) are ± 20 % of their respective CPID, \( k_{1} [0 5], \quad k_{2 } [0 1], \quad k_{3} [0 5], \) and \( k_{4} [0 30] \).

Decoding—We convert encoded binary value of each variable to decimal value. Then, we bring this decimal value in its defined range to get the real value of the optimization variable. The following linear mapping rule is used for this purpose:

\( X_{i} = X_{i}^{L} + \frac{{X_{i}^{U} - X_{i}^{L} }}{{2^{n} - 1}} \times ({\text{decimal value of the }}i{\text{th variable in the binary string }}). \) where \( X_{i}^{L} \le X_{i} \le X_{i}^{U} ,\quad X_{i} = {\text{real value of the}}\,i{\text{th optimization variable}} \), \( X_{i}^{U} = {\text{upper limit of}}\,i{\text{th variable}} \), \( X_{i}^{L} = {\text{lower limit of}}\,i{\text{th variable}} \), and n = no. of bits used for each variable (here it is 4 bits). The decoded values thus obtained are used to simulate the closed-loop system response in MATLAB. This process is repeated for all the 10 solutions. From each closed-loop response, we calculate the value of the objective function, IAE.

Selection—We sort the values of IAE in ascending order and select the 50 % fittest roots (best solutions) from the top for the next stage, i.e., crossover.

Crossover—50 % chromosomes will go for crossover. These chromosomes are known as parent. The crossover operator produces two children for each parent pair. So here, we will get 50 % children after crossover. Therefore, after crossover, total population will again be 100 % = 50 % (parents) + 50 % (children).

Mutation—To avoid local optima, we mutate the strings. The mutation probability (percentage of bits in a population mutated in each iteration) is generally kept low for steady convergence (here, it is ≈1.78 %).

Convergence check—To ensure the convergence, we draw a curve between performance index (IAE) and number of iteration. Initially, the value of the objective function IAE goes on decreasing rapidly, but after some iteration, its value remains almost constant, which indicates the optimization is complete.

3 Results

For simulation study, we consider the following nonlinear (7) and integrating (8) systems with dead time (L):

$$ \frac{{{\text{d}}^{2} y}}{{{\text{d}}t^{2} }} + \frac{{{\text{d}}y}}{{{\text{d}}t}} + 0.2y^{2} = u\left( {t - L} \right) $$
(7)
$$ G_{p} \left( s \right) = \frac{{e^{ - Ls} }}{s(s + 1)} $$
(8)

Performance of our GA-APID is compared with conventional PID (CPID), GA-optimized conventional PID (GA-CPID), and the APID of [8]. For detailed comparison, in addition to the response characteristics, several performance indices, such as percentage overshoot (%OS), rise time (t r ), settling time (t s), integral absolute error (IAE), and integral time absolute error (ITAE), are calculated for each setting. Closed-loop response curves (Figs. 1 and 2) for different PID controllers are presented as follows: CPID (– - –), GA-CPID (– –), APID (- - -), and GA-APID (—).

Fig. 1
figure 1

a Responses of (7) with L = 0.3 s; b responses of (7) with L = 0.4 s

Fig. 2
figure 2

a Responses of (8) with L = 0.2 s; b responses of (8) with L = 0.3 s

Table 1 and Fig. 1 present the performance comparison of different controllers for the nonlinear process of (7) with L = 0.3 and 0.4 s. Figure 1a and 1b shows remarkably improved performance of our proposed GA-APID during both set point change and load disturbance applied at t = 20 s, and this fact is clearly established from the various indices of Table 1. Responses of the integrating system of (8) with two different values of dead time (L = 0.2 and 0.3 s) are shown in Fig. 2. Table 2 provides the detailed performance comparison. In this case also, we find similar performance of GA-APID, though not to the same extent as that of the previous example.

Table 1 Performance analysis of (7)
Table 2 Performance analysis of (8)

From the above performance analysis, we observe that like CPID, GA-CPID also fails to provide acceptable performance due to excessively large overshoot, possibly due to their linear control law, whereas our GA-optimized adaptive PID (GA-APID) can significantly improve the performance over APID, which justifies the usefulness of GA for further enhancement of APID [8].

4 Conclusion

In this work, we studied the performance of (GA-APID) controller for nonlinear and integrating systems with dead time under both set point change and load disturbance. Simulation results revealed that GA-APID is capable of providing remarkably improved servo as well as regulatory performance compared to even GA-CPID, and significantly overall improved performance in comparison with the recently reported APID.