A distributed virtual sensor scheme for smart buildings based on adaptive approximation

This paper presents the design of a methodology for diagnosing sensor faults in heating, ventilation and air-conditioning (HVAC) systems, and compensating their effects on the distributed control architecture. The proposed methodology is developed in a distributed framework, considering a multi-zone HVAC system as a set of interconnected, nonlinear subsystems. For each of the interconnected subsystems, we design a local virtual sensor agent that can detect and isolate faults in its monitored sensors and provide sensor fault estimations for correcting the faulty measurements. Adaptive estimation schemes are implemented in each local virtual sensor agent, using adaptive approximation models for learning the unknown fault function. Simulation results are used for illustrating the effectiveness of the proposed methodology applied to a two-zone HVAC system.


I. INTRODUCTION
S MART BUILDINGS incorporate embedded intelligence based on computer technology, aiming at autonomously adapting the evolving building environment in order to increase energy efficiency and cost effectiveness, improve comfort, productivity and safety, and enhance system robustness and reliability [1]. The heating ventilation and airconditioning (HVAC) system constitutes a basic component of buildings, necessary for providing a high quality and healthy environment for the occupants. However, the HVAC system may increase the energy waste in commercial buildings when it is improperly controlled and its performance is degraded, especially due to the occurrence of faults. In that case, the energy waste was estimated to be 15% to 30%, according to the Electrical and Mechanical Services Department of Hong Kong [2].
A feasible and reliable solution for managing the energy consumption and, at the same time, maintaining comfort conditions in buildings is the implementation of fault diagnosis and accommodation mechanisms for detecting and isolating faults in HVAC systems and compensating their effects on the feedback control scheme [3]. During the last two decades, various methodologies have been developed for active fault tolerant control (AFTC) in HVAC systems. Most of these methodologies have focused on faults in actuators and the plant of the HVAC system. However, diagnosing sensor faults and ensuring the fault tolerant performance of the HVAC system are becoming key challenging problems, due to the The  large number of sensors used for monitoring and control of energy consumption and living conditions in smart buildings.
An efficient approach for ensuring the proper operation of HVAC systems under sensor fault conditions is the employment of AFTC schemes based on virtual sensors. The design of virtual sensors relies on developing mathematical models of the process implemented in software, which are used to reconstruct, estimate or predict the faulty or missing measurements [4]. In HVAC systems, which are typically highly complex, spatially distributed and with a large number of interconnected components, the utilization of model-based virtual sensors provides a more appealing approach compared to physical redundancy. Using physical sensors approach implies additional cost for installation and maintenance, while, if they are not added to the system during the initial HVAC installation, especially in the electromechanical part, invasive actions by specialized personnel are required. This may delay the initialization of the proper HVAC operation after the fault isolation or even risk a serious damage of the electromechanical part when accessing the system.
Several researchers have investigated the design of virtual sensor schemes, combining information from healthy sensors with static or dynamic analytical models, such as observers, aiming at reconstructing/estimating the output of a faulty sensor or correcting the faulty output using the estimation of the sensor fault [5]- [8]. In HVAC systems, there is a significant research activity in designing virtual sensors following a data-driven modeling approach with the goal of predicting the output of a faulty sensor [9]- [11]. However, these methods require a large amount of data collected under various normal operating conditions for synthesizing the virtual sensor models. An alternative approach to the design of virtual sensors for HVAC systems relies on the use of static models based on first-principles (see [4] and the references therein). This type of virtual sensors is more appropriate for monitoring or fault identification than for feedback control. There are very few virtual sensor schemes based on correcting the faulty output using the sensor fault estimation [12], while to the authors' best knowledge, no work has yet been developed on distributed virtual sensor schemes.
The objective and main contribution of this work is the development of a distributed virtual sensor scheme for compensating the effects of sensor faults on the distributed control of HVAC system using an adaptive approximation approach. In previous work [13], the authors have developed a distributed methodology for detecting and isolating sensor faults in a multi-zone HVAC system, based on local sensor fault diagnosis agents, where each agent is used to monitor one of the HVAC subsystems. In this work, the designed agents aim not only to detect and isolate sensor faults, but also to compensate their effects by generating virtual signals of the faulty sensors. To this end, we design local virtual sensor (LVS) agents using dynamic estimation schemes with real-time learning capabilities. The rationale behind the learning approach is the on-line approximation of the unmodeled nonlinear sensor faults by using adaptive approximation models (e.g. sigmoidal neural networks and radial basis functions) [14]- [16].
The development of a distributed virtual sensor scheme can significantly contribute in preventing the propagation of sensor faults in a distributed control architecture for HVAC systems. Moreover, a distributed virtual sensor methodology can provide a more suitable approach for HVAC systems in smart buildings with multiple sensors compared to a centralized approach, since it may reduce the computational complexity of the AFTC algorithms, increase their reliability with respect to security threats and be scalable in case of system expansion.
This paper is organized as follows. The HVAC description and problem formulation is described in Section II. The architecture and the design details of the proposed distributed virtual sensor approach are presented in Section III. Simulation results of the application of the proposed virtual sensor architecture to a two-zone HVAC system are provided in Section IV, followed by concluding remarks in Section V.

II. HVAC DESCRIPTION AND PROBLEM FORMULATION
Consider a HVAC system, which consists of N separated zones (e.g. dormitory rooms, classrooms) and the electromechanical part. The basic components of the electromechanical part of the HVAC, shown in Fig. 1 are the cooling coil, the chiller and the chilled water tank, the fan, the supply and return ducts and the variable air volume (VAV) boxes. The cooling coil is connected to the chiller through the chiller water tank, which regulates the water inserted to the cooling coil.  The temperature dynamics in each zone, cooling coil and chiller water tank can be modeled based on the fundamental mass and energy conservation equations [17], [18]. The Nzone HVAC system can be regarded as a set of N + 1 interconnected, nonlinear subsystems that correspond to the electromechanical part, comprised of the cooling coil and chiller water tank, and the N building zones. Let T zI ( • C) be the temperature of the I-th zone, I ∈ {1, . . . , N }, T e 1 ( • C) be the output air temperature from cooling coil and T e 2 ( • C) be the temperature of the water in the chiller storage tank, while the variable Q aI (m 3 / sec) is the volumetric flow rate of air entering into the I-th zone and χ (m 3 / sec) is the chilled water mass flow rate. The dynamics of the subsystem that corresponds to the electromechanical part, denoted by Σ e , can be expressed as:

Chiller
where It is noted that the first two terms of (1) represent the local dynamics of Σ e , while h e characterizes the interconnection dynamics between Σ e and { Σ (1) , . . . , Σ (N ) } , where Σ (I) corresponds to the dynamics of the I-th zone for all I ∈ {1, . . . , N } expressed as: where A (I) = − Again, the first two terms of (6), A (I) T zI and γ (I) (T zI , Q aI ) correspond to the local dynamics of Σ (I) , while h (I) represents the interconnection dynamics between Σ (I) and Σ e . The value T z I (t) ( • C/sec) represents the rate of internal heat change, due to occupants and appliances from the I-th zone. In this work, it is assumed that the ambient temperature T amb ( • C) is known. For a more detailed description of the HVAC system please refer to [13], [17].
The control inputs to the N -zone HVAC system are the volumetric flow rate of air to each zone Q aI and the chilled water mass flow rate to the storage tank χ, generated by feedback controllers based on some reference signals r (I) and r e respectively. By controlling these inputs, the objective is to achieve the desired temperature in each building zone (for occupants' comfort) and in the cooling coil (for energy efficiency). In each of the N zones, there exists a sensor measuring the zone temperature T zI , while two sensors are available in the electromechanical part of the HVAC, measuring the temperature of the air exiting the cooling coil T e 1 and the temperature of the chilled water in the tank T e 2 . Specifically, the I-th subsystem Σ (I) , I ∈ {1, . . . , N }, is monitored and controlled using a temperature sensor, denoted by S (I) , characterized by the output y (I) ∈ R; i.e., where d (I) ∈ R denotes the noise corrupting the measurements y (I) of sensor S (I) and f (I) ∈ R represents the possible abrupt sensor fault, described by: where β(t) is the time profile and ϕ (I) (·) is the (unknown) function of the sensor fault that occurs at the (unknown) time instant t (I) f . The time profile of the abrupt fault is modeled as β (t) = 0 for t < 0 and β (t) = 1 for t ≥ 0. In practice, there maybe more than one sensor covering a single zone (especially large zones). In this case, the multiple measurements can be combined by averaging or using advanced sensor fusion methods, while the proposed methodology can still be applied.
The nonlinear subsystem Σ e is monitored and controlled using a sensor set S e that includes two temperature sensors S e {1} and S e {2}, characterized by where y e j ∈ R is the sensor output, d e j ∈ R denotes the noise corrupting the measurements of sensor S e {j} and f e j ∈ R represents the possible abrupt sensor fault described by: where ϕ e j (·) is the (unknown) function of the sensor fault that occurs at the (unknown) time instant t e fj .
The objective of this work is to design a methodology using an adaptive approximation approach for detecting and isolating sensor faults that may occur in one of the subsystems and compensate their effects on the distributed control of the N -zone HVAC system.

III. DISTRIBUTED VIRTUAL SENSOR SCHEME
The design of the proposed distributed virtual sensor scheme is realized as follows. Taking into account the N + 1 subsystems, defined by (1) and (8), the first step is to design a local virtual sensor (LVS) agent for each of the interconnected subsystems; i.e. the agent M e dedicated to subsystem Σ e and the agent M (I) dedicated to subsystem Σ (I) , I ∈ {1, . . . , N }, as shown in Fig. 2. Each LVS agent has access to the control input and sensor output data of the underlying subsystem, while it may exchange information with some other agents. The agents M (1) , . . . , M (N ) monitoring the building zones do not exchange any information. The exchanged information is associated with the form of the physical (state) and input interconnections and is data-driven. In addition, event-driven communication is established between the agents M e and each M (I) based on the distributed sensor fault diagnosis decision logic executed by each agent, which will be described later on. Assuming the occurrence of sensor faults in one of the subsystems, the first goal of the proposed distributed virtual sensor scheme is the detection and isolation of the fault, given the bidirectional exchange of sensor information between each agent M (I) and M e . Considering the occurrence of multiple sensor faults in the sensor set of the electromechanical part, two modules are designed in the agent M e such that the j-th module, denoted by M e j is dedicated to the sensor S e {j}, j = 1, 2. When at least one agent M (I) or M (e) detects sensor faults, all agents M (I) transmit their decisions to M e . Due to the propagation of sensor faults through the exchange of information, the distributed sensor fault isolation procedure is conducted by processing combinatorially the decisions of the agents monitoring the building zones and the agent monitoring the electromechanical part. The second goal of the proposed distributed virtual sensor scheme is to compensate the effects of sensor faults on the control of the HVAC system by using on-line approximation models of the unknown sensor faults affecting one of the subsystems.
In order to accomplish these tasks, the agent M (I) and the modules M e 1 and M e 2 are designed using an adaptive nonlinear estimation scheme. Based on the generated estimation model and using local input and sensor output data, as well as transmitted information, each agent M (I) , (correspondingly modules M e 1 and M e 2 ) generates residuals and adaptive thresholds that are further used to formulate analytical redundancy relations (ARRs). The distributed sensor fault detection decision is obtained based on whether the generated ARRs are satisfied or not. The adaptive approximation of the isolated sensor faults is carried out by expressing the fault functions ϕ (I) and ϕ e j as linearly parametrized approximators (e.g. radial basis functions) [19], [20]; i.e.
where G (I) ∈ R 1×qI and G e j ∈ R 1×qe j are the regressors of the adaptive approximators and θ (I) ∈ R qI , θ e j ∈ R qe j are the (unknown) optimal parameter (weight) vectors that minimize the discrepancy between the corresponding unknown function and the adaptive approximator. The residual errors δ and δ e ϕj are referred to as minimum functional approximation errors over the compact sets Q I , X I , within which Q aI and χ reside respectively. The on-line approximation models of the unknown sensor faults are used to correct the output of the faulty sensors and the corrected measurements are provided to the distributed control architecture as virtual signals y (Fig. 2). The following sections present the design of the adaptive nonlinear estimation scheme, the generation of the residuals and the adaptive thresholds, as well as the sensor fault diagnosis decision logic.

A. Adaptive Nonlinear Estimators for Residual Generation
The residual generated by the module M e 1 , denoted by ε e y1 ∈ R, is defined as whereT e ∈ R 2 is the estimation of T e and y e v1 (t) is the virtual signal generated by the module M e 1 , defined as y e v1 (t) = y e withθ e 1 (t) ∈ R qe 1 be a vector that contains the adjustable parameters of the adaptive approximation model of ϕ e 1 . The state and parameter estimatesT e , θ e 1 are determined based on the adaptive nonlinear estimation model of the module M e 1 , selected as follows: where L e 1 ∈ R 2×1 is the estimator gain matrix, chosen such that   I ∈ {1, . . . , N }, defined later on. The matrix Ω e 1 (t) ∈ R 2×qe 1 is a filter, used to ensure the stability property of the adaptive nonlinear estimation scheme [14]. The initial conditions areT e 1 (0) = 0, θ e 1 (0) = 0 and Ω e 1 (0) = 0. In the adaptive law (20), Γ e 1 ∈ R qe 1 ×qe 1 is a symmetric, positive definite learning rate matrix, while the projection operator P e 1 restricts the adjustable parameter vectorθ e 1 (t) to a predefined convex set Θ e 1 for preventing parameter drift [19]. The dead-zone operator D e 1 [·] is defined as where D e 1 (t), I(t) are determined later on in Section III-C.
The residual generated by the module M e 2 , denoted by ε e y2 ∈ R, is expressed as: whereT e 2 ∈ R is the estimation of T e 2 and y e v2 (t) is the virtual signal generated by the module M e 2 , defined as y e v2 (t) = y e 2 (t) − G e 2 (χ(t))θ e 2 (t), withθ e 2 (t) ∈ R qe 2 defined as a vector that contains the adjustable parameters of the adaptive approximator of ϕ e 2 . The estimatesT e 2 andθ e 2 are computed based on the following adaptive nonlinear estimator: where A e 22 is the element {2, 2} of the matrix A e given in (2), γ e 2 is the second element of γ e and L e 2 ∈ R is the estimator gain chosen such A e L2 = A e 22 − L e 2 is stable. The initial conditions areT e 2 (0) = 0,θ e 2 (0) = 0 and Ω e 2 (0) = 0. The terms Ω e 2 (t) ∈ R 1×qe 2 , Γ e 2 ∈ R qe 2 ×qe 2 and P e 2 are defined as the terms Ω e 1 , Γ e 1 and P e 1 respectively. The dead-zone operator D e 2 [·] is defined as where D e 2 (t) is determined later on in Section III-C.
The residual generated by the agent M (I) , I ∈ {1, . . . , N }, is denoted by ε (I) y ∈ R and is described by whereT zI ∈ R is the estimation of T zI , I ∈ {1, . . . , N }, and y withθ (I) (t) ∈ R q I be a vector that contains the adjustable parameters of the adaptive approximatorφ (I) . The estimateŝ T (I) andθ (I) are generated based on the adaptive nonlinear estimation scheme, structured aṡ where L (I) ∈ R is the estimator gain, chosen such that A (I) and P (I) are defined as the terms is again defined as where D (I) (t), I(t) are determined later on in Section III-C.

B. Computation of Adaptive Thresholds
The computation of adaptive thresholds, designed to ensure the robustness of the agents M e and M (I) with respect to modeling uncertainty (disturbances, noise, etc), is realized by taking into account the following assumption: j , d e j are known constant bounds. The bound for the modeling uncertainty is commonly used for distinguishing between disturbances and faults [21], while the bound for the noise terms corresponds to a practical representation of the available knowledge for the noise that is typically provided in a given operation range by sensor manufacturers.
The adaptive threshold implemented in the module M e j , denoted by ε e yj (t), j = 1, 2, is computed such that where ε e yj (t) is the residual under healthy conditions, defined through (16)-(17) for j = 1 and (22)-(23) for j = 2 witĥ θ e j = 0, j = 1, 2, using the solutions of (18) and (24). Taking into account Assumption 1 and that there exist a known bound T e such that |T e (0)| ≤ T e , and positive constants ρ e 1 , ξ e 1 such that |C e 1 e A e L 1 t | ≤ ρ e 1 e −ξ e 1 t for all t, the adaptive threshold is expressed as: where where y = [y (1) , . . . , y (N ) ] ⊤ ; i.e., Taking into account (34), the adaptive threshold ε e y2 generated by the module M e 2 is described by where T where ε where T zI is a known bound such that |T zI (0)| ≤ T zI , ρ (I) , ξ (I) are positive constants such that |e A (I) L t | ≤ ρ (I) e −ξ (I) t for all t.
It is noted that the adaptive thresholds defined in (35), (37) and (39) can be implemented using linear filtering techniques [20].

C. Distributed Sensor Fault Detection and Isolation Decision Logic
The generated residuals and adaptive thresholds are used to formulate analytical redundancy relations (ARRs), based on which the distributed sensor fault detection and isolation decision logic is designed [22], [23]. Under healthy conditions of the HVAC system, the computed ARRs are always satisfied.

1) Distributed Sensor Fault Detection Decision
where ε e y1 , ε e y2 and ε e y1 , ε e y2 are defined in (16), (22) where t   Using the notations F qj = 1 and F qj = * , we discriminate the sensitivity of the ARRs to local and propagated sensor faults [23]. The notation F qj = * indicates that a sensor fault involved in an ARR and propagated from a neighboring agent can explain why an ARR is violated at some time instant, but ARR may happen to be satisfied while this sensor fault has occurred. For example, if N = 2, the matrix F is designed as in Table II.
For distributed sensor fault isolation, the observed pattern D(t) is compared to the columns of F . The result of the consistency test is the determination of the isolation set I that contains the possible diagnosed sensor fault combinations. It is noted that F qj = * is consistent with either D q (t) = 0 or D q (t) = 1. For example, based on Table II if at some (2) }}, inferring that either f e 1 or f (2) has occurred. During the consistency test, there may be an observed pattern that is not consistent with the columns of the matrix F . In this case, the isolation set is determined from the support of the violated ARRs [22], [24].
The resultant isolation set is transmitted to each agent M (I) for initiating or not the learning procedure, as described by the dead-zone operator D (I) in (33). The set I is also exploited in the dead-zone operator of D e 1 of the module M e 1 , while the dead-zone operator of the module M e 2 is activated based on the decision function D e 1 (t), defined in (41), which implies the isolation of sensor fault f e 2 .

IV. SIMULATION EXAMPLE
The objective of the simulation example is to illustrate the effectiveness of the proposed distributed virtual sensor scheme applied to the HVAC system described in Section II consisting of two zones (N = 2). The operation of the HVAC system is simulated based on equations (1) and (6), using the parameter values provided in [13]. In addition, we consider that the ambient temperature T amb is periodically varying within 24 hours as T amb = 30 + 5 sin(0.07π · t). Two feedback linearization controllers were implemented for the tracking control of the temperature of each zone, aiming at keeping the temperature at 24 • C. A backstepping controller was applied for maintaining the temperature of the output air of the cooling coil at 10 • C. Following the design of the distributed virtual sensor methodology provided in Section III, we design four estimators, structured as in (30), (18) and (24)  (1) f = 6 h, while the change in the sensor output is described by the function ϕ (1) (t) = 3 − cos(600 · Q a1 (t)).
The distributed SFDI decision logic is applied as described in Section III-C; at the time instant t = 6h, D (1) (t) = 1 so the agent M (1) detects the presence of sensor faults, i.e. infers that there is a fault affecting the temperature sensor in either zone one or the cooling coil. On the contrary, the agent M (2) and the modules M e 1 , M e 2 do not detect any fault, i.e. D (2) (t) = D e 1 (t) = D e 2 (t) = 0 for all t. Once the fault is detected, the agent M (1) transmits its decision to the agent M (e) aiming at isolating the sensor fault. Based on the sensor fault signature matrix F given in Table II and  The isolation set is transmitted to the agent M (1) , which, based on the dead-zone operator defined in (33), initiates the adaptive approximation procedure of the isolated sensor fault f (1) . The result of the adaptive approximation is shown in Fig. 3, where the approximation model is derived, using a network of 12 radial basis functions (RBF), with fixed centers evenly distributed in the interval [0, 0.005], while the width of each RBF is 0.0004. The approximation model of sensor faultφ(t) = G (1) (Q a1 (t))θ (1) (t) is used for generating the virtual signal y (I) v (t) as defined in (29). The effectiveness of the proposed distributed virtual sensor scheme is illustrated in Fig. 4. Specifically, Fig. 4 presents the actual temperature T zI (t) and air-flow rate Q a1 (t) (black, dashed line), which are respectively compared to the temperature set point and the air-flow rate generated under healthy conditions (green, solid line) with (subfigures 4(a) and 4(c)) and without (subfigures 4(b) and 4(d)) using the virtual sensor signals.

V. CONCLUSIONS
In this paper, we presented a model-based, distributed architecture for compensating the effects of sensor faults in a multi-zone HVAC system based on a bank of local virtual sensor (LVS) agents. The first goal of each LVS agent is to detect sensor fault in the local subsystem using local information, while it may exchange information with other agents. Due to the propagation of sensor faults through the exchange of information, the distributed isolation of sensor faults is conducted by combining the decisions of the LVS agents and applying a reasoning-based decision logic. The second goal of each LVS agent is to learn the isolated sensor faults and correct the outputs of the local faulty sensors, providing a virtual signal to the distributed control scheme. Simulation results illustrated the effectiveness of the proposed architecture, by showing the fault tolerant operation of a two-zone HVAC system under sensor fault conditions.