Abstract
Programmable logic controllers (PLCs) are usually equipped with only basic direct control algorithms like proportional-integral-derivative (PID). Modules included in engineering software running on a personal computer (PC) are usually used to tune controllers. In this article, an alternative approach is considered, i.e. the development of a stochastic optimizer based on the (μ,λ) evolution strategy (ES) in a PLC. For this purpose, a pseudorandom number generator (pRNG) was implemented, which is not normally available in most PLCs. The properties of popular random number generation methods were analyzed in terms of distribution uniformity and possibility of implementation in a PLC. The Wichmann-Hill (WH) algorithm was chosen for implementation. The developed generator with a uniform distribution was the basis for the implementation of a generator with a normal distribution. Both generators are the engines of the stochastic optimization algorithm in the form of the (μ, λ) strategy. For verification purposes, a modular servomechanism laboratory set was used as a test object for PID and linear-quadratic regulator (LQR) control. Moreover, the possibility of using the developed optimizer was shown in an application of model predictive control (MPC). Comprehensive tests confirmed the correctness of the implementation and high functionality of the developed software. Calculation time issues are also investigated.
Article PDF
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
References
M. He and C. Chen, “An effective online computation scheme for constrained model predictive control in embedded systems,” Proc. of 6th World Congress on Intelligent Control and Automation, vol. 2, pp. 6699–6703, 2006.
B. Käpernick, “PLC implementation of a nonlinear model predictive controller,” IFAC Proceedings Volumes, vol. 47, no. 3, pp. 1892–1897, 2014.
P. Krupa, D. Limon, and T. Alamo, “Implementation of model predictive control in programmable logic controllers,” IEEE Transactions on Control Systems Technology, vol. 29, no. 3, pp. 1117–1130, 2021.
G. Valencia-Palomo and J. Rossiter, “Efficient suboptimal parametric solutions to predictive control for PLC applications,” Control Engineering Practice, vol. 19, no. 7, pp. 732–743, 2011.
F. Delfino, M. Rossi, R. Minciardi, and M. Robba, “An optimization based architecture for local systems managed by PLC devices,” Proc. of IEEE International Symposium on Systems Engineering (ISSE), pp. 17–22, 2015.
J. Tarnawski, P. Kudelka, and M. Korzeniowski, “Advanced control with PLC-code generator for aMPC controller implementation and cooperation with external computational server for dealing with multidimensionality, constraints and LMI based robustness,” IEEE Access, vol. 10, pp. 10597–10617, 2022.
A. Purohit and J. Buch, “Evaluation of optimization solvers on programmable logic controller,” Proc. of IEEE Conference on Control Applications (CCA), pp. 533–538, 2015.
D. Kouzoupis, A. Zanelli, H. Peyrl, and H. Ferreau, “Towards proper assessment of QP algorithms for embedded model predictive control,” Proc. of European Control Conference (ECC), pp. 2609–2616, 2015.
C. Schreppel and J. Brembeck, “A QP solver implementation for embedded systems applied to control allocation,” Computation, vol. 8, no. 4, p. 88, 2020.
M. Mohamed, M. Ghazali, S. Idrus, and N. Wahab, “Optimization through artificial neural network on a programmable logic controller for a sludge drying plant,” Proc. of IEEE 9th International Colloquium on Signal Processing and Its Applications, pp. 103–105, 2013.
S. Howimanporn, S. Chookaew, and W. Sootkaneung, “Implementation of PSO based gain-scheduled PID and LQR for DC motor control using PLC and SCADA,” Proc. of International Conference on Control and Robots (ICCR), pp. 52–56, 2018.
J. Lu, “Design of PLC intelligent control system based on improved genetic ant colony algorithm,” Proc. of IEEE 2nd International Conference on Electronic Technology, Communication and Information (ICETCI), pp. 1185–1188, 2022.
H. Schwefel, Evolution and Optimum Seeking: The Sixth Generation, John Wiley & Sons, Inc., 1993.
Z. Michalewicz, Genetic Algorithms + Data Structures = Evolution Programs, Springer-Verlag, Berlin, Heidelberg, pp. 372–373, 1996.
D. Goldberg, Genetic Algorithms in Search, Optimization, and Machine Learning, Addition-Westly, Reading MA, 1989.
T. Bäck, C. Foussette, and P. Krause, Contemporary Evolution Strategies, Springer, Berlin, vol. 86, 2013.
“Creating and Controlling a Random Number Stream,”, Mathworks, https://www.mathworks.com/help/matlab/math/creating-and-controlling-a-random-number-stream.html, Accessed on 2023-11-20.
V. Neumann, “Various techniques used in connection with random digits,” Notes By GE Forsythe, pp. 36–38, 1951.
B. Wichmann and I. Hill, “Algorithm AS 183: An efficient and portable pseudo-random number generator,” Journal of The Royal Statistical Society. Series C (Applied Statistics), vol. 31, pp. 188–190, 1982.
L. Blum, M. Blum, and M. Shub, “A simple unpredictable pseudo-random number generator,” SIAM Journal on Computing, vol. 15, pp. 364–383, 1986.
G. Box and M. Muller, “A note on the generation of random normal deviates,” The Annals of Mathematical Statistics, vol. 29, pp. 610–611, 1958.
J. Arabas, Wykłady Z Algorytmów Ewolucyjnych, Wydawnictwa Naukowo-Techniczne, 2004.
K. Åström and T. Hägglund, Advanced PID Control, ISA-The Instrumentation, Systems, and Automation Society, 2006.
J. Tarnawski, T. Rutkowski, and A. Cimiński, “Implementation of hierarchical control of drinking water supply system: Didactic project - Computer controlled system,” Proc. of 22nd International Conference on Methods and Models in Automation and Robotics (MMAR), pp. 831–836, 2017.
A. Kowalczyk, A. Wlodarczyk, and J. Tarnawski, “Microgrid energy management system,” Proc. of 21st International Conference on Methods and Models in Automation and Robotics (MMAR), pp. 157–162, 2016.
O. Kramer, “A review of constraint-handling techniques for evolution strategies,” Applied Computational Intelligence and Soft Computing, vol. 2010, pp. 1–19, 2010.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
All authors have no conflicts of interest. The program code for tuning PID and LQR controllers and for the MPC controller in the form of a Siemens TIA Portal V18 PLC project has been attached to the content of the article as supplementary material. For the convenience of readers, text versions of individual procedures and a description of the program structure have also been prepared.
Additional information
Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Financial support of these studies from Gdańsk University of Technology by the 12/1/2023/IDUB/III.1a/Ra grant under the Radium - ‘Excellence Initiative - Research University’ program is gratefully acknowledged.
Kajetan Zielonacki was born in Gdynia, Poland, in 2000. He received his B.Eng. degree in automatics and robotics from the Gdańsk University of Technology in 2023. His research interests include programmable logic controllers, optimal control, and evolutionary algorithms.
Jarosław Tarnawski was born in Gdńnsk, Poland, in 1974. He received his M.Sc. and Ph.D. degrees from the Gdansk University of Technology. He is currently an Assistant Professor with the Department of Electrical Engineering, Control Systems and Computer Science, Gdańsk University of Technology. His research interests include mathematical modeling, identification, optimization, and hierarchical control systems.
Rights and permissions
About this article
Cite this article
Zielonacki, K., Tarnawski, J. PLC-based Implementation of Stochastic Optimization Method in the Form of Evolutionary Strategies for PID, LQR, and MPC Control. Int. J. Control Autom. Syst. 22, 1846–1855 (2024). https://doi.org/10.1007/s12555-023-0869-6
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s12555-023-0869-6