Optimal Identiﬁcation and Metaheuristic PID Control of a Two-Tank System

: In the modern optimization context, this paper introduces an optimal PID-based control strategy for a two-tank installation, namely ASTANK2. The process model was identiﬁed by using raw and spline smoothed measured data, respectively. Two PID controller conﬁgurations, a standard (regular) one (PID-R) and a non-standard one (PID-N), were considered for each type of model, resulting in four regulators. The optimal tuning parameters of each regulator were obtained by a searching approach relying on a combination of two metaheuristics. Firstly, an improved version of the Hill Climbing algorithm was employed to comprehensively explore the searching space, aiming to ﬁnd fairly accurate tuning parameters. Secondly, an improved version of the Fireﬂy Algorithm was proposed to intensively reﬁne the search around the previously found optimal parameters. A comparative analysis between the four controllers was achieved in terms of performance and robustness. The simulation results showed that all optimal controllers yielded good performance in the presence of exogenous stochastic noise (bounded error tracking, setpoint tracking, reduced overshoot, short settling time). Robustness analysis is extensive and illustrates that the PID-R controllers are more robust to model uncertainties, whilst PID-N controllers are more robust to tracking staircase type references. after identiﬁcation with linear multi-MISO models. Two PID conﬁgurations were investigated, PID-R and PID-N, for each


Introduction
Although there is a variety of complex control strategies (such as model predictive, sliding mode, adaptive control, neural and fuzzy control [1]), in control engineering practice, the Proportional-Integral-Derivative (PID) control structures are the most widely used (over 95% from industrial applications [2]), owing to their simple structure, good stability [3], high reliability, reasonable closed loop performance and robustness [4][5][6].
The key problem in designing a PID controller ensuring these features is to tune the parameters accurately and efficiently. This is a challenging task when dealing with industrial processes that usually are modelled as multi-variable systems, with nonlinear dynamics and a large number of tunable variables [5]. Adjusting controller parameters in Multi-Input-Multi-Output (MIMO) process can become a difficult problem, especially in case of strong coupling of the output channels, for which Single-Input-Single-Output (SISO) decoupled loops might affect the performance [4].
Over the years, the PID tuning methods evolved from empirical (Ziegler-Nichols [7,8], Cohen-Coon) and analytical (internal model, pole placement, gain-phase margin [9]) to adaptive and optimization-based [5]. Unlike the empirical and analytical methods that provide weak or only satisfying performance, the optimization techniques applied to PID tuning yield good performance (disturbance rejection, set-point tracking) and robustness [4,10,11]. Therefore, in recent decades, the problem of designing an optimal PID controller that drives the systems into a desired behavior has increasingly captured the interest of the automatic control community. 2

of 41
To find the optimal PID controller, a multi-objective optimization problem with constraints has to be solved [4,[12][13][14]. Although there is no clear methodology to define the cost function to optimize [12] (usually, to minimize), most of them rely on the tracking error variation (both on transient and steady-state zones in signal dynamics). For example, root mean square error (RMSE) and integral RMSE are basic minimization criteria, from which different variants have been derived, such as integral absolute error, integral square error, integral time square error [1], integral time weighted square error and integral time absolute error [3,6]. By default, minimizing these criteria guarantees the trade-off between of a set of desired but conflicting control performance indexes (e.g., overshoot, settling time, rise time, decay ratio, steady-state error) [3,15,16]. Moreover, in real applications, since the process outputs are affected by environmental and/or measure disturbances (exogenous noises) that are stochastic in nature, the performance indexes cannot be computed by means of closed form expressions. In this case, building the multi-objective cost function is not an easy task. A compromise between opposite desired performances has to be found. Usually, a weighted sum criterion, with some experimentally set weights, is defined for this aim [12].
Two main classes of optimization techniques are mostly referred to in the literature for optimal PID controller design. The first one is represented by traditional (exact) optimization methods, being applied in context of linear/nonlinear control theory. The second one is concerned with metaheuristics.
Interestingly, some methods usually employing state space representations can be adapted to find optimal PID controllers. For example, one can mention the methods to synthesize Linear Quadratic Regulators of H-infinity controllers (with the help of the Linear Matrix Inequality optimization procedure) [11,17]. This approach has been successfully employed to design multivariable and multiloop PID controllers implemented either in continuous time [10,11] or in discrete time [18]. Nevertheless, this approach involves an elaborated mathematical foundation and complex algorithms [12]. Additionally, the proposed solutions seem to be insufficiently tested for noisy output signals.
Intensive research has been reported in the literature for tuning the parameters of PID or Fractional Order PID [1] controllers using metaheuristics in the genuine or improved versions. Additionally, numerous comparative studies highlight the superiority of a metaheuristic over the others [6,8,21,22,24] or over empirical tuning methods [2,9,16,21].
Most contributions deal with continuous time SISO PID controllers [6,9,12,13,15,21,22,24]. To the best of our knowledge, few contributions are concerned with designing optimal PID controllers for the real-world MIMO processes [4,9,20]. In this case, the plant constructive characteristics, the operating conditions and, moreover, the noises corrupting the useful signals impose significant restrictions. Moreover, real-world processes often fail to verify some sufficient hypotheses usually employed to prove robustness of designed controllers. This involves the necessity to test robustness for each controller. Generally, the control Electronics 2021, 10, 1101 3 of 41 strategy either is of the multi-loop PID type (decentralized) [4] or is based on decoupled SISO loops [3].
In this paper, two multivariable PID-based control strategies for a laboratory installation (ASTANK2 [28]) were designed and implemented starting from the identification models proposed in [29]. This resulted in two control strategies for each type of identification model. Based on the modern optimization context, to find the optimal PID parameters, a combination of two metaheuristics was proposed. The first is the Advanced Hill Climbing Algorithm (AHCA) [29], aiming to widely explore the search space and to find a sufficiently accurate optimal point. The second is an improved version of the Firefly Algorithm (FA) [19,30], employed to efficiently refine the exploitation around the previously found optimum point and to improve accuracy.
The article is structured as follows: Within the next section, the context of research development is described at length. Additionally, the optimization problem is formulated, and the methods to find optimal solutions, based on AHCA and improved FA metaheuristics, are proposed. Section 3 is entirely devoted to simulation results analysis. The investigations are directed towards three main directions: metaheuristics behavior, PID controllers performance for step references (such as bounded tracking error of step references, commands smoothness, short transient response, reduced overshoot, disturbance rejection) and robustness. The performance and robustness are comparatively analyzed. Four types of robustness are considered: to sudden change of references, to stochastic and constant disturbances, as well as to model uncertainties. To this aim, automatic procedures to define and detect fairly accurate robustness margins are introduced. The supplementary explanations are given in three appendices. Some concluding remarks, together with future developments are included into the last section of article.

Main Framework
The present study aims to design and implement a PID-based control strategy of a two-tank system, starting from the identification models determined in [29]. Actually, this research was already mentioned as possible future development in the end of that article.
The two-tank system, namely ASTANK2, is a laboratory installation, as illustrated in the functional diagram in Figure 1a. The plant is composed of two main tanks (#1 and #2) located above an auxiliary storage reservoir, a main inverted-driven pump P (acting in the [0, 10] V range), two auxiliary on-off pumps (P1, P2) and a flexible pipeline network handled by seven manual taps (R11, R12, R13, R21, R22, R23, R). By acting the taps, different configurations of the installation can be set, such as serial/cascaded tank connection or independent tanks. The A j q −1 = 1 + a 1,j q −1 + · · · + a na j ,j q −na j B j1 q −1 = q 1−nk j1 b 1,j1 q −1 + b 2,j1 q −2 · · · + b nb j1 ,j1 q −nb j1 B j2 q −1 = q 1−nk j2 b 1,j2 q −1 + b 2,j2 q −2 · · · + b nb j2 ,j2 q −nb j2 C j q −1 = 1 + c 1,j q −1 + · · · + c nc j ,j q −nc j D j q −1 = 1 + d 1,j q −1 + · · · + d nd j ,j q −nd j . (1) Two types of experimental data were employed to identify the BJ models: raw (directly acquired from the sensors) and smoothed. The smoothed data were built from the raw data by using a least squares optimal stochastic cubic spline model [29]. In both cases, the optimal structure of the BJ models was obtained by means of a metaheuristic that maximizes the Signal-to-Noise Ratio (SNR). Table 1 illustrates the structural indices of each optimal MISO subsystem for both raw and smoothed data (whilst nk j1 = nk j1 = 1), as well as the variances of both Gaussian white noises. The simulation results showed that when using smoothed data, the useful models have significantly fewer poles than when using raw data (see the first structural index, na). Such models are expected to yield better performance in closed loop than the models identified from raw data. In addition to the idmo of ASTANK2, a static input/output (I/O) map was built experimentally. This map includes quadruples (u 1,s , u 2,s , y 1,s , y 2,s ) with the following meaning: if the tanks #1 and #2 need to be filled with water at constant levels y 1,s and y 2,s , respectively, then, in the absence of perturbations, the corresponding constant voltages of e-v FC1 and FC2 are u 1,s and u 2,s , respectively. This map is extremely useful in setting nominal functioning points of installation, around of which the dynamics of nonlinear installation are almost linear. Hence, if some reference water levels y 1,ref and y 2,ref are prescribed, then, from the static map, one can obtain the necessary voltages u 1,ref and u 2,ref to be applied on each e-v. If y 1,ref and/or y 2,ref do not correspond to the static points in the map, then the voltages u 1,ref and u 2,ref are obtained by linear interpolation. The static map includes 49 combinations of static water levels (7 for each tank), between 7 cm and 11 cm. This range was preferred to avoid water turbulences in tanks, which may provide wrong acquired data. Moreover, the linear models above were identified for the same level range.
The static map also revealed some constructive limitations of the ASTANK2 plant, to be considered as constraints in the design of any controller. The most important of them are as follows: (a) the e-v voltages are saturated at 2 V and 10 V (below 2 V, the e-v does not react any more); (b) the water levels in any tank can vary between 0 cm and 15 cm only; (c) to avoid hard saturation of voltages on e-v, the absolute difference between level references, |y 1,ref − y 2,ref |, is bounded by 2 cm; (d) to protect e-v against premature failure, any voltage cannot jump from the current value to the next one with more than ±3 V.

Selected PID Controllers and Closed Loop Configurations
The proposed control strategy relies on PID type controllers. Since the ASTANK2 plant is a multivariable system, two PID-based control configurations were designed and investigated (among many possible others) in order to meet certain performances, such as bounded tracking error of step references, smooth commands, short transient response, reduced overshoot, disturbance rejection, robustness against reference shocks, external perturbations and model uncertainties. An extended analysis of performance indicators is made in Section 3, devoted to simulation results. Note, however, that the optimal PID controllers were synthesized by means of a cost function, referred to as fitness, defined in the next subsection. The fitness does not consider all possible performance indicators, especially because many of them are defined for systems with smooth I/O signals. Alternatively, ASTANK2 installation works with noisy signals, as shown later.
The two selected PID are described by the schemes in Figures 2 and 3. They are depicted for SISO continuous time systems to allow for easy understanding. In both configurations, H is the transfer function of system to regulate, u is the input (the command), y is the output, y r is the reference signal, ε ≡ y r − y is the tracking error, whereas K p > 0 (the proportionality constant), T i > 0 (the integral constant), T d ≥ 0 (the derivative constant) and N d > 0 (the derivative divisor) are parameters of the PID controller.   The derivative component is filtered by a first order system to yield physical realizability. The derivative divisor d N usually is an integer at least equal to 10 The fist PID structure, as seen in Figure 2, is a regular (standard) one, being abbreviated by PID-R. The characteristic transfer function of the PID-R controller, from tracking error ε to command u , is: The second structure, illustrated in Figure 3, is non-standard and was considered for its main feature; the derivative component of the command is furthermore filtered by the other two components (P, I), which results in quite smooth commands (with as few spikes as possible). The acronym for this structure is PID-N, and the corresponding transfer function is: Unlike PID-R, the transfer function of PID-N is of the MISO type, with two inputs: the reference signal r y and the system output y . This allows for working with two regulation blocks of the SISO type: one on feedback, H R (the "pure" regulator), and another one in front of the system, H S (the "sensitive" controller), providing the command u : The derivative component is filtered by a first order system to yield physical realizability. The derivative divisor N d usually is an integer at least equal to 10. Thus, the time constant of filter (T d /N d ) is small enough (i.e., its bandwidth is large enough) to minimally distort the derivative component of the command. Here and hereafter, N d was set to 10.
The fist PID structure, as seen in Figure 2, is a regular (standard) one, being abbreviated by PID-R. The characteristic transfer function of the PID-R controller, from tracking error ε to command u, is: The second structure, illustrated in Figure 3, is non-standard and was considered for its main feature; the derivative component of the command is furthermore filtered by the other two components (P, I), which results in quite smooth commands (with as few spikes as possible). The acronym for this structure is PID-N, and the corresponding transfer function is: Unlike PID-R, the transfer function of PID-N is of the MISO type, with two inputs: the reference signal y r and the system output y. This allows for working with two regulation blocks of the SISO type: one on feedback, H R (the "pure" regulator), and another one in front of the system, H S (the "sensitive" controller), providing the command u: Since the idmo of the ASTANK2 plant is discrete, it is suitable to discretize the PID regulators. A fairly accurate discretizing method is the bilinear Tustin method, in which s 1+z −1 , for some sampling period T s > 0. After discretization, the transfer functions (2) and (4) become: where Q, P, Q S , P S , Q R , P R are polynomials of the second degree at most. Their coefficients are expressed as follows, depending on the controller type: 3. PD controllers (T i = ∞): 4. PID controllers (general case): For ASTANK2 installations, the selected closed loop configurations are displayed in Figure 4, for the two PID structures. There are 4 characteristic polynomials for the configuration in Figure 4a: Q 1 , P 1 , Q 2 and P 2 . Additionally, in Figure 4b, 8 polynomials have to be set: Q S,1 , P S,1 , Q R,1 , P R,1 , Q S,2 , P S,2 , Q R,2 and P R,2 . Their coefficients are determined by the 6 parameters of continuous time PID controllers, namely K p,1 , T i,1 , T d,1 (for the first channel), and K p,2 , T i,2 , T d,2 (for the second channel). To compute them, Equations (6)-(10) can be employed. Each PID controller is fed with the output and/or the tracking error of one channel, but provides a command that applies to both MISO blocks.

Optimization Problem Statement and Cost Function Definition
One seeks to find the optimal parameters of the two PID controllers by optimizing a cost function. There is an extensive discussion in the literature concerning the choice of such a cost function. Most approaches rely on the RMSE applied on the tracking error and the norm of command. Both have to be minimized. Usually, they are combined in a cost function with some weights in their original or modified versions. Basically, the cost function defined in this article, referred to as fitness, also employs the RMSE, but with some refinements adapted to ASTANK2 dynamics.
Take, for example, the output signal y of Figure 5, tracking some reference y ref .
The global RMSE is then: where N ∈ N * is the number of acquired output samples. Evidently, RMSE is a cost function to minimize. Using definition (11) in the context of the ASTANK2 plant revealed several disadvantages. The most important comes from the fact the tracking error can have similar values on transient and steady-state zones, which can lead to output signals that oscillate too much around references, while RMSE takes relatively small values. Thus, separating the two zones is necessary. Since the output signal is corrupted by stochastic noises, no analytical formula can be employed to compute the transient time, N t . Therefore, N t has to be estimated by using statistical tools.

Optimization Problem Statement and Cost Function Definition
One seeks to find the optimal parameters of the two PID controllers by optimizing a cost function. There is an extensive discussion in the literature concerning the choice of such a cost function. Most approaches rely on the RMSE applied on the tracking error and the norm of command. Both have to be minimized. Usually, they are combined in a cost function with some weights in their original or modified versions. Basically, the cost function defined in this article, referred to as fitness, also employs the RMSE, but with some refinements adapted to ASTANK2 dynamics.
Take, for example, the output signal y of Figure 5, tracking some reference ref y . The global RMSE is then: where N * ∈  is the number of acquired output samples. Evidently, RMSE is a cost function to minimize. Using definition (11)   Let ε ≡ y − y ref be the tracking error. A key parameter in estimating N t is the backward moving standard deviation (std) of tracking error: where µ b ε is the backward moving average: For the signal in Figure 5, σ b ε is displayed in Figure 6a. At the right side end, the std of final tracking error is computed, whereas the larger values obtained at the left side end correspond to the first values of tracking error. Actually, the variation above was horizontally flipped, as, according to the computing formula, the first values of std are the ones that lie at the right side end. Normally, the transient time is given at the left entry of the flat variation in the graphic. However, finding this entry is rather difficult, because, as one can easily notice, any of the lags between 180 and 300 can play this role. Therefore, a penalty can be applied to the std, aiming to better isolate the transient time. Among several penalties known in the literature, the Akaike-Rissanen (A-R) criterion seems to be suitable to the variation above. The A-R penalized std is then: In Figure 6b, the penalized A-R std is overlapped on normalized signal and reference variations (in range [0, 2]). One can notice how easy it now is to find the transient time (the minimum point of the penalized std) and how well this value corresponds to the subjective selection performed by visual inspection of signal variation.
In the framework of the ASTANK2 plant, the two output signals N be the two transient times detected on output signals by using the procedure above.
For the transient zone, the fitness can be defined as follows: where 0 σ > is a factor that allows for scaling of the fitness. For example, the function Now, it is natural to consider that each fitness above has a weight proportional to the duration of its zone, which leads to the fitness of each output channel: Actually, the variation above was horizontally flipped, as, according to the computing formula, the first values of std are the ones that lie at the right side end. Normally, the transient time is given at the left entry of the flat variation in the graphic. However, finding this entry is rather difficult, because, as one can easily notice, any of the lags between 180 and 300 can play this role. Therefore, a penalty can be applied to the std, aiming to better isolate the transient time. Among several penalties known in the literature, the Akaike-Rissanen (A-R) criterion seems to be suitable to the variation above. The A-R penalized std is then: In Figure 6b, the penalized A-R std is overlapped on normalized signal and reference variations (in range [0, 2]). One can notice how easy it now is to find the transient time (the minimum point of the penalized std) and how well this value corresponds to the subjective selection performed by visual inspection of signal variation.
In the framework of the ASTANK2 plant, the two output signals y 1 and y 2 are tracking the references y 1,ref and y 2,ref , with errors ε y 1 and ε y 2 , respectively. To define the fitness, the two zones of each signal dynamics are processed separately. Let N t,1 and N t,2 be the two transient times detected on output signals by using the procedure above. For the transient zone, the fitness can be defined as follows: where σ > 0 is a factor that allows for scaling of the fitness. For example, the function 100/(1 + x) (on which the definition (15) relies) takes the value of 58.82% in x = 0.7; by using the scaling factor σ = 0.5, i.e., σ x instead of x, the value can be increased to 74.07%. Assuming both output signals have the same length, N, for the steady-state zone, the fitness is: ϕ y s,j ≡ 100 Now, it is natural to consider that each fitness above has a weight proportional to the duration of its zone, which leads to the fitness of each output channel: In the case of commands u 1 and u 2 , the references u 1,ref and u 2,ref are computed from the static map, depending on references y 1,ref and y 2,ref , as explained in the end of Section 2.2. Two zones in command variation are considered as well, with transient times M t,1 and M t,2 . Unlike for outputs, the two commands should be analyzed as a whole, since they are simultaneously applied to both MISO models that produce the outputs; therefore, on the transient zones, a unique fitness is defined by means of tracking errors ε u 1 and ε u 2 : Similarly, the fitness on the steady-state zone is: Finally, the fitness of both input channels is a weighted average of (18) and (19): The fitness definitions (17) and (20) can be combined into a weighted average, to obtain the overall fitness of PID-ASTANK2 scheme: where 2α + β = 1. For example, α = 0.35 and β = 0.3. The fitness of output signals has the same weight, as no channel is more important than the other. Obviously, the fitness is a cost function to maximize. Definition (21) has an important drawback. Theoretically, a certain value of fitness, Φ 0 , can be obtained by an infinity of triplets φ y 1 , φ y 2 , φ u 1,2 . Thus, one of the fitness functions from the triplet can be small, whilst, in compensation, the other two are large. Usually, this happens when φ u 1,2 is small (the commands having big oscillations) and φ y 1 and φ y 2 are large (tracking of references being very fast, with small overshoot or even without overshoot). This means the e-v are worked hard in order to fasten the reference tracking. Or, such a situation is to be avoided. It is more suitable to have smoother commands, even though the references are tracked slower and/or with some overshoot. To deal with this ambiguity, the characteristics of a closed loop system can be taken into consideration. For an ASTANK2 installation, simulations have shown that good fitness values are above 75% (for definition (21) and the scaling factor σ = 0.5). In this case, the difference between φ the last case is suitable for finding optimal controllers. In order to drive the search towards smooth commands and large overall fitness values, definition (21) can be refined: where α ∈ (0.25, 0.5). Practically, in definition (22), the former definition (21) is only employed to find optimal regulators with smooth commands-see the third case. For the other two cases, the term that produce fitness ambiguity is now multiplied by large weight (of at least 0.5), which results in smaller overall fitness values. The fitness depends on the 6 parameters of continuous time PID controllers. Obviously, it is not possible to visually observe the characteristics of fitness in this case. Nevertheless, 6 fitness surfaces can be drawn, by varying couples of parameters, while keeping constant the other four. Such surfaces are depicted in Figure 7.
wearing out or failure); (b) if, on the contrary, 12 2 φ ≥ (or, even better, if , then the commands are quite smooth, and the overall fitness can take large values. Obviously, the last case is suitable for finding optimal controllers. In order to drive the search towards smooth commands and large overall fitness values, definition (21) can be refined: . Practically, in definition (22), the former definition (21) is only employed to find optimal regulators with smooth commands-see the third case. For the other two cases, the term that produce fitness ambiguity is now multiplied by large weight (of at least 0.5), which results in smaller overall fitness values.
The fitness depends on the 6 parameters of continuous time PID controllers. Obviously, it is not possible to visually observe the characteristics of fitness in this case. Nevertheless, 6 fitness surfaces can be drawn, by varying couples of parameters, while keeping constant the other four. Such surfaces are depicted in Figure 7. The stochastic nature of the I/O measured data induces irregular variations, with many local extremes of fitness. A mutual characteristic of all surfaces above is the alternance between smooth slopes and fractal heights or ridges, where the maximum point lies. Solving the maximization problem becomes a difficult task that cannot be accomplished by using exact methods [31]. Instead, a suitable alternative to this problem is adopting evolutionary computing techniques, referred to as metaheuristics [19]. In this article, two metaheuristics are employed: one to widely explore the search space and another one to exploit some narrow zones where the maximum seems to exist. Figure 8 suggests the search strategy. For exploration, the AHCA from [29] was employed. Its main task is to find an optimum with fair accuracy, while exploring large zones of search space. Since in case of the 6 optimal PID parameters the upper bound is unknown and the fitness The stochastic nature of the I/O measured data induces irregular variations, with many local extremes of fitness. A mutual characteristic of all surfaces above is the alternance between smooth slopes and fractal heights or ridges, where the maximum point lies. Solving the maximization problem becomes a difficult task that cannot be accomplished by using exact methods [31]. Instead, a suitable alternative to this problem is adopting evolutionary computing techniques, referred to as metaheuristics [19]. In this article, two metaheuristics are employed: one to widely explore the search space and another one to exploit some narrow zones where the maximum seems to exist. Figure 8 suggests the search strategy. For exploration, the AHCA from [29] was employed. Its main task is to find an optimum with fair accuracy, while exploring large zones of search space. Since in case of the 6 optimal PID parameters the upper bound is unknown and the fitness exhibits smooth slopes where the gradient is not oscillating, AHCA fits very well. Once the climbers have found some optima, a vicinity around them can be isolated. Now the search can be performed within a bounded zone. To exploit this zone, the FA was selected (and improved), due to its simplicity and effectiveness. Whilst the climbers are strongly dependent on the local gradient of fitness, the fireflies can easily jump from one peak to another, regardless of the gradient (which, anyway, may oscillate too much-see the magnification on the left side of Figure 8). exhibits smooth slopes where the gradient is not oscillating, AHCA fits very well. Once the climbers have found some optima, a vicinity around them can be isolated. Now the search can be performed within a bounded zone. To exploit this zone, the FA was selected (and improved), due to its simplicity and effectiveness. Whilst the climbers are strongly dependent on the local gradient of fitness, the fireflies can easily jump from one peak to another, regardless of the gradient (which, anyway, may oscillate too much-see the magnification on the left side of Figure 8). It has to be outlined that both the exploration and the exploitation phases are performed by varying all 6 parameters (and not only couples of them, as Figure 7 might suggest). The improved FA (IFA) is described next.

Improved Firefly Algorithm
The FA [30,19] was inspired by the principle of mutual attraction between insects and the phenomenon of natural attenuation of light with distance. The fireflies are small flying beetles, usually luminescent at twilight, that produce a cold light to attract mates or prey. They are grouped into swarms and, apparently, fly at random. In its flight, a firefly is tempted to fly towards other shinier fireflies in the swarm, being attracted by the light signals the latter are emitting. In this way, the shinier fireflies become targets for the current one. The strongest target is the shiniest firefly, which attracts the entire swarm. Thus, the swarm is more and more grouped around the firefly emitting the most intense light. Nevertheless, the shiniest firefly flies as well and their light can fade. In this case, another firefly becomes the shiniest. Even though the swarm was grouped around a firefly, it can move away towards another shinier firefly. In this way, there is a good balance between the convergence and the diversity of firefly swarms. Figure 9 illustrates a swarm of fireflies and its evolution from current to next positions. The current firefly is colored in blue, and the shiniest firefly is in red, whereas the other fireflies are in orange (the shinier ones) or in yellow (the less shining ones).  It has to be outlined that both the exploration and the exploitation phases are performed by varying all 6 parameters (and not only couples of them, as Figure 7 might suggest). The improved FA (IFA) is described next.

Improved Firefly Algorithm
The FA [19,30] was inspired by the principle of mutual attraction between insects and the phenomenon of natural attenuation of light with distance. The fireflies are small flying beetles, usually luminescent at twilight, that produce a cold light to attract mates or prey. They are grouped into swarms and, apparently, fly at random. In its flight, a firefly is tempted to fly towards other shinier fireflies in the swarm, being attracted by the light signals the latter are emitting. In this way, the shinier fireflies become targets for the current one. The strongest target is the shiniest firefly, which attracts the entire swarm. Thus, the swarm is more and more grouped around the firefly emitting the most intense light. Nevertheless, the shiniest firefly flies as well and their light can fade. In this case, another firefly becomes the shiniest. Even though the swarm was grouped around a firefly, it can move away towards another shinier firefly. In this way, there is a good balance between the convergence and the diversity of firefly swarms. Figure 9 illustrates a swarm of fireflies and its evolution from current to next positions. The current firefly is colored in blue, and the shiniest firefly is in red, whereas the other fireflies are in orange (the shinier ones) or in yellow (the less shining ones). exhibits smooth slopes where the gradient is not oscillating, AHCA fits very well. Once the climbers have found some optima, a vicinity around them can be isolated. Now the search can be performed within a bounded zone. To exploit this zone, the FA was selected (and improved), due to its simplicity and effectiveness. Whilst the climbers are strongly dependent on the local gradient of fitness, the fireflies can easily jump from one peak to another, regardless of the gradient (which, anyway, may oscillate too much-see the magnification on the left side of Figure 8). It has to be outlined that both the exploration and the exploitation phases are performed by varying all 6 parameters (and not only couples of them, as Figure 7 might suggest). The improved FA (IFA) is described next.

Improved Firefly Algorithm
The FA [30,19] was inspired by the principle of mutual attraction between insects and the phenomenon of natural attenuation of light with distance. The fireflies are small flying beetles, usually luminescent at twilight, that produce a cold light to attract mates or prey. They are grouped into swarms and, apparently, fly at random. In its flight, a firefly is tempted to fly towards other shinier fireflies in the swarm, being attracted by the light signals the latter are emitting. In this way, the shinier fireflies become targets for the current one. The strongest target is the shiniest firefly, which attracts the entire swarm. Thus, the swarm is more and more grouped around the firefly emitting the most intense light. Nevertheless, the shiniest firefly flies as well and their light can fade. In this case, another firefly becomes the shiniest. Even though the swarm was grouped around a firefly, it can move away towards another shinier firefly. In this way, there is a good balance between the convergence and the diversity of firefly swarms. Figure 9 illustrates a swarm of fireflies and its evolution from current to next positions. The current firefly is colored in blue, and the shiniest firefly is in red, whereas the other fireflies are in orange (the shinier ones) or in yellow (the less shining ones).  The perceived light attractiveness depends on the brilliance of the casting beetle. The brighter a firefly, the more fireflies it attracts. The current firefly is motivated to fly towards the shiniest one along the arrow in red (see the left side of Figure 9). Nevertheless, while tracking the target, our firefly can perceive lights from other fireflies, especially from the shinier ones, which constitute attraction points as well. Hence, the other fireflies in the swarm, especially the ones in orange, could disturb the flight along the direction colored in orange as well. By composing the two directions (in red and in orange), the final direction, in blue, is taken by the current firefly. Meanwhile, the swarm moves to new positions and changes light intensities, as suggested in the right side of Figure 9. It is possible that the shiniest firefly decreases its light intensity, whilst another firefly becomes the shiniest. All fireflies can change not only in position, but in light intensity as well. The swarm permanently tries to group around the shiniest firefly, but this becomes possible only if no other firefly becomes shinier. Otherwise, the swarm can oscillate between several positions, until a best position (of maximum light intensity) is found, eventually.
This behavior can be simulated by means of a numerical algorithm based on the following recursive equation expressing how the position of an artificial firefly changes: The notations in Equation (23) are explained next. Assume the swarm includes P ∈ N * fireflies. Each firefly p ∈ 1, P takes a position x k p at instant k ∈ N, into the search space S ⊆ R nx , where nx ∈ N * is the length of position vector. (For example, in the case of PID-ASTANK2 configurations, nx = 6.) The search space can be specified as a cartesian product of compact intervals: (24) To compute the next position, the firefly will take (x k+1 p ), and the current position is affected by two disturbances: one produced by the shinier fireflies than the current one (including the shiniest one), referred to as diversity disturbance, and another one generated by the entire swarm-the convergence disturbance. The sum term in Equation (23) stands for the diversity disturbance, where all the shinier fireflies than the current one are grouped into the set S p . This disturbance actually contributes to swarm diversity and is expressed as a linear combination of attraction directions from the current firefly to its shinier mates, . Thus, the current firefly is not exclusively attracted by the shiniest firefly, but by the other shinier fireflies as well. This phenomenon keeps the diversity of fireflies' swarms to some extent. The corresponding coefficients, β k p,q q∈S p , are light intensities perceived by the current firefly from the shinier ones. According to Biology, each perceived intensity can be computed as follows: where I 0 is a biological constant standing for the maximum light intensity a firefly can produce (usually set to unit) and D(S) is the diameter of search space, defined by: Definition (25) shows that the perceived light intensity is higher if the fireflies are closer to each other. However, the current firefly also can be strongly attracted by a distant firefly radiating an intense light. This case is not taken into consideration in definition (25). Therefore, a first improvement consists of including the radiated light intensity into the perceived intensity formula. Let Φ k p be the light intensity radiated by firefly p ∈ 1, P at instant k ∈ N. Then, the intensity of light the other fireflies perceive should increase as Φ k p increases and the distance from the current firefly decreases. A second improvement concerns the diameter. Normally, the perceived intensity should adapt itself to the space the entire swarm of fireflies is taking at current instant, denoted by S k . Obviously, S k ⊆ S and then: With the two improvements above, definition (25) can be replaced by: where, evidently, Φ k q ≥ Φ k p , ∀ q ∈ S p . The last term of Equation (23) expresses the second disturbance, generated by the entire swarm at each instant k ∈ N. The disturbance intensity is given by the scalar factor η k , uniformly selected at random in the interval [−1, +1]. Its sign encodes whether the disturbance is direct (+1) or opposite (-1). The other factor, ξ k (S) ∈ R nx , stands for the absolute disturbance vector generated by the swarm. According to biologists, each component of this vector, ξ k i (S) (i ∈ 1, nx), is generated at random as well, but not uniformly. This time, the random numbers generator uses Lévy's (probability) distribution: where λ ∈ [0, 3] is preset. Usually, λ = 1.5. To generate numbers with prescribed probability distribution, Baker's algorithms can be implemented and run [19,32]. The Lévy's distribution is assigned to each component of search space, i.e., to each interval [x min,i , , which explains why the vector ξ k depends on the search space S. However, during the run of IFA, this definition revealed two caveats: (a) Lévy's distribution over [x min,i , x max,i ] yields generating the most values in the vicinity of x min,i , although there is no reason the fireflies should be directed to the lower bound of the search space; and (b) as the swarm concentrates around a shiniest firefly, the disturbing direction becomes unrealistic, because the vector ξ k does not belong anymore to the space the fireflies are moving into, i.e., S k . Therefore, two more improvements of basic FA were made: (a) Lévy's distribution is centered around the light center of the swarm; and (b) instead of using S to generate the components of vector ξ k , the current search space S k is employed. The light center can be determined by using the radiated light of each firefly: Now Lévy's distribution is defined as follows, for each component i ∈ 1, nx: Hence, in definition (23), the factor ξ k (S) is replaced by ξ k S k . The product η k ξ k S k is a disturbance that ensures the swarm convergence to some extent.
After being computed, the next position x k+1 p may need to be made viable. This means bringing back all outsider components of x k+1 p inside the corresponding min-max interval, according to the initial search space definition (24). Assume x k+1 p,i / ∈ [x min,i , x max,i ] for some i ∈ 1, nx. Then, the integer below can be computed: Consequently, x k+1 p,i can be replaced by the new component below: It is easy to prove that the new component belongs now to the corresponding min-max interval.
The notation for radiated light intensity is not selected at random. In fact, Φ is the cost function to maximize among the fireflies' swarm during the search (and will stand for fitness, in case of PID controllers optimization).
The numerical procedure of IFA (the Algorithm 1) is summarized next. • optimal value of Φ and position of the shiniest firefly; • performance parameters of IFA: total number of iterations, surviving counter.
As in cases of many metaheuristics, there are no theoretical results proving the IFA is convergent. Therefore, to terminate the numerical procedure, the stop tests of the main loop in Algorithm 1 are necessary. Additionally, the position of the current shiniest firefly changes only because of the convergence disturbance, and its light can fade.

Simulations Setting
The simulations were performed within the MATLAB-SIMULINK™ environment. The two closed loop configurations of Figure 4 were implemented as SIMULINK models, as depicted in Figures 10 and 11. Unlike the schemes in Figure 4, the SIMULINK models include the characteristic limitations of ASTANK2 plant (enumerated in the end of Section 2.1). The output references are of two types: a step for optimal PID design, and a staircase for robustness analysis. In Figures 10 and 11, the step references are set as follows: They can be switched, as displayed in the left side of both schemes (see the block sw). Additionally, the sampling period was set to unit(T s = 1 s) in all simulations. Since ASTANK2 has a slow dynamic, the simulation duration was set to T = 1000T s = 1000 s for step references. Longer durations are employed in cases of other references types.
In the case of staircase references, the input of each scheme is changed to the one in Figure 12. The staircases can be designed by the user within an M-script with two variables: one giving the height of each step (stair), and another one setting the time instants of each step (time_steps). The staircases have to comply with ASTANK2 limitations of outputs (no more than 2 cm difference between steps on different channels).     To the right side of schemes in Figures 10 and 11, the characteristic static map of the ASTANK2 plant with linear interpolation is implemented (see the block u_ref). Thus, the command references are available during the simulation, depending on output references  Table 1, where the estimations resulted after linear identification of the ASTANK 2 plant.
Many signals are displayed in both schemes. Nevertheless, when simulation is em- Additionally, the staircases can be scaled in a suitable interval [Y min , Y max ] (specified by means of block Y_minmax). By default, the scaling interval is [7,11] cm.
To the right side of schemes in Figures 10 and 11, the characteristic static map of the ASTANK2 plant with linear interpolation is implemented (see the block u_ref). Thus, the command references are available during the simulation, depending on output references y 1,ref and y 2,ref .
The Gaussian white noises are generated by means of corresponding blocks on each channel. Their variances are set according to the last column of Table 1, where the estimations resulted after linear identification of the ASTANK 2 plant.
Many signals are displayed in both schemes. Nevertheless, when simulation is employed to evaluate the regulators fitness, signals plotting is suppressed in order to speed up the search.
For the two metaheuristics (AHCA and IFA), the configuring parameters are listed in Table 2, where, beside P, K, S, I 0 , λ, the following notations are used: M is the maximum number of mutations per climber, δ is the climber's altitude relative accuracy, P e is the number of elite climbers (see [29] for details of AHCA), ρ min is the relative lower bound of the search space, ρ max is the relative upper bound of the search space. The last two notations are useful to confine the search space for IFA. Assume AHCA provided a sufficiently accurate optimal solution, x AHCA o . Then the boundaries of search space for fireflies are:

Metaheuristic Optimization Results
Before running AHCA and IFA, the PID-R regulators were tuned by means of the well-known Ziegler-Nichols empirical method [7]. The resulting parameters of PID-R controllers are listed in Table 3 (where K u is the critical gain that pushes the system to stability limit, with oscillations of period T u ). After simulation with step references, the I/O signals of PID-R controllers are displayed in Figure 13 (<raw> idmo) Figure 14 (<spline> idmo). Channels 1 and 2 are represented on top and at bottom of figures, respectively. Additionally, variation of commands and outputs are depicted to the left side and right side of figures, respectively. The commands are represented in blue (left side) and the outputs in red (right side). All references are tracked in both cases, but the I/O signals are smoother for <spline> idmo than for <raw> idmo. This is proven by the corresponding fitness values in Table 3 as well (73.12% versus 70.12%). It is well known that Ziegler-Nichols method usually yields oscillating commands, but the variations for <raw> idmo are unacceptable ( Figure 13). In the case of <spline> idmo (Figure 14), while the first command can be marginally accepted, the second command is still too variable. The results after running the two metaheuristics are now analyzed. In Table 4, some running performances of AHCA and IFA are given, such as the final number of iterations, k; the surviving counter of best climber/firefly, ns; the total number of mutations applied to climbers, m; the total number of fitness evaluations n Φ ; and the optimal fitness, Φ o . mands, but the variations for <raw> idmo are unacceptable ( Figure 13). In the case of <spline> idmo (Figure 14), while the first command can be marginally accepted, the second command is still too variable. The results after running the two metaheuristics are now analyzed. In Table 4, some running performances of AHCA and IFA are given, such as the final number of iterations, k ; the surviving counter of best climber/firefly, ns ; the total number of mutations applied to climbers, m ; the total number of fitness evaluations n Φ ; and the optimal fitness, o Φ .   The algorithms were run on a regular computer at current technological levels. Usually, the exploration by AHCA takes about 20 min, whereas the exploitation by IFA is about 90 min long. (The optimal PID-N controllers were found to be a few minutes faster than the optimal PID-R controllers.) The difference between the two durations is due to  The algorithms were run on a regular computer at current technological levels. Usually, the exploration by AHCA takes about 20 min, whereas the exploitation by IFA is about 90 min long. (The optimal PID-N controllers were found to be a few minutes faster than the optimal PID-R controllers.) The difference between the two durations is due to the fact that the climbers are only employed to find the most promising zone where the optimum could exist. Inside that zone, as the fitness rather exhibits fractal variations, the climbers cannot use their compasses based on local gradient evaluation and, therefore, AHCA usually oscillates. Fireflies do not use the gradient to fly, but IFA is not as efficient as AHCA. Consequently, the configuring parameters were set to allow longer search durations and, thus, to increase the optimal point accuracy. The number of fitness evaluations, n Φ , is much higher for IFA than for AHCA, which means the search for optimum is more intense in the case of fireflies than in the case of climbers. One can see that both algorithms complete the search after the best optimal climber or firefly has survived at maximum (see parameters S and counters ns in Tables 2 and 4, respectively) and not after maximally iterating the positions updating (see parameters K and counters k, respectively). There is one exception; the optimal PID-R for <spline> idmo was found with a maximum number of iterations (100), but the surviving factor was almost maximum too (29 instead of 30). For AHCA, an interesting parameter is m, with values starting from 4192. Mutations are applied to blocked climbers on local peaks, for which the fitness cannot increase by using the gradient. The purpose of mutation is to throw the climber on another slope of fitness hyper-surface in the hope that, from there, it can continue to climb. Good exploration of search space is thus ensured. This short analysis proves that, very likely, the best local optimum was found by combining the two metaheuristics.
Looking again at Table 4, one can see that the optimal fitness of climbers is smaller than the optimal fitness of fireflies. Nevertheless, the difference is not so big. Furthermore, this difference can barely be observed when comparing the corresponding I/O signals in Figures 15-18. (The signals are arranged exactly like in the case of Figures 13 and 14.) Additionally, the optimal PID controllers for <spline> idmo are slightly fitter than the optimal ones for <raw> idmo, as expected. However, one can notice that both PID-N and PID-R controllers exhibit almost the same fitness for the same idmo, which does not meet the initial expectations. Normally, the commands the PID-N controller provides should have been smoother than the commands of the PID-R controller. Or, the command smoothness is almost the same for both PID controllers. One can notice, though, a slight improvement for PID-N commands in the case of <spline> idmo.
The parameters of optimal PID controllers found by IFA are listed in Table 5. The optimal PID-R parameters are very different from the ones in Table 3, especially in the case of derivative time constant (T d ). Not only the parameters are different, but the I/O signals are as well, as revealed by Figures 15-18. Interestingly, the best PID controller found (PID-N for <spline> idmo) works with a PI rule on the first channel (see the null T d,1 in Table 5), whilst the derivative time constant on the second channel is at least 70 times larger than the other derivative time constants on that channel. Simulations proved that the command on channel 2 mastered very well both output channels, which, in turn, were less sensitive to the variations of command on channel 1.   Moreover, as seen in Figures 15 and 17, corresponding to <raw> idmo, the command 2 u exhibits saturation of e-v voltage at 10 V on the first 100 s of transient zone. Though this may have speeded up the references tracking on output channels, saturating the voltages at their upper limit is to be avoided in order to protect the e-v. Fortunately, saturation does not occur in the case of <spline> idmo (Figures 16 and 18), which constitute an important advantage of this model.

PID Identification Model
Another interesting characteristic concerns the outputs. In all variations above, the output signals are like step responses of a second order system, corrupted by some noises. this may have speeded up the references tracking on output channels, saturating the voltages at their upper limit is to be avoided in order to protect the e-v. Fortunately, saturation does not occur in the case of <spline> idmo (Figures 16 and 18), which constitute an important advantage of this model. Another interesting characteristic concerns the outputs. In all variations above, the output signals are like step responses of a second order system, corrupted by some noises.  This allows some supplementary performance parameters (beside the fitness) to be estimated, provided that the noise can be filtered. Such a filter can be designed by identification of each noisy output with the ideal step response of order II.
In Appendix A, the identification method is briefly described. Let ( , , ) ,II j y ζ ω τ ) be the identified step response of order II corresponding to output j . Then, after performing identification on outputs in Figures 15-18, the matched step responses of order II are depicted in Figure 19.  Moreover, as seen in Figures 15 and 17, corresponding to <raw> idmo, the command u 2 exhibits saturation of e-v voltage at 10 V on the first 100 s of transient zone. Though this may have speeded up the references tracking on output channels, saturating the voltages at their upper limit is to be avoided in order to protect the e-v. Fortunately, saturation does not occur in the case of <spline> idmo (Figures 16 and 18), which constitute an important advantage of this model.

PID
Another interesting characteristic concerns the outputs. In all variations above, the output signals are like step responses of a second order system, corrupted by some noises.
This allows some supplementary performance parameters (beside the fitness) to be estimated, provided that the noise can be filtered. Such a filter can be designed by identification of each noisy output with the ideal step response of order II.
In Appendix A, the identification method is briefly described. Let y (ζ,ω,τ) j,II ) be the identified step response of order II corresponding to output y j (j ∈ {1, 2}. Then, after performing identification on outputs in Figures 15-18, the matched step responses of order II are depicted in Figure 19. This allows some supplementary performance parameters (beside the fitness) to be estimated, provided that the noise can be filtered. Such a filter can be designed by identification of each noisy output with the ideal step response of order II.
In Appendix A, the identification method is briefly described. Let ( , , ) ,II j y ζ ω τ ) be the identified step response of order II corresponding to output j . Then, after performing identification on outputs in Figures 15-18, the matched step responses of order II are depicted in Figure 19. Starting from ( , , ) ,II j y ζ ω τ ( {1, 2} j ∈ ), several specific performances can be evaluated. In Appendix B, the most important performance parameters are defined. Table 6 encompasses the values of performance parameters corresponding to signals in Figure 19. Table 6. Optimal PID controllers performance parameters related to second order step response. Starting from y (ζ,ω,τ) j,II (j ∈ {1, 2}), several specific performances can be evaluated. In Appendix B, the most important performance parameters are defined. Table 6 encompasses the values of performance parameters corresponding to signals in Figure 19. The damping factor ζ in the table shows that all outputs are under damped, although the relative overshoot RO is noticeably bigger on the second channel compared to the first channel (where this parameter is very small). Nevertheless, the maximum RO is less than 10% of reference for all controllers, which constitutes a good performance. The natural pulsation ω is slightly bigger on the second channel. This property is confirmed by the parameter T u in Table 3 (smaller for the second channel) and the small, damped oscillations of y 2 in Figures 15-19. On channel 1, an intrinsic delay τ between 9 and 11 s was detected, which corresponds to variations of y 1 in Figures 15-19. The controllers working with <spline> idmo seem to be slightly faster than the ones synthesized for <raw> idmo, not only in terms of intrinsic delay, but also when looking at the other time parameters: shorter time delay τ d , rise time τ r and settling time τ s . However, PID-N controllers are not necessarily better than PID-R controllers, according to the parameters in Table 6. In the last column of the table, the estimated transient time N t is shown for each controller. This parameter is compared with the settling time, τ s , to validate the estimation method described in Section 2.3 One can notice that the approximation is fair. Nevertheless, recall that τ s is computed for a clearly specified tolerance tube around the reference in the steady-state zone (set to ±5%), whereas this specification is not employed in estimation of N t .

Robustness Analysis
Controllers can or cannot be robust in several respects. Four types of robustness are investigated within this subsection: (a) against sudden change of references; (b) against constant perturbations on outputs; (c) against stochastic perturbations on outputs; and (d) against idmo uncertainties (stochastic variations of model parameters). The reason such an analysis is developed hereafter is twofold. On one hand, very often, installations like ASTANK2 do not comply with the theoretical hypotheses founding the very sound robustness theory devised in the literature. The hypotheses regarding the nature and power of exogenous noises usually are violated. Since such hypotheses only are sufficient (but not necessary) conditions of robustness, the fact they are not verified does not mean the controller cannot be robust to some extent. So, robustness has to be tested in order to estimate robustness margins without employing theoretical results in this aim. On the other hand, robustness analysis of such a real-world plant (especially the robustness against model uncertainties) are very useful in practice. Knowing the robustness margins, even with satisfactory accuracy, can help in predicting the mean time before failure or the right instant to act in correcting defects (not too soon, not too late). This may result in a better maintenance of installation, with optimally small costs.

Robustness against Sudden Change of References
The Simulink model of Figures 10 and 11 with inputs of Figure 12 were employed to test this type of robustness. More specifically, the step references were replaced by staircases. The performance of each PID controller was evaluated by means of fitness. Unlike fitness in (22), in this case, the fitness was computed according to the procedure described in Appendix C. Several staircase references were tested. Overall, if the references steps comply with ASTANK2 limitations, in all tested scenarios, the outputs succeed to track them, which means this type of robustness is accomplished (although with different fitness values, for different references).
To illustrate the tracking performance, the matrices of variations in Figures 20 and 21 were built. In Figure 21, the results correspond to switched staircase references of Figure 20. Additionally, each row of matrix exhibits I/O signals of a controller, as specified on the graphical windows. (Many of the following figures have the same structure.) The best fitness values are obtained by the PID-N controller with <raw> idmo (77.84% and 76.96%), for which the commands better follow their static references and the outputs better track the specified references. The second best is the PID-R controller with <spline> idmo (75.18% and 74.99%). Additionally, one can easily see that channel 1 is less robust than channel 2, where the references are sensibly better tracked. This phenomenon probably is due to the fact the first tank of installation, with a slanted face, induces stronger dynamic non linearities than the second tank (a regular parallelepiped). Hence, the first linear MISO idmo is not as accurate as the second MISO idmo when approximating the nonlinearities of the ASTANK2 plant.

Robustness against Constant Perturbations on Outputs
Two constant perturbations were artificially added to each output, while keeping constant the reference: the first one above the reference and the second one, later, beneath the reference. Additionally, the perturbations were not synchronized between channels. The simulation results are displayed by the matrix of variations in Figure 22. All four controllers succeeded in rejecting the constant perturbations, but no one had sensibly better fitness. The commands were slightly smoother in the case of <spline> idmo.

Robustness against Stochastic Perturbations on Outputs
The previous simulations were performed by using two sources of Gaussian white noise with variances estimated after ASTANK2 identification (see the last column of Table 1).
To investigate controllers robustness against stochastic perturbations, the variances of noises generators were varied in range 0, λ 2 max , where λ 2 max was experimentally set to 1 (after few simulations). The problem is how to define and estimate the robustness margin. The fitness can be used for this aim. Obviously, the fitness decreases when noises increase in power, as the variation in Figure 23a illustrates. Here, the horizontal index points to the noise variance. In this example, N = 31 noise variance levels are employed within the interval [0, 1]. Thus, if the index is set to n ∈ 1, N, then the two noises have the same variance λ 2 1,n = λ 2 2,n .  The problem with fitness is that, apparently, the robustness margin can only be set by subjective means while visually inspecting the I/O signals of the plant. Clearly, the marginal behavior of a closed loop system is expressed by outputs that oscillate around references with approximately constant amplitudes. However, there is a fine line between various oscillating behaviors. Hence, setting the right robustness margin becomes a difficult task. To remove the subjectiveness, a supplementary parameter can be employed. Consider the tracking errors on the steady-state zone for all I/O signals (commands and outputs). Evidently, when the noise variance increases, the std of each tracking error increases as well.
Therefore, a global std on the steady-state zone can be computed as follows (with natural notations related to I/O signals): where the weights α and β are the ones employed to compute fitness (see definition (21)), e.g. α = 0.35 and β = 0.3. Such a global std varies as shown in Figure 23b. The variation is increasing with the noise index, as expected.  well. Nevertheless, it is possible that the closed loop system remains at stability limit even outside the robustness zone. After simulations with step references and variable noise variances, the results in Figure 24 were obtained. In fact, in the figure, the noise variance was replaced by the estimated SNR, on each channel, computed on the steady-state zone of outputs. The fitness surfaces in Figure 24 are split in two regions by a horizontal plane determined after maximization of cost function J . One considers that all points on the surface above the plane are due to the robust behavior of controller. The height of each separation plan is listed in Table 7, together with the corresponding marginal SNR. The lower the separation plan height, the larger the robustness zone of the controller. One can notice that the PID-N Since the fitness decreases and the variance increases, a natural way to quantify the robustness margin is to normalize both variations and to define a cost function by taking their product. More specifically, one can define J ≡ Φ norm σ ssz norm , where:  Figure 23c shows the variation of cost function J. The maximum point, n max , can be set to the index of robustness margin. The robustness margin is then defined as {n max , Φ[n max ]}. If the exogenous noises lead to fitness values at least equal to Φ[n max ], then one considers the controller is robust. Otherwise, the controller is not performing well. Nevertheless, it is possible that the closed loop system remains at stability limit even outside the robustness zone.
After simulations with step references and variable noise variances, the results in Figure 24 were obtained. In fact, in the figure, the noise variance was replaced by the estimated SNR, on each channel, computed on the steady-state zone of outputs. The fitness surfaces in Figure 24 are split in two regions by a horizontal plane determined after maximization of cost function J. One considers that all points on the surface above the plane are due to the robust behavior of controller. The height of each separation plan is listed in Table 7, together with the corresponding marginal SNR. The lower the separation plan height, the larger the robustness zone of the controller. One can notice that the PID-N controller for <spline> idmo is slightly more robust than the other three controllers. Additionally, every controller can be robust if one noise is strong while the other one is weak. controller for <spline> idmo is slightly more robust than the other three controllers. Additionally, every controller can be robust if one noise is strong while the other one is weak.  Another remark concerns the robustness surface: large fitness values cover a larger area for <raw> idmo than for <spline> idmo. This means that, in general, the stochastic noises are better rejected by PID-R and PID-N controllers determined for <raw> idmo than by the other two controllers.
The I/O signals at the robustness margin are shown by the matrix of variations in Figure 25. Such behavior is considered as robust. Many other situations with similar I/O variations exist, but the robustness is decided by fitness margins in Table 7.

Robustness Against Identification Model Uncertainties
The uncertainties are induced by changing the coefficients of idmo polynomials. Assume P is any of the model polynomials, expressed as: Then, the coefficient i The problem is to define and determine the robustness margin of a PID regulator, while working with uncertain model polynomials and variable uncertainty powers. Obviously, the PID performance is expressed in terms of fitness. Nevertheless, to solve the problem of uncertainty margin detection, the fitness needs to be put into correspondence with the reference tracking property. One can consider that the uncertainty margin is  Another remark concerns the robustness surface: large fitness values cover a larger area for <raw> idmo than for <spline> idmo. This means that, in general, the stochastic noises are better rejected by PID-R and PID-N controllers determined for <raw> idmo than by the other two controllers.
The I/O signals at the robustness margin are shown by the matrix of variations in Figure 25. Such behavior is considered as robust. Many other situations with similar I/O variations exist, but the robustness is decided by fitness margins in Table 7.

Robustness against Identification Model Uncertainties
The uncertainties are induced by changing the coefficients of idmo polynomials. Assume P is any of the model polynomials, expressed as: Then, the coefficient p i (i ∈ 1, np) is replaced by a (uniform) random value in the interval [1 − η, 1 + η]p i , if p i = 0 or in the interval [−η, +η], if p i = 0. The parameter η ∈ [0, 1] is referred to as uncertainty power.  The problem is to define and determine the robustness margin of a PID regulator, while working with uncertain model polynomials and variable uncertainty powers. Obviously, the PID performance is expressed in terms of fitness. Nevertheless, to solve the problem of uncertainty margin detection, the fitness needs to be put into correspondence with the reference tracking property. One can consider that the uncertainty margin is reached as soon as the closed loop system is unable to track at least one output reference signal. In this case, the polynomials are affected by uncertainties of some power, whilst the closed loop system exhibits a marginal fitness. Thus, the uncertainty margin can be defined by the smallest fitness value for which the closed loop system still manages to track all given references. This lower limit also reveals the marginal (maximal) values of uncertainty power. For example, the robustness margin of 75% (in terms of fitness) can be obtained by affecting the plant model with uncertainties of estimated marginal (maximal) power of 10% (η ∈ [0, 1]). Increasing the uncertainty power leads to the incapacity of the closed loop system to track references.
In the following, an example is given. The output y 1 of ASTANK2 installation is acquired after applying uncertainties on the numerator and denominator of the useful transfer function in MISO 1 idmo (see Figure 1b again). The uncertainties were generated at random, by using the uniform pseudo-random generator of MATLAB (rand function).
The uncertainties can affect the 3 polynomials of useful transfer function, namely: A 1 , B 1,1 and B 1,2 . As Equation (1) shows, the first coefficient of polynomials is normalized: 1 for A 1 and 0 for B 1,1 , B 1,2 . Uncertainties cannot affect this coefficient. By inducing uncertainties on the remaining coefficients, a fitness surface can be generated, depending on two uncertainty powers: one affecting the denominator A 1 and another one modifying the numerators B 1,1 , B 1,2 . The ASTANK2 idmo usually have polynomials with many coefficients (up to 50, in some cases). Trying to test all combinations of uncertainty applied on model coefficients is unrealistic. Therefore, the Monte-Carlo method can be employed to estimate the uncertainty margin. Hence, 100 uncertainty cases are uniformly generated at random on each axis. The resulted fitness surface looks like that in the left side of Figure 26. The estimated fitness margin is represented by the horizontal plane intersecting the fitness surface. All points above the plane correspond to the robust behavior of the closed loop system. The other fitness values, beneath the plane, rather reveal the incapacity of the closed loop system to track at least one reference. As the figure clearly shows, there are cases in which the robustness is preserved even though one uncertainty power is high and the other one is low. Consequently, it is quite difficult to determine the marginal powers if they are different. It is more suitable to determine such a marginal power along the main diagonal of the separation plane, where the two powers are equal. In the right side of Figure 26, the fitness variation along the diagonal (with equal uncertainty powers) is displayed. The horizontal line refers to the separation plane.
Electronics 2021, 10, x FOR PEER REVIEW 32 of 43 are cases in which the robustness is preserved even though one uncertainty power is high and the other one is low. Consequently, it is quite difficult to determine the marginal powers if they are different. It is more suitable to determine such a marginal power along the main diagonal of the separation plane, where the two powers are equal. In the right side of Figure 26, the fitness variation along the diagonal (with equal uncertainty powers) is displayed. The horizontal line refers to the separation plane. One can see that the most fitness values are beneath this line, as expected. Increasing the uncertainty power naturally leads to the loss of robustness. Therefore, to estimate the robustness margin, one should focus on the zone with small uncertainty powers. In the figure above, one can easily notice that the marginal uncertainty power is less than 10%.
The problem with fitness is the same as in the previous subsection; apparently, the robustness margin can only be set by subjective means, while visually inspecting the I/O signals of the plant. For example, the first two output signals in Figure 27 reveal that the system is unable to track the reference, but is very close to this goal. The fitness equals 73.98% with 5% uncertainty power and 74.03% with 4.9% uncertainty power, respectively. By decreasing the uncertainty power, the last two output signals in Figure 27 were obtained. At 74.37% fitness with 4.75% uncertainty power, the reference started to be tracked in the end of variation (see the third signal of figure). Furthermore, decreasing the uncertainty power to 4.6% leads to a fitness of 74.5% and to an output that succeeds in reaching the reference sooner than previously (see the last signal). In this case, the robustness margin can be set to 74.4% fitness with 4.7% uncertainty power. The estimation of uncertainty margin is fair but subjectively set. The robustness margins can thus be estimated by varying the separation plane and analyzing the cases leading to fitness values close to the plane height. If the uncertain One can see that the most fitness values are beneath this line, as expected. Increasing the uncertainty power naturally leads to the loss of robustness. Therefore, to estimate the robustness margin, one should focus on the zone with small uncertainty powers. In the figure above, one can easily notice that the marginal uncertainty power is less than 10%.
The problem with fitness is the same as in the previous subsection; apparently, the robustness margin can only be set by subjective means, while visually inspecting the I/O signals of the plant. For example, the first two output signals in Figure 27 reveal that the system is unable to track the reference, but is very close to this goal. The fitness equals 73.98% with 5% uncertainty power and 74.03% with 4.9% uncertainty power, respectively. By decreasing the uncertainty power, the last two output signals in Figure 27 were obtained. At 74.37% fitness with 4.75% uncertainty power, the reference started to be tracked in the end of variation (see the third signal of figure). Furthermore, decreasing the uncertainty power to 4.6% leads to a fitness of 74.5% and to an output that succeeds in reaching the reference sooner than previously (see the last signal). In this case, the robustness margin can be set to 74.4% fitness with 4.7% uncertainty power. The estimation of uncertainty margin is fair but subjectively set.
By decreasing the uncertainty power, the last two output signals in Figure 27 were obtained. At 74.37% fitness with 4.75% uncertainty power, the reference started to be tracked in the end of variation (see the third signal of figure). Furthermore, decreasing the uncertainty power to 4.6% leads to a fitness of 74.5% and to an output that succeeds in reaching the reference sooner than previously (see the last signal). In this case, the robustness margin can be set to 74.4% fitness with 4.7% uncertainty power. The estimation of uncertainty margin is fair but subjectively set. The robustness margins can thus be estimated by varying the separation plane and analyzing the cases leading to fitness values close to the plane height. If the uncertain idmo that leads to fitness values above and beneath the plane height still allow tracking of the references, then the plane should be lowered. On the contrary, if the idmo with fitness values around the plane height yield loss of robustness, then the plane should be raised. The separation plane is placed at the right height when the idmo with fitness below that height cannot allow reference tracking, whereas for the other idmo, with fitness above The robustness margins can thus be estimated by varying the separation plane and analyzing the cases leading to fitness values close to the plane height. If the uncertain idmo that leads to fitness values above and beneath the plane height still allow tracking of the references, then the plane should be lowered. On the contrary, if the idmo with fitness values around the plane height yield loss of robustness, then the plane should be raised. The separation plane is placed at the right height when the idmo with fitness below that height cannot allow reference tracking, whereas for the other idmo, with fitness above the height, the references are eventually tracked. Because of the noises corrupting the data, such a balanced behavior can be discovered experimentally, as a theoretical approach on this topic is difficult (if not impossible) in this case.
For ASTANK2 installation, three scenarios can be investigated: (a) affect MISO 1 model by uncertainties and the keep the genuine MISO 2 model; (b) switch MISO models (keep the genuine MISO 1 and work with uncertain MISO 2 ); (c) induce uncertainties on both MISO models. After several simulations, it has been noticed that output y 1 is more sensitive to idmo uncertainties than output y 2 . This means the controller loses robustness because of y 1 in the first. Therefore, in the following figures, only y 1 is displayed. In all figures, the fitness surface obtained by Monte-Carlo method takes the first column of matrix. The second column displays the diagonal of fitness surface. The last two columns are devoted to output y 1 in two cases: non robust (column 3) and robust (column 4). The corresponding fitness values of closed loop system for columns 3 and 4 are below and above the estimated marginal fitness of robustness zone, respectively.
The simulation scenarios providing the results in Figures 28-30 offer further parameters allowing analyzing robustness. Hence, the robustness zone can be confined by: the marginal fitness Φ min ; the marginal uncertainty power η max ; the relative density ρ of robust behavior; the relative robustness margin µ. The first two parameters (Φ min and η max ) are determined experimentally. The height of separation plane is set to Φ min . The fitness values Φ down and Φ up corresponding to variations of output y 1 in Figures 28-30 are close to each other.
Moreover, Φ down < Φ min < Φ up , which proves that Φ min is fairly accurate. The marginal uncertainty power η max was determined by using the fitness diagonal drawn in column 2 of graphical matrices. The principle illustrated in Figure 26 was used in this aim.
The other two parameters (ρ and µ), although conventionally defined, allow performing a top of controllers with respect to robustness against uncertainties. Since the Monte-Carlo method is employed to draw fitness surfaces, one can compute the ratio between the number of robust behaviors and the number of all behaviors (10.000). If this ratio is multiplied by 100, the relative density ρ of robust behavior is estimated. Now, one controller is more robust than another if Φ min is as small as possible, whilst η max and ρ are as big as possible. Then, the relative robustness margin µ can be defined as: where σ > 0 is a constant scaling factor set to 0.04, such that µ can vary in a suitable range (recall the explanation between Equations (15) and (16)). The robustness parameters are listed in Table 8, for all four controllers, in all scenarios. Without the last column, Table 8 is rather confusing and says almost nothing. The µ parameter can enlighten the closed loop behavior against model uncertainty.   The first clear insight is that the PID controllers for <raw> idmo are noticeably more robust to uncertainties than the PID controllers for <spline> idmo. This can be explained by the fact the <spline> idmo has a reduced number of poles, which are more exposed to the loss of stability in a way that the PID controllers cannot compensate. Secondly, among controllers for <raw> idmo, PID-R is slightly more robust than PID-N when coping with uncertainties that affect one MISO model at a time, whereas when both models are corrupted, PID-N seems to be the best (62.65% versus 45.97%). Thirdly, for <spline> idmo, the PID-R controller is better than the PID-N controller, in terms of robustness, in all scenarios. To conclude this analysis, one can notice that, regardless of the idmo type, robustness of MISO 2 is superior to robustness of MISO 1 , as expected (since, in all simulations, output y 1 loses its tracking ability before output y 2 ). Moreover, another expectation is met: the relative robustness margin of the entire ASTANK2 idmo (in the last scenario) is the smallest one (compared to the other two scenarios). Electronics 2021, 10, x FOR PEER REVIEW 7 of 7 Figure 30. Estimating the robustness margin against uncertainties of the overall ASTANK2 model. Figure 30. Estimating the robustness margin against uncertainties of the overall ASTANK2 model.

Concluding Remarks and Future Developments
The main goal of this article was to perform an extensive analysis of metaheuristic PID control applied to a nonlinear installation such as ASTANK2, after identification with linear multi-MISO models. Two PID configurations were investigated, PID-R and PID-N, for each identification model type, <raw> and <spline>. Two metaheuristics were employed in the design of four optimal controllers: AHCA to extensively explore the search space, and IFA to intensively exploit a restricted zone around some promising optimal point found by climbers. Four improvements of classical FA were introduced in order to fasten the search and increase the final results accuracy. Defining a fair cost function (referred to as fitness in the article) is not an easy task. Many other authors coped with the same difficult problem, as reported in their publications. Unfortunately, to the best of our knowledge, no general cost function can be defined to be employed in any automatic control optimization problem. Therefore, adapting the cost function to the installation characteristics (and limitations) seemingly is a wise way to proceed.
The simulation results revealed the performance as well as the limitations of designed controllers. Overall, one can say that any of the four PID controllers can be employed in a closed loop with an ASTANK2 installation, as they exhibit almost the same performance. Basically, PID-R controllers are recommended to reject model uncertainties, whilst PID-N controllers are better in tracking staircase type references.
Various future research directions can be approached. A multivariable (non-decentralized) PID control structure likely yields superior performance. Another development is possible in the direction of metaheuristic multivariable RST control. Of course, the metaheuristic control based on state space representation of ASTANK2 installation is another interesting direction to investigate.
where ω > 0 is the natural pulsation ([rad/s]), ζ ≥ 0 is the (relative) damping factor and τ ≥ 0 is the intrinsic delay. When stimulating the system with a unit step, four types of responses are possible, depending on the dumping factor:
During the delay, the response is set to null (although, by using the equations above in a mathematical sense, the response is non null).
In case of noisy signals looking like a step response of order II, the identification problem can be formulated by means of a quadratic criterion. More specifically, if y is such a signal (in discrete time) and y (ζ,ω,τ) II is any of the step responses (A2)-(A5), then the following quadratic cost function has to be minimized: where ζ ≥ 0 (the damping factor), ω > 0 (the natural pulsation) and τ ≥ 0 (the intrinsic delay) completely determine the response y (ζ,ω,τ) II . Additionally, N ∈ N * is the total number of samples and T s > 0 is the sampling period (in seconds).
As one can easily notice, the response y (ζ,ω,τ) II is nonlinear with respect to the three parameters. Consequently, solving the quadratic optimization problem is not an easy task. Moreover, the criterion can exhibit large flat zones where the global minimum may lie. In Figure A1, criterion surfaces were drawn for each output of ASTANK2 plant (y 1 -the left side couple, y 2 -the right side couple).
The images 1 and 3 reveal how large the flat zone can be. The surface includes all four types of second order responses. For output y 1 , the intrinsic delay is set to about 11 s, whereas, for the output y 2 , τ = 0 s. A zoom on the plateau is displayed in images 2 and 4. Despite what the images 1 and 3 suggest, the plateau is not so flat. It seems that the global optimum lies somewhere in this apparently flat zone. As one can easily notice, the response ( , , ) II y ζ ω τ is nonlinear with respect to the three parameters. Consequently, solving the quadratic optimization problem is not an easy task. Moreover, the criterion can exhibit large flat zones where the global minimum may lie. In Figure A1, criterion surfaces were drawn for each output of ASTANK2 plant ( 1 y -the left side couple, 2 y -the right side couple). To solve the optimization problem, a numerical procedure is needed. Given the optimization criterion expression, an appropriate numerical recipe can be selected from the variable advancing step, gradient based class. The variable step allows fast jumps towards the global optimum in the flat zone. The Newton-Raphson method [31] is a good candidate. However, this method involves computing and inverting the Hessian matrix of quadratic criterion, which is both difficult and time consuming. The Gauss-Newton method is better, since the Hessian matrix is approximated by only using the gradient of quadratic criterion (see the details of this method in [31]). To implement the Gauss-Newton method, the gradient of quadratic criterion is needed. Fortunately, this gradient can be evaluated in closed form, as shown next. The gradient expression of is The quality of a step response provided by the order II system (A1) is analyzed according to following parameters, also indicated in Figure B1: a. Time constant of second order system: Relative overshoot (only in under damped case, ζ ∈ (0, 1)): It shows how far from step reference the maximum of system response can rise. Therefore, RO is computed relatively to the reference height.

c.
Peak time (only in under damped case, ζ ∈ (0, 1)): It points to the time instant of when the response reaches its maximum. Note that the time delay τ adds to the maximum point value. d. Delay time, τ d . It stands for the necessary duration of response to rise from 0% to 50% of reference signal. In case of under damped response (ζ ∈ (0, 1)), τ d is: For the critically damped or over damped responses (ζ ≥ 1), closed form expressions are impossible to derive. Therefore, in such cases, the equation that gives τ d can be solved by numerical algorithms. An easy way to approximate τ d is as follows: express the condition y(t) = 0.5; expand the exponentials in Taylor series up to the 7-th term (as it is well known that the exponential is accurately approximated by such an expansion); compute the coefficients of polynomial that results and derive its roots; among them, there is a unique, real valued, positive root, which stands for τ d .

e.
Rise time, τ r .This is the necessary duration of response to rise from a lower bound to a higher bound expressed as percentages from the reference. In case of under damped response (ζ ∈ (0, 1)), the bounds are 0% and 100%, which leads to the following closed form expression: For the critically damped response (ζ = 1), the bounds are 5% and 95%, respectively. For over damped responses (ζ > 1), the bounds are 10% and 90%, respectively. Like in case of rise time, it is not possible to derive closed form expressions of τ r . Nevertheless, numerical procedures are available. The 7-th term expansion approach, previously described, can be considered as well.

f.
Settling time, τ s . This parameter is equal to the duration of transient zone, also known as transient time. Normally, the steady-state zone is supposed to begin when the response enters and remains within a tolerance tube around the reference. Usual tubes are form ±2% to ±10%; in case of 10% tube width (i.e., by taking a ±5% tolerance tube), τ s can be computed differently, depending on damping factor. If the response is under damped (ζ ∈ (0, 1)),then: Otherwise, an empirical expression is currently employed (for ±5% tolerance tube):

Appendix C. Computing Fitness for Staircase References
The computing procedure of fitness is easier to understand following the example of Figure A3. Unlike for the outputs, for the inputs, the references need to consider the couple of output references at each time instant. Therefore, as the figure displays, seven zones have to be considered to extract input references from the static table. Each change of an output reference creates a delimiter for a new zone. In the example of Figure A3, each new zone preserves one output reference and changes the other one.
However, both output references can change at the same time as well, without affecting the input references extraction procedure. The main zones 1, 3, 5 and 7 have longer durations than the secondary zones 2, 4 and 5.
Like in the case of single step references, there are three fitness components to compute two for the outputs (φ y 1 , φ y 2 ) and one for both inputs φ u 12 . For each output, the fitness is computed by processing all the steps of corresponding staircase. Let N s j be the number of steps exhibited by the staircase of channel j ∈ {1, 2} (e.g., N s 1 = N s 2 = 4, as in Figure A3). Then: where n i ∈ N * is the duration of current step i ∈ 1, N s j . Obviously, N s j ∑ i=1 n i = N (the duration of all signals). In the weighted average of (A19), the fitness of current step, φ y j,i , is computed like in case of single step output reference (see Equation (17)). For the two input signals, the fitness is a weighted average as well where N z 12 is the number of zones to extract the input references for (e.g., 7 in the previous figure); n i ∈ N * is the duration of current zone i ∈ 1, N z 12 (with N z 12 ∑ i=1 n i = N); φ u 12,i is the fitness of current zone i ∈ 1, N z 12 , computed like in case of step output references (see Equation (A20)).
Overall, the fitness is computed by considering that the controllers are optimal. Therefore, in the refined definition of step references fitness (22), only the third case is employed ζ ω Otherwise, an empirical expression is currently employed (for ±5% tolerance tube): (B7)

Appendix C. Computing Fitness for Staircase References
The computing procedure of fitness is easier to understand following the example of Figure C1. Unlike for the outputs, for the inputs, the references need to consider the couple of output references at each time instant. Therefore, as the figure displays, seven zones have to be considered to extract input references from the static table. Each change of an output reference creates a delimiter for a new zone. In the example of Figure C1, each new zone preserves one output reference and changes the other one.
However, both output references can change at the same time as well, without affecting the input references extraction procedure. The main zones 1, 3, 5 and 7 have longer durations than the secondary zones 2, 4 and 5.
Like in the case of single step references, there are three fitness components to compute: two for the outputs ( 1 y φ , 2 y φ ) and one for both inputs 12 u φ .