<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>ORCID:</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>IoT Control Systems base on Fuzzy PW M-controller</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Roman Ponomarenko</string-name>
          <email>ponomarenkoroman@knu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Anastasiia Demchuk</string-name>
          <email>demchuka@fit.knu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Taras Shevchenko National University of Kyiv</institution>
          ,
          <addr-line>Volodymyrska str.,60, Kyiv, 01033</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0001</lpage>
      <abstract>
        <p>The paper investigates the use of fuzzy data converters based on intelligent systems of fuzzy inference in the Internet of Things systems. An approach has been developed for converting fuzzy input parameters read from sensors into a PWM signal based on the Takagi-Sugeno fuzzy algorithm. Based on the suggested method an IoT-based smart fan was developed to demonstrate the characteristics of the proposed method for intelligent control of Internet of Things devices that support a PWM signal. Finally, the findings of the experimental data were utilized to simulate the performance of the fuzzy model, using three parameters: temperature, relative humidity, and carbon dioxide concentrations (CO2) vis-à-vis the PWM signal output. The proposed method shows the simplicity of training a smart fan control system and makes the possibility of efficient energy consumption. Control systems, fuzzy inference, Internet of Things, fuzzy PWM-controller, Smart fan.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>2021 Copyright for this paper by its authors.
2010 and 2050 [7]. Therefore, the development of IoT-based platforms in the field of smart
ventilation needs to be improved in terms of resource consumption. We must develop new techniques
for improving the energy efficiency of ventilation systems to achieve the reduction in overall building
energy consumption and as a result decrease operating electricity costs.</p>
      <p>IoT smart fan systems still rely on the traditional methods of control strategies such as cycling or
on/off control, staging, modulation, or proportional control [8]. These may be quite obsolete,
inaccurate, and inefficient for energy consumption in smart fan systems. The novel idea is to apply
fuzzy logic in early IoT-based fans to assess the environmental factors like temperature, humidity,
carbon dioxide concentrations, etc and convert them by Takagi-Sugeno [9] algorithm into Pulse width
modulation (PWM) signal to control the speed of motors, heat output of heaters, and the other
parameters in an energy-efficient and quieter manner [10]. Thus, the proposed smart inverter fan
based on fuzzy logic will provide comfortable levels of cooling and optimized electricity
consumption.</p>
      <p>The main contribution of the paper is:
 To consider the Takagi-Sugeno algorithm for input data conversion in IoT-based fans with
a fuzzy expert system.
 To propose the use of Takagi-Sugeno systems for converting input data from sensors into
an output PWM signal for efficient energy consumption in smart ventilation systems.
 The experimental results demonstrate dependencies between input and output variables of
a smart fan controller based on the fuzzy converter, which transforms quality indicators
into PWM signal, which assume its high performance and cost-effectiveness.</p>
      <p>The paper is structured as follows: Section 1 introduces the existing methods of control strategies
in smart ventilation systems and describes the energy consumption problem. Section 2 introduces the
fundamentals of fuzzy control systems and describes the Takagi-Sugeno algorithm. In Section 3,
Takagi-Sugeno system for converting output data from sensors into an output PWM signal is
proposed to provide efficient energy consumption in smart air ventilation systems. In Section 4, the
experiment results are demonstrated. Finally, Section 5 concludes the research paper.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Fundamentals of fuzzy control systems</title>
      <p>Intelligent fuzzy systems are actively used to solve a wide class of problems in many areas of
industry and life (medicine, production, safety, management, etc.). Belonging to the class of
intellectual, fuzzy systems are designed to solve highly specialized tasks of the creative direction.
Such tasks may include decision-making systems, expert systems, artificial intelligence systems,
testing, assessment, classification systems, etc. [11-16].
2.1.</p>
    </sec>
    <sec id="sec-3">
      <title>Fuzzy inference</title>
      <p>Control systems based on fuzzy converters of input data into output data are used in cases where
the following features take place:
 The system operates with qualitative values and characteristics
 There is incomplete data about the modeled object and its environment
 The investigated object is extremely difficult to model and find ideal solutions
 There is a non-linear dependence of the input-output data
 Decision making by the system is based on the knowledge and experience of experts in a
specific problem area</p>
      <p>Figure 1 shows a general scheme of a fuzzy inference system, which is equally suitable for all
fuzzy algorithms [11] (Takagi-Sugeno, Mamdani, Larsen ...). As can be seen in the figure, many input
values  = {  :  = ̅1̅̅,̅̅} are converted into a set of output conclusions  = {  :  = ̅1̅̅,̅̅̅}, using an
inference algorithm on a fuzzy knowledge base. The knowledge base, typical for any fuzzy inference
algorithm, consists of blocks of fuzzy rules  = {  ,  = ̅1̅̅,̅̅}products of IF-THEN statements (1).
  : 
x  

y   ,
(1)
where x ⊆ X, y ⊆ Y,  – input linguistic variable,  – output linguistic variable respectively.
 1
…</p>
      <sec id="sec-3-1">
        <title>Fuzzy inference algorithms may differ in the way (presence) of defuzzification</title>
        <sec id="sec-3-1-1">
          <title>Fuzzy Rule</title>
        </sec>
        <sec id="sec-3-1-2">
          <title>Base</title>
        </sec>
        <sec id="sec-3-1-3">
          <title>Fuzzy</title>
        </sec>
        <sec id="sec-3-1-4">
          <title>Inference</title>
        </sec>
        <sec id="sec-3-1-5">
          <title>Algorithm</title>
          <p>Depending on the fuzzy inference algorithm, fuzzy
production rules can have a different structure (the
consequent can be a fuzzy value or a precise number)</p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>In general, the functioning of fuzzy systems consists of the following stages [11]:</title>
      </sec>
      <sec id="sec-3-3">
        <title>Fuzzification of input variables</title>
      </sec>
      <sec id="sec-3-4">
        <title>Activation of fuzzy production rules</title>
      </sec>
      <sec id="sec-3-5">
        <title>Aggregation of rule subconclusions (in consequent)</title>
        <p>systems, the consequents of which are fuzzy values)
of the rules are clear numbers)</p>
        <p>Accumulation of sub-conclusions of the consequent of fuzzy rules (carried out only for those
Defuzzification of output values (or a procedure similar to defuzzification, if the consequents
Let us take a closer look at the fuzzy logical conclusion of Takagi-Sugeno [9], since for research in
this work it is of the greatest interest in the context of fuzzy data converters in IoT systems. The main
feature of Takagi-Sugeno systems is the ability to transform qualitative indicators (fuzzified values)
into quantitative ones since the subconclusions of fuzzy rules consist of functional dependencies on a
set of input data (primary, non-fuzzified) and generate precise numbers.</p>
        <p>The Takagi-Sugeno fuzzy rule is:
 

: 
x   





= 

 0 + ∑</p>
        <p>,

 =1</p>
        <p>input prerequisites.
where j – system-generated output number, w – fuzzy rule number, n – number of input variables,
  – free coefficient. The consequent of a rule is essentially a weighted summation of non-fuzzified</p>
        <p>An output conclusion for every   (see Figure 1) according to the Takagi-Sugeno algorithm, it is
the finding of the weighted average of rule subconclusions in a fuzzy knowledge base (3):
  =
∑ =1[⋀ =1 


 (  )](  0 + ∑


 =1</p>
        <p>)

∑ =1[⋀ =1  (  )]


=
∑ =1   (x)</p>
        <p>∑ =1   (x)

where ⋀ − is the operation of taking the minimum,  (х) – is the membership function of the input
value to a fuzzy term.
(2)
(3)
3. Control of the output PWM signal in IoT systems based on intelligent fuzzy
converters (fuzzy PWM-controller)</p>
        <p>PWM-signal [10, 17] (pulse width modulation) – one of the varieties of a digital signal and is
designed to control the power (speed) on output devices based on periodic on / off voltage on the port
(Figure 2). One of the tasks related to the operation of the microcontroller in IoT systems is to control
the PWM signal, and often its value depends on the input parameters read from other sensors
(temperature, smoke sensor, proximity, etc.).</p>
        <p>The total power consumption at the PWM output is calculated as:
 
=
  +  


+   +   ,
(4)
where   – the energy consumption during the time of transition from Low to High mode,   –
the energy consumption during the current supply time to maintain High mode,   – the energy
consumption during the time of transition from High to Low mode,  
during the time for current regeneration in order to maintain Low mode, 

– the energy consumption
– total operating time
of the PWM signal (0..255).</p>
        <p>Thus, there is often a non-linear relationship between the input parameters and the PWM output
signal in such systems. It should be noted that the read-out data from the sensors are very often
qualitative indicators and require the introduction of fuzzy linguistic values for their further operation
and classification.</p>
        <p>The paper proposes the use of Takagi-Sugeno systems for converting input data from sensors into
an output PWM signal. A characteristic feature of this approach is the ability to convert input data
from several sensors, realizing a nonlinear input-output dependence (a model of a converter of quality
data from sensors into a PWM signal is shown in Figure 3). This approach allows the implementation
of intelligent IoT systems with high energy savings due to the use of PWM as a control signal.</p>
      </sec>
      <sec id="sec-3-6">
        <title>Signal</title>
      </sec>
      <sec id="sec-3-7">
        <title>HIGH LOW</title>
        <p>255 ( 
)
255
255
qualitative characteristics read from the sensors:</p>
        <p>In Figure 3, the input parameters are represented by a vector of fuzzy (fuzzified) values, which are
 ̃ = {̃  ,  = ̅1̅̅,̅̅},
 ̃ = {


 
1(  )
+


 
2(  )
+ ⋯ +


 
 (  )
},
where + is a union operation,  ̃ – vector of fuzzy input values.</p>
        <p>Subconclusions of fuzzy rules (Takagi-Sugeno fuzzy rules), form the weighted values of the PWM
output signal from 0 to 255, which then go through the procedure for finding the weighted average
value, which, accordingly, will also lie in the range [0..255].
t (mc)
[0..255]
[0..255]
[0..255]
[0..255]</p>
        <p>Weighted
average

∑
 =1   (x) 
∑

 =1   (x)</p>
        <p>PWMvalue
[0..255]
4. Smart fan based on the fuzzy PWM-controller for convert of quality
indicators into PWM signal
4.1.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Problem definition of smart ventilation systems</title>
      <p>In this paper, a model of an intelligent fan based on fuzzy control has been developed using the
proposed in this article method of fuzzy transformation of quality indicators into a PWM signal. The
use of a fuzzy controller allows the ventilation system to work in different modes of operation,
adjusting to the external environment, and also taking into account the individual requirements of the
customer, the climate of a particular region, medical contraindications, etc. Based on a fuzzy
knowledge base, this system makes it possible to formalize the customer's requirements in the form of
an expert set of rules, makes it possible to make the operating modes more varied.</p>
      <p>It is also worth mentioning that efficient energy consumption, sustainability, environment-friendly
– terms that should be taken into consideration in the
modern scientific world. The heating,
ventilation, and air conditioning systems can be the largest energy consumers in the building. The
different approaches to modeling these systems and providing them with additional controllers can
change the situation for the better.</p>
      <p>The most common methods to solve the above problems are the classic use of
proportionalintegral-differential (PID) controllers and Computational Intelligence techniques [18].</p>
      <p>The advantage of using intelligent control methods in ventilation systems over the classic ones is
the ability to regulate the room temperature at partial load, minimize system steady-state error. In
recent studies [19–20] there was an attempt to use fuzzy logic to model the cooling process of
ventilation systems. However, existing systems do not take into account that the resistance of
transistors and resistors also leads to additional energy loss, because they burn part of it as a heat.
Such systems are constantly running at full speed, making a lot of noise and consuming a lot of
energy. The solution may be to use PWM, which varies the speed of the motors of the devices, so they
consume only as much energy as they need [10].
4.2.</p>
    </sec>
    <sec id="sec-5">
      <title>The architectural design of the Smart ventilation system</title>
      <sec id="sec-5-1">
        <title>Basic fuzzy-based architectural model of smart ventilation system consists of (Figure 4): 1.</title>
      </sec>
      <sec id="sec-5-2">
        <title>Sensor components: 59 2. 3.</title>
      </sec>
      <sec id="sec-5-3">
        <title>Cloud API</title>
      </sec>
      <sec id="sec-5-4">
        <title>Sensor temperature</title>
      </sec>
      <sec id="sec-5-5">
        <title>Sensor relative humidity</title>
      </sec>
      <sec id="sec-5-6">
        <title>Gas sensor 1.1. 1.2. 1.3.</title>
      </sec>
      <sec id="sec-5-7">
        <title>Sensor temperature</title>
      </sec>
      <sec id="sec-5-8">
        <title>Sensor relative humidity</title>
      </sec>
      <sec id="sec-5-9">
        <title>Gas sensor Micro Controller Unit – intermediate component, which receives transmitted information from the sensors for processing of the collected data</title>
      </sec>
      <sec id="sec-5-10">
        <title>Micro Controller</title>
      </sec>
      <sec id="sec-5-11">
        <title>Unit</title>
      </sec>
      <sec id="sec-5-12">
        <title>Cloud API</title>
      </sec>
      <sec id="sec-5-13">
        <title>Fuzzy Inference</title>
      </sec>
      <sec id="sec-5-14">
        <title>System</title>
      </sec>
      <sec id="sec-5-15">
        <title>Remote control</title>
        <p>(5)
(6)
where  – the number characterizing the slope of the graph (the larger the  , the greater the slope),  –
inflection point of the function ( ( ) = 0,5).</p>
        <p>Furthermore, we will use the bell-shaped membership functions to model the mean values of fuzzy
terms:
 ( ) =
1 + exp[− ( −  )]</p>
        <p>,
 ( ) =
1 +
| −  |2 ,
1
1

where c – central (modal) value at which  ( ) = 1,  ≥ 0 – number characterizing the slope of the
graph (similar to sigmoidal membership functions),  &gt; 0 – the distance from the center c to the
inflection points of the function, where at  = 0,5 the  ( ±  ) = 0,5 is fulfilled.</p>
      </sec>
      <sec id="sec-5-16">
        <title>Methods for constructing fuzzy membership functions are considered in [21]. Linguistic variable "temperature" and its membership function graph (Figure 5):</title>
        <p>= { 
2 = {  ( ) =
1
1 +  0,03 −24 +  
0,5
0
400</p>
        <p>LOW</p>
      </sec>
      <sec id="sec-5-17">
        <title>MEDIUM</title>
      </sec>
      <sec id="sec-5-18">
        <title>HIGH</title>
        <p>HEAVY
700
1000
1300
1600 
2(
)
Linguistic variable "relative humidity" and its membership function graph (Figure 7):

= { 
through a PWM signal, consisting of 18 fuzzy rules. It is also important to note that the maximum
number of rules of a fuzzy system can be found according to (7).</p>
        <p />
        <p>= ∏ 
where 
variables.</p>
        <p>– returns the number of fuzzy terms of a linguistic variable   ,  – number of input
0,5</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>4.4. Simulation Experimental Setup</title>
      <p>LOW
25
50
100  (%)</p>
      <sec id="sec-6-1">
        <title>HIGH</title>
        <p>75
 2 ( )
EXCELLENT
EXCELLENT</p>
        <p>GOOD
GOOD
HEAVY</p>
        <p>HEAVY
EXCELLENT
EXCELLENT</p>
        <p>GOOD
GOOD
HEAVY</p>
        <p>HEAVY
EXCELLENT
EXCELLENT</p>
        <p>GOOD
GOOD
HEAVY
HEAVY
signal in the range from 0 to 255. Among the advantages of this system, it is worth to mention the
high operating speed (no defuzzification), as well as the simplicity of training the system, which
essentially boils down to finding the weights of the input parameters in the consequent of fuzzy rules
and which, if necessary, can also be produced by a subject matter expert.</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>5. Conclusions</title>
      <p>A fuzzy PWM controller based on the Takagi-Sugeno fuzzy inference algorithm is proposed. In
this paper, a method of fuzzy control of the output PWM signal based on the Takagi-Sugeno fuzzy
inference algorithm is presented. An IoT system of an intelligent fan has been developed based on the
approach of converting fuzzy input parameters read from sensors into a PWM signal to control the fan
screw rotation speed. A mathematical model of an intelligent fan based on fuzzy control has been
developed, as well as its hardware architecture. In this approach, the model operates with three input
parameters, namely, temperature, relative humidity and carbon dioxide concentrations (CO2) under
different operating conditions vis-à-vis the PWM signal output. Experimental studies have been
carried out that demonstrate the characteristics of the proposed methods for intelligent control of</p>
      <sec id="sec-7-1">
        <title>Internet of Things devices that support a PWM signal, using the example of a Smart Fan.</title>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>6. References</title>
      <p>[1] Oracle - What Is the Internet of Things (IoT)? 2021. URL:
https://www.oracle.com/internet-ofthings/what-is-iot/
[2] L. Zadeh, The concept of a linguistic variable and its application to approximate reasoning.</p>
      <sec id="sec-8-1">
        <title>American Elsevier Publishing Company, 1973.</title>
        <p>[3] Air Conditioning. URL:
https://www.energy.gov/energysaver/home-cooling-systems/airconditioning
[4] Air conditioning in nearly 100 million U.S. homes, 2011. URL:
https://www.eia.gov/consumption/residential/reports/2009/air-conditioning.php
[5] D. Westphalen and S. Koszalinski. Energy Consumption Characteristics of Commercial Building</p>
      </sec>
      <sec id="sec-8-2">
        <title>HVAC Systems. Chillers, Refrigerant Compressors, and Heating Systems 1 (2001)</title>
        <p>[6] N. Bhagwat, S.N. Teli, P. Gunaki and V.S. Majali. Review paper on energy efficiency
technologies for heating, ventilation and air conditioning (HVAC). International Journal of
Scientific &amp; Engineering Research 6 (12) (2015) 106–116.
[7] IoT and Machine Learning to Reduce Energy Use in Cooling Systems, 2018. URL:
https://www.ibm.com/blogs/research/2018/07/reduce-energy-cooling/
[8] Fundamentals of HVAC Controls. URL:
http://people.eecs.berkeley.edu/~culler/cs294f09/m197content.pdf
[9] Takagi T. and Sugeno M. “Fuzzy identification of systems and its application to modeling and
control.” IEEE Trans. of Systems, Man and Cybernetics 15(1) (1985): 116–132.
[10] N. Brown. Introduction To PWM: How Pulse Width Modulation Works, 2021. URL:
https://www.kompulsa.com/introduction-pwm-pulse-width-modulation-works/
[11] F. M. McNeill and E. Thro (1994) Fuzzy logic. A practical approach. - Academic press. - 312 p.
[12] S. Yershov and R. Ponomarenko, Software architecture of hierarchical fuzzy inference.</p>
        <p>International Conference of Programming – UkrPROG'2018. In: CEUR Workshop Proceedings,
CEUR-WS.org, 2–3, 2018, pp. 99–108.
[13] S. Yershov and R. Ponomarenko, Parallel Fuzzy Inference Method for Higher Order Takagi–</p>
        <p>Sugeno Systems. Cybernetics and Systems Analysis 54(6) (2018) 170–180.
[14] R. Ponomarenko. Systems for checking and testing the quality of knowledge based on fuzzy
inference. CEUR Workshop Proceedings (CEUR-WS.org) “VII International conference
“Information Technology and Interactions” (IT&amp;I-2020) December 02-04”, 2021, 65-74, ISSN
1613-0073. URL: http://ceur-ws.org/Vol-2845/Paper_7.pdf
[15] P. Lizunov, A. Biloshchytskyi, A. Kuchansky, Y. Andrashko and S. Biloshchytska. Improvement
of the method for scientific publications clustering based on N-gram analysis and fuzzy method
for selecting research partners. Eastern-European Journal of Enterprise Technologies. 4(4-100)
(2019) 6–14 doi: 10.15587/1729-4061.2019.175139
[16] N. Baccar and R. Bouallegue. (2016) Interval type 2 fuzzy localization for wireless sensor
networks. EURASIP J. Adv. Signal Process. 2016, 42 doi: 10.1186/s13634-016-0340-4
[17] A. Patel, A.R. Patel, D.R. Vyas and K.M. Patel. Use of PWM Techniques for Power Quality</p>
      </sec>
      <sec id="sec-8-3">
        <title>Improvement. International Journal of Recent Trends in Engineering 1(4) (2009) 99–102.</title>
        <p>[18] A.-H. Attia, S.F. Rezeka and A.M. Saleh. Fuzzy logic control of air-conditioning system in
residential buildings. Alexandria Engineering Journal 54 (3) (2015) 395–403. doi:
10.1016/j.aej.2015.03.023
[19] S.K. Dash, G. Mohanty and A. Mohanty. Intelligent Air Conditioning System using Fuzzy Logic.</p>
      </sec>
      <sec id="sec-8-4">
        <title>International journal of scientific and engineering research. 3 (12) (2012) 1–6.</title>
        <p>[20] M. Fayaz and D.-H. Kim. An efficient actuator control mechanism using fuzzy logic on
embedded system. International Journal of Control and Automation 11(6) (2018) 35-44 doi:
10.14257/ijca.2018.11.6.04
[21] A. Sancho-Royo and J.L. Verdegay. Methods for the Construction of Membership Functions.</p>
        <p>International Journal of Intelligent Systems 14 (12) (1999) 1213–1230
doi:10.1002/(SICI)1098111X(199912)14:123.0.CO;2-5</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list />
  </back>
</article>