A Dynamic Fuzzy Controller to Meet Thermal Comfort by Using Neural Network Forecasted Parameters as the Input

.


Introduction
In the few last years, the scientific community has carried out some works finalized to improve indoor environmental quality (IEQ) in order to ensure the health and the comfort of the occupants inside a building.The IEQ refers to the building performance in providing an indoor environment to its occupants that meets the expectations of maintaining the occupants' health, well-being and productivity [1].Moreover, the lifestyle of modern society leads to spending much time in indoor environments (offices, houses, rooms for games and sports, and many more).For this reason, the indoor quality of the air is considered an important well-being factor.In fact, a pleasant and comfortable environment can increase productivity or learning.On the contrary, a poor indoor comfort has negative effects, both on users and on buildings' energy efficiency [2,3].
Today, environmental impact has gained more and more interest in terms of well-being in all its facets: acoustic comfort [4], visual comfort [5], thermal comfort [6], IEQ [7] and the productivity and safety of the occupants in a confined place [8,9].As mentioned above, temperature is one of the parameters that contributes to the comfort of the individual within the occupied building.For this reason, temperature control is a methodology that must be carefully analyzed for the individual's comfort.For this purpose, it is possible to define thermal comfort as "the condition of mind that expresses satisfaction with the thermal environment and is assessed by subjective evaluation" [10].Moreover, the ANSI/ASHRAE (American National Standards Institute / American Society of Heating, Refrigerating and Air Conditioning Engineers) 55-2010 standards define the thermally-acceptable environmental conditions for the occupants of indoor environments [11] and suggest the temperatures and the air flow rates for different types of buildings and different environmental circumstances.For example, a single office in a building has an occupancy ratio per square meter of 0.1.In summer, the suggested temperature is between 23.5 • C and 25.5 • C; and the airflow velocity is 0.18 m/s.In winter, the recommended temperature is between 21.0 • C and 23.0 • C, with an airflow velocity of 0.15 m/s [12].
However, for the control of thermal comfort, it is necessary to obtain a good compromise.In fact, in order to obtain indoor comfort, it is also necessary to take into account external parameters, such as temperature, relative humidity, radiation, etc.However, these are not the only parameters that have an influence on the comfort of the individual, because it is necessary to consider internal heat gains, thermal insulation, natural ventilation, air infiltration and, also, the work being done by the occupants [13].
HVAC (heating, ventilating and air conditioning) systems deal with heating, ventilation and air conditioning.They have the purpose of regulating the air conditions inside structures, usually of large dimensions, such as industrial buildings, hospitals and office locations.Heating, ventilation and air-conditioning are closely related, since they aim at achieving thermal comfort for building occupants, ensuring acceptable air quality and minimizing the operating, installation and maintenance costs.Moreover, due to the increase of fossil fuel costs and, consequently, the environmental problems derived from them, the energy consumption of HVACs has become a very important issue.However, this challenge must be achievable without compromising comfort and the indoor air quality.For these reasons, it is necessary to propose new approaches in order to improve the efficiency of HVAC systems, in terms of energy consumption, while maintaining the building environmental wellness.Some literature works (i.e., [14]) show that the achieving of thermal comfort can lead to high energy consumption, especially in the case that the system tries to obtain an optimal combination of the different variables (air temperature, air velocity, relative humidity, radiant temperature) that influence indoor comfort.On the other hand, some attempts that want to reduce energy consumption can act to the detriment of thermal comfort, producing adverse effects on human health.For these reasons, it is important to ensure the proper functioning of such systems, in order to obtain the desired level of environmental comfort, developing a suitable control system that is able also to promptly report possible faults or malfunctions.
Modern HVAC systems [15] can manage the power consumption more efficiently.However, in buildings with older HVAC systems that cannot be significantly modified, energy-efficient heating and cooling systems are not a realistic goal without sacrificing comfort.Using an intelligent controller in HVAC systems, significant improvements in energy efficiency can be obtained without major modifications to an existing heating and cooling system.Simple controllers or control modules can be easy to install, to operate and to remove and are an attractive enhancement for an environmentally-friendly home.In order to identify an approach that can be useful, as said previously, it is necessary to start from the analysis of a generic HVAC system.In fact, an HVAC system is a complex, non-linear, multi-input multi-output system with several variables (air temperature, air velocity, humidity, etc.) and is influenced by disturbances and uncertainties, such as external air temperature or occupants' activities.
Several works focus on both the research of a mathematical model, in order to accurately describe an HVAC system [16,17], and the analysis of the parameters and the characteristics that need to be considered in the development phase [18,19].Considering both the features and the problems listed previously, the application of intelligent control strategies can be a promising solution for achieving better results in HVAC systems compared to conventional control methods.
Therefore, in this work, a control system based on a soft computing technique is proposed.The soft computing techniques fit themselves well to the adjustment of an existing HVAC system, since they have been proposed for the construction of new generation artificial intelligence (high machine intelligence quotient, human-like information processing) and for solving non-linear and mathematically unmodeled systems.In addition, soft computing techniques can be implemented at low cost.The proposed control system takes into account the place where it operates and the weather-climate parameters that can influence the comfort of the individual directly or indirectly.The soft computing techniques used in this work consist of a fuzzy logic controller (FLC) and an artificial neural network (ANN), since their inputs and outputs are real variables mapped with a non-linear function.For this reason, these soft computing techniques can be appropriate for several engineering problems, especially for complex problems, where classical control methods do not achieve comparatively favorable results.The ANN has been chosen, because it can be a valuable tool for the prediction of weather and climate parameters, while the use of rule-based controllers (FLC) enables the implementation of multi-criteria control strategies.In fact, the use of smart setting and tuning techniques for these controllers can improve the energy savings and the indoor comfort of building occupants.For this reason, the FLCs, based on linguistic rules instead of inflexible reasoning, can be the right choice to describe HVAC systems and to increase thermal comfort.Anyhow, it is necessary to forecast weather and climate parameters, and then, this can be done by a neural network that is well suited for this purpose.

Motivation
The main aim of this paper is to show the advantages of the proposed neuro-fuzzy approach in order to meet the requirements of the thermal comfort of the users.Literature works have shown that neural networks can be both a support for the prediction of weather and climate parameters and can influence the comfort of the individual [20].Considering the artificial neural network model proposed in this work, an analysis will be done in order to point out the importance of designing the temperature forecast model efficiently, especially with respect to the selection of the order of the regressor for each of the external and internal used parameters.Moreover, an analysis on the embedding parameters of the neural network will be carried out in this paper.In fact, if the embedding dimension and time delay are chosen properly, the state can be reconstructed without a change in the dynamical properties.In particular, after proper selection of the embedding dimension and the time delay, the state is reconstructed in the form of delay coordinates.The reconstructed state can be used to perform one-step prediction, which involves finding an appropriate mapping function from the state to time series values.The output (forecasted climate values) of the neural network will be used to feed a fuzzy logic controller, which has the goal of keeping acceptable indoor conditions from the thermal comfort point of view through the dynamic adjustment of the membership functions.In fact, the real innovation introduced in this paper is represented by the dynamic fuzzy logic controller that is able to guarantee not only the thermal comfort in an environment in which there are several occupants, but thanks to its ability to dynamically change the membership functions, also ensures the optimum comfort in the case when there is a single occupant in the environment; whereby, it is useful to note that this paper introduces a new approach (not an application) to manage and to optimize HVAC systems.Moreover, the development of the proposed approach on an embedded prototyping board will be presented.
The paper is organized as follows.In Section 2, the main related works in order to deduce the innovations introduced with this work are shown.In Section 3, the system architecture and the proposed approach are described, while the neural network and the fuzzy logic controller are introduced in Section 4 and Section 5, respectively.In Section 6, the performance obtained by the proposed approach is shown, and finally, in Section 7, the paper is summarized, reporting the conclusions.

State-of-the-Art
Air temperature control inside buildings is not easy, if the purpose is the maintaining of thermal comfort conditions.The thermostat is a device used to regulate the indoor temperature parameters.It is low cost and reusable.However, considering its very reduced functionalities, it is not suitable in order to meet some typical requirements, with the purpose of obtaining improved comfort parameters [21].Moreover, it is necessary to consider the increasing of the power consumption, due to the setting choices of the users inside the building.Therefore, it is necessary to develop smart strategies for thermal control in order to obtain internal comfort automatically.
Several literature works deal with assessing, creating and maintaining indoor comfort conditions for building occupants [22].The IEQ is influenced by several factors: parameters, such as the thermal-physical properties of building materials and the architectural features of the building (layout, orientation, transparency ratio, shape factor, solar irradiation).However, these are not the only parameters that have an influence on the comfort of the individual.In fact, it is necessary to consider also the internal heat gains, the thermal insulation, the natural ventilation, the air infiltration and also the work done by the occupants [13].Moreover, the IEQ is influenced by individual characteristics and by physiological parameters, such as age, clothing and physical activity [23].
In recent years, several studies focused on soft computing technique applications, whose objective is to evaluate, to decide, to monitor and to measure in several application fields, emulating and using human ability to perform the above activities on the basis of experiences.Soft computing techniques have been proposed for the construction of new generation artificial intelligence and for solving non-linear and mathematically unmodeled systems.For this reason, soft computing techniques are applied in various fields, such as wireless sensor networks [24], flight controllers [25] and industrial networks [26], and they have found also several applications in HVAC systems.Since the inputs and the outputs of fuzzy logic controllers (FLCs) are real variables mapped with a non-linear function, they are appropriate for various engineering problems, especially for complex problems where classical control methods do not achieve comparatively favorable results.It is necessary to note that the human sensation of thermal comfort is subjective and can vary among occupants and over time.
Artificial neural networks (ANNs) have been widely used to forecast indoor and outdoor air temperature in building applications, sometimes coupled with fuzzy logic systems [27].However, an adequate literature on the coupling of fuzzy logic and a neural network in order to guarantee comfort evaluation is missing.
A hybrid model, in order to control indoor thermal comfort in an HVAC system, is presented in [28].The proposed model suggests a building structure and a fuzzy model in order to achieve indoor thermal comfort.To evaluate indoor thermal comfort situations, the predicted mean vote (PMV) and percentage of dissatisfaction indicators are used.The PMV is used to quantify the subjective evaluation of the comfort sensation of the occupants of indoor environments.It is an index proposed by Fanger [29] in order to predict the average vote of a large group of people on the thermal sensation scale.Several factors influence the PMV parameter, such as the metabolic rate, clothing insulation, the air temperature and humidity, the air velocity and the mean radiant temperature.
Computational intelligence tools, including fuzzy logic and artificial neural networks, are also used in [30].The authors propose a novel approach for the development of an automatic building diagnostic software tool for health monitoring system.The proposed model can be used to monitor a component of the HVAC system, detect fault conditions and trends and, then, classify the fault condition.The results of simulations underline that the creation of a health monitoring system can involve several benefits, such as helping to reduce maintenance efforts considerably, finding faults before critical failures occur and avoiding suboptimal system performance, in regard to energy consumption and user satisfaction.
The approach proposed in this paper is inspired by [20], where ANN models have been used for the control of thermal conditions combined with a fuzzy logic system.In fact, the authors show that such systems, as well as having a good control of internal air temperature, also contribute to the energy savings of the building.Specifically, in [20], the application of a combined neuro-fuzzy model for indoor temperature dynamic and automatic regulation is proposed.The main aim of the authors was in pointing out the effectiveness of the hybrid neuro-fuzzy approach and the importance of efficiently designing the temperature forecast model, especially with respect to the selection of the order of the regressor for each of the external and internal parameters used.Anyhow, the approach proposed in [20] can be improved considerably, for example, optimizing both the neural network, by calculating the embedding parameters through the most appropriate methodology, and the FLC, by using more inference rules and making it dynamic.
After analyzing these works that propose a neuro-fuzzy approach in HVAC systems, it is clear that adequate research works in order to guarantee comfort evaluation are missing.For this reason, in the following sections, the research works that apply neural network models and fuzzy logic controllers in HVAC systems will be analyzed separately.

Neural Network Models in Comfort Indoor Applications
Scientific research offers several works related to the assessment and the maintenance of thermal comfort conditions tested by occupants [22].In many works, a neural network is used in order to control the temperature inside buildings, with the purpose of maintaining adequate comfort conditions for the users.
The authors of [31] introduce an innovative control strategy, used in an air handling unit (AHU), by using a couple of neural networks; the second is called an auxiliary neural network.The networks are implemented in order to ensure a better control of the AHU and to obtain better thermal comfort and lower energy consumption.
In this context, the literature provides different models of neural network applications, such as, for example, the implementation of a model based on an Elman recurrent artificial neural network for the prediction of the electrical consumption supplied to the residential users located within a particular area of the town of Palermo (Italy) for cooling in summer [32].In recent years, in fact, the use of electrical devices for air conditioning (as multi-split systems) and resulting electricity demand in the civilian sector (residential and tertiary) have increased exponentially.The authors of [32] showed that the use of an ANN and of meteorological data (model input) can provide information about the electricity consumption of households, even in the absence of reliable data on the local spread of the AC devices.
In other studies [33], the neural network models have been also used to estimate the reference power curve (on-line profile) in order to monitor the performance of a wind farm as a whole.In [33], the authors have used and compared three different models of learning (a self-supervised neural network called Generalized Mapping Regressor, a feed-forward multi-layer perceptron and a general regression neural network) in order to estimate the relationship between the wind speed and the power generated in a wind farm.This methodology has allowed the development of a non-parametric model of the power curve that can be used as a reference profile for the on-line monitoring of the process of power generation and for the prediction of the power of the wind park.
In other approaches, artificial neural networks have also been used in order to examine the performance and the adaptability of predictive control strategies in residential buildings.They have been developed based on the thermal properties of the building envelope [34], through predictive control based on both ANN and non-ANN.The results show that the ANN-based models have the greater potentiality to create favorable thermal conditions inside the examined buildings rather than a predictive model based on non-ANN.
In [35], a dynamic ANN model for the prediction of the energy consumption in an HVAC system is presented.The aim is to maintain the temperatures in order to have an acceptable thermal comfort.The reduction of the consumed energy is evaluated through a multi-objective optimization, by using a particle swarm optimization algorithm.
The literature has demonstrated that ANNs are a useful tool to forecast temperatures and suggests several challenges if combined with approaches that control specific parameters, in order to obtain internal comfort and to reduce the discomfort, due to different comfort perceptions among different users.

Fuzzy Logic Controller Approaches
The authors of [36] want to demonstrate the efficacy in the fault occurrence of a power network when fuzzy control is used in unified power flow controller systems.In order to show the efficacy of the proposed controller, several simulations have been carried out, and the obtained results have been compared with a conventional PID controller.Simulations results show that power system stability has been significantly improved using the proposed approach, and it is clear that the fuzzy controller leads to better results.
A new fuzzy control strategy, based on PID parameters tuning, to control HVAC systems is proposed in [37].In order to improve the design of a fuzzy controller, the proposed approach starts from the mature technologies of the PID controller.The authors achieve a mathematical analytical expression of the parameters between fuzzy controllers and the gain coefficients of PID controllers through an analysis of the fuzzy controller's structure.The proposed fuzzy controller is applied to control the temperature in HVAC systems.The simulation test results show that the proposed fuzzy control strategy is effective compared with the conventional PID control.Moreover, the proposed fuzzy control algorithm has less overshoot, shorter setting time, better robustness, etc.The simulation and the experiment compare the PID controller and the fuzzy controller, and the results show that the proposed novel design of the fuzzy controller achieves good performance.
A novel optimal Type-2 fuzzy proportional-integral-derivative controller is proposed in [38] for controlling the air supply pressure in an HVAC system.Both the parameters of input and output membership functions and the PID controller coefficients are optimized simultaneously.Simulation results indicate that the proposed fuzzy PID controller has a faster response, a smaller overshoot and a higher accuracy than PID under normal conditions and under existing uncertainties in the parameters of the model.For this reason, the authors suggest that their approach can be extensively applied in the HVAC industry.
In [39], the development of an algorithm for the air-conditioning control system, based on fuzzy logic in order to provide optimal conditions for comfortable living inside a building, is described.The proposed system is composed by two sensors for feedback control, one to monitor temperature and another one to monitor humidity.On the contrary, the FLC handles the compressor motor speed and the fan speed in order to maintain the room temperature at a desired one.In order to validate the proposed approach, a simulation is carried out using MATLAB, and the results are promising, as they show the benefits introduced by the application of an FLC in an HVAC system.The author of [40] presents an adaptive incremental fuzzy PI controller for an HVAC system capable of maintaining comfortable conditions under varying thermal loads.Since the HVAC systems have strong-coupling and non-linear characteristics, fixed PI controllers have poor control performance and more energy consumption.For this reason, the proposed approach combines together fuzzy control and PI control.In the proposed control scheme, the error of the system output and its derivative are taken as two parameters necessary to adapt the proportional (P) and integral (I) gains of the PI controller based on fuzzy reasoning according to practical control experiences.In order to evaluate the effectiveness of the proposed control methods in the HVAC system, they are compared with a fixed well-tuned PI controller, and the results demonstrate that the adaptive incremental fuzzy PI controller has more superior performance than the latter.
In [41], an application of a fuzzy logic system to an air conditioner is presented.With the proposed approach, it is possible to modify the functioning of the air conditioner and to reduce the electrical energy intake of the air conditioner compressor/fan; in this way, all available resources can be used in an efficient manner.The analysis carried out by the authors clearly underlines the advantages of fuzzy logic in dealing with problems that are difficult to study analytically, but can be solved in terms of linguistic variables intuitively.In fact, in the case of an air-conditioning system, the fuzzy logic helped to solve a complex problem without getting involved in the intricate relationships between physical variables.

System Model
The proposed system is characterized by the architecture depicted in Figure 1.The main elements of the system are an artificial neural network (ANN) and a fuzzy logic controller (FLC), described in detail in Section 4 and Section 5 of this work, respectively.In the proposed approach, the effect of weather parameters are taken into account in order to train an ANN model aiming at forecasting indoor temperature.The output of the ANN is used to feed an FLC, which has the goal of keeping acceptable indoor conditions from the thermal comfort point of view."Acceptable" means that it is possible to achieve the target values of comfort established in [11] or those that are subjective.In fact, thanks to user feedback, dynamically, at runtime, it is possible to obtain the comfort conditions based on the user experience.The outdoor temperature, the air relative humidity, the wind speed and the recorded indoor temperature in previous time steps are used by the ANN in order to perform the indoor temperature forecast and, thereby, drive the controller.The fuzzy control system is driven by the indoor temperature forecasted by the ANN module.Moreover, the air conditioning system, through fuzzy logic, automatically sets the preferred temperature by the occupier of the environment.This is possible because the FLC learns about the user's personal preference of comfort.In fact, the control system automatically sets the dehumidification, the cooling or the heating, depending on the initial temperature of the environment, to values of programmed comfort.Anyhow, this setting may vary if the user prefers a situation with regard to comfort different from that programmed in the system.This is possible because comfort, although defined in [11], is a very subjective factor, and may vary, even in the same subject.In fact, for example, if a user moves himself from a very hot environment to another that has a temperature in line with the target values proposed in [11], he might feel very cold.Therefore, the user could set the system in order to adapt to its temporarily feeling cold (due to the change in temperature).Subsequently, the system could be re-set to default values or to others lower or higher than the target, again if the user requests.The fuzzy control system is dynamic, because receiving user feedback regarding the temperature (cold, hot) is able to bring the room temperature to the maximum value of personal comfort.In this work, the default comfort temperature in the studied environment refers to the acceptability range proposed in [11].The proposed model has a cascade structure, where the non-linear indoor temperature forecasting module is directly linked to the FLC module that acts on the HVAC.The FLC aims for indoor thermal comfort conditions, always maintaining the temperature within the desired range.In HVAC systems, the application of fuzzy controllers involves the advantage that they can be characterized by means of linguistic rules instead of using complex analytical expressions.In order to demonstrate the advantages of the use of ANN forecasted parameters as input for an FLC, in this work, a scenario of a typical indoor environmental situation has been chosen.As shown in Figure 1, the activation of the FLC refers to the difference ∆T between the value T i (k) of the predicted indoor temperature at time k and the value T i (k − n) of the indoor temperature measured at time (k − n), where n = 60, 55, . . ., 5 min.
In this paper, a comparison with the approach proposed in [20] will be done.Anyhow, it is necessary to highlight that the approach proposed in this paper has characteristics significantly different from the one proposed in [20].First of all, the neural network proposed in this paper is optimized through a different methodology.In fact, the method applied to calculate the embedding parameters, which will be shown in Section 4.1, is purely analytical and leads to significantly higher performance.Furthermore, the two works differ mainly for the fuzzy logic controller.In fact, from a deep study, both on the choice and on the quantity of membership functions (MFs) [42][43][44], we have come to the conclusion that in the proposed approach, it is necessary to use more MFs represented by Gaussian functional shapes [45], rather than less MFs represented by triangular functional shapes [46].In this way, the accuracy increases greatly, without degrading the computational performance, as shown in [47].Moreover, considering the thermal comfort within an environment, the authors of [20] do not consider the comfort of a single occupant within the environment.In fact, the comfort measure can be subjective, depending on the user's feeling of being hot or cold.For this reason, the fuzzy logic controller, proposed in this paper, thanks to its ability to dynamically change the MFs, achieves not only thermal comfort in an environment in which there are several occupants, but also ensures the optimum comfort in the case when there is a single occupant in the environment.In addition, the approach proposed in [20] has been only simulated, while the one proposed in this paper has been implemented on a real prototyping board (Figure 2).In fact, in order to validate the proposed controller, described in the following sections, a real test-bed scenario has been deployed.The processing unit is the Microchip PIC24FJ256GB108 micro-controller [48], which integrates the control features of a micro-controller unit with the processing and throughput capabilities of a digital signal processor.It is a 16-bit micro-controller with a maximum processing power of 16 MIPS (Millions of Instructions Per Second).This micro-controller is ideal for low power (< 100 nA standby current) and connectivity applications that benefit from the availability of multiple serial ports (3xI2C, 3xSPI), 4xUARTS and 23 independent timers.Moreover, it is suitable for embedded control and monitoring applications, due to the large amounts of RAM (16 kB) memory for buffering and large (up to 256 kB) enhanced Flash program memory.The peripheral pin select function aids in configuring the most efficient pin configuration of available I/O, and the charge time measurement unit provides touch support for up to 64 individual buttons.Moreover, the analysis carried out in Section 2 showed that adequate research works, in which neuro-fuzzy approach are applied in HVAC systems, are missing.Therefore, it is clear that the approach proposed in this paper represents a clear novelty among the various research works available in the literature.

Forecasted Temperature by Using an ANN Model
This work implements an artificial neural network model with a non-linear-autoregressive NNARX-type (neural network auto regressive external input model) structure, in order to obtain forecasted indoor temperatures.The ANN model allows the emulation (by using MATLAB) of indoor thermal comfort.Subsequently, the model coupled with an FLC is implemented in a real prototyping board.The neural network has been built by using a multilayer perceptron (MLP) topology and has been trained by using several weather-climate outdoor and indoor data, measured and recorded in a meteorological station located at Enna, a city in the center of Sicily.The used input data in the ANN are: • dry bulb outdoor air temperature (T a ( • C)); • relative humidity (RH(%)); • wind speed (W S(m/s)); • dry bulb indoor air temperature (T i ( • C)).
The dry bulb indoor air temperature (T i ( • C)) is the parameter used for the design of the fuzzy controller.All data used for the development of the ANN are recorded during the period 2010-2011.These data have been divided into two main groups, according to the months of detection, for the analysis of thermal comfort conditions, in the summer and in the winter cases, respectively.The temperature of thermal comfort will be reached when it falls within the acceptability range proposed by ASHRAE [11].The input parameters (T a , RH, W S, T i ) of the network are given in the NNARX model at the previous time moments.Therefore, the NNARX model computes the expected indoor temperature at time t one step ahead (t + 1).Subsequently, the difference (∆t) of the indoor temperature between t and t + 1 represents the input parameter of the FLC that, then, is able to run the fan coils in order to tune the inlet air speed.The time instants of inputs parameters have not been determined arbitrarily, but using a special formulation of embedding parameters, shown in Section 4.1.The equation used in order to develop the ANN model is the following [49]: where ŷ is the y value at time t predicted by the model, θ is a vector containing the weights of the neural network, g is the function realized by the neural network and g(ϕ) is the vector of regressors.
The selection of past used signals as regressors are carried out by using a new formulation of embedding parameters described in the following section.As previously said, the input parameters of the ANN have been divided into two groups in order to simulate two different scenarios: indoor comfort in summer and winter.The network has been trained using the Levenberg-Marquardt algorithm [50], and the NNARX model has been built with 30 neurons in the hidden layer (HL) for winter scenario and 10 neurons in the HL for the summer scenario.The training parameters used in the simulations are the following: • performance goal: 5 × 10 −3 ; • learning rate: 0.1; • maximum failure number for validation: 20; • Marquardt adjustment parameter: 0.05.
In this proposed ANN, the technique of early stopping is applied.This ensures good performance and the best generalization of the implemented model, as well as avoiding the over-fitting phenomenon.This technique envisages that the data set is split into three groups: training set (it computes the gradient and then updates the weights and the bias of the network), validation set and test set.During the training process, the error on the validation set is calculated.Usually, both the validation set error and the training set error decrease in the initial phase of training.When the over-fitting starts, the error on the validation set typically begins to rise.If the validation set error continues to rise for a given number of epochs, the training is stopped and returns the corresponding weights and bias to the minimum validation error.In the considered case, 70% of the data have been used for the training set, 15% for the validation set and the remaining 15% for the test set.Moreover, before starting the simulations, all data have been normalized between the minimum and maximum of the data values.In the training set, the performance of the network have been evaluated by mean squared error (MSE).The prediction performance of the network have been evaluated in the test set, using the parameters shown in Table 1.Considering that Y i is the value of the i -th actual observation and Ŷi is its forecasted value, the forecast error is calculated as follows: while p i is determined with the following equation: Table 1.Error measures used to assess the forecasting performances of the neural network auto regressive external input (NNARX) model.

Error Measure Formula
Mean squared error (MSE) mean(e 2 i ) Root square mean error (RMSE)

State Reconstruction: Embedding Parameters
According to Takens embedding theorem [51], the dynamical behavior of a state x = x(t) can be reconstructed by means of a m-dimensional vector, such as: where τ is the delay time and m is the embedding dimension [52].Even if their values are not uniquely determined, these two parameters are crucial in the algorithm efficiency and result accuracy during the reconstruction state.Considering the embedding dimensions, in the literature, two perspectives can be distinguished [53].In the first one, the embedding parameters may be considered as independent of each other (according to Takens theorem).In this way, several different approaches can be proposed, such as a GP algorithm [54], for m calculation, series correlation approaches [55], phase space extension approaches [56], multiple autocorrelation and non-bias multiple autocorrelation [57], for τ evaluation.
The second perspective considers m and τ as closely related and then combined methods are proposed, such as a small-window solution [58], the C-C (Correlation-Correlation integral) method [59] and automated embedding [60].In this paper, a univariate time series {x i } N i=1 is taken into account.The time delay is determined by using the autocorrelation approach [61], while the embedding dimension is calculated using the nearest neighbor technique [62].
As proposed in [61], the value of the time delay τ has been selected by examining the autocorrelation function: where x is the mean value, i.e., x = N i=1 x i /N .A good compromise in the choice of the time delay is setting r(τ ) ≈ 0.97.It is possible to define: for all n = (m − 1)τ + 1, . . ., N .Moreover, considering J 0 = (m − 1)τ + 1 and: it is possible to determine the optimal embedding dimension m by minimizing the error function E(m), that is: These methods, used to calculate the embedding dimension and the time delay, have been chosen, as they allow one to obtain good results with the univariate time series {x i } N i=1 taken into account in this paper.In this paper, a direct comparison with other approaches in the literature is not carried out, but after a deep analysis of other methods in the literature, it has been deduced that, in the context considered in this paper and if an univariate time series is taken into account, the autocorrelation function (for the time delay) and the nearest neighbor technique (for the embedding dimension) are the most appropriate.
In Table 2, the embedding dimension (m) and the time delay (τ ), obtained for this study, for all of the regressors are shown.The respective vectors ϕ(t) containing the regressors corresponding to the NNARX model used for the winter and summer cases are, respectively:

ANN Validation
This section shows the results obtained with the model NNARX, for both scenarios: summer and winter.Some performances values are shown in order to obtain a metric of comparison between the proposed NNARX model and the approach of Marvuglia et al. [20].We expect some improvements compared to the approach proposed in [20], because if we can reduce the prediction error, we can use a neural network model that can obtain good input parameters for the fuzzy controller.It is necessary to underline that a very low error (a variation of the order of tenths of a degree) may not affect the fuzzy controller.However, it is also true that the approach described in [20] is based on 25 input (summer scenario) and 27 inputs (winter scenario), and then, this makes it more difficult to implement on a real device.Since our goal is to implement the coupled approach (ANN/FLC) on prototyping boards with a micro-controller [48], the proposed approach aims to get the same or better performance than the one of Marvuglia et al. [20], lowering the complexity of the algorithm using 20 inputs for the summer scenario and 23 inputs for the winter scenario.This has been possible thanks to the method described in Section 4.1.In fact, considering Table 2, the inputs of the neural network are given by the sum of the embedding dimensions (m), specifically 20 = 3+4+9+4 for the summer scenario and 23 = 6+5+7+5 for the winter one.Furthermore, a higher number of inputs leads to a significant accumulation of data in memory, and considering that the used prototyping board has reduced capacity in terms of memory, the reduction in the number of inputs also improves memory management in the device.
Before comparing the two approaches, it is necessary to analyze the best performance of the proposed approach among all trained networks.Subsequently, it is possible to compare the two approaches.Tables 3 and 4 show the values obtained by performance evaluation in terms of error values (M SE, RM SE, M AE, M AP E).The measures have been carried out by varying the number of neurons in the HL from 10 to 100.In particular, in Table 3, the performance measures for the summer scenario are shown, and in Table 4, the performance of the winter scenario is shown.The values shown in Tables 3 and 4 are the best obtained from all trained networks.The results show that the best performance has been obtained with nets with 50 neurons (summer scenario) and 40 neurons (winter scenario) in the hidden layer.In both cases, the values of indoor temperature are referred to when the HVAC system is off-line.Figures 3 and 4 show the following results: • forecasting indoor temperatures (top); • the corresponding forecasting errors (down).
The first refers to the real temperature and to the forecasted value obtained by using our approach and the one proposed in [20], while the last represents the errors obtained by the difference between real temperature and the best performance of forecasted indoor temperature using approach of both ours and Marvuglia et al. [20].Figure 4 shows the performance obtained in the winter scenario, whereas Figure 3 refers to the summer one.In both scenarios, the temperature values are the ones recorded when the HVAC system is off, i.e., they refer to the building envelope in natural evolution dynamics.The approach proposed in this paper obtains a lower error (an average of about 0.2 degrees Celsius lower) compared to the one proposed by Marvuglia et al. [20], using both a lower number of inputs and a higher number of neurons.This is not a problem, since, as shown in [64], the complexity of the system is not directly proportional to the number of used neurons.

Fuzzy Control System
The fuzzy control system handles the switching on or off of the HVAC system and the regulation of the inlet air speed, called the ON/OFF speed.The heat gains are only indirectly considered through their effect on the variation of the indoor temperature, which is recorded by the data logger.The controller takes as input crisp values of T i (k) and ∆T i , which are converted into linguistic values by using a chosen set of membership functions.The used linguistic values are: • Very Cold (VC); • Pretty Cold (PC); • Slightly Cold (SC); • Comfortable (COM); • Slightly Hot (SH); • Pretty Hot (PH); • Very Hot (VH).
The membership functions used for T i in the summer and winter scenarios and for the difference ∆T i are shown in Tables 5, 6 and 7, respectively, while their graphical representation is depicted in Figures 5, 6 and 7, respectively.The aim of the controller is to elaborate on these linguistic values using an inference mechanism based on a set of if-then rules.These rules are combined in the FLC, which returns a membership function, represented, in this paper, by Gaussian functional shapes [45].A Gaussian membership function is specified by the following equation: where c represents the membership function center and σ determines the membership function width.Using this function, it is possible to determine the linguistic output, which can assume one of the above presented values.The Gaussian model takes crisp inputs and produces crisp outputs.It does so on the basis of user-defined fuzzy rules on user-defined fuzzy variables.The operations of the Gaussian rules can be described in four steps: • mapping each of the crisp inputs into a fuzzy variable (fuzzification); • determination of the output of each rule given its fuzzy antecedents; • determination of the aggregate output(s) of all of the fuzzy rules; • mapping of the fuzzy output(s) to crisp output(s) (defuzzification).Through the inference mechanism, it is possible to determine the correct output according to the fuzzy inference rules presented in Table 8.For example, considering the summer scenario, if the predicted value of T i (k) is 26 • C, the membership function considers the linguistic value of SH, while if ∆ T i = −2 • C, the linguistic value refers to SC.In this way, the final inference value is SH.The next step consists in the conversion of this value into crisp logic decisions suitable to drive the HVAC system (defuzzification).The defuzzification process of the proposed FLC is based on Mizumoto's functions centroid and maximum [63].Through the fuzzy logic, the HVAC system is able to set the preferred temperature by the occupier of the environment.Another feature of the proposed FLC is that it learns about the user's personal preference of comfort.In fact, as depicted in Figure 1, the "user feedback" block allows the controller to be dynamic, since, receiving the user's feedback regarding the environment temperature (cold, hot), it is able to bring the room temperature to the maximum value of personal comfort.The membership functions previously proposed refer to the case of standard operation, while through the users' feedback, the rules can be changed dynamically.In this case, the Gaussian membership function is redefined by the following equation: where w is specified according to Tables 9 and 10 for the summer and winter scenarios, respectively.In this way, Equation ( 13) determines the new width of the membership function.It is necessary to underline that the function of "user feedback" block is called only if the occupant of the room provides feedback to the FLC, while in the other cases, the standard or the last defined membership functions are loaded.Moreover, this function is called whenever users provide feedback (cold, hot) to the HVAC system.For example, considering the summer scenario (Table 9), if the feedback is hot and the current membership function is VH, then according to Equation (13), the new membership functions are recalculated with the following values of w: • w = 1.5 for VH membership function; • w = 1 for PH membership function; • w = 0.9 for SH membership function; • w = 0.8 for COM membership function; • w = 0.7 for SC membership function; • w = 0.6 for PC membership function; • w = 0.2 for VC membership function.
In fact, the user feels a hot temperature in the environment and provides this feedback to the controller, which, as a result, dynamically adapts the membership functions in order to obtain the maximum value of personal comfort.

Experimental Results
In order to evaluate the validity of the proposed approach, a real test-bed scenario has been deployed.As mentioned previously, the literature has demonstrated that ANNs are a useful tool to forecast temperatures.In this work, the prediction made by the NNARX is really relevant and mandatory, because we want to obtain the optimum comfort for the individual.In order to achieve this, it is not sufficient to consider the measurement of the actual temperature, but it is necessary to have a prediction of what will happen.It is not useful to provide the FLC with the internal temperature and its variation as input parameters, but it is necessary to provide the values predicted by a neural network.Only in this way can the optimum comfort for the individual be achieved.The proposed FLC, based on the indoor temperature values forecasted by the NNARX model and on the temperature detected in the room by the data logger (recorded every f minutes), dynamically determines the ON/OFF time and the inlet air speed of the HVAC system.The time step between two consecutive regulation signals sent by the controller to the HVAC system has been set to 5 min, i.e., equal to the sampling interval of the indoor temperature data logger.As mentioned above, the proposed approach has been implemented in a prototyping board [48], and the output values are shown on an LCD screen connected to it.In addition, in order to calculate and plot the performance, the micro-controller continuously sends the output data to a computer through a serial cable.
In Figures 8 and 9, a comparison between the performance of the FLC proposed in this work and the one proposed in [20], in summer and winter scenarios, respectively, is depicted.Specifically, the evolution of the inlet air speed injected by the fan coils and the indoor air temperature forecasted by the NNARX model are shown as a function of the time during a day.The figures do not refer to a typical day, but show what happens when a certain temperature is forecasted.For example, considering that it is 02:00 p.m. and the temperature is 16 • C, it is specified how the inlet air speed has to be set.Specifically, considering Figures 8 and 9, at 03:00 p.m., the depicted decision (inlet air speed) does not depend on the action taken at 02:00 p.m.In fact, the values must be considered as if the system turns on for the first time on that hour.The measurements have been carried out in a free environment.It is necessary to underline that the inlet air speed has been set to the default value of 2 m/s in both approaches, while, as is possible to see, when the neural network forecasts a temperature that would fall outside the comfort range, the controller drives the HVAC system in order to obtain an adjustment of the indoor temperature in the right direction.The results show that in both approaches, the neural network model performs an off-line learning in order to set up the FLC.In fact, subsequently, the fuzzy controller takes as input the values of the trained NNARX model and, through the membership functions, optimizes the control, managing the switching on or off of the HVAC system and adjusting the inlet air speed.Both approaches are based on an on-line dynamic control of the inlet air speed, considering a forecasted temperature and not the actual measured one in the room, because the main aim is to achieve the better adaptation of the HVAC system to the dynamics of the nonlinear system at the base of the temperature evolution.Therefore, the artificial neural network models, based on the strict relationship existing between their inputs and their output, that are the forecasted indoor temperatures, are able to learn the mechanism of the temperature's evolution over time.Therefore, what has been learned by the neural networks is then transmitted to the fuzzy controller to prevent unnecessary energy consumption due to non-optimal regulation of the inlet air.
As is possible to see in Figures 8 (right) and 9 (right), the FLC proposed in this work is able to manage the ON/OFF speed of the HVAC system differently than the one proposed in [20].In fact, the inlet air speeds are optimized thanks to the use of a greater number of membership functions in the fuzzy controller.Due to this feature, the FLC proposed is also able to prevent unnecessary energy consumption due to an optimal regulation of the inlet air.Specifically, considering the summer scenario (Figure 8), the proposed approach sets the inlet air speed of 3 m/s only twice, rather than the approach proposed in [20], in which it is set eight times.In the winter scenario (Figure 9), the inlet air speed is set to 3 m/s six times using the proposed approach, rather than nine times using the approach proposed in in [20].The proposed system would respect the current directive of the European Community (2012/27/UE [65]), which proposes the design of zero energy buildings trying to achieve a greater energy efficiency (about 20%) by 2020.In this paper, we cannot quantify the energy savings of the proposed system, as this depends on the type of HVAC system (heating/cooling, single, centralized, etc.).Moreover, we have considered only meteorological factors, while the goal of our future work is to obtain the consumption of HVAC systems, both through a thermostat and through a fuzzy controller, comparing the obtained results.
Furthermore, as said previously, the authors of [20] do not consider the comfort of a single occupant within the environment.This comfort measure can be subjective, depending on the feeling of being hot or cold of the user.The proposed fuzzy logic controller is able to change the MFs dynamically and, so, achieves not only thermal comfort in an environment in which there are several occupants, but also ensures the optimum comfort in the case when there is a single occupant in the environment.In order to validate the dynamic variation of the membership functions, two tests have been performed, one for the summer scenario and the other for the winter one.As mentioned previously, the user can provide feedback on the temperature of the environment.In order to do this, the current membership function is displayed on the LCD of the prototyping board, and the user provides his feedback (cold, hot), pressing the appropriate button connected to it.In the first test (summer scenario), the SH membership function has been considered, and the received feedback was "hot".The adjusted membership functions are depicted in Figure 10 and shown in Table 11.As is possible to see, the new membership functions have been calculated in order to achieve the optimal comfort level for the user.In fact, the widths of the VH, PH and SH membership functions have been increased, while the others related to SC, PC and VH have been reduced.The second test refers to the winter scenario.In this case, the SH membership function has been considered again and the received feedback was "cold".In Figure 11 and Table 12, the adjusted membership functions are shown, and even in this case, they have been adjusted in order to meet the requirements of the thermal comfort of the user.Analyzing the obtained results, it is clear that the proposed FLC is able to dynamically adapt the membership functions in order to achieve the optimal comfort level for the user, whereby, even in the case that the main aim is to obtain the maximum thermal comfort for a single occupant of the room, the proposed FLC achieves better results and introduces a clear innovation, unlike the one proposed in [20].

Conclusions
In this paper, an application of a combined neuro-fuzzy model for the dynamic and automatic regulation of indoor temperature has been presented in order to meet the requirements of thermal comfort.The approach proposed in this paper shows an FLC fed by an indoor temperature predictor.The temperature forecast is carried out by an NNARX model, which attained good forecasting performances compared to the state-of-the-art, thanks to the new methodology used in order to calculate the embedding parameters.In fact, an analysis on the embedding parameters has been performed in order to mathematically determine the embedding dimension and the time delay.Moreover, the rapid response of the ANN and the high quality of the data approximation have been shown.Experimental results, obtained through a prototyping board, are very promising.The results show that the efficient dynamical regulation of the on/off times of the HVAC system and of its inlet air speed achieves a more efficient use of energy rather than simple on-off devices; timers with fixed set point temperature or controllers whose correction actions are based only on the temperature detected in the controlled room.Furthermore, the results show the feature of the FLC to learn about the user's personal comfort preferences.In fact, receiving feedback regarding the temperature, the proposed fuzzy control system has been able to adjust its membership functions in order to bring the room temperature to the maximum value of personal comfort.Moreover, the further application of an improved fuzzy logic controller, based on other characteristics, which affect the internal temperature and, then, the thermal comfort, such as special scenarios located in urban canyons or buildings that use different types of insulation, etc., is a goal of our future research works.

Author Contributions
All of the authors have contributed toward developing the ideas.Messineo Antonio and Nicolosi Giuseppina have analyzed the weather-climate data in order to obtain the comfort for building occupants.Moreover, they carried out both the study and the development of the neural network model.Collotta Mario and Pau Giovanni have implemented the fuzzy controller and have integrated the neuro-fuzzy approach in the real embedded system.All of the authors have collaborated to obtain the results, the performance evaluation and in the definition of reference scenarios.All of the authors have been involved in preparing the manuscript.All of authors are responsible for the integrity of the work as a whole.

Figure 3 .
Figure 3. Measures of forecasting indoor temperatures (top) and forecasting error (down) (summer scenario with 50 neurons in the hidden layer).

Figure 4 .
Figure 4. Measures of forecasting indoor temperatures (top) and forecasting error (down) (winter scenario with 50 neurons in the hidden layer).

Figure 5 .
Figure 5. Membership functions for T i in the summer scenario.

Figure 6 .
Figure 6.Membership functions for T i in the winter scenario.

Figure 7 .
Figure 7. Membership functions for ∆T i .

Figure 8 .
Figure 8. Summer scenario: ON/OFF speed of the HVAC system.The approach proposed in[20] (left); The approach proposed in this paper (right).Reproduced with permission from[20], Copyright 2014 Elsevier.

Figure 9 .
Figure 9. Winter scenario: ON/OFF speed of the HVAC system.The approach proposed in [20] (left); The approach proposed in this paper (right).Reproduced with permission from [20], Copyright 2014 Elsevier.

Figure 10 .
Figure 10.Adjusted membership functions for T i in the summer scenario.

Figure 11 .
Figure 11.Adjusted membership functions for T i in the winter scenario.

Table 2 .
Selected (optimal) values of the embedding parameters used for the NNARX model.

Table 4 .
Performance in the winter scenario.

Table 5 .
Membership function T i used for the summer scenario.VC, Very Cold; PC, Pretty Cold; SC, Slightly Cold; COM, Comfortable; SH, Slightly Hot; PH, Pretty Hot; VH, Very Hot.

Table 6 .
Membership function T i used for the winter scenario.

Table 7 .
Membership function ∆T i .

Table 8 .
Fuzzy inference rules of FLC.

Table 9 .
Variation of the w parameter for the summer scenario.

Table 10 .
Variation of the w parameter for the winter scenario.

Table 11 .
Adjusted membership function T i for the summer scenario.Linguistic Values T i (k) ( • C) interval

Table 12 .
Adjusted membership function T i for the winter scenario.Linguistic Values T i (k) ( • C) interval