Fast Real-Time Model Predictive Control for a Ball-on-Plate Process
Abstract
:1. Introduction
- Simplified process modeling based on state–space process description is derived.
- A fast state–space MPC algorithm is discussed and next applied to the considered ball-on-plate system. Its main advantage is computational simplicity: the manipulated variables are computed on-line using explicit formulas with parameters calculated off-line, no on-line optimization is necessary (nonlinear or quadratic). The presented state–space MPC algorithm uses a simple, yet very efficient state and output disturbance estimation necessary for prediction in state–space MPC [39].
- Software and hardware implementation details of the MPC algorithm are presented.
2. Ball-on-Plate Process
3. Fast Model Predictive Control
4. Real-Time Implementation of MPC for Ball-on-Plate Process Using STM32 Microcontroller
4.1. Hardware Set-Up
- A filter that finds out when the sensor stops detecting the ball. The touch panel then returns position values zero or NaN. When the filter detects such a value, it is ignored and the last meaningful number is taken as the current position value.
- A filter that finds out when the sensor detects an incorrect ball position. If the current position change is greater than a certain threshold, it is ignored.
- An arithmetical filter that collects n measurements of the ball position and calculates the ball position as:The ADCs of the microcontroller operate with much higher frequency than the developed controllers. Therefore, it is possible to collect more than 100 measurements in one control loop. The value has been chosen experimentally, as the smallest one that is able to eliminate all measurement errors. This filter is necessary for the system to work properly. Without it, the measurement errors destabilize all control algorithms.
- A median filter, which could be used as an alternative to arithmetical filter described above.
- Additionally, a Kalman filter has been implemented in the system. Its main role is to serve as an observer that estimates the unmeasured ball velocity value later used in the MPC algorithm. However, during the experiments it was observed that using Kalman filter’s estimates of the ball position instead of the true position measurements, helps to improve the quality of control slightly, due to elimination of small interferences that slipped through the arithmetical/median filter. In other words, the estimated position signal is slightly smoother than the measured signal.
- pin PB10 is configured as TIM3 timer’s channel 3 and used to send PWM control signal to the X axis servomotor,
- pin PA1 is configured as TIM3 timer’s channel 2 and used to send PWM control signal to the Y axis servomotor,
- pins PA2, PA3, PB0, PB1 are connected to the resistive touch panel, their configuration change in time as described in Table 1.
4.2. Software System
Listing 1: Fragment of the code: calculation of the control signal for the MPC controller. |
|
|
5. Results of Experiments
- constant weighting coefficients are assumed,
- the same prediction horizon N and control horizon are used; if the controller is not working properly, both horizons are lengthened,
- the prediction horizon is gradually shortened, and its length is chosen (with the condition ),
- the effect of the changing the length of the control horizon on the resulting control quality is assessed experimentally (e.g., assume successively ). The shortest possible control horizon is chosen.
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Bay, C.J.; Rasmussen, B.P. Exploring controls education: A re-configurable ball and plate platform kit. In Proceedings of the 2016 American Control Conference (ACC), Boston, MA, USA, 6–8 July 2016; pp. 6652–6657. [Google Scholar]
- Fabregas, E.; Dormido-Canto, S.; Dormido, S. Virtual and Remote Laboratory with the Ball and Plate System. IFAC-PapersOnLine 2017, 50, 9132–9137. [Google Scholar] [CrossRef]
- Stander, D.; Jiménez-Leudo, S.; Quijano, N. Low-Cost “ball and Plate” design and implementation for learning control systems. In Proceedings of the 2017 IEEE 3rd Colombian Conference on Automatic Control (CCAC), Cartagena, Colombia, 18–20 October 2017; pp. 1–6. [Google Scholar]
- Dušek, F.; Honc, D.; Sharma, K.R. Modelling of ball and plate system based on first principle model and optimal control. In Proceedings of the 2017 21st International Conference on Process Control (PC), Strbske Pleso, Slovakia, 6–9 June 2017; pp. 216–221. [Google Scholar]
- Kassem, A.; Haddad, H.; Albitar, C. Commparison Between Different Methods of Control of Ball and Plate System with 6DOF Stewart Platform. IFAC-PapersOnLine 2015, 48, 47–52. [Google Scholar] [CrossRef]
- Spacek, L.; Bobal, V.; Vojtesek, J. Digital control of Ball & Plate model using LQ controller. In Proceedings of the 2017 21st International Conference on Process Control (PC), Strbske Pleso, Slovakia, 6–9 June 2017; pp. 36–41. [Google Scholar]
- Bang, H.; Lee, Y.S. Implementation of a Ball and Plate Control System Using Sliding Mode Control. IEEE Access 2018, 6, 32401–32408. [Google Scholar] [CrossRef]
- Jeon, J.; Hyun, C. Adaptive sliding mode control of ball and plate systems for its practical application. In Proceedings of the 2017 2nd International Conference on Control and Robotics Engineering (ICCRE), Bangkok, Thailand, 1–3 April 2017; pp. 119–123. [Google Scholar]
- Morales, L.; Gordón, M.; Camacho, O.; Rosales, A.; Pozo, D. A Comparative Analysis among Different Controllers Applied to the Experimental Ball and Plate System. In Proceedings of the 2017 International Conference on Information Systems and Computer Science (INCISCOS), Quito, Ecuador, 23–25 November 2017; pp. 108–114. [Google Scholar]
- Robayo Betancourt, F.I.; Brand Alarcon, S.M.; Aristizabal Velasquez, L.F. Fuzzy and PID controllers applied to ball and plate system. In Proceedings of the 2019 IEEE 4th Colombian Conference on Automatic Control (CCAC), Medellin, Colombia, 15–18 October 2019; pp. 1–6. [Google Scholar]
- Moreno-Armendáriz, M.A.; Pérez-Olvera, C.A.; Rodríguez, F.O. Indirect hierarchical FCMAC control for the ball and plate system. Neurocomputing 2010, 73, 2454–2463. [Google Scholar] [CrossRef]
- Huang, W.; Zhao, Y.; Ye, Y.; Xie, W. State Feedback Control for Stabilization of the Ball and Plate System. In Proceedings of the 2019 Chinese Control Conference (CCC), Guangzhou, China, 27–30 July 2019; pp. 687–690. [Google Scholar]
- Wang, Y.; Sun, M.; Wang, Z.; Liu, Z.; Chen, Z. A novel disturbance-observer based friction compensation scheme for ball and plate system. ISA Trans. 2014, 53, 671–678. [Google Scholar] [CrossRef] [PubMed]
- Tatjewski, P. Disturbance modeling and state estimation for offset-free predictive control with state-space models. Int. J. Appl. Math. Comput. Sci. 2014, 24, 313–323. [Google Scholar] [CrossRef] [Green Version]
- Nebeluk, R.; Marusak, P. Efficient MPC algorithms with variable trajectories of parameters weighting predicted control errors. Arch. Control Sci. 2020, 30, 325–363. [Google Scholar]
- Huyck, B.; De Brabanter, J.; De Moor, B.; Van Impe, J.F.; Logist, F. Online model predictive control of industrial processes using low level control hardware: A pilot-scale distillation column case study. Control Eng. Pract. 2014, 28, 34–48. [Google Scholar] [CrossRef] [Green Version]
- Pour, F.K.; Puig, V.; Ocampo-Martinez, C. Multi-layer health-aware economic predictive control of a pasteurization pilot plant. Int. J. Appl. Math. Comput. Sci. 2018, 28, 97–110. [Google Scholar] [CrossRef] [Green Version]
- Wang, B.; Shahzad, M.; Zhu, X.; Rehman, K.U.; Uddin, S. A Non-linear Model Predictive Control Based on Grey-Wolf Optimization Using Least-Square Support Vector Machine for Product Concentration Control in l-Lysine Fermentation. Sensors 2020, 20, 3335. [Google Scholar] [CrossRef] [PubMed]
- Carli, R.; Cavone, G.; Ben Othman, S.; Dotoli, M. IoT Based Architecture for Model Predictive Control of HVAC Systems in Smart Buildings. Sensors 2020, 20, 781. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Rybus, T.; Seweryn, K.; Sąsiadek, J.Z. Application of predictive control for manipulator mounted on a satellite. Arch. Control Sci. 2018, 28, 105–118. [Google Scholar]
- Ogonowski, S.; Bismor, D.; Ogonowski, Z. Control of complex dynamic nonlinear loading process for electromagnetic mill. Arch. Control Sci. 2020, 30, 471–500. [Google Scholar]
- Horla, D. Experimental Results on Actuator/Sensor Failures in Adaptive GPC Position Control. Actuators 2021, 10, 43. [Google Scholar] [CrossRef]
- Eskandarpour, A.; Sharf, I. A constrained error-based MPC for path following of quadrotor with stability analysis. Nonlinear Dyn. 2020, 98, 899–918. [Google Scholar] [CrossRef]
- Ducajú, S.; Salt Llobregat, J.J.; Cuenca, Á.; Tomizuka, M. Autonomous Ground Vehicle Lane-Keeping LPV Model-Based Control: Dual-Rate State Estimation and Comparison of Different Real-Time Control Strategies. Sensors 2021, 21, 1531. [Google Scholar] [CrossRef] [PubMed]
- Bassolillo, S.R.; D’Amato, E.; Notaro, I.; Blasi, L.; Mattei, M. Decentralized Mesh-Based Model Predictive Control for Swarms of UAVs. Sensors 2020, 20, 4324. [Google Scholar] [CrossRef]
- Bania, P. An information based approach to stochastic control problems. Int. J. Appl. Math. Comput. Sci. 2020, 30, 47–59. [Google Scholar]
- Fan, J.; Han, M. Nonliear model predictive control of ball-plate system based on gaussian particle swarm optimization. In Proceedings of the 2012 IEEE Congress on Evolutionary Computation, Brisbane, QLD, Australia, 10–15 June 2012; pp. 1–6. [Google Scholar]
- Bang, H.; Lee, Y.S. Embedded Model Predictive Control for Enhancing Tracking Performance of a Ball-and-Plate System. IEEE Access 2019, 7, 39652–39659. [Google Scholar] [CrossRef]
- Oravec, M.; Jadlovská, A. Model Predictive Control of a Ball and Plate laboratory model. In Proceedings of the 2015 IEEE 13th International Symposium on Applied Machine Intelligence and Informatics (SAMI), Herl’any, Slovakia, 22–24 January 2015; pp. 165–170. [Google Scholar]
- Houska, B.; Ferreau, H.J.; Diehl, M. An auto-generated real-time iteration algorithm for nonlinear MPC in the microsecond range. Automatica 2011, 47, 2279–2285. [Google Scholar] [CrossRef]
- Wang, Y.; Boyd, S. Fast model predictive control using online optimization. IEEE Trans. Control Syst. Technol. 2010, 18, 267–278. [Google Scholar] [CrossRef] [Green Version]
- Bemporad, A.; Morari, M.; Dua, V.; Pistikopoulos, E.N. The explicit linear quadratic regulator for constrained systems. Automatica 2002, 38, 3–20. [Google Scholar] [CrossRef]
- Valencia-Palomo, G.; Rossiter, J.A. AEfficient suboptimal parametric solutions to predictive control for PLC applications. Control Eng. Pract. 2011, 19, 732–743. [Google Scholar] [CrossRef] [Green Version]
- Rauová, I.; Valo, R.; Kvasnica, M.; Fikar, M. Real-Time Model Predictive Control of a Fan Heater via PLC. In Proceedings of the 18th International Conference on Process Control, Slovak University of Technology in Bratislava, Tatranská Lomnica, Slovakia, 14–17 June 2011; pp. 388–393. [Google Scholar]
- Liu, S.; Wang, J. A simplified dual neural network for quadratic programming with its KWTA application. IEEE Trans. Neural Netw. 2006, 17, 1500–1510. [Google Scholar] [PubMed]
- Tatjewski, P. Advanced Control of Industrial Processes, Structures and Algorithms; Springer: London, UK, 2007. [Google Scholar]
- Chaber, P.; Ławryńczuk, M. Fast Analytical Model Predictive Controllers and Their Implementation for STM32 ARM Microcontroller. IEEE Trans. Ind. Inf. 2019, 15, 4580–4590. [Google Scholar] [CrossRef]
- Valencia-Palomo, G.; Rossiter, J.A. Programmable logic controller implementation of an auto-tuned predictive control based on minimal plant information. ISA Trans. 2011, 50, 92–100. [Google Scholar] [CrossRef]
- Tatjewski, P.; Ławryńczuk, M. Algorithms with state estimation in linear and nonlinear model predictive control. Comput. Chem. Eng. 2020, 143, 107065. [Google Scholar] [CrossRef]
- Zarzycki, K.; Ławryńczuk, M. Development and modelling of a laboratory ball on plate process. In Advanced, Contemporary Control; Bartoszewicz, A., Kabziński, J., Kacprzyk, J., Eds.; Advances in Intelligent Systems and Computing; Springer: Cham, Switzerland, 2020; Volume 1196, pp. 396–408. [Google Scholar]
- Maeder, U.; Morari, M. Offset-free reference tracking with model predictive control. Automatica 2010, 46, 1469–1476. [Google Scholar] [CrossRef]
- Muske, K.; Badgwell, T. Disturbance modeling for offset-free linear model predictive control. J. Process Control 2002, 12, 617–632. [Google Scholar] [CrossRef]
- Pannocchia, G.; Rawlings, J. Disturbance models for offset-free model predictive control. AIChE J. 2003, 49, 426–437. [Google Scholar] [CrossRef]
- HS-5485HB Standard Karbonite Digital Sport Servo. Available online: https://hitecrcd.com/products/servos/sport-servos/digital-sport-servos/hs-5485hb-standard-karbonite-digital-servo/product (accessed on 8 June 2021).
- 15” 4-Wire Resistive Screen. Available online: http://www.greentouch.com.tw/product/22-inch-four-wire-resistive-screen.html (accessed on 8 June 2021).
- Domański, P. Control Performance Assessment: Theoretical Analyses and Industrial Practice; Studies in Systems, Decision and Control; Springer: Cham, Switzerland, 2020; Volume 245. [Google Scholar]
- Ławryńczuk, M. Computationally Efficient Model Predictive Control Algorithms: A Neural Network Approach; Studies in Systems, Decision and Control; Springer: Cham, Switzerland, 2014; Volume 3. [Google Scholar]
- Marusak, P.M. A numerically efficient fuzzy MPC algorithm with fast generation of the control signal. Int. J. Appl. Math. Comput. Sci. 2021, 31, 59–71. [Google Scholar]
Short Biography of Authors
| Krzysztof Zarzycki was born in Pruszków, Poland, in 1993. He received his B.Sc. degree in 2017 at the Faculty of Mechatronics, Warsaw University of Technology, and his M.Sc. degree in 2020 at the Faculty of Electronics and Information Technology, the same university, both in automatic control and robotics. He has been with the Institute of Control and Computation Engineering, Warsaw University of Technology, since 2020, where he is currently employed as an assistant. His scientific interests include: algorithms for industrial process control, mainly advanced Model Predictive Control (MPC), and applications of artificial intelligence as a tool in process control and modelling. |
| Maciej awryńczuk was born in Warsaw, Poland, in 1972. He obtained his M.Sc. in 1998, Ph.D. in 2003, D.Sc. in 2013, all in automatic control, from Warsaw University of Technology, Faculty of Electronics and Information Technology. Currently, he is employed at the same university at the Institute of Control and Computation Engineering as an associate professor. He is the author or co-author of six books and more than 100 other publications, including over 40 journal articles. His research interests include advanced control algorithms, in particular, Model Predictive Control (MPC) algorithms, set-point optimisation algorithms, soft computing methods, in particular, neural networks, modelling, and simulation. |
Function | PA2 | PA3 | PB0 | PB1 |
---|---|---|---|---|
read x | output 1 | ADC2 | output 0 | input no pullup |
read y | ADC1 | output 1 | input no pullup | output 0 |
N | V | ||||
---|---|---|---|---|---|
20 | 3 | ||||
40 | 5 | ||||
80 | 10 |
Controller | |||
---|---|---|---|
PI | 7327.9 | 2759.2 | 10087.1 |
PD | 1662.7 | 4420.9 | 6083.6 |
PID | 483.9 | 837.9 | 1321.8 |
LQR1 | 692.3 | 825.6 | 1517.9 |
LQR2 | 684.3 | 793.7 | 1478.0 |
LQR3 | 676.0 | 849.9 | 1525.9 |
MPC1 | 881.5 | 498.0 | 1379.5 |
MPC2 | 1274.5 | 1378.6 | 2653.1 |
MPC3 | 373.7 | 760.0 | 1133.7 |
Controller | ||||
---|---|---|---|---|
PI | Impossible to determine | |||
PD | Impossible to determine | |||
PID | 3.75 | 7 | 4.5 | 9 |
LQR1 | Impossible to determine | |||
LQR2 | 4 | 7 | 5.5 | 8 |
LQR3 | 4.83 | 6 | 5.83 | 8 |
MPC1 | 3.17 | 4 | 5.17 | 7 |
MPC2 | Impossible to determine | |||
MPC3 | 2.17 | 3 | 2 | 2 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zarzycki, K.; Ławryńczuk, M. Fast Real-Time Model Predictive Control for a Ball-on-Plate Process. Sensors 2021, 21, 3959. https://doi.org/10.3390/s21123959
Zarzycki K, Ławryńczuk M. Fast Real-Time Model Predictive Control for a Ball-on-Plate Process. Sensors. 2021; 21(12):3959. https://doi.org/10.3390/s21123959
Chicago/Turabian StyleZarzycki, Krzysztof, and Maciej Ławryńczuk. 2021. "Fast Real-Time Model Predictive Control for a Ball-on-Plate Process" Sensors 21, no. 12: 3959. https://doi.org/10.3390/s21123959
APA StyleZarzycki, K., & Ławryńczuk, M. (2021). Fast Real-Time Model Predictive Control for a Ball-on-Plate Process. Sensors, 21(12), 3959. https://doi.org/10.3390/s21123959