Offset-free MPC of Temperature in Smart Greenhouse VESNA Erika Pavloviˇcov´a, Jozef Vargan, Peter Bakar´aˇc, Miroslav Fikar, Juraj Oravec Institute of Information Engineering, Automation, and Mathematics, Faculty of Chemical and Food Technology, Slovak University of Technology in Bratislava, Radlinsk´eho 9, SK-812 37, Bratislava, e-mail: erika.pavlovicova@stuba.sk. Abstract: The VESNA smart greenhouse system aims for sustainable, ecological, and organic food production. This study explores an offset-free model predictive controller (MPC) for temperature tracking. The MPC proves effective in maintaining temperature within constraints. Extensive experiments assess different MPC setups, focusing on environmental factors, including energy use and carbon footprint. Additionally, a novel software toolbox simplifies analysis and remote control, enhancing user-friendliness. Together, the designed offset-free reference tracking MPC controllers and the toolbox offer a comprehensive solution for smart greenhouse control. Keywords: Process Control, IoT, Optimization and Model Predictive Control, Smart Greenhouse, Offset-free Control, Object-oriented Programming, Industry 4.0 1. INTRODUCTION Climate change and resource limitations are pushing sus- tainable production forward. Integrating advanced control technologies, such as smart greenhouses, efficiently ad- dresses these challenges. Applying optimal control meth- ods minimizes the adverse effects on climate (Bersani et al., 2020) and intensifies crop production (Villagran et al., 2020). Temperature control is crucial in maintaining optimal growing conditions for various crops in greenhouses. Tradi- tional control methods like PID controllers often struggle to achieve precise and efficient temperature performance. Optimization-based control strategies, such as well-known model predictive control (MPC) (Qin and Badgwell, 2003), provide a matured control strategy addressing these limi- tations and enabling efficient reference tracking tempera- ture control in greenhouse environments. MPC has gained increasing attention as a robust, versatile control method for greenhouse environments. Several studies have investi- gated the application of MPC in greenhouse temperature control, demonstrating its ability to control temperature effectively while dynamically adapting to changing envi- ronmental conditions. An analysis of the control perfor- mance of MPC and reinforcement learning for managing a lettuce greenhouse was presented in Morcego et al. (2023). They showed better results using MPC considering energy and economic efficiency. Hu and You (2022) proposed a data-driven robust MPC to control the inner environ- mental conditions of the greenhouse in the presence of uncertainty. While the papers above primarily focused on simulated re- sults and theoretical guarantees, the presented paper intro- duces a comprehensive solution for laboratory greenhouse control, including a user-friendly toolbox for data ex- change between the laboratory smart greenhouse VESNA (Versatile Simulator for Near-zero Emissions Agricul- ture) 1 and the autonomous control unit. Smart green- house VESNA and its goals in control and education were introduced in detail in Oravec et al. (2023). This paper investigates the problem of designing and implementing a constrained offset-free MPC for reference tracking of temperature in a smart greenhouse VESNA. A user-friendly communication toolbox in modern agri- culture is indispensable for seamlessly integrating IoT technology with greenhouse devices (Prakash et al., 2023). As part of the paper, a newly developed toolbox VESNA CODE 2 is introduced as a user-friendly software for com- munication with the VESNA greenhouse. The toolbox developed in MATLAB programming environment allows the user to easily download and upload data to the greenhouse, allowing the user to stay focused on controller design and fine-tuning of the controller parameters. 2. SMART ECO GREENHOUSE VESNA VESN