Development of an Adaptive HVAC Fuzzy Logic Controller for Commercial Facilities: A Case Study

Article history: Received: 11 June, 2020 Accepted: 14 July, 2020 Online: 09 August, 2020 This paper is a case study of the integration of an energy management system (EMS) in a commercial building. A detailed analysis of this EMS’s impact on energy consumption is presented. High energy demand is very common in commercial and industrial facilities. With this in mind, the present work aims to improve the energy consumption rate within a commercial facility by proposing an energy management system based on a central fuzzy logic controller. Thus, the central controller adapts the energy management to a preestablished schedule taking at consideration primarily the Heating, Ventilation and Air Conditioning (HVAC) of the targeted building.


Introduction
The energy consumption is growing considerably in recent years making global warming and climate change an everlasting threat. Commercial activities and individual lifestyles directly impact the energy demand [1], [2]. Therefore, it is very important to exploit energy in a more efficient way without altering the desired comfort [3]- [7]. Heating, Ventilation and Air-Conditioning systems (HVAC) maintain a good indoor air quality through adequate ventilation and provide thermal comfort. However, HVAC systems are among the most energy demanding components within buildings [1], [8]. These elements require about 40% of the overall energy demand causing an excessive and rapid increase in energy consumption leading to a harmful impact on the global environment [3], [9]. In addition, energy consumption is more substantial in residential and commercial facilities [10]. The energy consumption is around 18% in commercial buildings while it is 22% in residential ones for the same components architecture [2], [11]. This energy requirement is due to the poor design and thermic insolation of existing classic commercial buildings and population general behavior [2], [8], [12]. Consequently, new energy efficient technologies and applications are emerging as a key solution capable of facing the building performance challenge [7], [11]- [13]. Furthermore, researchers recently, focus on the management and control of energy in buildings using active control systems within the buildings [8]. Their primary interest is to realize sustainable energy savings, while improving the energy efficiency and maintaining a proper comfort conditions [14][15][16][17][18][19]. In this scope, the current work is a case study where we propose a new approach to optimally manage energy in a typical commercial facility. In this building, we establish a very specific controlling algorithm in order to reduce the energy consumption as much as possible. The integrated system targets basically the management of loads following various parameters. In addition to the electrical loads, the proposed controller takes account of other parameters such as the building architecture, customers flow, internal and external temperature, energy consumption behavior. The building architecture and load structure is first described. Then, the HVAC components and specification are briefly presented. Moreover, the energy saving methodology is described and the design and modeling of the Fuzzy logic controller is well depicted in addition to the simulation results and analysis.

Outline description
In a commercial facility, the two main energy-consuming loads are light and the HVAC system. Figure 1 summarizes an analysis study conducted on commercial buildings of the same type with a surface between 1,000 m² and 3,000 m² and present the average loads consumption of these commercial buildings. As shown in Figure 1, the HVAC system consumes about 58% of the total energy; a huge amount compared with the other categories. The ASTESJ ISSN: 2415-6698 lighting system consumes about 17%, followed by office devices with 15% consumption and only 10 % for all the other instruments.  The present case study studies a commercial building located at Oujda, Morocco (34° 40' 48'' N, 1° 54' 36'' W). Oujda city has a Mediterranean climate with a cold, rainy winter and a hot summer. The average annual temperatures are between 15°C and 20 °C. The average temperature in summer is 35 °C and can reach 40 °C. Unlike winter, the average temperature is 18 °C and minimal temperature can drop under 0°C. The building was opened in December 2016, extending over an area of 1600 m², the monthly average electrical consumption is 11879 kWh. The commercial building is equipped with LED lighting system. The HVAC system is divided to three Modules M1, M2 and M3 as presented in Figure  2. The first and second modules control 25 % of the buildings each, the third one is responsible for the rest. The electrical power of the HVAC system is 72KW in average, total power can be divided as follows: In a typical commercial store environment, the parameters such as customer flow, collaborators number may be taken into consideration beside internal and external temperature. Indeed, these parameters can be used to assess more details related to the energy consumption. Different works have studied their effect on the overall user's comfort and building profitability [8,15].

Modeling approach
So far, several reviews have been published on modeling methods [20][21][22][23], control approaches [24 -26] and optimization techniques [26]. Besides HVAC systems simple modeling and practical energy savings, recent works target the evaluation of overall system performance [27]. The HVAC modeling techniques are widely discussed in the review study conducted in [28]. The presented models have been classified into three different categories physics-based model, data-driven model and gray-box model. Authors have concluded that each model category has both strengths and weaknesses and none of those models could be commonly used as HVAC system modeling. However, authors recommend to select the most suitable modeling technique based on the case study. In the present study, the modeling approach was carried out according to the commercial building specifications and the required energy ( ) to meet the loads demand of the building. The global data taken at consideration consist of internal parameters (people, HVAC, lighting) and external ones (sun, air, moisture). Thus, the energy need can be written as: Where represents the energy losses through envelope components of the building and depicts the ventilation/infiltration losses. The energy losses consist of energy transfer outwards from the building in terms of conduction ( ) through envelope components (roof, walls, glazing, ground), ventilation by the HVAC equipment ( ), and infiltration process ( ). This energy can be defined as: While, energy gain is the useful energy to the building from occupants ( ), lighting equipment ( ) and sun ( ). This can be written as: Based on the studied building specifications, some energy losses could be neglected for simplicity purposes. Therefore, the building conditioning system can be described by energy balance model [29] as follows: Where and 0 are respectively the building inside and outside temperature at the time sequence , +1 is the inside temperature at the time sequence + 1, represents the electric power input at . , and represent respectively the inertia factor, the overall thermal conductivity and the thermal conversion efficiency. The term "±" in "equation (5)" means that the operator "−" is used when the HVAC is on cooling mode and "+" when heating.

Energy repartition in typical buildings
Authors in [2] propose a review on large-scale energy saving studies. The work deals with the governments energy policies capable of generating noticeable energy savings. Authors also propose a scientific approach for quantifying the potential energy savings by improving the customer operations planning in 58% 17% 15% 10% Air conditioner Lighting Office devices Other device commercial buildings. The study associates between energy modeling techniques, studies on human behavior in buildings exploitation activities, surveying and sampling methods.
In commercial buildings, less than 50% of office equipment are switched off during off-work hours [1], [2]. In the present case, we also investigate the application of eco-energetic protocols in both operating and non-operating hours. The present study confirmed that the use of traditional eco-energy methods and protocols could save up to 60% of the monthly electric energy consumption. Moreover, authors in [3] confirmed that in HVAC systems, the average energy saving is generally 20-60%, lighting (20-50%), water heating (20-70%) and refrigeration (20-70%). Consequently, it is estimated that in new buildings, an energy economy of up to 50% can be achieved. In almost all cases, HVAC shows the highest share of energy savings, especially in small buildings where HVAC typically accounts for the major portion of the energy use [8], [2].

Operations time slots
The general electricity cost is not solely related to the total electricity consumption; the daily consumption periods noticeably affect the energy consumption budget [30]. The electricity consumption during a time slot is related to the number of costumers during that period and the classic exterior climate conditions.
In this work, the energy consumption fees are divided into three time slots, each one corresponds to a specific cost. According to [ 31], there are generally three classic time slots: Off-Peak hours, Peak hours, and Full hours. We have closely studied each period in order to understand the evolution of the energy consumption in each slot. This allows us to propose a schedule for the operation of the HVAC system. Table 1 illustrate the difference between the three time slots, and their consumption cost.   During winter season, we have an early sunset which causes a rapid drop in temperature in the evening. Figure 3 illustrates the impact of winter season on the consumption during the designed time slots. As the figure illustrates, the power consumption is at its peak during the Full hours between December and January. This change in consumption is due to the alteration in customers' flow which increases between 5 pm and 9 pm. On the other hand, during the Off-Peak hours, the energy consumption is very low because during closing time, the building consumes a minimum of the energy. The function cost in this system is essentially based on three variables and can be expressed as: Where 1 is the actual operating time slot, 2 is related to the number/costumer flow change and 3 is related to the external temperature. The control system aims to reduce as much as possible the cost function (6). In order to grasp the whole concept, the cost function can be expressed in more details as follows: Where and are variables related to the cost function factors. These variables are subject to seasonal changes and power generation cost in the region. "equation (6)" and "equation (7)" are related by the following equation:   The difference in costumers' flow in Figure 4 and 5 shows that controlling the HVAC system during off-work periods is not necessary and can guarantee a considerable energy savings. Furthermore, the work conditions, and costumers' availability are season dependent, thus, the total working time and periods of high activity change gradually along the year. Figure 6 shows the general segmentation of the working time and cost function factors for the studied case.
are directly related to the cost function and represent the portion of time when energy can be represented as entirely consumed inside slots.
On Figure 6 the total working time can be written as: Standard conditions in the present case study where 1 ( 2 ) = 8ℎ , 2 ( 3 ) = 4ℎ and 3 ( 1 ) = 12ℎ , the total working time = 12ℎ. At this point, it is clear that the working time, population condition and external conditions should be controlled depending on time segment. Authors in [ 32] the use of PID as control strategy for HVAC systems which resulted in in a high energy consumption. Whereas, in the same study, authors found that the use of HVAC control method presents the most promising results in terms of energy efficiency.

HVAC Controllers principle
The HVAC system being the key component to energy saving in commercial buildings, studies investigate multiple control strategies in order to encourage their implementation [8,28,33]. Numerous recent studies have given an emphasis on improving the HVAC system through advanced control algorithms rather than classic control methods [28,34]. Thus, some control strategies manage the HVAC system based on a day-ahead electricity price and outdoor temperature forecast [30]. Furthermore, existing controllers are generally classified into two major categories: predictive and adaptive controllers [16]. The study in [ 28] offers a critical overview of the modeling technics currently used in HVAC systems with regard to their applicability and acceptance in real practice, the study also summarizes the weaknesses, applications and services of the modeling technics. Authors in [27] present a study where they examine the performance of each HVAC unit, while evaluating the energy consumption and efficiency of each control technic (FLC, PID and simple ON/OFF time slots).
Control policies, also, can be categorized into two major types: model based and data driven [ 35]. Model-based control strategies require mathematical models as much as the building and the HVAC system specifications to generate minimal control rules. The data driven HVAC control strategies operate by adjusting the management parameters. In [28] authors offer a fairly global review on the different algorithms used to improve the HVAC energy management systems. Most used ones are the data mining algorithms, the Artificial Neutral Network (ANN) and the Support Vector Machine (SVM). The work in [27] compared between classic ON/OFF method, PID, Fuzzy logic, Agent based and neural network control. Related to the present case study, we have chosen to base the exploited control strategy on the fuzzy logic system given the promising results obtained [23][24][25][26][27]. Moreover, since the operation of HVAC systems is not linear, classic controllers not suitable for exploitation in such facilities. The common components of Fuzzy Logic Controller (FLC) attached to HVAC systems are well illustrated as block diagrams in various works [27,36,37]. The implementation of fuzzy logic based methods requires a qualitative distribution of the inputs and outputs ranges by establishing a direct link to the different comfort zones sought for the clients visiting the facility. Several research works have analyzed this particular point, hence pushing us to adapting the same approach based on the facility's schedule in present case study [38,39]. Figure 7 presents a control model of the studied building that depends on the external temperature, consumer number, working time. The three zones of the building are controlled via the Fuzzy logic program taking for each section the main three parameters described before.

Overall description of fuzzy logic controller
The temperature control is achieved by integrating several parameters such as temperature and humidity inputs [38,39]. In this case study, we implemented two inputs in the designed model; temperature and number of clients. During the test period, we consider that time slots configuration remains unchanged [40][41][42]. Figure 8 illustrates the design adopted in present case study. As it can be understood from the figure, temperature variations and clients' density inside the building are the inputs while the heating or cooling actions represent the outputs. This design is applied to each module zone depending on costumers flow and the frequency of temperature variation. In order to enhance the management strategy each of the customers' flow, opening hours and the temperature is regularly updated by keeping a close feed on present season and any other sudden variations such as vacation periods and time zone change.

Input variables' design a) Membership function for the temperature management
In order to establish the membership of temperature variation inputs we used the local weather data registered over the previous year. The sections of temperature vary between very cold conditions when temperatures are less than 14°C and hot conditions when temperatures are above 38°C in Oujda city.
For the temperature membership function, it is divided into five ranges as described in Table 2. The "Too cold range" is reserved for any value below 14°C. For the "Cold" range between 7 and 23°C, "Warm" is the range of 15 and 30°C, the "Hot" range between 23 and 38 °C and the final range "Too Hot" above 38 °C. This segmentation was the key to designing the Ranges of temperature inputs in the fuzzy logic model as presented in Figure  9.
The definition or this partition of the membership function ranges, depends on the region and its climatic conditions. That means if we have another case of study in another region the value of the range may change in term of the variation of the local weather data.

b) Membership function for the costumers' flow
In this case of study costumers flow is a primary factor in the proposed commercial building EMS. In this perspective, Table 3 shows that the number of membership functions is organized into five categories of clients' density. The same process as the temperature input was applied for the consumer flow input.
Where the "Very low" range is reserved for 1 to 15 persons followed by the "Low" range between 10 and 30 persons, "Medium" range between 20 and 80 costumers, the "High" range between 60 and 150 peoples and the final range "Very high" is reserved for 120 to 250 costumers. The definition or this partition depends on the region, the building size and the most import the data of the costumers' flow of the previous years to define the average number of people in each single range. In Figure 10 presents the ranges of clients' density inputs implemented in fuzzy logic model.

Output variables' design
Membership functions and ranges are supposed to be similarly designed for each of the units M1, M2 and M3 constituting the HVAC system. Each unit is endowed with its own sensors and aeration control. The author in [17] describes the design of room temperature and humidity controller using Fuzzy Logic. He considered almost the same model of the distribution of the membership functions except that it was categorized in different ranges for cooling and heating functions. For this case of study, the Output membership function is organized in four ranges (OFF, Slow, Medium and Fast) into the interval of 0 and 1, either for the cooling or the heating controller output. The used control output in this case study is achieved by adopting two outputs with the same interval functions as illustrated on Table 4 and Figure 11.

Rule base
The rule base describes the laws and conditions governing the activation of the heating/ventilation system in all the sections 1 , 2 and 3 . Table 5 presents the fixed rules obtained after several operation tests in HVAC system. The control's rule base in Table  5, shows different possible decision making by the fuzzy logic system for different inputs range, and the considered decision that the fuzzy logic control will made based on the previous input and output membershi For example, if the Number of consumers is high (between 120-250 consumer) and the temperature is Too Hot (above 39 °C), the decision of the fuzzy logic controller for the three units will be: 3 = . Figure 12 presents a planning example based on the fuzzy logic controller decision. Figure 12 presents a one planning example based on a recorded set of data during summer. During morning working hours M1, M2 and M3 are generally all occupied by workers and store staff, this is why they are all initially activated in order to guarantee minimum comfort conditions. Indeed, between 10h and 12h in the example above, M3 is activated using medium cooling mode because temperature is above 38°C and clients are between 30 and 50 individuals. From 12h to 13h, we notice that M3 is still activated but with a change in operating mode (cooling fast) and M1 is initiated in cooling medium. This decision is primarily related to the temperature and clients' number, however M1 will be rapidly switched off, because the controller anticipates the thermal exchange between the units of the building. The same procedure is followed throughout the day; the controller adapts the internal temperature to the external temperature and clients' number.  Figure 13 illustrates the impact of adopting the fuzzy logic controller on electric consumption fees of the building, the first month corresponds to December 2016 and number 20 to July 2018. The control model has been commissioned on June 2017, however it can be seen that there is an increase in power consumption in the month of July 2017 because of the high ambient temperature during the season period and laps of temporary suspension of the controller for technical adaptation. Moreover, the high energy consumption during summer season still poses a technical difficulty even after commissioning the proposed controller. Despite this stiffness we established that a steady decrease of 9.71% energy consumption has been achieved compared with the same period of the previous year. In Figure 14 month corresponds to January and number 12 to December of each corresponding year.

Impact of the proposed schedule on the fuzzy logic controller
Related to the present case study, we can undoubtedly assume that promising and palpable results have been noticed after only two months from the first introduction of the fuzzy controller. After the first testing period it has been reported to us that the facility has achieved a 30% energy gain. Table 6 presents the recorded energy profit during the testing periods of 2017 and 2018. The recorded gains were calculated based on the following equations: Where is the energy consumption in ℎ and is the energy fees in . As it can be seen on Table 6 substantial energy gains have been made which proves the efficiency of the developed controller.

System simulation and behavior
The ingenuity of the proposed controller is its ability to manage the three areas of the commercial building separately, while taking at consideration the thermal exchange between the three units.    HVAC power Thus, the system, adapts the needed power for air conditioning purpose while exploiting at the same time the already deployed power in the other units. M3 requires the largest share of energy, this is why, during long periods of harsh temperature difference between the inside and the outside of the building, this unit is the main preserver of comfort inside the building. Figure 15 presents the simulation principle of the proposed controller. The controller doesn't simply adapt the inside ambient temperature based on defined set-points and external conditions, but it also exploits the possibility of under-powering M1 or M2 when the conditions are beneficial. Figure 16 presents all the possible cases for powering M1 based on the external temperature, clients' movement inside the store and power status of the HVAC system in M2 and M3.
As it can be seen on Figure 16 above, M1's HVAC system is only activated in extreme cases of temperature and clients' movement Figure 16 (a). Since the controller exploits the thermal exchange between the building units, power required in the middle of the day is greatly decreased. Furthermore, it can be noticed on Figure 16 (b) and (c) that during normal operating conditions, dissipated power of M1's HVAC system is greatly reduced, since M2 and M3 can help stabilize temperature inside the building.

Conclusion
In this paper, the design and implementation of a new Fuzzy logic controller was introduced into a commercial facility in Morocco. The case study presents how the building was functioning before and how the HVAC system was the primary drainer of energy during infrastructure analysis. The article describes how an appropriate modeling approach was designed in order to assess and quantify the energy loss during each month of the year. Furthermore, the article founded the energy saving methodology on existing research works. Thus, the working time was distributed into operating time slots, each with its own working characteristics defined by workers and visitor's dynamics. Particularly, in the present case study, special variables were introduced to cover the season time change and personnel interaction with the visitors and clients in the facility. This design allows the HVAC system to adapt automatically to the season without undergoing any change by the management team. During the design phase, input and output variable were carefully selected to minimize the number of uncontrolled events, especially during season shifts.
This case study showed very promising results in terms of energy saving and smoothness in HVAC control. For instance, the integration of this particular controller granted the facility a 20% steady energy savings during the first official test period. The presented controller can also help HVAC oversizing errors caused by classic design methodologies, thus limiting the maximum power subscription. Besides, by taking additional measures such as population flow control and energy efficiency ethics among working staff, a more substantial gain can be achieved. In the upcoming work, we intend to investigate how categorizing areas in the facility, each with its own control strategy, can affect the HVAC system in terms of energy economy.