1. Introduction
Currently, most industrial processes still employ traditional controllers such as Proportional–Integral–Derivative (PID), which are simple, practical, have well-established design techniques, and come pre-packaged in most control devices, such as programmable logical controllers (PLCs) [
1]. However, linear controllers have limited performance due to their intrinsic linearity [
2,
3,
4]. Nonlinear controllers, in most cases, can easily overcome such limitations [
5]. Adaptive control is a class of nonlinear control that takes the linear controller structure and adapts the control parameters dynamically, following a special rule that defines these parameters upon some operating conditions [
6]. Other techniques use adaptive practices to adjust functional parameters, such as Fuzzy Adaptive [
7,
8] and Neural Adaptive [
9,
10,
11,
12] control techniques.
Several works propose adaptive PID-based techniques that enhance the controller performance, taking advantage of the robust structure of the traditional PID. One option employs Fuzzy logic to adapt the PID gains. In [
13], the membership functions are described for inputs (error and derivative) and outputs (
,
and
gains); as such, these gains can adapt according to the designed membership functions. The advantage of using Fuzzy techniques relies on requiring only basic knowledge of how the adaptive gains are expected to perform in the controller. The disadvantage is that the resulting controller is likely not optimal.
Another option consists of building adaptation functions based on the error signal to adapt the PID gains dynamically. In [
14], a nonlinear PID (NL-PID) is compared to a PID tuned by a Genetic Algorithm (GA) and a PID adjusted by the Ziegler–Nichols method. This NL-PID takes a Gaussian function of the error and employs linear functions as the adaptive rules for the gains. Such a procedure demands relatively low computing power, but the method to define the adaptive parameters of the NL-PID are not straightforward, and it is unlikely to lead to an optimal controller.
In [
15], a nonlinear adaptive PID with parameters defined by Genetic Algorithm (GA) was described. The adaptive PID rules were determined by 11 parameters, representing a complex problem optimized by the GA. Furthermore, its operation needs to calculate five exponential functions for each control iteration which takes a considerable computational power.
The Gaussian Adaptive PID (GAPID) is a kind of adaptive control firstly proposed by this research group in 2015 [
16], where the adaptive rule follows a Gaussian function of the system error. A Gaussian curve allows for transition from low to high gain in a smooth fashion. It demands light computational effort by using only one exponential function in each iteration, considering that more specific functions save lots of computing power in massive calculations.
The GAPID control technique currently has no mathematical design procedure. The problem of parameter tuning belongs to the NP-hard challenges, which cannot be addressed with traditional deterministic methods. An alternative to overcome these problems is to use bio-inspired optimization metaheuristics that allow for finding a better controller and eventually optimum parameters in a reasonable period [
1]. Such an optimization task poses a particular difficulty because the problem is multi-modal, where distinct solutions have very similar performance values. Furthermore, several solutions are not robust because the system performs well only with the load defined for optimization and decreases considerably with other load values [
17].
Regarding bio-inspired metaheuristics, the inspiration for the development of such methods lies, for example, in the Laws of the Darwinian Evolution (evolutionary algorithms) or the collective intelligent behavior of groups of animals (swarm-inspired methods) [
18,
19,
20]. These algorithms are endowed with an intrinsic capability of finding local or, eventually, the globally optimum values of the coefficients of a system.
In this sense, intelligent algorithms have been successfully employed to solve multi-modal optimization tasks from various real-world problems. For example, in [
21], the authors proposed the use of an improved version of the Salp Swarm Algorithm to deal with feature selection problems; variations of the Moth-flame algorithm, Particle Swarm Optimization (PSO), Genetic Algorithm (GA), and Bees Life Algorithm (BLA) were addressed for cyber-physical system applications in real fog computing; a hybrid proposition among Firefly Algorithm and PSO is proposed in [
22] for optimal cluster head selection in wireless sensor networks with the goal of increasing the energy efficiency of the system; notwithstanding, nonlinear control is the target of many studies involving bio-inspired optimization, such as [
23,
24,
25,
26,
27,
28].
In [
17,
29] some applications of GAPID were explored by using bio-inspired metaheuristics optimization (Genetic Algorithm and Particle Swarm Optimization (PSO)) to find optimal parameters for the GAPID. In [
30] other metaheuristics (Whale Optimization Algorithm (WOA) and Artificial Bee Colony (ABC) targeted to GAPID were also studied, using PSO as a common comparison choice to verify different metaheuristics algorithm effectiveness. This study demonstrated that WOA achieved a slightly better optimization result, but PSO converges faster and presented the smallest dispersion of the final results.
Considering the assumption mentioned above, this work aims to analyze the performances of a set of optimization algorithms in charge of finding optimal solutions for the special case of the GAPID controller. However, differently from the previous works [
1,
17,
29], which applied optimization algorithms to GAPID for the plant with fixed load, the novelty here is that variable load is now being considered in the optimization. This demanded some modifications in the optimization process to result in a more robust controller; in this case, for each iteration and each individual, several loads within the load range were tested, and the mean of the fitness for each load was taken as the individual fitness in that iteration. In practice, such a procedure is capable of leading to a robust controller that is expected to perform optimally within a predefined load range.
To this end, six variations of the Genetic Algorithm and six variations of the Particle Swarm Optimization were selected and applied to a DC motor-driven rotating beam [
31,
32,
33,
34,
35]. In the first moment, the different optimization strategies to obtain the optimal parameters of the GAPID were examined, then analyzed and compared regarding their efficiencies. Afterward, their performances in an experimental test plant were verified.
The GAPID tuned by optimization algorithms is a robust control technique canning share parameters with a previously designed PID, which facilitates its adoption in the industry but also offers some limitations. In most cases, it has the same restrictions as the PID, such as the windup problem in the integral component and noise amplification in the derived component, which is mitigated in the GAPID for minor errors. The other issue is that the plant must be stressed by a series of tests to obtain the fitness values for each individual in each iteration. It is impractical to perform such a task in a real-world plant, so an accurate model must be derived and the heavy lifting transferred to a computer simulation environment.
The remainder of the paper is divided as follows:
Section 2 presents the subjects under study, which are the GAPID control and the optimization algorithms used to find optimal parameters for the GAPID.
Section 3 presents the test plant model.
Section 4 discusses the methodology employed for simulations and experimental analysis.
Section 5 presents the results obtained from simulation, comparisons, and comments about the optimization algorithms and the experimental results obtained in the physical plant. Finally,
Section 6 presents the main conclusions and future perspectives.
3. Test Plant Model
The application system comprises an axis with a rotating beam linked to a DC motor [
31,
32,
33,
34,
35]. The control system must be tuned to perform well for load variation defined by different beams, which influences the total moment of inertia of the axis.
With the beams attached, the system is influenced by the drag force, as stated in Equation (
9), which represents an opposite torque to the rotor movement [
45].
where
is the air density,
A is the area of the moving object facing the air,
is the drag coefficient, and
v is the linear speed.
The state-space equations of the system are given by Equations (
10) and (
11)
where
L is the stator’s inductance,
R is the stator’s resistance,
J is the rotor’s moment of inertia,
B is the rotor’s friction coefficient,
is the current-to-torque conversion constant,
is the speed-to-induced-voltage conversion constant,
is the linear-to-rotational factor,
is the constant equivalent to
,
is the stator’s current (state 1),
is the rotor’s rotational speed (state 2), and
is the input voltage in form of PWM pulses.
From Equations (
10) and (
11), a Simulink model was built in order to do computational simulations, as presented in
Figure 5. The plant parameters are summarized in
Table 1.
It is highlighted in
Table 1 that the moment of inertia J is not fixed because, in this work, it depends on the beam attached to the motor that acts as a variable load. Thus, the load is composed of the moments of inertia of the axis joint and a range of different beams, as summarized in
Table 2. This range is used for simulations and covers the beams available in the physical plant.
4. Methodology
The methodology for developing this work is divided into two parts: the first determines the procedures for choosing the simulation parameters, starting with the proposal of 6 different scenarios for the GA; and then the six scenarios for the PSO. The best scenario found was used for an experimental evaluation, described in the second part of the methodology.
Thus, a computational model using Matlab/Simulink was elaborated for running simulations. This model comprises the plant and the GAPID controller.
This model is used during the optimization process, where all the algorithms’ variations are executed upon this model, and the desired results are extracted at the end of each simulation.
For each algorithm, each individual (or particle) needs to run the starting transient of the model for each iteration. This means that the model was executed once for n individuals, with k iterations, considering h load variations, for all of the 12 algorithms.
The novelty here is that the load variations represent an additional variable to the optimization problem and then allow for finding an optimal and robust GAPID control. This is important because a large class of plants has variations in their operating conditions that must be considered to achieve a robust stabilization.
The final fitness results, as well as the individual evolution, were collected, tabulated and analyzed in order to verify which algorithm is more appropriate for the problem of finding the optimal parameters of the GAPID.
Some of the best results were tested in the physical plant, the DC motor-driven rotation beam, and one of them, the best one, is described in
Section 5.
It is important to remark that the quantity of different loads utilized in the simulations is larger than that used in the physical plant, which allows for a greater definition of the load variation range during the optimization process, which occurs exclusively in the simulation environment.
4.1. Methodology for Simulation Analysis
4.1.1. GA Variations
In this work, 6 variations of the GA are used, all of them based on the premises described as follows [
38,
41,
46]:
GA1: The first GA follows the classic version initially proposed, except considering the mutation, which always occurs at a low rate. The roulette wheel is used to select the individuals that will participate in the crossover. The same individual may be selected more than once. The one-point crossover occurs with 70% probability, and 5% of the genes considering the entire population are randomly chosen and pass thought the mutation. In this case, it is addressed as a perturbation considering a Gaussian distribution;
GA2: The second GA is almost identical, but the crossover probability is 100%. It means that all selected individuals will generate offspring;
GA3: This version uses the binary tournament instead of a roulette wheel. However, if an agent loses the game, it returns to the previous population and can be selected again;
GA4: This version differs from the last because the “death tournament” is used. It means that if an agent loses the tournament, it is suppressed from the population;
GA5: This proposal is more different from the others. The order of the operations is changed so that the crossover happens first, then the mutation, and finally the selection. With this idea, note that an intermediate subpopulation is created with the double individuals (see
Section 2.2.1: Ultimately, the selection procedure (roulette wheel) is responsible for choosing the remaining agents, leaving the population with the original size. In this approach, all parents are chosen once at random to perform crossover;
GA6: The last GA is similar to the previous one, but a tournament replaces the roulette wheel as a selection procedure.
4.1.2. PSO Variations
Two main topologies are proposed: in the Global Topology, each particle has its social factor
related to the global best (
), while in the Ring Topology, the particle has its social factor related to its nearest neighbors [
41].
Six variations of the PSO are addressed in this study:
The summary of the examined strategies is presented in
Figure 6.
After the simulation scan tests of the scenarios addressed above, the best result will be selected to evaluate it experimentally.
4.2. Methodology for Experimental Analysis
To experimentally evaluate the proposed solution, an experimental plant based on a DC Motor with variable load was developed.
The application system comprises an axis with a rotating beam linked to a DC motor. The control system must be tuned to perform well in a broad range of operating conditions.
Figure 7 depicts the simplified schematic of the system.
The experimental plant was built with a DC Motor powered by a controlled voltage source passing through the Pololu Dual VNH5019 motor driver shield module. This module is a compact breakout board for ST’s high-power motor driver IC, a fully integrated H-bridge to control the speed of a single brushed DC motor [
49]. The motor is connected to an encoder to measure its rotation angle and speed.
Figure 8a presents the image of both the motor drive module and the signal acquisition board, and
Figure 8b shows the picture of the motor with the encoder attached.
The beams are interchangeable to simulate different loads. Three test beams were used: light slim aluminum, carbon steel, and thick heavy aluminum, as shown in
Figure 9. The moments of inertia for these beams are presented in
Table 3.
Data from the encoder are sent to a PLC CompactRIO
®, a real-time embedded industrial Data Acquisition and controller made by National Instruments for industrial control systems. This system consists of a controller with a microprocessor and an FPGA programmable by the user. In our case, the encoder (sensor) signal is connected as a digital input and the PWM signal to control the motor speed as an analog output [
50].
Figure 10 illustrates the PLC used.
5. Results
5.1. Simulation Results
As stated in
Section 2.2, six GAs and six PSOs were tested to study the behavior of each algorithm. Each algorithm was run 10 times with the average results taken to compose the figures and tables reported in the following sections. The objective is to observe the characteristics, performance, advantages, and drawbacks of each strategy. Simulations were carried out in Matlab/Simulink employing GA and PSO optimization algorithms. The first step is to compare GA and PSO strategies separately. This action is needed to reach the behavior of selecting different parameters within the same algorithm. In the second step, a general comparison between these two algorithms is made, particularly for the final result, remembering that due to their nature being so different, no fair comparison can be realized regarding the evolution of each algorithm.
5.2. Comparison of GA Strategies
As stated in
Section 2.2, six GAs were tested to study the behavior of each algorithm. The objective is to observe the characteristics, performance, advantages, and drawbacks. The parameters of each GA employed in the tests are summarized in
Table 4.
Figure 11 presents the evolution of each GA regarding the best, the worst, and the mean of all individuals in the population.
To better analyze the overall population distribution at the end of iterations, a boxplot of each GA variant was done, shown in
Figure 12.
The final results with the best fitness values are summarized in
Table 5.
From
Figure 12 and
Table 5, some conclusions can be taken: GA3, GA4, and GA6 presented less-dispersed populations in higher fitness ranges, with a smaller dispersion in GA4. This last finding in GA4 may pose a problem because some dispersion is often expected in GAs. The main similarity of these strategies is the use of binary tournament selection. On the other hand, GA1 and GA5, which use the roulette wheel, showed worse results with higher dispersion.
It seems clear that the use of roulette wheel should be avoided to this problem. The literature is abundant in presenting the drawbacks of applying such a selection procedure because it presents a high selective pressure. It means that the individuals with the highest fitness present a high probability of being selected at each iteration. However, this procedure may prematurely guide the search for local minimum points, often far from the global optimum. In this sense, the tournament is a better candidate.
In addition, the use of the death tournament did not perform better than the traditional binary tournament due to the risk of losing potentially well-positioned agents. As seen in
Figure 12, despite the dispersion being small in GA4, the top fitness is not the highest.
Regarding creating a sub-population, if the strategy is used with a binary tournament, the results revealed that the algorithm could reach better values to the parameters of the GAPID due to the existence of more individuals simultaneously. This procedure may increase the probability of finding good positions in the search space when applying the genetic operators.
Despite presenting the highest dispersion, GA2 achieved a result comparable to GA3, GA4, and GA6 in terms of the mean and the best individuals. Finally, it is important to mention that the results lie within the topmost 1% of the normalized fitness values. This means that all GAs perform quite well, with slightly different results.
5.3. Comparison of PSO Strategies
In addition to the analysis of GA algorithms, six PSO variations were evaluated. The parameters were determined by previous tests and are detailed in
Table 6.
As mentioned in
Section 4.1.2, PSO 1, 2, and 3 use the global topology while PSO 4, 5, and 6 use the ring topology; variants 1 and 4 use no inertial weight
while 2 and 5 use fixed
and 3 and 6 use the linear decreasing weight approach [
41].
Table 7 presents the best fitness obtained after 10 simulations for each PSO strategy. It can be noted that the first-ranked strategies employ the global topology, which reinforces the conclusion that this is the best topology. Indeed, for this specific application, the full communication between the particles and the best-positioned one is an advantage, leading to better configurations. It seems clear that the ring topology now allowed the search for the maximum fitness points.
Considering the best combination of strategies used to set , linear decay proved to be the best choice, which is an important finding since the modification in the value of along the iterations adjusts the model to perform a kind of global search strongly at the beginning of the process (exploration) and to perform a local search refining the solutions along the process (exploitation).
Interestingly, while the global topology led the swarm to small dispersion using all chosen values of , its application in the ring topology degraded the performance and increased the dispersion. This is an unexpected behavior since the algorithm tends to present a problematic convergence. This finding reinforces the need to choose the best configuration, considering the specificities of the topology selected.
The Friedman test was applied to the results and resulted in a p-value of 0.0027, which means that an optimizer change leads to different results.
Considering the parameters presented in
Table 5 and
Table 7, simulations were carried out, and all the results were summarized in a boxplot, presented in
Figure 13.
This fact evidences the dispersion of results and allows for some statistical analysis that help to assess the differences among the PSO versions.
Due to the nature of the chosen normalized fitness function in Equation (
8), it is important to remark that small values of the cost function IAE result in fitness values close to 1. So, even if the values presented in the graph seem comparable, the performance differences are considerable.
At a first glance, it is clear that the global topology is better for this problem. The performances in these approaches are better than with their ring topology counterparts. The dispersion in these variants is also narrower, which means these algorithms achieve better solutions due to their exploration capability [
41].
Comparing the best three proposals demonstrates that using an inertial weight with linear decrease seems to be an advantage.
Another observation is that the topology change results in special performances related to updating velocities. In the most straightforward velocity update strategy, the topology of the ring generates the best results.
Finally, PSOs 5 and 6 are the worst regarding fitness and dispersion.
Figure 14 shows the evolution of each PSO strategy for each iteration. It gives an idea of how the individuals behave during the search. The graphics show the Global Best, the best in each iteration (Iteration Best), the average best of the iteration (Average), and the worse of the iteration (Iteration Worse).
In most cases, 30 iterations are enough for convergence. By the evolution of the average best, PSO2 and PSO3 achieved faster Average and Global Best convergences, indicating fewer iterations would be necessary for the optimization.
The resulting best parameters found, in this case by PSO3, are summarized in
Table 8. These parameters were selected and employed to obtain the waveforms shown in
Figure 15 and the experimental tests presented in the next section.
It is known that PID has limited robust responses for parameter variations, primarily due to its linear nature, which those nonlinear controllers can overcome. Then, a load sweep was performed to analyze each behavior of the controller, PID, and GAPID, remembering that the GAPID parameters are linked to the PID gains.
In
Figure 15, the output transients of the PID and GAPID controlled system subjected to variation of the moment of inertia in the range from 0.002 to 0.015 are presented. As expected, the load variation causes a significant change in behavior in the linear PID. In the GAPID, on the other hand, this behavior change is minimal, providing good robustness to load variation. In this case, there was also a considerable performance improvement. It is important to remark that, in our case, the fitness function is based on IAE, and load variation is considered, showing the robustness behavior becomes the primary objective of the optimization.
5.4. Experimental Results
For the experimental analysis, the three beams presented in
Section 4.2 were used as loads to the presented physical plant. In it, the motor carries different beams which represent different loads to test the performance and robustness of the controller.
The PID and the GAPID-tuned controllers were tested to a set point of angular speed of 5 rad/s., with the startup waveforms shown in
Figure 16 and
Figure 17.
For the PID controller, the gain values used were 0.2578 for the proportional (
), and 0.0625 for the integral (
), and the output response for each of the three beams is presented in
Figure 16.
In it, one can see that the output speed kept an overshoot under 5% and a settling time under 2 s with the light aluminum beam it was projected for. In contrast, the two other beams could not maintain a low overshoot and took longer to stabilize. The system was not unstable, and the PID was still able to control, but not with the same performance.
For the parameters of GAPID, the best solution (PSO3) parameters were taken, representing the set of parameters shown in
Table 8.
In
Figure 17, although the slower settling time is close to 4 s, the overshoot was under 5% for the three beams. It is noticeable that the output response behaves similarly even with the load mass variation in comparison to the performance of the PID.
It can be observed that the startup transients shown in
Figure 16 demonstrate that only the designed PID for one specific load performs well, while the others exhibit a lack of robustness. Again, the robustness advantage of GAPID is evident, as shown in
Figure 17, where the controller performs well for all loads.
6. Conclusions
This work addressed a comparative study about two bio-inspired algorithms, Genetic Algorithm (GA) and Particle Swarm Optimization (PSO), with six strategy variations each. These algorithms were used to find the optimal parameters of the Gaussian Adaptive PID control (GAPID) controller.
The test plant is a controlled rotating beam driven by a DC motor. The mathematical model was derived, enabling the building of a computational model used in simulations, and an experimentation plant was used to validate the results.
The GAPID, used to control this plant, represents an NP-Hard and multi-modal optimization problem with several distinct suboptimal solutions, then metaheuristics are used to find optimal solutions to the controller parameters.
In the PSO, the strategies were divided by topology (global or ring topology) and inertial weight factor (absent, fixed, or linearly decreasing).
The quality of the solution was evaluated by a fitness function that employs the Integral Absolute Error (IAE) value. This index covers the settling time and the overshoot of the output waveform.
The computational results were presented in boxplots which allow the analysis of the quality and dispersion of the solutions. It demonstrated that the global topology performs better than the ring topology, with higher fitness values and lower distribution.
A step response test shows how each GAPID optimization performs and how much better they are concerning PID. It is an essential conclusion since the existence of adaptive, robust, and reliable control strategies are very important in real applications.
In future works, it is planned to study a multi-objective optimization approach, which may also help us to better select robust solutions among the near best results. Moreover, other metaheuristic strategies can be tested to determine if any of them are more suitable for this problem, such as Whale Optimization Algorithm (WOA), Artificial Bee Colony (ABC), Differential Evolution (DE), Firefly Algorithm (FA), Bat Algorithm (BA), among others, should be tested in future works. Finally, other plants are also planned to be used as test plants, including higher-order and nonlinear ones.