Skip to main content

Optimized Control of HVAC systems using Artificial Intelligence

ABSTRACT

Many recent efforts have employed machine learning alongside classical control to manage HVAC systems, aiming to improve energy efficiency while maintaining temperature and humidity. However, these approaches usually rely on vast amounts of historical data and ideal scenarios, where the control signal meets the targets, which may be unavailable or insufficiently representative of the system. To address these challenges, this study proposes an architecture that decouples the process into two neural networks: a controller and a reverter. The controller predicts actuator setpoints, namely the water control valve and air bypass damper based on environmental conditions. The reverter forecasts resulting values of room temperature and humidity from these actions.      Trained on two years of 5-minute resolution data from a pharmaceutical (pharma) factory in Thailand, the system has shown to reduce Characterized Control Valve usage while maintaining a temperature of 23.6°C and relative humidity of 59.4%, offering a robust and scalable solution for advanced HVAC automation.

INTRODUCTION.

Wholesale electricity prices have risen significantly in many countries and remain above pre-COVID levels in the United States, where they have increased by more than 90% over the past 20 years [1]. Several factors contribute to these rising costs, including extreme temperatures that drive higher demand for heating and cooling. This increased demand, in turn, raises both fuel and electricity prices.

As a result, electricity use for Heating, Ventilation, and Air Conditioning (HVAC) has become a central focus of energy efficiency and demand-response strategies across economic sectors. In 2018, HVAC systems alone accounted for 14% of total electricity consumption [2]. These systems are essential for maintaining indoor comfort and air quality, but traditional designs depend on predefined settings and human intervention. Such reliance often makes them less responsive to fluctuating temperatures and human behavior, leading to inefficient electricity use.

For the pharma industry, beyond the challenge of rising electricity costs, strict maintenance of temperature and humidity setpoints is crucial. The current Good Manufacturing Practices (GMP) forces all rooms in a plant to be within 20°C and 25°C, with relative humidity below 60% in clean utilities (technical space) and below 75% for raw materials and finished goods warehouses [3]. Without these standards being met, a pharma company would face fines, or even prosecution. Therefore, it is of utmost importance that these regulations are always met.

In literature, numerous methods and variations have been proposed and tested. Most approaches rely on classical controllers, such as Model Predictive Controls (MPCs) or Proportional-Integral-Derivative (PID) Controllers in tandem with architecture inspired by other sources, such as IoT. While classical controllers have proven effective for well-modeled systems, their performance often declines with uncertainty, noise or changing environmental conditions. As such, there has been growing interest in AI-driven approaches to learn system behaviour. For example, Lee et al. conducted a review on 12 papers and selected 85 specific cases of applications of AI for HVAC energy usage reduction. They evaluated both academic and commercial usage and found between 8.8% and 25.5% in energy savings. They concluded that six effective methods, composing of MPCs, Model-Free Predictive Controls (MFPCs), Kernel Predictive Control (KBS), Mobile Air Climate Systems (MACS) among others, were highly effective in optimizing HVAC systems [4]. This study demonstrates the value Artificial Intelligence can bring to existing HVAC systems.

Raman et al. have applied MPC-Based hierarchical control for a multi-zone commercial HVAC system without a high-resolution multi-zone building model. The architecture mentioned uses a low-resolution model which is divided into “meta-zones”. Over the period of one week, the algorithm showed 11%, 62% and 68% of electrical savings in hot-humid (approx. 20°C-33°C, 50%-100% Relative Humidity) mild (approx. 10°C-28°C, 25%-100% Relative Humidity) and cold conditions (not provided) respectively [5].

A. Abida and P. Richter have applied similar methods to existing buildings in Germany. They successfully trained Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), Long Term Short Memory (LSTM) and Gated Recurrent Unit (GRU) models to fit on optimized historical data and act as a controller to buildings in Germany [6]. This paper aims to do the same but for suboptimal historical data instead.

MATERIALS AND METHODS.

Data.

The dataset analyzed in the paper spans from 1/1/2022 to 4/17/2025 and comes from the BACNET system that cools 12 rooms in SRIPRASIT Pharma Co., located in Samut Sakhon, Thailand. The dataset contains readings of (1) the temperature of air supplied by the Air Handling Unit (AHU), (2) the temperature of return air, (3) the return air humidity, (4) the percentage opening of water supply control valve, (5) the percentage of air bypassed, (6) the ambient (outdoor) temperature, (7) the supply air temperature, and (8) the supply air humidity. There is a total of 11 AHUs, but we are limiting our research to one AHU, namely AHU-C01 specifically to serve as proof of concept.

Assumptions.

For this analysis, we assume that there is always a sufficient supply of chilled water, with no limitations on availability. Another assumption made is that the setpoints of all the AHUs are set to 17°C. This is based on empirical evidence from the dataset suggesting a 7°C difference between setpoints and room temperatures achieved, thereby resulting in the targeted 23°C to 25°C temperature range. AHU-C01 runs on a permanent basis, while the remaining AHUs are operational from 5:00 AM to 7:00 PM local time. Therefore, we evaluated the model in two modes, namely “Operational Mode” and “Night Mode”.

Model Design.

Artificial Neural Networks (ANNs) are data-driven computational models capable of acting as nonlinear function approximators. Each neuron inside of a network processes inputs by applying a weight, adding a bias and passing the result through an activation function such as the Rectified Linear Unit (ReLU) to introduce nonlinearity, enabling the network to learn complex, non-obvious relationships., showing promise in addressing the concern of non-optimal control data.

The diagram shown in Figure 1 provides an intuitive way on how the NN model works with the AHU-C01 in practice. The NN algorithm generates predictions of the percentage openings for the Characterized Control Valve (CCV) and the Bypass Damper (BPD) as functions of ambient temperature, room air temperature (RAT) setpoint, relative humidity setpoint, return air temperature, and room relative humidity.

Figure 1. Diagram illustrating the implementation and flow of data for the NN-Algorithm.

An Artificial Neural Network (ANN) was selected as the model type, as it is well-suited for multivariable input and output requirements, provides good generalization, and can effectively handle the non-linear nature of the system [7]. The NN is structured similar to how a PID works, however it includes another term, C for Chatter. This term is included to minimise fluctuations between CCV outputs and aims to remove oscillations from the control signal.

The process for evaluating the model-in-training, referred to as the Controller, involves using another model called the Reverter. The Reverter takes the percentage of opening of the CCV and the percentage of air that passes through the cooling coil, BPD, both outputs produced by the Controller, and uses them to predict the room temperature (RAT) and relative humidity.

The proposed Controller model uses a Deep Multilayer Perceptron (MLP) architecture. The model consists of an input layer followed by four fully connected (Dense) hidden layers with Rectified Linear Unit (ReLU) activation functions. The final output layer is a Sigmoid activation function to scale the control signals (i.e. 0-100%) for the two control variables. As seen in Figure 2, the controller is trained via the Reverter model incorporated into the loss function.

Figure 2. Diagram of the data exchange between the Controller and Reverter models.

The proposed Reverter model also uses a Deep Multilayer Perceptron but now featuring 3 hidden layers. To improve the model’s ability to generalize to unseen conditions, Dropout regularization (p=0.2) was implemented after the first two hidden layers. The output layer employs a linear activation to directly predict physical states: Zone temperature and humidity.

We developed and trained the model using Google Colab. We implemented the predictive framework in TensorFlow, which we used to construct and optimize the neural network architecture, while Pandas library supported data preprocessing and feature engineering.

The dataset comprised two years of operational data recorded at 5-minute intervals. We cleaned and normalized the data to ensure consistency and reliability. We reconstructed missing ambient temperature values using a secondary neural network–based imputation model, also implemented in TensorFlow.

Following preprocessing, we split the dataset into training and validation subsets using an 80/20 ratio, providing a balanced foundation for model learning, validation, and performance evaluation within the Reverter framework. To enhance model accuracy and temporal awareness, we engineered features such as cosine transformation of time intervals to capture cyclic behaviour and introduced temperature/humidity differentials (ΔT, ΔH) to allow the model to accurately predict short-term environmental changes. These engineered features allowed the Reverter model to learn more accurately dynamic system responses.

Once the Reverter Model was trained, we integrated it into the loss function of the Controller Model. This was done by evaluating the Controller Model’s  outputs (CCV and BPD) using the Reverter Model. This approach allowed us to use suboptimal historical control signals to train an NN-based system capable of generating more optimal control outputs.

The finalized Controller Model was then deployed on a locally hosted Jupyter server, which was queried in real-time via a Node-RED flow. Node-RED handled data acquisition from AHU-C01’s sensors and transmitted the model’s predicted optimal signal to the BELIMO valves.

RESULTS.

We analyzed AHU-C01’s control data collected between May 26th and July 7th for years 2024 and 2025 with a 15-minute granularity. The data from 2024 represents the legacy Building Automation System (BAS) implementing Direct Digital Control (DDC) by Siemens, while the data from 2025 represents the operation of the newly deployed NN-based system. The dataset includes the following variables: Characterized Control Valve (CCV, %), Return Air Temperature (RAT, °C) and Return Air Humidity (RAH, %). The CCV is used as the primary variable for measuring energy efficiency, as it directly controls the amount of water the AHU intakes from the main pipe.

The evaluation of the NN system is structured into two operational periods: the first, labeled “Operational Mode”, spans from 07:00 to 19:00 local time (UTC+7) and focuses on maintaining compliance with the European Union Good Manufacturing Practice (EU-GMP) requirements. The second, referred to as the “Night Mode”, spans from 19:00 to 07:00, where humidity guidelines are not required as production stops and energy efficiency is prioritized. The EU-GMP requires 25°C average and Relative Humidity <65% for Clean Rooms.

As such, the main criterion we are evaluating the new system on is compliance with the EU-GMP’s standards for temperature and humidity through RAT & RAH and energy savings via CCV percentages. Our target temperature is 24°C to account for fluctuations in daytime temperature and the aforementioned Relative Humidity < 65%.

From factory sensor data, the average ambient temperature in 2025 was 31.8°C, compared to 32.8°C in 2024. This difference falls within the 5% limit of experimental accuracy, indicating that the two periods experienced comparable environmental conditions. In contrast, the CCV revealed a 15.7% reduction in average opening, which can be interpreted as a corresponding 15.7% decrease in energy consumption under relatively similar ambient conditions.

The analysis of the performance of the system during “Operational Mode” revealed notable differences in its behavior between 2024 and 2025 (Tables 1 and 2). The Characterized Control Valve (CCV) exhibited higher average opening values in 2025, reaching 90.3%, compared to 79.0% in 2024. Similarly, the Return Air Humidity (RAH) in 2025 was slightly elevated, averaging 59.4% compared to 57.6% in 2024. Despite this increase, the RAH values in 2025 remained below the requirement of 60% average and 65% maximum, indicating that the humidity control performance continued to meet operational requirements.

 

Table 1. Key Statistics Summary for “Operational Mode” (3 s.f.) for 2024
Variable Min Max Mean SD
CCV 49.3 100.0 79.0 9.12
RAT 21.3 23.6 22.4 0.40
RAH 50.4 67.4 57.6 3.25

 

Table 1. Key Statistics Summary for “Operational Mode” (3 s.f.) for 2025
Variable Min Max Mean SD
CCV 54.4 100 90.3 6.86
RAT 20.4 25.1 22.0 0.84
RAH 54.2 66.8 59.4 2.45

 

When evaluating the proportion of values that meet the defined environmental thresholds, the results showed comparable performance across both periods. For Return Air Temperature (RAT ≤ 25°C), compliance remained high, with 98.06% of readings in 2025 and 98.25% in 2024 meeting the criterion. Similarly, for Return Air Humidity (RAH ≤ 60%), the percentage of compliant values was 72.31% in 2025, slightly lower than the 75.88% observed in 2024. These findings suggest that while the NN-based control system maintained temperature regulation effectively, further optimization may enhance humidity control consistency.

While the CCV% of the AI-controlled AHU-C01 during day mode increased by 14.3% from 2024 to 2025, the CCV% of another AHU, AHU-C02, operating under the classical control method, rose by an average of 15.9%. This suggests that the AI-based Control System outperformed the conventional approach in minimizing CCV%.

To evaluate whether the observed differences were statistically significant, we conducted a two-proportion z-test. For RAT ≤ 25°C, the Z-statistic was -0.39 (p = 0.69), indicating no significant difference between 2024 and 2025. For RAH ≤ 60%, the Z-statistic was -3.18 (p ≈ 0.0014 indicating a statistically significant decrease in the proportion of values below the threshold in 2025. Although the decrease in RAH ≤ 60% is statistically significant, the absolute difference (~3.6%) is relatively small and may be acceptable within operational tolerance.

The analysis system performance during “Night Mode” revealed a clear distinction in valve operation between 2024 and 2025 (Tables 3 and 4). The Characterized Control Valve (CCV) maintained a significantly higher average opening in 2024 at 78.7%, compared to 63.0% in 2025, suggesting reduced valve utilization following the implementation of the NN-based Control System. In terms of environmental temperature control, the percentage of data points meeting the Return Air Temperature (RAT ≤ 25°C) threshold remained consistently high, with 100.00% compliance in 2024 and 99.60% in 2025, demonstrating that both control approaches effectively maintained the desired thermal conditions.

 

Table 3. Key Statistics Summary for “Night Mode” (3s.f.) for 2024
Variable Min Max Mean SD
CCV 53.2 100 78.7 9.39
RAT 21.2 23.1 22.1 0.29
RAH 51.6 68.3 60.3 2.14

 

Table 4. Key Statistics Summary for “Night Mode” (3s.f.) for 2025
Variable Min Max Mean SD
CCV 51.5 91.0 63.0 3.72
RAT 21.2 25.2 23.8 0.62
RAH 57.1 71.0 68.0 1.59

 

To evaluate whether the observed differences were statistically significant, we conducted a two-proportion z-test. For RAT ≤ 25°C, the Z-statistic was 3.9 (p ≈ 0.00011), indicating a statistically significant difference between 2025 and 2024. Although the decrease in RAT ≤ 25°C is statistically significant, the absolute difference (~3.5%) is relatively small and may be acceptable within operational tolerance.

DISCUSSION.

The trained NN-based Control System successfully maintained compliance with EU-GMP requirements during the Operational Mode period. Although the mean CCV position in 2025 was higher than in 2024 (90.3% compared to 79.0%), the Return Air Humidity) averaged 59.4%, remaining just below the 60% threshold. This suggests that the system operated with near-minimal cooling effort while effectively maintaining humidity within the required limits. The elevated CCV values in 2025 may reflect external environmental influences or variations in system operating conditions, rather than inefficiencies in the AI control strategy.

During “Night Mode”, where RAH is less critical. This allowed the AI-based Control System to lower CCV values by 15.7%. We also saw that RAT was closer to the 24 °C threshold.

Another notable benefit, as illustrated in Figure 3, is the reduced variance in the control valve signal. This smoother operation decreases mechanical wear on the valves, potentially extending their operational lifespan compared to traditional control methods.

Figure 3. Comparison of Characterized Control Valve (CCV) opening percentages for 2024 (legacy system) and 2025 (AI-based Control System).

CONCLUSION

This project has demonstrated the development and application of an NN-based Control System for an Air Handling Unit, designed to regulate the room temperature and humidity during operating hours and minimizing energy usage during nighttime operation. The system employed a two-model training framework, wherein the Controller predicted actuator positions and the Reverter simulated corresponding environmental responses. This architecture enabled effective learning and control despite the availability of limited and suboptimal historical data. Experimental results indicated that the NN-based controller achieved accurate tracking of temperature and humidity setpoints while concurrently reducing chilled water valve utilization compared to conventional control strategies.

The work highlights the potential of artificial intelligence in advancing HVAC system performance, offering an approach that adapts real time to environmental conditions. However, the project is limited by its reliance on historical data, fixed granularity and system specific conditions and assumptions, which may hinder attempts at generalizability to other environments.

Future research could extend this approach to additional AHUs or be integrated into other methods with classical control, such as model predictive controls, where AI could be employed to dynamically regulate gain scheduling. The successful real-world deployment of this system underscores the potential of AI-driven control strategies to enhance operational intelligence, energy efficiency, and sustainability within building management systems.

ACKNOWLEDGMENTS.

We would like to thank Sriprasit Pharma Co. for allowing us to access their data and for allowing us to implement the AI-based Control System. We also acknowledge the assistance provided by the Engineering Department for their support in hardware-related issues.

REFERENCES

  1. “Average Price: Electricity per Kilowatt-Hour in U.S. City Average (APU000072610)” (Federal Reserve Bank of St. Louis, 2025); https://fred.stlouisfed.org/series/APU000072610.
  2. “How much electricity is used for air conditioning in the United States?” (U.S. Energy Information Administration, 2024); https://www.eia.gov/tools/faqs/faq.php?id=1174&t=1
  3. “Temperature & Humidity Requirements in Pharmaceutical Facilities” (International Society for Pharmaceutical Engineering, 2021); https://ispe.org/pharmaceutical-engineering/september-october-2021/temperature-humidity-requirements-pharmaceutical
  4. Dasheng Lee, Liyuan Chen, Sustainable Air-Conditioning Systems Enabled by Artificial Intelligence: Research Status, Enterprise Patent Analysis, and Future Prospects. Sustainability. 14, 7514 (2022).
  5. N. S. Raman, R. U. Chaturvedi, Z. Guo, and P. Barooah, MPC-Based Hierarchical Control of a Multi-Zone Commercial HVAC System; arXiv:2102.02914; https://arxiv.org/abs/2102.02914 (2021).
  6. A. Abida and P. Richter (2022); HVAC control in buildings using neural network. Journal of Building Engineering, 65, 105558 (2023).
  7. Anran Li, John P. Swensen, Mehdi Hosseinzadeh, Provably-Stable Neural Network-Based Control of Nonlinear Systems. Engineering Applications of Artificial Intelligence, 138, 109252 (2024).


Posted by on Wednesday, June 3, 2026 in May 2026.

Tags: , , ,