Design and Implementation of a Fuzzy Inference System
for Fan RPM Control in HVAC Systems
Godwin Mbaga Urujzian, Aina Oluwagbolahan Emmanuel, Adjeroh Divine Okaidochianya, Alaku
Abraham Umbli, Jude Jethro Chukwudube.
1
Department of Electrical/Electronics and Computer Engineering, College of Engineering, Afe Babalola University Ado-Ekiti (ABUAD),
Ado-Ekiti, Ekiti State, Nigeria.
Article Info ABSTRACT
Article history: Fuzzy Inference System (FIS) is a framework that uses fuzzy logic and
depicts the process of mapping any input to its output. The mapping then
Received month provides a basis from which decisions can be made or patterns can be
Revised month dd, yyyy discerned. It uses conditional statements along with logical operators such as
Accepted month dd, yyyy “OR” or “AND” for drawing essential decision rules. Controlling fan speed
to adjust airflow according to temperature and humidity conditions is an
essential aspect of HVAC systems. Traditional control methods such as
Keywords: ON/OFF control and time-based control often struggle to adapt to the
irregular and uncertain nature of HVAC environments, leading to suboptimal
Fuzzy Interference System performance and energy waste. Thus, there is a need for a more efficient
HVAC system capable of adapting to the conditions of our environments, thereby
Fuzzy Logic ensuring optimal performance and low energy waste. This research aims to
Fuzzification optimize and control fan RPM in HVAC systems by designing and
Defuzzification employing a fuzzy inference system or controller that will adapt to changes
in temperature and humidity levels to provide a more efficient way of
ensuring comfort as compared to the traditional control method.
Temperature and humidity sensors provide real-time data as inputs to the
Fuzzy Inference System. The fuzzy logic system translates these crisp values
into linguistic terms like "low," "medium," and "high." By applying fuzzy
rules based on human expertise and comfort preferences, the FIS determines
the desired fan speed. This approach offers an intelligent and adaptable
solution for maintaining thermal comfort in HVAC systems compared to
traditional on/off control methods. From the 2D scatter plot graph, it was
observed that as temperature increased, there was a trend toward higher
RPM values. This observation agrees with the common opinion that higher
temperatures can lead to increased demand for cooling, thereby requiring
greater fan speeds to maintain optimal environmental conditions. When
RPM and humidity were compared, interesting trends emerged that
suggested a complex interaction between the two variables. Although there
was no obvious linear pattern, there were groups of data points that seemed
to indicate that humidity as well as temperature may affect RPM readings.
Thus, this represents a significant advancement in the pursuit of energy-
efficient and comfortable indoor environments, with implications for both
residential and commercial building applications.
This is an open access article under the CC BY-SA license.
Corresponding Author:
Adedayo Olukayode Ojo
Department of Electrical & Electronics and Computer Engineering, College of Engineering Afe Babalola
University Ado Ekiti Km. 24, Ijan Road Ado Ekiti, Ekiti State, Nigeria
Email: ojoao@[Link]
1. INTRODUCTION
The acronym HVAC stands for heating, ventilation, and air conditioning. It’s a collective
term for all the different types of cooling and heating systems homeowners use to change the
temperature and humidity indoors. HVAC systems also improve indoor air quality through
mechanical ventilation and filtration. [1] The importance of HVAC includes, it ensures
comfort, it is energy efficiency, and has healthy indoor air quality. It also protects against
extreme temperatures, reduces utility costs, and promotes overall well-being. Well-
functioning HVAC systems prevent mold, enhance productivity, and extend equipment
lifespan. They create a comfortable environment, reduce health risks, and contribute to a
sustainable future. The need for an intelligently controlled system that can dynamically adjust
fan RPM based on real time temperature and humidity readings in order to optimize HVAC
performance is a problem that this paper seeks to solve using Fuzzy logic.
FL is a control system methodology that lends itself to implementation in simple, small,
embedded microcontroller to large, networked, multi-channel PC or workstation-based data
acquisition and control systems. FL can be developed as a hardware or software solution, or
as a combination of both. It offers uncomplicated solution to come to a definite conclusion
based upon fuzziness, vague, inexact, noisy, or lacking of input information. [2] Fuzzy logic
imitates the logic of human thought, which is much less rigid than the calculations computer
generally perform. Intelligent control strategies mostly involve a large number of inputs. The
objective of using fuzzy logic has been to make the computer think like people. Fuzzy logic
can deal with the vagueness intrinsic to human thinking and natural language and recognize
its nature is different from randomness. Using fuzzy logic algorithm, we could enable
machines to understand and respond to vague human concept such as hot, cold, large, small,
etc. [3]
Python is a computer programming language often used to build websites and software,
automate tasks, and conduct data analysis. Python is a general-purpose language, meaning it
can be used to create a variety of different programs and isn’t specialized for any specific
problems. In this paper, we will be using the python programming language to analyze our
data set
2. METHOD
This section describes the algorithm used in computing an electric fan’s RPM (Revolutions
Per Minute) by incorporating temperature and humidity factors in a room. The algorithm used
computes fan RPM based on temperature and humidity inputs, providing a structured
approach to RPM calculation. Fuzzy logic is then applied to handle uncertainties in fan speed
control, offering a flexible model for decision-making.
This methodology mixes membership functions and fuzzy logic rules to develop a Fuzzy
Inference System (FIS) that makes intelligent speed adjustments based on the conditions of
the room. The goal of this strategy is to maximize fan efficiency and performance.
The parts and implementation details covered in the following sections will clarify how this
methodology uses fuzzy logic in conjunction with temperature and humidity information to
compute and control fan RPM.
2.1. Fuzzy Inference System Architecture Employed in Computing Fan RPM
Fig 1: Electric fan rpm determination system
Fuzzy logic requires a methodical approach to determine the fan's RPM. The input variables
in this example are temperature and humidity, and RPM is the output variable. The
procedure starts with a clear definition of the problem. The next stage is to define fuzzy sets
for each variable, where membership functions are used to express phrases such as low,
medium, and high in language. Then, using heuristics or expert knowledge, a set of fuzzy
rules is created to map input combinations to output levels. Fuzzification allows for
uncertainty and imprecision by converting crisp input values into fuzzy sets. In order to apply
the fuzzy rules, one must first determine each rule's degree of membership using the input
fuzzy sets, then combine them using fuzzy logic operators.
Defuzzification then uses techniques like centroid or max membership to transform the fuzzy
output set into a precise crisp output value, like the fan's RPM. The method culminates in the
deployment of the fuzzy logic control system in the target environment, testing, simulation,
and eventual implementation. This ensures that the fan's RPM is effectively controlled based
on computations using fuzzy logic and real-time input data.
Fig 2: Entity Relationship of the System
2.2. Python Code Algorithm
The Python code below which has been divided into different sections was used to determine
the fan’s speed as shown below:
1. Importing necessary libraries
This section imports the required libraries. numpy is used for numerical operations,
skfuzzy is used for fuzzy logic computations, and ctrl is used to define fuzzy control
systems.
2. Define Input and Output Variables
Here, the input variables temperature and humidity are defined using the
Antecedent class from skfuzzy. The temperature range is set from 20 to 30 degrees
Celsius, and the humidity range is set from 0 to 100 percent. The output variable rpm
is defined using the Consequent class from skfuzzy. The RPM range is set from 0 to
5000 RPM.
3. Define the Fuzzy sets for the Variables
Fuzzy sets for temperature are defined using triangular membership functions (trimf).
Three fuzzy sets are defined: 'low', 'medium', and 'high', with appropriate ranges for
each set. Similarly, fuzzy sets for humidity are defined with 'low', 'medium', and 'high'
membership functions. Fuzzy sets for RPM are defined with 'low', 'medium', and
'high' membership functions, representing different RPM levels.
4. Define the Rule Base
Fuzzy rules are defined to map combinations of temperature and humidity to RPM
levels. Each rule specifies a condition (e.g., temperature is low and humidity is low)
and the corresponding RPM level.
5. Create the Control System
A control system is created using the defined rules (fan_ctrl). A control system
simulation (fan_speed) is also created to compute the RPM based on input values.
6. Input Values for Temperature and Humidity to Compute RPM
Input values for temperature and humidity are set for the simulation then the
simulation computes the RPM using the defined fuzzy logic rules and input values.
2.3. TEST AND ANALYSIS
The table below contains 10 random samples of temperature and humidity recorded at
different times during the course of the day. The python algorithm will be implemented on
this dataset to carry out further analysis and obtain actionable insights from the results:
Temperature (°C) Relative Humidity (%)
19 33
18 22
17 28
17 22
15 23
30 16
34 14
22 20
24 19
18 22
Table 1: Temperature and Humidity Dataset
3. RESULTS AND DISCUSSION
The following RPM Results were obtained after using the algorithm to analyze the
temperature and humidity inputs:
Temperature (°C) Relative Humidity (%) RPM
19 33 2364.02
18 22 2121.88
17 28 2271.36
17 22 2121.88
15 23 2150.09
30 16 2642.72
34 14 2592.48
22 20 2060.98
24 19 2028.11
18 22 2121.88
3.1. Overview of Analysis
In this study, a 2D scatter plot with color-coded RPM was utilized to analyze the association
between temperature, relative humidity, and fan rotational speed (RPM). Ten random
samples, each with the temperature in degrees Celsius, the relative humidity in percentage,
and the related RPM values, made up the dataset. The Matplotlib module was utilized to
create the scatter plot after the data were gathered and examined utilizing the Python
programming language.
The methodology involved plotting the temperature on the x-axis, relative humidity on the y-
axis, and representing RPM values through color gradients in the scatter plot. This approach
allowed for visualizing the three variables simultaneously and exploring potential
relationships or trends among them as shown below.
Fig 3: Scatter Plot showing the relationship Temperature, Humidity and the resulting RPM
Fig 4: 3D Surface plot expressing the relationship between RPM, Temperature and Humidity
From the graphs above, we can come to the following conclusions concerning: As
temperature increased, there was a trend of higher RPM values, indicating a positive
correlation between temperature and fan rotational speed. This observation aligns with the
common understanding that higher temperatures can lead to increased demand for cooling,
thereby requiring higher fan speeds to maintain optimal environmental conditions.
In particular, the RPM values tended to be lower at lower temperature ranges (e.g., 15°C to
20°C), indicating a reduction in the amount of cooling required; as the temperature rose
above 20°C, the RPM values increased correspondingly, peaking at the highest temperature
point sampled (34°C). This pattern indicates that the fan's rotational speed is temperature-
responsive, adapting to the changing environment's cooling needs.
Furthermore, the scatter plot analysis indicated a relatively linear relationship between
temperature and RPM, with RPM values gradually rising as temperature increased. This
linear trend underscores the direct impact of temperature on fan performance and highlights
the importance of temperature monitoring and control in optimizing fan operation and energy
efficiency.
Fig 5: Graph of RPM vs Temperature
The analysis of RPM with Humidity revealed intriguing patterns that suggest a nuanced
interaction between these two variables. Unlike the clear linear correlation observed with
temperature, the relationship between RPM and humidity appeared more complex, with no
distinct linear pattern discernible. However, upon closer examination, clusters of data points
emerged, indicating potential influences of both humidity and temperature on RPM readings.
Notably, at moderate humidity levels (ranging from 20% to 30%), there were instances where
both high and low RPM values were recorded. This variability in fan performance under
seemingly similar humidity conditions suggests that factors beyond humidity alone may be at
play. One plausible explanation could be the impact of air density changes associated with
varying humidity levels, influencing the fan's efficiency and its ability to respond effectively
to cooling demands.
Moreover, the analysis revealed outlier RPM values at extreme humidity levels (below 20%
or above 30%), hinting at possible anomalies or non-linear correlations between humidity and
fan RPM. These outliers may indicate specific environmental conditions that have an
unpredictable effect on fan performance. Further investigation into these anomalies could
provide valuable insights into the intricate interplay of humidity, temperature, and other
environmental factors on fan operation.
Fig 6: Graph of RPM vs Humidity
3.2. Limitations and Considerations
While the analysis provided valuable insights into the relationship between Temperature,
Humidity, and RPM, several limitations and considerations should be acknowledged to
ensure a comprehensive understanding of the results:
i. The analysis's 2D scatter plot with color encoding offers a condensed
depiction of the intricate relationships between temperature, humidity, and fan
RPM. Although it provides a graphic summary of the connections, it might
oversimplify the complex interplay between ambient conditions and fan
performance. More complex modeling methods and the consideration of other
variables may lead to a more detailed comprehension of the dynamics of the
system.
ii. The analysis focused solely on the intrinsic relationship between
environmental variables and fan RPM, without considering external factors or
contextual influences. Factors such as fan design, motor efficiency, air
ducting, and operational settings could significantly impact RPM values but
were not explicitly addressed in this study. Future research could explore these
external factors to provide a more comprehensive analysis of fan performance.
iii. Biases or presumptions inherent in the data analysis process may impact how
the results and discussions offered in this section are interpreted.
Acknowledging any biases and taking into account alternate interpretations or
opinions is crucial in order to guarantee a fair and impartial discussion of the
results.
Based on the results obtained, the assertions made by Bahar, Baowaly, and Chakraborty in
their paper published in the I.J. Intelligent Systems and Applications journal in 2012 are
concurred with. The significant achievement highlighted by the authors involves developing a
Fuzzy inference system that effectively establishes a correlation among relative humidity, air
temperature, and air velocity. This accomplishment enables the automatic control of an
electric fan based on weather conditions and environmental factors, leading to intelligent fan
control.
The study conducted by Bahar et al. (2012) provides substantial evidence supporting the
successful implementation of a Fuzzy inference system for regulating an electric fan in
response to temperature and relative humidity variations. By incorporating these parameters
into the control system, the feasibility of intelligent fan control that adapts to changing
weather conditions is demonstrated by the authors. This advancement represents a crucial
step forward in enhancing energy efficiency and environmental comfort through automated
fan management based on real-time weather data and environmental conditions.
4. CONCLUSION
In this study, the utilization of fuzzy logic offers a flexible and adaptable solution capable of easily
adjusting fan speeds to ensure thermal comfort while minimizing energy consumption. Thus, this represents a
significant advancement in the pursuit of energy-efficient and comfortable indoor environments, with
implications for both residential and commercial building applications. Moving forward, continued research in
this area could explore further refinements to the fuzzy inference system, such as incorporating additional input
variables, expanding the data sets, or optimizing rule sets to enhance performance even further. Additionally,
real-world implementation and validation of the system in various HVAC applications would provide valuable
insights into its practical effectiveness and potential for widespread adoption.
REFERENCE
Bahar, A. N., Baowaly, M. K., & Chakraborty, A. (2012). An Intelligent Approach of
Regulating Electric-Fan Adapting to Temperature and Relative Humidity. I.J. Intelligent
Systems and Applications, 7, 61-69. DOI: 10.5815/ijisa.2012.07.08.