Performance comparison between the results obtained by MATLAB pidtune and the proposed genetic algorithm. In bold are highlighted the better results for each parameter.
Abstract
The PID controller is widely used in industry and its tuning is always a concern for the plant stabilization. Several methods for auto-tuning the PID have been proposed over the years, however, the relay method is the most used even though this method may determine nonideal PID gains and cause some physical stress on the plant. Here is presented a proposal for an auto-tuning PID controller based on a genetic algorithm. Genetic algorithm is a well-known method that imitates the natural selection process in order to obtain approximate solutions to optimization problems. Here, the method is presented in underdamped plants with the hypothesis that any plant can be approximated to a second-order function. From the unit step response of the system, the maximum overshoot and peak time were used in the GA evolution to obtain optimal PID parameters. The system was tested with a set of parameters and compared to MATLAB PID tuner function. Using the rising time and the settling time of unit step response from the closed loop system as validation parameters, the GA presented better results than the MATLAB tuner for most cases.
Keywords
- auto-tuning PID
- genetic algorithm
- artificial intelligence
- PID controller
- underdamped second order plants
1. Introduction
The PID (Proportional–Integral–Derivative) controller is widely used in industry for process control and robotics. The auto-tuning is an important feature embedded in some commercial PID controllers. This feature is responsible for tuning the PID controller by using the plant’s unit step response and changing the
Figure 1 presents a typical unit step response from a second-order system with the parameters indication. The
The PID controllers are tuned by the
There are well-established auto-tuning algorithms that implement the relay and Ziegler-Nichols methods [7]. The Ziegler-Nichols method requires the parameters from the system in an oscillatory fashion to obtain the critic
Another approach is the usage of artificial intelligence [9]. Applications using Fuzzy Logic [10] for PID tuning are based on a predetermined expert system, which uses a rule table for each of the controller parameters. By using this set of rules, it was possible to reach a satisfactory result. Other works using fuzzy [11, 12, 13] and flower pollination algorithms [14] presented good results for obtaining the PID parameters. The point here is that auto-tuning of PID controllers using artificial intelligence is a possibility.
The artificial neural network (ANN) has the disadvantage in the need of a large quantity of data from the plant. Whereas, the use of genetic algorithm (GA) uses only the unit step response parameters. The GA is able to produce better results than Ziegler-Nichols in terms of performance [15, 16]. Therefore, this work proposes the usage of GA for tuning the values of
This method allows the tuning of the PID controller with minimal physical plant stress. The method allows the parameter computation from any physical plant of unknown mathematical model since the idea is the approximation to a second-order function.
2. Methodology
The proposed system uses the extraction of temporal parameters from the plant unit step response. The method uses the extracted temporal data to apply it to a transfer function. This transfer function (second-order mathematical model) was used by the GA to validate the parameters
A unit step signal is applied to the plant. Next, from the unit step response of the plant is possible to obtain the peak time
Hence, the idea is to approximate any plant to a second-order system. By the
The PID controller is determined by Eq. (4).
The feedback model of the system yields Eq. (5).
At this point, the control structure is established. Now the question is how to determine the parameters to improve the
The ideal desired output
This error was used to improve the GA algorithm that computes new values for
The genetic algorithm is a method to seek approximate solutions to optimization problems. The main idea is to look for better solutions from a population of abstract solution representations. The evolution starts with a random population to form the generation, in each generation, each solution is evaluated, some are selected, some are discarded, and some are recombined or mutated to form the next generation. The next generation is used in the next interaction of the algorithm.
In the presented method, the parameters to be tuned in the PID are the
The GA optimal hyperparameters were defined after testing. In these tests, the hyperparameters were varied individually over a well-known plant (a classic underdamped system of second order). We used some different plants to realize these tests and validate the system. Their step response was generated using MATLAB and fed into the system in order to analyze different overshoot levels. With these tests, the optimum hyperparameters were a population with 100 individuals (genomes), 50 generations (50 times that the GA has the opportunity to evolve), and a mutation chance of 6% (a random factor responsible to avoid locals optimum).
3. Discussion and results
In order to check the effectiveness of the proposed method for PID tuning, we compared the tuning capability with the pidtune function from MATLAB, which is a well-known tool for mathematics and very robust for control analysis. Our method was developed in MATLAB, as well, for a fair comparison.
Table 1 presents the results for the MATLAB pintune and the proposed GA method for a second-order plant with different values of
ξ | ωn (rad/s) | MATLAB | GA | MATLAB | GA | MATLAB | GA | MATLAB | GA | MATLAB | GA |
---|---|---|---|---|---|---|---|---|---|---|---|
KP | KP | KI | KI | KD | KD | tr (ms) | tr (ms) | ts (ms) | ts (ms) | ||
0.1 | 2 | 24.20 | 24.445 | 11.100 | 98.865 | 13.100 | 39.782 | 41.0 | 61.0 | ||
10 | 1.05 | 1.000 | 0.546 | 7.691 | 0.507 | 1.000 | 70.0 | 11200.0 | |||
0.3 | 2 | 24.20 | 59.656 | 11.100 | 99.494 | 13.100 | 39.942 | 43.0 | 68.0 | ||
10 | 3.16 | 3.505 | 4.900 | 0.362 | 0.509 | 0.332 | 67.0 | 29600.0 | |||
0.6 | 2 | 31.60 | 99.083 | 19.000 | 99.752 | 13.100 | 47.501 | 44.0 | 76.0 | ||
10 | 6.31 | 1.000 | 19.400 | 13.833 | 0.514 | 1.000 | 571.0 | 2420.0 | |||
0.9 | 2 | 47.30 | 99.816 | 42.600 | 99.974 | 13.100 | 80.820 | 44.0 | 75.0 | ||
10 | 9.47 | 9.858 | 42.900 | 99.310 | 0.525 | 1.000 | 45.0 | 215.0 |
Observing the
Figure 3 presents the unit step response of the second order plant and the closed loop with the MATLAB function and the GA method with
Figure 4 presents the results for
Figure 5 presented the results for
Finally, Figure 6 presents the results for
It was possible to observe that both techniques eliminated the overshoot and searched for the smallest rising time
Hence, the proposed method was developed to obtain the better performance in terms of
4. Conclusion
The presented work proposed a method for auto-tuning PID controllers using genetic algorithm. The method was applied to different parameters of a second order plant and compared to the MATLAB pidtune function. The GA method presented better results than MATLAB function for the most cases. The cases in that GA had a poor result were with high oscillations in unit step response of the plant. The explanation may the choice of the simple error function, thus a more sophisticated and complete error determination shall be studied. Although the advantage of the proposed GA method is that any prior knowledge of control system is not necessary to avoid complex analysis of high-order mathematical models.
Acknowledgments
The authors are grateful for the technical and financial support of UniRV (Rio Verde University), which made the publication of this book chapter possible. They also thank IntechOpen for the opportunity to share their studies and knowledge with other researchers.
References
- 1.
Blondin MJ, Sanchis Sáez J, Pardalos PM. Control Engineering from Classical to Intelligent Control Theory—An Overview. In: Blondin M, Pardalos P, Sanchis Sáez J, editors. Computational Intelligence and Optimization Methods for Control Engineering. Springer Optimization and Its Applications. Vol. 150. Cham: Springer; 2019. DOI: 10.1007/978-3-030-25446-9_1 - 2.
Borase RP, Maghade D, Sondkar S, Pawar S. A review of pid control, tuning methods and applications. International Journal of Dynamics and Control. 2021; 9 (2):818-827 - 3.
Lloyds Raja G, Ali A. New pi-pd controller design strategy for industrial unstable and integrating processes with dead time and inverse response. Journal of Control, Automation and Electrical Systems. 2021; 32 (2):266-280 - 4.
Castellanos-C’ardenas D, Castrill’on F, V’asquez RE, Smith C. Pid tuning method based on imc for inverse-response second-order plus dead time processes. PRO. 2020; 8 (9):1183 - 5.
Nguyen NH, Nguyen PD. Overshoot and settling time assignment with pid for first-order and second-order systems. IET Control Theory & Applications. 2018; 12 (17):2407-2416 - 6.
Somefun OA, Akingbade K, Dahunsi F. The dilemma of pid tuning. Annual Reviews in Control. 2021; 52 :65-74 - 7.
Patel VV. Ziegler-Nichols tuning method. Resonance. 2020; 25 (10):1385-1397 - 8.
Aisuwarya R, Hidayati Y. Implementation of Ziegler-Nichols PID Tuning Method on Stabilizing Temperature of Hot-water Dispenser. In: 2019 16th International Conference on Quality in Research (QIR): International Symposium on Electrical and Computer Engineering, Padang, Indonesia. 2019. pp. 1-5. DOI: 10.1109/QIR.2019.8898259 - 9.
Ekinci S, Hekimoğlu B, Kaya S. Tuning of PID Controller for AVR System Using Salp Swarm Algorithm. In: 2018 International Conference on Artificial Intelligence and Data Processing (IDAP), Malatya, Turkey. 2018. pp. 1-6. DOI: 10.1109/IDAP.2018.8620809 - 10.
Senthil Kumar S, Anitha G. A novel self-tuning fuzzy logic-based PID controllers for two-axis gimbal stabilization in a missile seeker. International Journal of Aerospace Engineering. 2021:1-12 - 11.
Anand A, Aryan P, Kumari N, Raja GL. Type-2 fuzzy-based branched controller tuned using arithmetic optimizer for load frequency control. Energy Sources, Part A: Recovery, Utilization, and Environmental Effects. 2022; 44 (2):4575-4596 - 12.
El-Samahy AA, Shamseldin MA. Brushless dc motor tracking control using self-tuning fuzzy pid control and model reference adaptive control. Ain Shams Engineering Journal. 2018; 9 (3):341-352 - 13.
Somwanshi D, Bundele M, Kumar G, Parashar G. Comparison of fuzzy-pid and pid controller for speed control of dc motor using labview. Procedia Computer Science. 2019; 152 :252-260 - 14.
Potnuru D, Mary KA, Babu CS. Experimental implementation of flower pollination algorithm for speed controller of a bldc motor. Ain Shams Engineering Journal. 2019; 10 (2):287-295 - 15.
Bari S, Zehra Hamdani SS, Khan HU, Rehman Mu, Khan H. Artificial Neural Network Based Self-Tuned PID Controller for Flight Control of Quadcopter. In: 2019 International Conference on Engineering and Emerging Technologies (ICEET), Lahore, Pakistan. 2019. pp. 1-5. DOI: 10.1109/CEET1.2019.8711864 - 16.
Rodr’ıguez-Abreo O, Rodr’ıguez-Res’endiz J, Fuentes-Silva C, Hern’andez-Alvarado R, Falc’on MDCPT. Self-tuning neural network pid with dynamic response control. IEEE Access. 2021; 9 :65206-65215 - 17.
Kumar D, Aryan P, Raja GL. Design of a novel fractionalorder internal model controller-based smith predictor for integrating processes with large dead-time. Asia-Pacific Journal of Chemical Engineering. 2022; 17 (1):e2724 - 18.
Kumari S, Aryan P, Raja GL. Design and simulation of a novel foimc-pd/p double-loop control structure for cstrs and bioreactors. International Journal of Chemical Reactor Engineering. 2021; 19 (12):1287-1303 - 19.
Mukherjee D, Raja G, Kundu P. Optimal fractional order imcbased series cascade control strategy with dead-time compensator for unstable processes. Journal of Control, Automation and Electrical Systems. 2021; 32 (1):30-41