Nothing Special   »   [go: up one dir, main page]

A Distributed Fuzzy Logic With Consensus For Exhaust Fan Controller

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

2020 8th International Conference on Information and Communication Technology (ICoICT)

A Distributed Fuzzy Logic with Consensus for


Exhaust Fan Controller
Misbakhul Munir Bayu Erfianto
School of Computing School of Computing
Telkom University Telkom University
Bandung, Indonesia Bandung, Indonesia
misbaakhul@gmail.com erfianto@telkomuniversity.ac.id

Abstract—Recently, the deployment of several exhaust fans and the smoke from burning wood char- coal in the room
for indoor cannot perform smoke suction ditributedly with the contain carbon monoxide. Carbon monoxide that is too much
different exhaust fan speed according to the spread of smoke contaminated in the room can cause failure of oxygen transport
concentrations. It is because of the commercial exhaust fans
sold in the market only have a constant fan rotational speed to the tissues and result in tissue anoxia, central nervous
(usually full speed). Therefore, in this paper, a distributed fuzzy disorders (memory loss, poor mental growth especially in
logic exhaust fan controller system with consensus averaging is infants) [5].
designed to control different fan speed based on the distribution There are a lot of studies investigating the combination
of smoke concentration in a closed room. Smoke is detected by of multi-sensor with related techniques for fire and smoke
smoke sensor in the form of carbon monoxide (CO) gas from
burning wood charcoal. Based on the experiment, after the fuzzy early warning and detection. Automatic smoke detection is
logic process, each controller can communicate and exchange important for early detection and promptly extinguishing fire
fuzzy logic output with its adjacent controllers to execute average and smoke in a room [2] or in a tunnel [6] [3] [7] [8]. The
consensus algorithm to regulate fan speed with respect to smoke work of [9] has developed a framework to demonstrate and
concentration. analyze real-time smart building data. The author is intended to
Index Terms—fan controller, consensus, fuzzy logic
automatically manage the level of oxygen, level of luminosity
and smoke or hazardous gases in different location of the
I. I NTRODUCTION
smart building. As the results, it indicates that the proposed
The Internet of Things is a structure where objects are given framework is fit for the purpose for the development of IoT-
exclusive identities that can relocate data through a network enabled Big Data Analytics for smart buildings. The key
to interact from source to destination. In the field of smart contribution of the author is the integration of Big Data
building, IoT can be used for existing electronic automation. Analytics for IoT to address especially the large volume and
No exception in terms of regulating fresh air stability in a velocity of real-time data used in the smart building domain.
closed room. One of the electronic devices used to regulate In general, to condition the air in a smoking room, it needs an
fresh air concentration in a room is using exhaust fan [1]. exhaust fan that will later regulate the circulation of cigarette
Exhaust fan commonly is used to remove hot air, and also can smoke air from a closed room. Whereas in most cases the
be used to remove smoke and gas in a room simultaneously exhaust works with manual control without any automatic
[2], or in a tunnel [3]. Recently, the installation of several adjustment so that it has a constant rotating speed at a certain
exhaust fan for indoor purpose cannot do smoke suction with value to regulate the air circulation, without detecting the
different fan speed according to the smoke concentrations. It is actual needs or air conditions desired by the room. In their
because the existing exhaust fan available in the market only research, [4] make a system to control the exhaust speed
has a constant speed and controlled by a default controller. To automatically so that the air conditioning output is more stable
overcome this problem, an exhaust fan control system based in accordance with the smoke intensity conditions in the room
on distributed fuzzy logic controller is made for suctioning the by using a fuzzy logic controller to get the output as desired
contaminated air [4]. by the system. The speed regulation is done by switching the
Air is the most important requirement for human survival. PWM wave on the inverter which will also apply the fuzzy
The air itself consists of mixing 21% oxygen, 78% nitrogen, logic method.
and other gases such as carbon dioxide, carbon monoxide, The work in this paper extends [4], while in their previous
argon, hydrogen, neon, xenon, helium, krypton. Components work, a fuzzy logic based fan controller was made to regulate
of the gas compound elements and particles in the air will fan speed. However, this method is still limited to single fan
vary depending on the height of the soil surface [4]. Clean air only, not multiple fan to work collaboratively to eliminate
is air that is free from pollution in the form of gas, liquid smoke in a closed room for faster and efficient suctioning.
or solid. To create clean air in a room you can keep the A significant contribution of our research work is distributed
room clean, ventilate, and not smoke indoors. Cigarette smoke fuzzy logic controller combined with consensus control to

978-1-7281-6142-6/2020/$31.00
Authorized ©2020
licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on April 28,2021 at 06:15:12 UTC from IEEE Xplore. Restrictions apply.
colaboratively work on smoke removal in a closed room. With
the use of our method, the smoke removal process will be
faster and the system will be smarter where the speed of
the fans only depends on location of nearest highest density
of smoke sources. We use averaging consensus to generate
control input for fan controller. Average consensus is a model
where each controller node updates its local variable with a
weighted average value of its neighbor controller value through
local communication. If smoke concentration is detected,
the output voltage on the sensor will rise, so that the gas
concentration will decrease and a de-oxidation process will Fig. 1. General system overview: configuration of controllers and sensor
occur. To convert smoke data from individual sensor node
into 2D heatmap, the cubic interpolation method is preferably
used. Interpolation means that we can use previously known ppm. All sensor nodes can communicate and exchange data
data to estimate and produce other data that is related and with controller using MQTT protocol via an access points of
and in between of two sensors. In other word, the goal Wifi network. All controller nodes also can communicate each
of interpolation is to find out the values that are in the other to perform averaging consensus algorithm. The propose
middle between two points that have known exact values. In system in this paper is scalable, therefore the number of sensor
this research, we also use cubic interpolation combined with nodes involved in this system only depends of the capability
heatmap to visualize the distribution of smoke concentrations and capacity of micro-controller on controller node to run
in a closed room. consensus algorithm. To enable MQTT communication, we
This paper consists of four sections. The first section is deploy local broker MQTT. Thus, communication between
introduction of this paper. The second section consists the controllers, nodes and PCs is fully supported by MQTT
related methods to conduct this research. The third section protocol. This mechanism can simplify the communication
presents sensor reading and heatmap generation of smoke requirement of the system. The architecture of communication
data, which is more about design and experiments. The fourth of the system is depicted in Fig. 2 and Fig. 3.
section present the results and analysis of experiments. The
last section, which is the conclusion, present the conclusion
and recommendation of the research.
II. R ESEARCH M ETHODS
A. System Overview
In this research, we develop a distributed exhaust fan con-
troller using distributed fuzzy logic with averaging consensus
algorithm. Each controller works based on the distribution of
smoke data within a closed room. The following is the detail
explanation of the capabilities of the system. Sensor node
consist of smoke sensor and wifi-enabled microcontroller. This
Fig. 2. Requirement of communication of sensor topology and consensus
sensor node is able to read smoke density value and can send network. Sensor S1, S4, S7 physically are placed within the controller, while
the smoke concentration data using MQTT protocol via WiFi S2,S3,S5,S7 are sensor node only. S1,S4 and S constitute a consensus network.
network. A smoke sensor sends smoke concentration data (in
ppm, or parts per million) to its adjacent controllers, which
further will be fed as input of fuzzy logic control. Further, III. S ENSOR R EADING AND H EATMAP G ENERATION OF
the system executes a distributed fuzzy logic controller to S MOKE DATA
determine the speed of each exhaust fan. For this purpose, the Nodes send smoke concentration data to the related and
distributed fuzzy logic controller method is combined with the adjacent controllers, which is physically originated from MQ7
average consensus value of fuzzy logic output. The illustration sensor. A sensor node consists of Wemos D1 mini as a mi-
of distributed exhaust controller is depicted in 1. crocontroller and a MQ7 smoke sensor that can detect carbon
Since the concentration of smoke is not distributedly the monoxide concentration. A controller node also consists of
same within a closed room, hence each sensor node will Wemos D1 as a microcontroller, MQ7 sensor (functioned as a
capture different value of smoke concentration as well. As sensor node), and AC voltage controller MOC3021 and BTA
can be seen in Fig. 1, we use three small exhaust fans Triac16 to drive fan motor using PWM.
with its particular fans controllers, seven sensor nodes, and A computer (PC) subscribes all sensor data to MQTT bro-
1 monitoring station using PC (not depicted in that figure). ker. This data will be used to generate heatmap of smoke dis-
Those devices are located in a 2.5m x 8m closed room. The tribution for visualization purpose. The python program on the
sensor nodes capture the smoke concentration with unit of PC receives smoke concentration data from the controller and

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on April 28,2021 at 06:15:12 UTC from IEEE Xplore. Restrictions apply.
Fig. 4. Mapping sensor data into variogram to see smoke distribution in a
closed room. The black dots are sensor nodes. The pink color represents the
higher concentration of CO than the green area.

IV. F UZZY L OGIC AND C ONSENSUS C ONTROLLER D ESIGN

Fuzzy logic is defined as a type of logic that has multiple


Fig. 3. Communication topology with MQTT Protocol. All controller nodes values and is related to uncertainty and partial truth. In fuzzy
are functioned as publisher and subscriber, all sensor nodes as publisher and
monitoring PC as subscriber. systems, membership functions play a very important role in
presenting problems and producing accurate decisions. There
are four membership functions that are often used in the real
node to generate heatmaps using cubic interpolation. Heatmap, world, namely sigmoid functions, phi functions, triangular
a.k.a. variogram, is used to visualize smoke concentration functions and trapezoidal functions. A complete fuzzy rule
within a closed room. In our system, cubic interpolation is used based system consists of three main components, fuzzyfi-
to generate interpolated smoke data that will visually be used cation, inference and defuzzyfication. Fuzzyfication changes
for heatmap. The position or coordinates of the heatmap use inputs whose truth values are definite (crisp input) in the form
meters with a length of 8 meters and a width of 2.5 meters. The of fuzzy input, in the form of linguistic values whose seman-
position of the node and controller will be represented using tics are determined based on certain membership functions.
coordinates (x, y) to generate heatmap. Cubic interpolation Inference makes reasoning using fuzzy input and fuzzy rules
requires a sample of data from the node and a controller in that have been determined to produce fuzzy output. Fuzzy
the form of ppm smoke concentration. The algorithm used to inference has two models, commonly known as Mamdani
generate heatmap is described as follow. model and Sugeno model. While defuzzyfication converts
fuzzy output into crisp value based on the specified mem-
bership function. In defuzzyfication of the Sugeno model, the
Algorithm 1 Heatmap Generation weighted average is often used in the fuzzy equation.
while true do In this paper, we use distributed fuzzy logic algorithm,
connect Wifi which is executed in each controller. Controler 1 and 3 use
connect MQTT three inputs, i.e. Sensor 1, Sensor 2, and Sensor , while
if Wifi = connected & MQTT =connected then Controler 2 uses five inputs (see Fig.3 ). All inputs in this
subscribe (topic, node[ppm]) system use the same membership function, namely the carbon
subscribe (topic, controller[ppm]) monoxide membership function. Having a membership with
create gridmap(x,y) linguistic values consists of low, medium and high with
location = node(x,y) & controller(x,y) trapezoid and triangle membership functions. The choice of
value = ppm fuzzy input variables is based on the Document of the Head
grid(location, value, gridmap, interpolation) of Bapedal No. 107 of 1997 concerning the calculation and
show heatmap reporting as well as information on the index of air pollution
end if standards. Determining that 0-50 ppm has no effect, 51-100
end while ppm already has an effect on blood chemistry changes but is
undetectable, 101-199 ppm is categorized as unhealthy, 200-
From all calculation results, interpolated data is the visu- 299 ppm is very unhealthy and 300-over ppm is dangerous
alized using gradient of colors. Color scale is based on ppm [5].
values within 100 ppm to 300 ppm, which consists of pixels We use Sugeno to model fuzzy inference that consists of
where each pixel is colored on a color scale to represent the two categories of fuzzy rules. Controller 1 and 3 there have
corresponding element values of the data matrix [10]. The 27 fuzzy rules while controller 2 has 243 fuzzy rules. All
green color represent the lowest CO concentration, while the fuzzy rules are made based on a combination of values on
red one is the high concentration. As the result, the example each sensor. In this system the defuzzification process uses
result of mapping smoke data into variogram can be seen in the Sugeno model which has an application formula using
Fig. 4. a weighted average. The output is in the form of fan speed

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on April 28,2021 at 06:15:12 UTC from IEEE Xplore. Restrictions apply.
(in PWM) power in percent, where 20%, 60%, 100% are the
maximum voltage to drive the fan on the exhaust fan which
is 220V AC. The output of Fuzzy Logic controller is depicted
in Fig. 6.
Distributed controllers accept smoke density data from the
nearest sensor nodes prior doing Fuzzyfication processes. The
fuzzy output of each controller is then fed to consensus
algorithm, i.e. averaging consensus method, by only involv-
ing the adjacent controllers ( red line in Fig.3). Averaging
consensus value is used to adjust the output of fuzzy from
each controller to determine the speed for each exhaust fan.
Fig. 6. Fuzzy Output
Thus, for different time each fan will have different speed
depending on the concentration of the smoke captured by
nearest sensor nodes. We may consider Fig. 1 and Fig. 2
to see the work of distributed fuzzy logic controller works.
For example, Controller 1 is only connected to Sensor 1
(physically inside the Controller 1), Sensor 2, and Sensor 3 to
execute fuzzy inference rule. However, to perform averaging
consensus, the value of fuzzy output from Controller Node
1 is only affected by the output of fuzzy from Controller
since there is no physical communication between Controller
1 and Controller 3. Those fuzzy outputs are then processed by
consensus algorithm to drive the speed of motor in Exhaust Fig. 7. Consensus Controller Combined with Fuzzy Logic Controller
Fan 1. This principle also applies for the remaining controller
nodes. The block diagram of distributed fuzzy logic controller
with consensus algorithm can be seen in Fig. 7. V. RESULTS AND DISCUSSION
Distributed fuzzy logic controller consists of collaborative In this section, we briefly explain the results of the research.
fuzzy output, where the neighboring value of sensor determine Previously, the experiment was carried out in the closed indoor
the output of fuzzy inference system. Distributed average balcony room building E on the 2nd floor of School of
consensus takes the output of the fuzzy process from each Computing, Telkom University. To generate smoke, we do
node controller. As the result of distributed average consensus, experiments using burning wood charcoal. Sensor nodes and
the averaging value is then used to adjust the fan speed, which controllers are turned on simultaneously using a remote ap-
is in the form of fan speed power in percent of power. The plication on a PC. Smoke concentration coming from burning
controller will stop if the power of the fan speed is less than wood charcoal will be detected by the MQ7 sensor on each
20% of power. We refer to [11] to find the averaging consensus node. All sensor nodes send ppm smoke data every 5 seconds.
value on each controller, i.e. To adjust the fan speed on each controller, the averaging
consensus value from fuzzy logic is used, hence the consen-
1 X sus algorithm will also updated every 5 second. Regarding
K̄ = aij Ki , (1)
N Equation 1, the output of consensus is based on the adjacent
j∈Ni
and related controllers. The deployment of the sensors, fan
where Ki is the output of fuzzy controller at node i, and controllers, as well as PC to monitor the experiments can be
K̄ is consensus value, N is the number of node involved in seen in Fig. 8.
consensus, aij is the adjacency of node i, and j is neighbors For the experiment purpose, we define three scenarios.
of node i. For each scenario, the source of smoke that comes from
burning wood charcoal is put under the sensor nodes. In
scenario 1, the experiment is done by placing the source of
smoke from burning wood charcoal under the Controller 1,
while in scenario 2 and 3, source of smoke is placed under
the Controller 2 and 3, respectively. The illustration of all
scenarios is depicted in Fig. 9.
We present the result of experiment from scenario 2, where
the source of smoke is under controller 2. Data from sensors
are obtained every 1 minute with variable levels of smoke
density which contain carbon monoxide (CO) with ppm units.
The smoke density data received by the PC will further be
Fig. 5. Fuzzy membership function of Carbon Monoxide processed to generate heatmap of smoke distribution. The

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on April 28,2021 at 06:15:12 UTC from IEEE Xplore. Restrictions apply.
TABLE I
S MOKE D ISTRIBUTION WITH R ELATED FAN S PEED IN S CENARIO 2.

Smoke Fan Speed


Heatmap F1 F2 F3

20% 20% 20%

25.9% 23.9% 25.9%

43.8% 35.9% 41.9%


Fig. 8. Deployment of distributed fan controller.

53% 42% 46.7%

48% 39.2% 38.96%

22.7% 21.8% 21.4%

20% 20% 20%

Based on the test data obtained from the three scenarios,


it is seen that smoke is very easy to spread, this is due to
wind gusts from the side of the balcony and the size of the
room which is fairly narrow. But the center of the smoke
source is successfully detected by a sensor that results the
value of the sensor close to the source of smoke is greater
than the sensor that is far away from the source of smoke.
Fig. 9. Scenarios of experiment in a closed room The time it takes for the distributed exhaust fan to suction
smoke is about 11 minutes on the average and it can reduce the
carbon monoxide levels in the room to be below 100 ppm. The
results of smoke density from scenario 3 can be seen in Table distributed exhaust fan controller works as expected, where the
I. Therefore, the spreading of smoke concentration triggers controller can do fuzzy processes, and after that the adjacent
fuzzy logic to drive different fan speed, as can be seen Fan and related controllers will communicate with each other in
Speed column in Table I. terms of setting the fan speed using the averaging consensus
Based on the smoke density data obtained from sensors, of Fuzzy output.
the controller will perform Fuzzyfication process for every 1
minute. The further process is then to adjust the fan speed VI. C ONCLUSION
(in percentage of PWM) on each controller node based-on In this paper, it can be concluded that the setting of the fan
the consensus averaging value from fuzzy output based on speed at each exhaust fan can be done based on the spread of
adjacent and related controllers. For example in Table I, using smoke concentration using a distributed fuzzy logic controller.
the data for scenario 2, we obtain smoke distribution on Based on the results of several experiment, the distributed
every generated heatmap at minute 1, minute 2, minute 4, exhaust fan controller can read smoke concentration data
minute 5, minute 6, minute 10, and minute 11, respectively and the distribution of smoke concentration data has been
on column Smoke Heatmap. As well, the corresponding result successfully generated using heatmap. Each controller also
of averaging consensus for each controller can be seen in Table successfully performs a fuzzy process every minute. Adjacent
I column F1, F2, and F3, respectively. and related controllers can communicate with each other to

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on April 28,2021 at 06:15:12 UTC from IEEE Xplore. Restrictions apply.
send fuzzy output results, these values are processed by each
controller with average consensus and produce averaging value
to regulate the fan speed. During experiment, if the smoke
concentration is decreasing, the smoke still spreads to the
part of the room with the lower concentration. However, the
direction of spreading of the smoke which is combusted from
wood charcoal cannot be predicted, this is because the nature
of the smoke itself is light and the distribution of the smoke
in isolated room is hard to predict due to the absence of wind
vector.
R EFERENCES
[1] A. W. Burange and H. D. Misalkar, “Review of internet of things in
development of smart cities with data management & privacy,” in 2015
International Conference on Advances in Computer Engineering and
Applications. IEEE, 2015, pp. 189–195.
[2] J.-Y. Kim and C.-S. Ahn, “Design of mechanical smoke exhaust system
in large space of convention center,” Open Journal of Fluid Dynamics,
vol. 7, no. 03, p. 386, 2017.
[3] S. Takeuchi, T. Aoki, F. Tanaka, and K. A. Moinuddin, “Modeling
for predicting the temperature distribution of smoke during a fire in
an underground road tunnel with vertical shafts,” Fire Safety Journal,
vol. 91, pp. 312–319, 2017.
[4] A. A. Rosi, A. Rusdinar, and E. Susanto, “Perancangan dan implemen-
tasi pengendali kecepatan exhaust fan berbasis arduino dengan sensor
asap karbon monoksida,” eProceedings of Engineering, vol. 2, no. 2,
2015.
[5] “Peraturan menteri kesehatan republik indonesia nomor
1077/menkes/per/v/2011 tentang pedoman penyehatan udara dalam
ruang rumah,” Peraturan Menteri Kesehatan Republik Indonesia, Tech.
Rep., 2011.
[6] Q.-q. Xu, L. Yi, Z.-s. Xu, and D.-x. Wu, “Preliminary study on exhaust
efficiency of smoke management system in tunnel fires,” Procedia
Engineering, vol. 52, pp. 514–519, 2013.
[7] L. He, Z. Xu, H. Chen, Q. Liu, Y. Wang, and Y. Zhou, “Analysis of
entrainment phenomenon near mechanical exhaust vent and a prediction
model for smoke temperature in tunnel fire,” Tunnelling and Under-
ground Space Technology, vol. 80, pp. 143–150, 2018.
[8] M. Bahrepour, N. Meratnia, and P. J. Havinga, “Automatic fire detection:
A survey from wireless sensor network perspective,” Pervasive System
Group, Univeristy of Twente, 2008.
[9] M. R. Bashir and A. Q. Gill, “Towards an iot big data analytics
framework: smart buildings systems,” in 2016 IEEE 18th International
Conference on High Performance Computing and Communications;
IEEE 14th International Conference on Smart City; IEEE 2nd Interna-
tional Conference on Data Science and Systems (HPCC/SmartCity/DSS).
IEEE, 2016, pp. 1325–1332.
[10] L. Wilkinson and M. Friendly, “The history of the cluster heat map,”
The American Statistician, vol. 63, no. 2, pp. 179–184, 2009.
[11] L. Xiao, S. Boyd, and S.-J. Kim, “Distributed average consensus
with least-mean-square deviation,” Journal of parallel and distributed
computing, vol. 67, no. 1, pp. 33–46, 2007.

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on April 28,2021 at 06:15:12 UTC from IEEE Xplore. Restrictions apply.

You might also like