Modeling , Analysis , and Design of a Fuzzy Logic Controller for an AHU in the S . J . Carew Building at Memorial University

Proper functioning of heating, ventilation, and air conditioning (HVAC) systems is important for efficient thermal management, as well as operational costs. Most of these systems use nonlinear time variances to handle disturbances, along with controllers that try to balance rise times and stability. The latest generation of fuzzy logic controllers (FLC) is algorithm-based and is used to control indoor temperatures, CO 2 concentrations in air handling units (AHUs), and fan speeds. These types of controllers work through the manipulation of dampers, fans, and valves to adjust flow rates of water and air. In this paper, modulating equal percentage globe valves, fans speed, and dampers position have been modeled according to exact flow rates of hot water and air into the building, and a new approach to adapting FLC through the modification of fuzzy rules surface is presented. The novel system is a redesign of an FLC using MATLAB/Simulink, with the results showing an enhancement in thermal comfort levels.


Introduction
Heating, ventilation, and air conditioning (HVAC) systems are installed in millions of commercial and noncommercial buildings as a means to provide the desired thermal comfort standards at an affordable cost and with minimal maintenance requirements.The HVAC approach to heating and cooling has become much more complicated, with the latest HVAC components using control algorithms, sensing technology, and artificial intelligence [1].
Energy saving is a key feature of HVAC systems and is increasing in importance [2,3].As the housing and business needs of the developed world generally include buildings that require HVAC systems, the percentage contribution of the total energy consumption of these buildings has increased from 20% to 40% in Western countries [4,5].Typically, an HVAC system requires more energy per building than any other system, given optimal comfort in home and work environments.However, there is a rising demand for costs to remain reasonable but efficiency to be high without sacrificing comfort levels.Recent research indicates that intelligent control might be a viable method of achieving optimal comfort levels at high energy efficiency.Intelligently controlled HVAC systems have been shown to reduce energy consumption by up to 30% [6] or higher [7].Due to the potential these systems have for future energy needs, this paper proposes identifying advanced novel HVAC system models that employ intelligent control algorithms to produce energy savings without sacrificing comfort levels.Modeling HVAC systems and components mathematically has been demonstrated in the literature to be a viable approach for designing controls and detecting faults.
Earlier research in the field reveals modeling strategies that fall into two distinct categories: grey box and black box.The grey box approach depends on the existence of physical knowledge, while the black box method requires no previous knowledge.In the literature, black box is more common due in large part to issues related to thermodynamic modeling.Some black box options used in modeling HVAC systems include linear parametric models and polynomial forms such as OE, BJ, ARMAX, and ARX.However, this approach does consider a system's physical characteristics, which can be a drawback in practical application of designs.
Chi-Man Yiu et al. [8] investigated black box identity in an air conditioning system.They compared a single-input single-output (SISO) system ARMAX model with a multiinput and multioutput (MIMO) system ARMAX model, and they they devised the latter using parameters obtained from the Recursive Extended Least Squares (RELS) technique.Mustafaraj et al. [9] investigated humidity and temperature models (OE, BJ, ARMAX, and ARX) to be applied in an office environment, identifying them with a black box strategy.This research was extended by Mustafaraj et al. [10], where they explored nonlinear autoregressive models with eXogenous (NARX) inputs.Using this approach, they estimated humidity and temperature and compared the performance of these models with linear ARX models.Mustafaraj et al. [10] also investigated carbon dioxide concentrations' impact on the models, as there is a direct relationship between CO 2 and occupancy levels.
In other studies, Qi and Deng [11] reviewed a MIMO control strategy in air conditioning systems for modulating humidity and temperature indoors, using an air conditioning model that was based on principles of mass and energy conservation.Maasoumy [12] researched temperature models applicable to a three-room suite, designing a suitable HVAC control algorithm for the system using an analogue of electric circuits along with the thermal circuit technique.More recently, Wu and Sun devised a room temperature model for an office building using a linear parametric model that was physics-based; the researchers used thermodynamics equations to develop structure and order in the linear regression model.The outcome indicated that the physics-based ARMAX (pbARMAX) model showed improved functioning over black-box models [13].Finally, in [14] and based on physical dynamic systems, the researchers developed MISO ARMAX models to investigate humidity, temperature, and CO 2 levels in a standard bedroom.This model also makes allowances for the impact of room occupants, as occupants were deemed a "disturbance" in the room temperature pbARMAX model was designed in.
The present study develops a simulation for a whole building, using IDA Indoor Climate and Energy 4.7 as a simulation program.The IDA Indoor Climate and Energy program was founded in 1998 to study thermal climate zones [15].The simulation will test the energy consumption (heating and cooling) at Memorial University's S.J. Carew building in Newfoundland, Canada.It will investigate a heat model that is dependent on a range of parameters, a three-dimensional (3D) model, and IDA ICE model library components.The present work will also examine results from [16,17], which used real data as a basis for developing whole structures.
There are three primary aims in this study.Our first aim is to test system identification viability as a means for shortening the calculation times needed to simulate more complicated structures in air handling unit one (AHU 1 ).Our second aim is to test the usefulness of system identification in the dynamics identification for structural climate control design when applying discrete time data for one-hour samples.Our third aim is to develop fuzzy logic controller structures that feature 6 inputs and 3 outputs and use this to develop a controller in an AHU 1 state space model.

Description of System
2.1.Building Structure.Our analysis will use the S.J. Carew building at Memorial University in St. John's, Newfoundland.S.J. Carew building measures approximately 25,142 m 2 and houses the university's Faculty of Engineering and Applied Science, as well as teaching rooms, research labs, and a cafeteria.From a structural perspective, the building houses four AHUs across 300 zones.The energy report of building is presented in Table 1 and Figure 1 shows 3D model of building using IDA ICE (IDA Indoor Climate and Energy) program.A more detailed description of the structure and amenities of the S.J. Carew building can be found in earlier studies [16,17].As the building's HVAC system is based on the IDA ICE program, good approximation results can be obtained from the model regarding power and hot water data, which can then be compared to real data.
2.2. 1 Structure.Figure 2 illustrates an AHU 1 with a variable air volume (VAV) system.There are valves, hot water pumps, heating and cooling coils, supply and return fans, and fresh air dampers.To maintain a constant point of internal air quality (IAQ), the building employs fresh air control dampers.An economizer mixes outdoor air with recycled building air, while a supply fan funnels the air mixture into cold-deck and hot-deck ducts.The return fan located in the room's return duct is around 10% slower than the supply fan.The fan keeps the ducts set at fixed pressure points.
Figure 3 depicts Room 347 at the S.J. Carew building; also alternating the fan speed is a means to balance any duct system resistance changes caused by opening/closing dampers located at VAV terminal units.Controllers are employed in the heat exchanger for keeping zonal temperatures set at fixed points through the use of modulating control valves.During the cold season (October to May), the heating system is turned on and the cold system is turned off.The present study used data from October to December 2016, so the cold system was off, as illustrated in Figure 2.

Simulation Model.
The IDA Indoor Climate and Energy 4.7 simulation tool is used for assessing the indoor climate and energy performance.This simulation tool is suitable for modeling HVAC systems located in multiple-zoned structures, such as the S.J. Carew building.The tool can assess IAQ, dynamic simulation, required energy, and overall thermal comfort.For the real system, a hot water valve (Figure 2) provides data on hot water usage for the heating coil, as the system has a single valve for the building's entire hot water generation.However, with the IDA-ICE software, the hot water valve is divided into four valves, such that every AHU can have its own valve.Hence, every AHU includes 3 inputs and 3 outputs.This information will be used as a reference model and identification data when modeling the AHU 1 .AHUs are useful in system identification.There are three inputs to the AHU: (1) hot water valve for the heating coil/zones, (2) supply fan speed, and (3) fresh air from outdoors.The outputs show data for three different system elements: (1) return air temperature (degree Celsius ( ∘ C)) for controlling the valve aperture of hot water, (2) static air pressure, P S (inches of water (INW)) in ducts for controlling supply fan speed, and (3) CO 2 levels (parts per million (PPM)) for controlling fresh air dampers.

Inputs and Outputs Signals.
Figure 4 shows the inputs of the AHU 1 as percentage of the hot water valve aperture, supply fan speed, and fresh air dampers position.As illustrated in Figure 5, an output is zone temperature.The second output is static air pressure (Figure 6) and the third output is CO 2 quantity (Figure 7).
A model structure is selected from a range of structures that are roughly categorized as being either linear or nonlinear.The identification toolbox of MATLAB is used in preprocessing the data.The decision process can be categorized into a few steps of optimal model structure (e.g., ARX, ARMAX, and process models), model order, optimal estimation approach, and launching the identification process.Fuzzy techniques have been used in BIEMS, giving significantly better outcomes than traditional control systems.Practical applications employing fuzzy and neural control in HVAC systems are also being used, with the overall aim of lowering energy consumption and costs [18][19][20][21][22].

Control Strategies
In traditional control methods, mathematical models of the building's operations are needed, but when using intelligent systems (i.e., model-free automatic controllers), mathematical modeling is unnecessary.Hence, through the introduction of higher-level comfort variables in intelligent controllers, such as PMV [23], comfort can be managed without the need to regulate lower-level variables such as humidity, air speed, and temperature.Users participating in intelligent systems are able to choose their preferred comfort levels with optimized fuzzy controllers that employ genetic algorithms and adaptive control strategies.Fuzzy logic control is already being applied in the latest furnace controllers, using adaptive heating control as a means to optimize comfort and energy efficiency in domestic heating systems [24].Fuzzy controllers are also used to control natural ventilation, visual comfort, and thermal comfort; there are notable results in these subsystems [25,26].

Design of Fuzzy Logic Controller.
There are several approaches for applying fuzzy logic for closed-loop control.
The most common technique is the fuzzy PI controller [27,28] that uses process-derived measurement signals as fuzzy logic controller inputs and outputs to operate the actuators.A fuzzy PI controller represents an incremental controller.A traditional fuzzy PI controller can be expressed as in (1), with fuzzy rules determining the output [29].
where k is the sampling instance and Δu(k) is the incremental change in controller.
The present study uses a traditional fuzzy PI controller for the AHU 1 model.The proportional (P) and integral (I) actions are combined to benefit from the inherent stability, which is a feature in proportional controllers, as well as to benefit from the integral controllers' offset elimination feature.Incremental controllers are most suitable for use  in situations where a valve or motor serves as actuator.Additionally, it can be beneficial when controller output is derived from an integrator due to its ease in handling noise and wind-up.As shown in Figure 8, a fuzzy PI controller applies error signals and change of error as inputs.
Another benefit in using a fuzzy PI controller is its lack of operational or setpoint.A rule-driven control strategy weighs differences between a setpoint and measured values, measuring any modifications to these differences as a means to determine if increments or decrements should be applied to a building's control variables.While a fuzzy logic controller is able to perform nonlinear control strategies, applying a fuzzy logic technique in real applications must be done in the following three-step process [30]: (i) Step 1. Fuzzification changes crisp/classical data into membership functions (MFs) or fuzzy data.
(ii) Step 2. In the fuzzy inference process, MFs are added to control rules to obtain the required fuzzy output.
(iii) Step 3. Defuzzification employs a variety of strategies as a means to formulate every associated output, to place them within a table framework, and to choose the output in a look-up table in accordance with the current input obtained for the specific application being performed.
As it is illustrated in Figure 8, fuzzy controller is assigned to control zone temperature, static air pressure, and CO 2 level.Error signals and their changes are fed to a fuzzy controller.The output of fuzzy controllers is assigned as inputs of the system.The system outputs are sent to the fuzzy controller to make a closed-loop controller.Fuzzy Logic Designer App of the system is shown in Figure 9; with this App, the FLC can be designed to add or remove input or output, fuzzy membership function, and IF-Then rules and select fuzzy inference functions.

Fuzzy Membership Function.
The MFs editor is used in unpacking the fuzzy tool box, which is applied in shapedefining any MFs that are related to variables in the membership.The AHU 1 control system indicates 3 outputs and 6 inputs.Brief definitions of the MFs for the input and output variables are presented in Sections 3.3.1 and 3.3.2.

Input Variables
(1) Temperature Differences (Δ).Current zone temperature of return air as recorded by an electronic sensor (Figure 2) illustrates that (2) expresses differences between setpoint (T setp ) and current zone temperature (T z ) for time (k), while Figure 10 and Table 2 show the 5 MFs of V-hot, hot, okay, cold, and V-cold.
(2) Change in ΔT (Δ).Error input variables related to changes in temperature are formulated through finding the ratio for the difference of past and present temperature error values in relation to sampling time (Δ), as expressed in (3).The building's real system, Honeywell Software, gives a system sampling time of 3 seconds (Department of Facilities Management and Honeywell Offices at Memorial University).As shown in Figure 11 and Table 3, three membership functions can be used to define error variable changes: Positive (), Negative (), and Zero ().
(3) Static Air Pressure   Differences.Figure 2 illustrates changes in present duct P S ; these differences were noted by sensors located in both cold-and hot-deck ducts.As can be  seen, the static pressure P S-setp setpoints occur for time (k), given in (4). Figure 12 and Table 4 present five membership functions of V-high, high, optimal, low, and V-low.
(4) Change in Δ  (Δ  ).As expressed in ( 5), any alterations in the P S error input variable are formulated using ratios for differences between present and past P S error values in relation to sampling time (Δ).Figure 13 and Table 5 illustrate (5) Differences in  2 Levels (Δ 2 ).As shown in Figure 1, this is the difference between the present CO 2 level in the return air from the sensor in the AHU 1 return duct and the CO 2 level CO 2-S-setp setpoint, as recorded at time (k) and expressed by (6).The 5 MFs of V-high, high, optimal, low, and V-low are shown in Figure 14 and Table 6.
(6) Change in Δ 2 (Δ 2 ).As expressed in (7), CO 2 error input variable changes can be formulated through finding the ratio for the difference between present and past CO 2 error values in relation to sampling time (Δ).Figure 15 and Table 7 show the three MFs error variable changes as sets labelled Positive (), Negative (), and Zero ().

Output Variables.
The three inputs of AHU 1 (fresh air, air flow, and hot water) serve as FLC outputs.The values are introduced as gains to the system in order to move system responses towards a stability state.As a means to increase output gains, PI controller tuning can be used, as detailed in the following subsections.
(1) Aperture on Hot Water Valve.The process involving the hot water valve's opening and closing is indicated through the 5 MFs for the fuzzy controller output in order to find the zone temperature setpoint (T setp ). Figure 16 depicts MFs using MATLAB/Fig, while Table 8 shows MFs and the related valve operation percentages.
(2) Supply Fan Speed.The FLC's second output serves as the speed control for the supply fan in order to reach the ducts'   static air pressure setpoint.Figure 17 and Table 9 show the five MFs for this process.
(3) Fresh Air Dampers Position.Five MFs of the fuzzy controller output were for opening and closing operation of the fresh air dampers position in order to find the zone CO 2 level setpoint; the range of this operation is presented in Table 10 and Figure 18.

Fuzzy Rule
Base.The rule base controls output variables as the most crucial part within the fuzzy inference system.In simplified terms, a fuzzy rule is represented as a basic IF-THEN rule that includes a condition and conclusion.
The fuzzy membership functions can first be applied for  converting both the input errors (Δ, Δ  , Δ 2 ) and the error changes (Δ, Δ  , Δ 2 ) to their fuzzy values.Furthermore, in every output (damper position, fan speed, and hot water valve), the control action is represented by fuzzy rules in different error/change of error values.In every control signal output, the default fuzzy rule is 5 × 3, thus indicating 45 rules for system control [31].

Defuzzification.
In the process of defuzzification, convert the fuzzy output variable back to the crisp variable for the control objective.This process is required for hardware applications that exchange crisp data.Generally, defuzzified output has to be the most appropriate solution.The two mechanisms are the maxima method, which looks for the highest pack, and the centroid method, which relies on determining a property's balance point.The present study uses the centroid approach.In Figure 19, the control surface for MFs implemented using zone temperature error values, as well as fuzzy ruleimplemented change of error values, is presented.The values for the control output are associated with every potential input combination for controlling hot water valve processes.
Figure 20 shows the control surface for implementing MFs for static air pressure error values as well as fuzzy rule-implemented change of error values.The values for the control output are associated with every potential input combination for controlling the supply fan speed in order to obtain static air pressure setpoints for the ducts.
Figure 21 illustrates the control surface for error/change of error values for MFs related to CO 2 levels.Fuzzy rules are applied for controlling output values for every potential input combination to achieve the CO 2 setpoint.

Simulation Model and Results
The Simulink model and simulation results are presented in this section.Figure 22 shows a block diagram for the AHU 1 state space model for a fuzzy controller with MAT-LAB/Simulink.The initial conditions selected for temperature, air pressure, and CO 2 levels are 20.7 ∘ C, 3.62 INW, and 374.2 MMP, respectively.The sampling time is three seconds for the control action, which is the same as that for the real system.Furthermore, the real system's indoor air quality setpoints are a zone temperature of 23 ∘ C, air pressure of 4 INW, and a CO 2 level of 500 MMP.A fuzzy-PI type adaptive controller controls the AHU 1 system, with T setp , P S-setp , and CO 2-Setp as input references for temperature, air pressure, and CO 2 level, respectively.Control signals are obtained from FLC to reduce error as well as error change.The control signals can alter the system inputs which include fresh air, air flow rate, and hot water to achieve the reference setpoints.
Figure 23 shows the first of the system's output responses that demonstrate the system's stability.Zone temperature T z achieves the setpoint of 23 ∘ C at a rise time of only 10.83 minutes and no overshoot.
Figure 24 depicts the second response of static pressure, with a rise time of 6.71 minutes and no overshoot.
Figure 25 shows the CO 2 level response, achieving the setpoint, again with no overshoot, at a rise time of 14.13 minutes.

Conclusion
This research paper presented a simulation of the S.J. Carew building's AHU 1 system using MATLAB's system identification toolbox along with real data and results from the IDA ICE program to formulate system parameters for both inputs and outputs.A fuzzy logic controller modulated the three AHU 1 inputs (fresh air, air flow, and hot water), while FLC was implemented in the multi-input/multioutput system state space model for the AHU 1 .The results indicate that the fuzzy expert controller performance exceeded that of traditional algorithms, such that sufficient control was obtained from the fuzzy controller HVAC system.Furthermore, across all lab conditions, the FLC algorithm gave a stable response and could deal better with several different parameters, including steadying errors, response time, and overshoot.

Figure 3 :
Figure 3: VAV terminal units of room 347 at the Carew building.

Figure 13 :
Figure 13: MFs of change in ΔP s .

Figure 18 :R a t e o f t e m p e r a t u rFigure 19 :
Figure 18: MFs of third output.

Figure 20 :Figure 21 :
Figure 20: Control surface of the second output.

Figure 22 :Figure 23 :
Figure 22: Block diagram for the AHU 1 state space model with controller.

Table 1 :
Energy report for the building.

Table 2 :
MFs of zone temperature difference.

Table 3 :
MFs of change in ΔT.

Table 5 :
MFs of change in ΔP s .

Table 8 :
MFs of first output.

Table 9 :
MFs of second output.

Table 10 :
MFs of third output.