Modelling, simulation and control of tankless gas water heaters: a hardware-in-the-loop approach - Quintã, André Figueiredo (2023)
Tankless gas water heaters (TGWH) are widely used to produce hot water for domestic use. Despite its advantages over other water heating systems, one of the relevant drawbacks is undesirable water temperature oscillations. When subjected to variations in hot water demand, sudden temperature changes with overshoots or undershoots occur, causing waste of water and energy, unwanted emissions, and a negative impact on the user's comfort. As a result, improvements are needed in TGWH temperature control, and the manufacturers need to reduce the development time for new control strategies. Thus, the present work aims to develop methodologies and tools to implement and evaluate TGWH advanced control strategies with improved comfort by reducing temperature undershoots and overshoots impact, in addition to higher sustainability and lower environmental impact by reducing energy and water waste and gaseous emissions. TGWH models are developed and implemented to establish a simulation framework that supports the development of model-based control strategies and the evaluation by hardware-in-the-loop simulation (HILS). A lumped space approach is applied to model individual components, describing thermal, fluidic and mechanical dynamics. For the heat cell, a semi-empirical model was considered and parametrised with experimental data. Models of each component are interconnected, creating models of complete TGWHs. A methodology based on HILS is proposed, and a prototype of a virtual test bench is constructed to support the development of water heater control strategies embedded in low-cost microcontrollers. This platform allows for speeding up the development and evaluation of control systems even before the existence of prototypes or tests in realistic environments. The architecture of the proposed system establishes four operating modes: data acquisition, real-time simulation, hardware-in-the-loop simulation, and test of the complete system. A control strategy based on model predictive control (MPC) is proposed to stabilise a non-linear process with a time-varying delay. To overcome linear MPC loss of performance when operating far from the linearisation operating point, adaptive MPC and gain scheduling MPC are also developed, showing performance improvements; however, with high computational resources and memory space, limiting its embedded implementation. Classic feedback PID and combined feedforward feedback control strategies are commonly used by TGWH manufacturers and are implemented as references. For the embedded implementation of MPC, an automatic code generation tool is developed explicitly for TGWH. Computational burden and memory footprint were optimised for implementation on low-cost microcontrollers. Embedded MPC was assessed using HILS methodologies in disturbance rejection and cold start scenarios. It was demonstrated that embedded MPC could be successfully implemented on computationally limited microcontrollers, even for thermal systems with large and varying time delays. MPC has shown significant performance improvements with increased comfort by reducing the temperature, undershoots and overshoots impact.