Abstract
PID controllers are one of the most popular types of controllers found in the industry; they require determining three real values to minimize the error over time and to deal with specific process requirements. Finding such values has been subjected to extensive research, and many popular algorithms and methods exist to accomplish this. One of these methods is Simulated Annealing. In this paper, we study the use of the re-annealing characteristic of Adaptive Simulated Annealing (ASA) for PID tuning in 20 benchmark systems. This adaptive version gives special treatment to each parameter of the search space. We compare the results of ASA with a simple SA algorithm. An extra comparison, with a Particle Swarm Optimization algorithm, was made to provide some information on how ASA behaves compared against another optimization based method. The results show that using an adaptive algorithm effectively improves the performance of the tested systems.
Introduction
Along with the creation of complex industrial systems came the need to maintain them under certain operation conditions. This was achieved by means of many human operators, until control theory was developed and automated control schemes were put in practice. A good example of that evolution can be found in the chemical industry [18] as well as in some others. Among such control approaches, it is possible to mention: root locus controller design, frequency domain control methods, and proportional-integral-derivative (PID) controllers [21]. As noted in [21], by 2001 more than half of the industrial controllers were either PID controllers or modifications of such schemes. PID controllers make use of three different terms: proportional, integral and derivative gains. The proportional gain depends on the current error, the integral depends on past errors, and the derivative is a prediction of future errors. Then, the sum of those three elements is used to adjust the process. The main advantage of PID controllers is that they can be applied to most control systems even when the mathematical representation of the system is unknown. Also, PID controllers improve both transient and steady-state responses [2]. The general form for PID controllers is given by equation (1):
In general, the controller is designed to improve certain characteristics of the system such as maximum overshoot (how much above the desired final value is the maximum peak), settling time (how much does it take for the system to get close to the final value), the final value and the time the oscillations remain in the system.
Despite the simplicity in PID controllers, in most of the cases, the values for the proportional, integral and derivative gains are determined in situ. There are several systematic methods to tune PID controllers. Perhaps the most popular one is the Ziegler–Nichols method [32]. The Ziegler–Nichols method is often combined with manual tuning to produce the desired behavior of the controlled system [21]. Unfortunately, the Ziegler–Nichols method cannot be applied to tune PID controllers for every system; particularly, systems for which there is no proportional gain that causes the system output to oscillate cannot be controlled using this method.
Thus, some researchers have considered the PID tuning problem from an optimization perspective. In such case, the cost function could be represented in many ways, going from a single-valued function (the total error) to a multi-objective function. Once the PID tuning problem is stated as an optimization one, it would not be surprising that researchers have approached its solution via different heuristic and meta-heuristic methods coming from the artificial intelligence community. We will cover some of the most representative works on this matter in the next section.
In this work, we study the use of the re-annealing characteristic of Adaptive Simulated Annealing (ASA) for PID tuning in benchmark systems: a variety of representative systems found in industrial controllers. We make an extensive analysis of an adaptive version of simulated annealing that gives special treatment to each parameter of the search space for 20 different benchmark systems and compare it to the performance of normal simulated annealing.
The paper shows a fruitful effect in the tuning of the PID in comparison with the classical method of Ziegler–Nichols or the non-adaptive version of Simulated Annealing for the benchmark systems tested. An extra comparison with a Particle Swarm Optimization algorithm was made, and it is presented in the results section. Finally, some conclusions are derived from those results.
Previous work
Automatic PID tuning algorithms have received a lot of attention due to their importance in the industry. This has been particularly true in the last two decades [28]. Some of the methods applied include meta-heuristic techniques such as: genetic algorithms, particle swarm optimization and simulated annealing, among others. In the following paragraphs we give a short overview of some of such proposals.
A genetic algorithm (GA) is an optimization method based on the principles of natural selection and genetics [19]. The genetic algorithm generate a population of candidate solutions for the problem. A number of genetic operators modify the population emulating actions such as: crossover, mutation and reproduction. This technique has been applied for automatic PID tuning [9,11,22,23,28,30]. In [28], this algorithm was used to tune the PID controllers for four benchmark systems which are difficult to tune using conventional methods.
[22] approached the PID tuning problem for two specific systems with GA by using the sum of the squared error as the cost function to optimize the PID values; the results improved over the classical Ziegler–Nichols algorithms.
Working with GAs is not always straightforward. The GAs work with strings that represent the solutions, rather than with the solutions themselves. In some settings, GAs are known to need more computational time than other methods to achieve good solutions [9,19].
Another possibility is to use Particle Swarm Optimization (PSO). PSO is an optimization technique based on having a set of points distributed in the search space and moving them with specific velocities through it looking for an optimum solution [13]. PSO was designed considering numerical optimization problems in the space of the real numbers. That means that its application to engineering problems is, in general, easier than genetic algorithms since this algorithm does not require a candidate solution to be represented as a string. In [29], the authors propose a modified hybrid PSO and Simulated Annealing (SA) algorithm. The focus of their work is on the initialization of the particles in the search space. The tests are conducted over well known benchmarks in the optimization area. Our approach differs from all this in that the algorithm is simpler; less parameters, less complexity in the code. In a recent work, the authors of [20] describe how to use SA to tune a multi-variable cross-coupled PID controller for a lab-scale helicopter. The authors offer a comparison against evolutionary techniques such as differential evolution (DE) and GA. For the domain in which the authors tested their method, it outperformed GA and DE. The approach of considering the tuning problem as a multi-objective optimization instance is also investigated by the authors of [16]. In this work a non-dominated Sorting Particle Swarm Optimization (NSPSO) is applied to the design of multi-objective robust PID controllers. The proposed method is tested in several industrial settings, showing good robustness.
For the specific problem of tuning PID controllers, significant work has been done using PSO. For instance, in [6] the authors developed a PSO based method to optimize an automatic voltage regulator. In the same way in [27], it is reported the design of a PID controller for an air heater temperature control system. The approach is based on the application of PSO. In both papers, the results show that the PSO optimized PID controller is able to improve the performance when compared to the Ziegler–Nichols as well as to GA.
In [1], the PSO approach was applied to the design of a DC Motor Drive and compared with a Fuzzy Logic approach, finding that this method improved the dynamic performance of the system. In [26], the authors proposed a PSO implementation to tune PID controllers. According to their findings, the controllers that were tuned by using the PSO approach had less overshoot compared to that of the classical Ziegler–Nichols method.
In [17], a Support Vector Machine (SVM) was used to represent the dynamics of a turbine engine, and PSO was employed to tune the PID controller; the controllers for two benchmark functions with high dimensionality and a marine system are tuned in [5] using PSO with adaptive mutation.
In [15], a comparison between GA, PSO, SA and the classical Ziegler–Nichols method was made for the PID controller tuning of a third order system representing a DC motor. Out of those three algorithms, the SA approach gave the best results concerning overshoot and settling time, and the PID gains were the lowest for the three parameters.
Of particular interest for this work is what has been done with another technique called Simulated Annealing (SA). Simulated Annealing is a stochastic technique used to find an optimum solution given a search space of independent variables [14]; this technique is based on the physical process for getting low energy state of a solid material exposed to heat. One form of simulated annealing is the Adaptive Simulated Annealing (ASA) algorithm that was extensively described by Lester Ingber [10]; this form of simulated annealing is especially useful for problems where changes in variables of the search space have varied sensitivities in the cost function.This technique is useful for the problem of PID tuning, where the proportional, integral and derivative gain values can have varied and different effects when changed. PID controllers for some specific plants have been tuned using this technique: an axial motion system represented by two plants [31], a high-performance drilling process [8] and a real-time process occurring in a pressurized tank [7]. In [24], the authors consider the problem of tuning a PID controller by means of a multi-objective optimization procedure. The process under consideration is an unstable first order plus dead time.
Background
Simulated annealing
The simulated annealing algorithm (SA) was proposed by Kirkpatrick [14] in 1983 as a technique to solve optimization problems. Simulated annealing is based on similarities that Kirkpatrick found between statistical mechanics and combinatorial optimization. In statistical mechanics, a configuration of a physical system is described by the positions that the atoms have at a certain temperature. Each such possible arrangements have a weighted probability factor, given by the Boltzmann function:
The simulated annealing algorithm is composed of the following elements:
Cooling schedule: Simulated annealing starts with a high temperature that is gradually decreased using the cooling schedule. This schedule dictates how the temperature T is updated at each step and has an important impact on the algorithm’s performance.
Neighbors of the current state generation: A function is required to create neighbor states given a current state for which the energy change will be computed and analyzed to decide if it will be accepted as the next current state.
Cost function: This is a problem specific function that serves as a measure of the energy. In the general case, this will be the function that the algorithm is trying to optimize.
Acceptance probability: This probability distribution determines which states are to be accepted.
The initial temperature and cooling schedule for SA have important effects on both the optimization time and the best solution found by the algorithm. The work by [12] presents the drawbacks of increasing the initial temperature or having a slower rate of cooling. A higher initial temperature may lead to an optimal solution, the optimization time of the algorithm increases accordingly. On the other hand, a low initial temperature and a faster rate of cooling decrease the optimization time, but may give a suboptimal solution. The results presented in [12] show evidence that choosing an initial temperature is not a straightforward process, and there is not a deterministic approach for such purpose.
The simulated annealing algorithm can be represented with the pseudo-code shown in Algorithm 1.

Simulated annealing
The pseudo-code can be explained as follows: Initially we assign to the current temperature T an initial value
Then, we loop from a starting temperature of
We assign to the current state a neighbor state by using a neighbor generating function
At the end of each state, we update the current temperature by using a temperature update function: temp-schedule
Adaptive simulated annealing (ASA) is an algorithm proposed by Ingber [10] that is based on simulated annealing. This adaptive version of simulated annealing is based on randomly importance sampling of the parameter space. Ingber [10] remarks that in optimization problems there are different parameters with varying finite ranges and with different annealing-time dependent sensitivities; this serves as a motivation for adaptive simulated annealing where different annealing schedules are held to address the different sensitivities corresponding to each parameter. Keeping individual temperatures for each parameter, re-annealing, and generating new parameters based on the current temperature are some characteristics of ASA.
The motivation of using adaptive simulated annealing for the tuning to PID controllers is precisely the fact that changing the different parameters of the PID controller in the same magnitude can have very different effects in the system output since adaptive simulated annealing maintains temperatures and cooling schedules specifically for each parameter. This technique seems suitable to solve this optimization problem.

Adaptive Simulated annealing
The pseudo-code shown in Algorithm 2 illustrates the differences between Simulated Annealing and Adaptive Simulated Annealing. The main difference is that we keep track of a temperature vector
We perform each step of the Adaptive Simulated Annealing algorithm in the same way as in the simple version; except that, when the number of iterations t is a multiple of the re-annealing interval
Finally, at the end of each iteration we update the temperature vector
A PID controller can be viewed as an extreme form of a phase lead-lag compensator having one pole in the origin and a second at infinity [2]. The transfer function corresponding to this type of controller is the following:

Block diagram of a closed loop control system with a PID controller.
The PID controller is typically applied to closed loop control systems in a configuration as shown in Fig. 1.
Some of the characteristics that are desirable to improve with the controller regarding the transient response are:
Rise time: The time taken by the system output to go from a low value to a high value (usually above 90% of its final value). Overshoot: The amplitude of the highest peak with respect to the final value. This parameter is usually measured as a percentage. Settling time: The time taken by the system output to reach its final value (95% of the final value is the usual measure).
And the feature to be improved concerning the permanent response is:
Steady-state error: The difference between the desired output and the final value of the system after the transient response.
Increasing each of the three gains has different effects on the output of the controlled system [2]:
Increasing
Increasing
Increasing
There are many methods for assessing the performance of the output of a system; those methods are useful in constructing a cost function to be used as part of optimization techniques. The following measures serve as single objective cost functions of the performance of a system and are based on the error: Integral of Absolute Error (IAE), Integral of Squared Error (ISE), Integral of Time multiplied by the Absolute Error (ITAE) and Integral of Time multiplied by the Squared Error (ITSE). They are calculated respectively:
Tested systems
Äström et al. in [3] show a series of benchmark systems commonly found in industry and useful to test several PID automatic tuning techniques. The application of tuning rules over known process responses and known plant models have some particular conditions. These conditions make the design methods and tuning rules non-general. This is the main reason of [3] to collect systems which are suitable for testing PID controllers. Four families of those systems are controlled with a PID controller tuned using adaptive simulated annealing:
The first group of plants have multiple equal poles and include first and second order systems. For higher values of α the system has a slow response:
The second group of benchmark systems are fourth order systems with poles whose spacing is determined by parameter α [28].
Third order systems with zeros located at
Finally, a group of second order systems with a one second time delay is also tested:
Adaptive simulated annealing
The adaptive version of SA used to tune the PID controllers keeps individual temperatures for each parameter and independent cooling schedule parameters
Cooling schedule. The temperature is updated after each step according to the following relation:
Neighbor generation. For each parameter i a normally distributed random number
Acceptance function: States for which the energy change is positive are accepted with a Boltzmann probability distribution, where T is taken as the maximum temperature of all parameters, and
Re-annealing: One of the features of adaptive simulated annealing is that after a specific number of steps the temperature is raised again independently for each parameter in the search space. For this experiment, different (as described below) re-annealing intervals were tested, and 175 was found to be the optimal value for those systems. To adjust to the different sensitivities of each parameter, the partial derivatives of the current value of the cost function with respect to each parameter are calculated; then the cooling schedule parameter
Where L is the current cost function,
The optimization algorithm does not consider any bounds for the parameters, and an ideal closed loop control model with no disturbance and no derivative filter is used. Since every application may have very different requirements (for instance, some may prioritize overshoot over settling time), the ITSE cost function was selected to give a general improvement of the system.
Resulting cost function (ITSE) value after tuning 20 benchmark systems with simple simulated annealing (
°C, constant scale parameter
) and adaptive simulated annealing (
°C, re-annealing after 175 steps). The systems were tuned 30 times with those configurations; and the table shows minimum, maximum and average of the simulations
Resulting cost function (ITSE) value after tuning 20 benchmark systems with simple simulated annealing (
The PID tuning for the 20 plants described earlier was tested using the adaptive simulated annealing algorithm. Different initial temperature values: 75°C, 100°C and 125°C were tested with re-annealing interval values of 75, 100, 125, 150 and 175 iterations giving a total of 15 different configurations. The results were compared, and an initial temperature of 75°C in combination with a 175 iterations re-annealing interval provided the best performance overall.
To compare the performance of adaptive simulated annealing with the simple simulated annealing algorithm, i.e. without re-annealing, the next state generation function shown in [31] was used:
The next set of PID values
Where η is the scale parameter and λ a random perturbation with Gaussian distribution.
The scale parameter η is reduced at each iteration ‘k’ proportionally with the same value, α, for which the temperature is decreased:
This simple simulated annealing version was tested with initial temperatures of 50°, 100°C and 150°C with scale parameter initial values, η, of 1, 25, 50, 100, 125 and 150, making a total of 18 different settings. Low initial temperature values, 50 for instance, showed worst results for the cost function of the
Finally, this same simulated annealing algorithm was tested, but this time keeping the scale parameter constant; i.e. not decreasing it after each iteration. Initial temperatures of 75°, 100°C and 150°C along with scale parameter values of 1, 2, 5, 10, 20 and 50 were tested as well. As with the simple simulated annealing algorithm, the results varied when increasing or decreasing the parameters: initial temperature and the re-annealing interval. In particular, decreasing the initial temperature worsened the results of all of the
Both the best adaptive simulated annealing version (
Three systems:

System,

System,

System,
In [26], particle swarm optimization (PSO) is used to find the optimal values of the PID controller of a DC motor. Four different cost functions (ISE, IAE, ITSE, ITAE) are used to find the gains of the PID controller with the PSO algorithm. The three parameters of the controller are limited in the range of 0 to 100.
The following system represents the DC motor model in the Laplace domain:
In this section, we use the adaptive simulated annealing algorithm to tune the same controller. The search space is limited in the same range as in [26], and the integration interval used to calculate the four cost functions is set from 0 to 10 seconds. The ASA parameters selected were: Re-annealing interval, 175 iterations; Initial temperature 75°C, and maximum number of iterations 1500. Table 2 shows the result of the comparison. The PID parameters reported in [26] for each objective function were taken and the cost function was calculated under the same conditions reported in that work to compare it with our algorithm.
Comparison of best cost function found using a particle swarm optimization approach (PSO) and adaptive simulated annealing (ASA)
Comparison of best cost function found using a particle swarm optimization approach (PSO) and adaptive simulated annealing (ASA)
As mentioned, the four configurations were run for a maximum of 1500 iterations, and the objective function value after 100, 500, 1000 and 1500 iterations is shown in Table 2. The simulations were run on a machine with Intel Core i5 2.4 GHz processor. The running time for each configuration was as follows:
ISE: 70.85 seconds
IAE: 72.57 seconds
ITSE: 69.38 seconds
ITAE: 73.97 seconds
In average the algorithm is running 1500 iterations in 70 seconds, which is roughly equivalent to 21 iterations per second. ASA significantly improved the results obtained with PSO in 100 iterations (roughly 5 seconds according to the calculation above). [26] does not specify the running time used to obtain its results, but mentions a total of 50 PSO iterations being used.
Four systems:

One system of each of the four families of plants discussed earlier. Each system was set with an input reference of 0 and with a unit step disturbance. The PID was tuned with ASA to correct the error due to this disturbance. When analyzing the disturbance rejection of a control system, a reference input (set point) of zero is typically used to limit the analysis to just disturbance rejection.
Figure 6 shows the configuration of a system with a PID controller to correct the error due to a disturbance signal
This section reports the results generated after running ASA and comparing it against particle swarm optimization. The reason to choose PSO for comparison is based on the interest of comparing ASA against another optimization-based approach, and the fact that PSO reported interesting results according to [26]. The results (minimum, maximum, average cost function value) after running the simulations with 30 repetitions and for the 20 different benchmark systems are shown in Tables 1, 3–5. For each system we report the three gains and the respective system characteristics after tuning with ASA (percentage overshoot, steady-state error, and settling time). Three of those systems were selected for comparison with the Ziegler–Nichols algorithm by creating a plot of the system after being tuned by both methods. To compare ASA with PSO, a DC motor system representation was tuned using both methods, and the results are described as well. Finally, plots of four systems under constant disturbance are shown before and after PID tuning with the technique described in this paper.
Block diagram of a closed loop control system with a PID controller and disturbance. 
Resulting standard deviation of the cost function (ITSE) value after tuning 20 benchmark systems with simple simulated annealing (
To illustrate the ASA algorithm performance graphically, three different systems;
Resulting average characteristics and PID parameters of 20 different benchmark system after being tuned with adaptive simulated annealing (
Resulting minimum characteristics and PID parameters of 20 different benchmark system after being tuned with adaptive simulated annealing (
Table 6 shows the results of running each system for both ASA and SA in a computer with an Intel Core i5-6300HQ CPU at 2.3 GHz CPU. In general, SA can run slightly more iterations per second than ASA given the fact that in the ASA algorithm, in the re-annealing interval the gradient for each parameter has to be calculated.
The table shows the running time for a single run of each system using both ASA and SA. The table also shows the number of iterations each algorithm run, and the iterations per second for each algorithm and system. As in the previous experiments, the algorithm was set to run for 9000 iterations stopping the algorithm if no improvement was made after 1500 iterations
Table 1 shows the minimum, maximum, and average cost function (ITSE) values for the 20 benchmark systems after SA and ASA tuning. The last column shows the percentage decrease in the cost function of the average simple simulated annealing algorithm in relation to that obtained by the adaptive simulated annealing algorithm. The results show that for 14 of the 20 system tested there was a decrease in the cost function when using ASA with respect to SA; and for the remaining 5 systems, where the average cost function was greater in ASA, the percentage increase of using ASA with respect to SA was lower than 10% for all five cases.
The desired system characteristics are something that varies among different applications. Some systems where speed is the major factor prefer to improve the settling time while sacrificing percentage overshoot, and in other applications where avoiding peaks is the priority, percentage overshoot can be improved at the expense of settling time for instance. Decreasing the percentage overshoot, the steady state error, and the settling time have the effect of decreasing the objective function ITSE, so this is why all of the systems were tested only considering the value function to provide greater generality.
The average, minimum and maximum values of the system characteristics and their corresponding
Resulting maximum characteristics and PID parameters of 20 different benchmark system after being tuned with adaptive simulated annealing (
Table 2 shows the optimal values for each cost function found by using ASA after 100, 500, 1000 and 1500 iterations along with the cost function value obtained by using PSO. Table 8 shows the PID values found for each cost function, the resulting overshoot and the settling time. After just 100 iterations, ASA obtained a better value than PSO for the four cost functions used to tune the DC motor system representation. The settling time was below 4 seconds and the percentage overshoot below 15% for all the cases (4 different cost functions).
Proportional, derivative and integral gains of the PID controllers obtained after tuning the DC motor using adaptive simulated annealing for the four cost functions described earlier
As mentioned earlier,
In [27], the authors report the design of a PID controller for an air heater temperature control system. The approach is based on the application of PSO. The authors perform simulations and according to them, the simulation results are achieved that the PSO optimized PID controller is able to improve the performance when compared with the Ziegler–Nichols as well as with GA in the perspectives of transient responses.
The tests showed that the best adaptive simulated annealing version outperformed the best simple simulated annealing version. Particularly, out of the 20 benchmark systems tested, for 14 of them the average smallest cost function was achieved through adaptive simulated annealing. For 10 of those systems, the percentage decrease with respect to the average simple simulated annealing cost function was greater than 5%, and only in one benchmark system this percentage decrease was greater than 5%. This best ASA version was able to obtain a smaller cost function than that obtained by PSO in less than 100 iterations for the four different cost functions described earlier. The tests performed in four of the benchmark systems demonstrated that ASA can also be effectively used to tune PID controllers for plants with constant disturbance.
The desired characteristics of the controlled systems were improved with respect to the original system (no control): overshoot, settling time and steady state error. The comparisons with the Ziegler–Nichols tuning method and with simple simulated annealing show that the idea of adapting the algorithm to each of the three parameters, which have very different effects on the system, proved to be fruitful.
