IoT-enabled dependable control for solar energy harvesting in smart buildings

: Efficiency and reliability have been essential requirements for energy generation in smart cities. This study presents the design and development of dependable control schemes for microgrid management, which can be seamlessly integrated into the management system of smart buildings. Here, to recover from failures in the solar energy system of a building microgrid, dependable controllers are proposed along with their hardware implementation. The system features the use of Internet of Things (IoT) as its core to coordinate the operation of multiple subsystems in a scalable manner. The control scheme uses a number of controllers cooperatively functioning via a token-based mechanism within the network to provide redundancy and thus reliability in solar tracking. The system exploits data from not only local in-situ sensors but also online sources via IoT networks for fault-tolerant control. Experiments conducted in a 12-storey building indicate that the harvested solar energy meets the design requirement while the control reliability is maintained in face of communication or hardware disruptions. The results confirmed the validity of the proposed approach and its applicability to energy management in smart buildings.


Introduction
Smart cities are our urbanisation trend with enormous potential for addressing sustainable development needs. In this vision, initial studies to improve the city smartness are typically focused on such areas as energy generation from renewable sources to reduce costs and emissions; building management efficiency to fulfil energy demand and consumption; and air quality improvement to enhance the living quality and minimise urban heat island impacts. To be sustainable in future energy usage, two aspects that need to be considered include: the energy generation or supply and the consumption side, consisting the closely linked building and construction industries that consume a significant amount of energy. Fundamental requirements for energy efficiency are to rely more on renewable energy sources and yield fewer greenhouses gas emission for future sustainability. While the former involves alternate sources in smart grids and advanced technologies for carbon capture and storage, the latter requires the reduction of greenhouse gases as well as energy wastes as prerequisites for green certification within the building and construction sector. Therefore, affordable and secure energy is among the major priority in urbanisation to sustain economic growth, improve public health, and mitigate the effects of climate change.
In future cities, large assets such as office buildings, shopping malls and theatres, and even residential buildings, play a central role because it accounts for around 40% of the energy consumption and 30% of the emissions [1]. Consequently, there has been an increasing research effort in monitoring and management of energy consumption and generation in buildings to enhance efficiency and reduce emissions of greenhouses gas. Various intelligent techniques have been added in the building control framework including learning-based artificial intelligence methods such as fuzzy systems and neural networks [2], adaptive fuzzy neural network systems [3], model predictive control (MPC)-based techniques [4], and multi-agent-based control systems [5]. Optimisation algorithms such as multi-objective genetic algorithm [6], multi-objective particle swarm optimisation [7], meta-analysis and others [8] have also been used to minimise the energy consumption and tariff cost while maintaining the comfort. Along with this, the occupants' attitudes and preferences on energy performance [9] also contribute to a significant amount of energy savings and emissions reduction. Nevertheless, increasing demands for monitoring and management inbuilt infrastructure have been made possible owing to the rapid development of control and optimisation techniques for renewable energy. A variety of cogeneration sources such as small wind turbines, photovoltaic (PV), biomass, or fuel cells are reaching a price point where they become viable elements to manage a building energy profile. The integration of renewable energy microgrids and utility grids supply in buildings needs more research effort. Various terms and conditions need to be negotiated and optimised, including power supply directional flow, time-of-use tariff variations, quality of supply, and customised supply requirements. This leads to increased cross flows of data from monitoring and management systems enhanced with computational support to meet the challenging requirements of smart cities.
Along with increasing demands for higher efficiency and more sustainable in electricity usage, there has been the need to seamlessly integrate advanced technologies of monitoring, control, and communication into electric networks to deliver reliable and secure supply, enhance the efficiency of generation and distribution, and provide alternatives from renewable energy sources. For buildings, the integration of solar energy into resulting microgrids should address at the first priority issues of reliability and resilience due to energy abundance, widespread availability, easy installation and maintenance, and feasibility in remote areas with scalable and versatile capabilities [10]. Together with other renewable sources, solar energy will soon outdate the traditional fossil fuels to become a pillar for sustainable development. To this end, a great deal of research has been devoted to maximise the energy collection via tracking of the solar panels, dealing with various factors such as sun's direction, weather conditions, PV materials, and energy conversion [11]. Once installed, solar panels are usually connected to the control station via the network and hence are subject to such imperfect conditions as network time delay, data package loss, communication, and hardware problems. Therefore, the real-time control of PV systems in smart buildings requires a reliable control strategy with fault tolerance and network resilience capabilities [12]. On the other hand, the PV panels and solar trackers represent an inseparable part of the whole energy management system consisting of numerous devices operating in different clusters of the networks, containing physical systems, and information sensing, processing, intelligence, and control in a cyber-physical system [13]. In addition, the multifaceted interaction between information and communication technologies together with the physical solar energy in a microgrid introduces new security concerns [14]. To improve the system performance, in particular, reliability and resilience, a distributed control system (DCS) is needed possessing the capabilities of tolerance to such faults from the power supply, communication or hardware and selfrecovery to maintain continuity of the service (DCS) [15]. In such control architecture, communication data can be exploited to automatically detect and isolate faults using distributed intelligence within the Internet of Things (IoT) framework. Also, various online resources such as astronomy data and real-time meteorological information can be gathered to maximise the energy harvest.
In this paper, we present a novel approach to the problem of solar energy tracking to improve the system reliability and resilience using model prediction-based dependable control, with hardware implementation and experimental results for a building microgrid. We first introduce a control hierarchy to manage the solar tracking of PV panels integrated with an energy network along with hardware devices to form an IoT-based interconnected system wherein embedded computers are employed to implement fault-tolerant control of energy harvested from the sun radiation. The dependable control technique is then used to implement fault tolerance and network resilience control schemes for improved reliability. Experimental results are provided to show the effectiveness of the proposed approach. Since the proposed approach is generic for improving reliability and resilience of a complex system, here a renewable energy system of a smart building, the development and obtained results are also scalable to apply for either a house or a number of buildings.
The paper is organised as follows. After the introduction given in Section 1, Section 2 described the building renewable energy management. Section 3 presents the solar tracking approach. Section 4 shows the dependable control design. The control implementation and experimental results are presented in Section 5. Finally, Section 7 draws the conclusion of the paper.

Building renewable energy management
Energy management in this study is based on the renewable energy system operating, as shown in Fig. 1. The system consists of two main plants, a renewable energy plant and a co-generation plant. The renewable energy generation consists of roof-installed solar thermal concentrators, PV cells, hydrogen fuel cells, a wind turbine and a smart metering system. The co-generation system consists of a number of stages to harness energy from superheated hot water. The central of the renewable energy plant is a storage system named ZBB EnerStore which enables the plant to operate 'offgrid'. This system conducts three main functions: (i) rectifying the inputs of renewable sources; (ii) storing the rectified power for later use; and (iii) converting the stored energy into AC output using the standard three-phase 415 VAC voltage. The output is then delivered to a separate building microgrid which is connected to certain power points, devices, and equipment placed within the building that are solely powered by the renewable energy generated.
Given the average energy needs of households in Australia, ranging about 15 kWh/day in New South Wales [16] and 12 kWh/day in Victoria [17], the power requirement for this building microgrid testbed is 50 kW among which 20 kW is contributed by nine strings of solar panels. The purpose of the PV system here is to harvest the maximal solar energy when combining with other renewable sources installed on a rooftop of a 12-floor building. In addition, the objective of the building energy management system is to achieve the overall high-energy efficiency, low emissions, and economic feasibility, without compromising the preferences and comfort of consumers. For this objective, various inputs are considered including not only input from the monitoring system but also information of on-site renewable energy sources, occupants' attitude and preferences, and observation from in-situ sensors. The relation between inputs and control variables is then modelled, e.g. between the air temperature, humidity, building structure and material, and the heat exchange between the building and the environment; between the solar generation with incident radiation and higher temperature and cloud formation. We then identify high-energy generation units to privily handle. In typical buildings, 50% of the renewable energy is generated in the PV system; when combining with hot water heating system, the energy generation may reach 60%; thereafter 20% of the energy is generated in wind turbine; and finally 20% for the remaining. Optimising the energy harvested by PV panels, therefore, plays the main role in maximising the renewable energy profile of the building.

Solar tracking for PV panels
In the development of solar trackers, current approaches are implemented by using either electromechanical fixtures or customised electronic circuits [11,18]. For the first approach, single-or dual-axis trackers are typically used. The single-axis trackers track the direction of the sun using closed-loop controllers with the feedback obtained from radiation sensors such as the electromechanical system introduced in [19] or the hybrid tracking system developed in [20]. The dual-axis tracking systems, on the other hand, adjust both the altitude and azimuth angles to find the sun direction yielding the maximum output power. Different techniques have been used such as stochastic search algorithms [21], a declination-clock mounting system [22] or a global positioning system-based system [23] with an improvement of about 20-30% in generated energy as compared to a fixed-tilt PV system. Nevertheless, these techniques rely mostly on local sensory information but not make use of meteorological and astronomical data for real-time optimisation and control.
In the second approach, electronic circuits, which are essentially DC-DC converters, are designed to drive the PV panels to operate at the maximum power point (MPP) under different environmental conditions. Various approaches have been proposed such as the perturb and observe technique [24], the incremental conductance (IC) algorithm [25], the variable step size IC MPPT algorithm [26], the ripple correlation control and parasitic capacitance [27], the voltage-based or current-based peak power tracking [28] or, more recently, the fuzzy model-based tracking control [29]. However, limitations can be found as these techniques often require adjustments subject to varying atmospheric conditions at a local region, and also that the type of tracker used is rather sensitive to loading variations and ambient changes, or depending on the expert knowledge for the model-based approach. Moreover, there is also the need for reliable and resilient performance in dealing with any system failures.
In this study, we employ the dependable control operated over the internet protocol network to not only optimise the sun tracking performance but also to improve the control reliability. The solar energy management system, as shown in Fig. 2, includes dual tracking modules, PV panels used for collecting solar radiation, and motion mechanisms to control the azimuth and elevation of the panels. The two-degrees-of-freedom motion can be controlled in either the local or a network mode. The data communication is conducted via a gateway that converts signals from Modbus Serial to Modbus TCP protocols. The harvested energy is rectified and stored in two 50 kWh flow-technology batteries. The AC output is fed into a separate building microgrid via inverters and isolators using standard three-phase 415 VAC. The generated voltage supplies to certain devices and power points placed throughout the building.
For monitoring and safety, systems developed by Tigo are implemented for data recording of solar panels. The data are then aggregated in an application server with algorithms implemented to optimally manage the energy consumption, evaluate the harvested solar radiation, and monitor the renewable energy generation. This can result in not only references for optimal and predictive control modules through network-based application program interfaces (APIs) but also integrations with building data for enhanced management of the database in the energy aspect.
The management system is centred on IoT-based controllers for reliable regulation of solar trackers in imperfect or faulty conditions in the communication, supply, and/or system architecture context. These controllers implement dependable control algorithms, with interconnected subsystems via control boards. They together with other processing units, for controlling and managing energy flows, constitute a private cloud, which can be considered as a level of abstraction brought to the actuators. For instance, a separation between the solar tracker and its controller can be obtained by standardising signal formats and control protocols provided via network services. Consequently, a subsystem does not need to know which controller is in place or which controllers are in standby status. This abstraction therefore allows for one controller to take over the control of several subsystems while at the same time serve as redundancy for other controllers, here for solar tracking. It also allows for online environmental resources to be retrieved and integrated into the system for global optimisation. This can eventually result in a reliable and resilient system for solar radiation.

IoT-based dependable control
In fault tolerance and resilience control using IoT communications, the control architecture is required to cope with issues of cyberand physical security, hardware failures, and communication imperfections. This control attribute, defined as dependability [30], encompasses reliability, safety, integrity, and availability. While dependability is a concept adopted in the computer systems, dependable control was first introduced in [31], achieving these merits via feedback control adopting IoT in interconnected links. In principle, several controllers can be deployed for a single plant, each runs the control algorithm independently, whereby only one active controller is in charge to actually control the plant. Concurrent exchange of status information can take place among controllers involved in the operation. Along with the status information, performance variables are also made available for backed-up controllers. A standby controller can take over the control, depending on those performance variables. The distributed system can therefore become fault-tolerant and self-recovering.

Controller design
Consider a solar tracker system S having a discrete-time state-space model of the form where x(k) ∈ X ⊂ ℝ n , u(k) ∈ U ⊂ ℝ m and y(k) ∈ Y ⊂ ℝ p are, respectively, the state, control and output vectors, with the state and control being both constrained; A ∈ ℝ n × n , B ∈ ℝ n × m and C ∈ ℝ p × n are, respectively, the system, input and output matrices in which (A, B) is controllable and (A, C) is observable. At the field level, this system can be controlled by conventional control techniques such as proportional, integral, derivative (PID) control or MPC. Here, we consider the state feedback problem having the control u(k) computed online by an MPC algorithm that employs model (1) in prediction, given known state vector x(k). The objective function is defined as follows: where Q and R are the weighting matrices and N is the predictive horizon. The minimisation of J(k) subject to (1), x(k) ∈ X, and u(k) ∈ U is then solved for the predictive vector sequence defined as u := {u(k), u(k + 1), . . . , u(k + N − 1)}. The optimal sequence u * will be obtained as a result of this online computation. Here, only the first element u * (k) is sent to control the solar tracker. Consequently, the optimisation of (3) yields a state feedback control of the form where u * (0, x(k)) is the optimal solution at the time step k = 0, 1, . . . , N − 1 in the horizon, i.e. u * (0, x(k)) is the first vector of the sequence u * (k).

Dependability for fault-tolerant and self-recovery operation
At the low level of the solar tracking system, dependable control is proposed to drive the PV panels while maintaining the system reliability and resilience in the case of hardware failures and communication imperfections. This is achieved by using the redundancy advantage with the duty-standby architecture and the online switching-over capability. The structure of a dependable control system (DepCS) is presented typically in Fig. 3 with four controllers. These regulatory control loops, representing a dutystandby architecture with commercial-off-the-shelf components, can achieve the integrity level (IL) required. A number of n processors are designed in association with a DepCS, depending on the expected IL and available resources [32]. The IL is usually calculated from the mean time between failure and the mean time to repair subject to industry standards such as IEC 61508 [33]. In the system, each processor runs the control algorithm independently. The set point Ref is obtained from the IoT network through an optimisation process. Data for the optimisation such as meteorology information are retrieved from online resources in real time. The generated control signal u * (0, x(k)) and the system output y(k) are then transmitted to the plant and controller via the network. Different data transport protocols can be used for communication depending on the characteristics of the plant and control criteria. For a plant with slow time response, the transmission control protocol (TCP) would be a proper choice as it maximises the reliability. However, if the real time and fast response are more important, others such as the user datagram protocol and real-time transport protocol could be used. From a comparative analysis of transport protocols [34], we choose in this work to use TCP as the response time of solar trackers is large compared to the data transmission time.
In practical implementation, dependable systems rely on the ability to transfer the duty to controllers participating in the realtime networked control of the plant. Initially, a token is broadcast in the network. The first controller catching it will become active for controlling the plant. As only one controller is in charge while others being standby, the duty processor can be different at a time, determined by the state machine. To activate a standby controller, it requires certain circumstances such as (i) the duty controller running out of resources; (ii) the duty controller facing hardware failures; (iii) the data communication encountering an imperfect condition; or (iv) no state variables being broadcast. In such circumstances, the token will be released for other healthy controllers to take over the control. This mechanism thus enables the scalability of the system, i.e. adding/removing controllers without the need for a priority sequence of the controllers.

Resource efficiency in dependable control and IoT
With the IoT, every device is connected to each other and the abstraction between them is established through the cloud infrastructure. As a result, no controller is assigned to a particular plant. Rather, at a time there will be a controller ready to take control of several plants. This particular controller can, moreover, play the role of a backup controller for others at the same time, as illustrated in Fig. 4. The number of plants that each controller can control depends on the computational complexity of the control algorithm and processing capability of the control processor. With rapid advancements in the very-large-scale integration design and hardware manufacturing, embedded computer boards are becoming more powerful with better multitasking capability. Consequently, in the dependable control framework, a certain controller can be deployed to simultaneously control multiple plants while keeping the required IL and redundancy to achieve system reliability, fault tolerance and network resilience.

Optimisation for control
In DepCS, optimisation can be conducted at different levels depending on the available input data. At the lowest level, the optimisation is carried out via the MPC, as presented in (3). At a higher level, the data flow includes a combination of meteorology information obtained from online resources and local measurements provided by a weather station such as sun direction, solar radiation, wind speed, wind direction, air density and temperature. Given those data, various optimisation criteria can be selected to form the objective function, e.g. to maximise the energy harvested and/or to minimise the energy consumed by the solar tracker. In our system, the objective is selected from the practical requirement to minimise the effect of wind acting on the panels as a top priority while ensuring the energy harvested. This criterion is essential for the safe operation of trackers, especially for those located on top of high buildings in urban areas. Let d be the deviation of the solar panel, which depends on its orientation with the azimuth and elevation angles, and f be the fluctuation due to the wind force acting on the tracker. The objective function L f is defined as where μ > 0 is a scaling factor and F τ is a pre-defined threshold representing the maximum wind force at which the system still operates safely. The wind force is calculated by where c is the force coefficient chosen in accordance to the American Standard ASCE/SEI 7-05 [35], ρ is the air density, v is the wind speed and S is the exposed surface area, depending on deviation d and the wind direction.
To minimise L f , a particle swarm optimisation algorithm [36] is used owing to its simplicity and robustness. Initially, random values of d are assigned to particles of the swarm. Based on the cost associated with each particle calculated from (5) and (6), the particles and thus the values of d evolve towards the optimal values in accordance to the convergence behaviour of the swarm. In the critical case when the wind force is greater than the threshold, f > F τ , the tracker will be switched to a protective mode so that the solar panel will be in parallel with the ground to minimise the resistance force. The output of this optimisation, as illustrated in Fig. 3, provides references for the dependable controllers. Fig. 5 shows the flowchart of the proposed control algorithm.

Stability of DepCSs
Given the state feedback control and dependable control structure in the above subsections, constraints on feedback gains are now derived to ensure the stability of DepCS. First, the state and control increment are defined, respectively, as Δx(k) := x(k + 1) − x(k) (7) Δu(k) := u(k + 1) − u(k), (8) subject to the following constraints: for given α > 0 and β > 0. The quadratic supply rate for system S is then defined as where Q, R, S are the coefficient matrices with positive symmetric Q and R. Moreover, the closed-loop system with a state feedback law u = K x is said to be incrementally dissipative with respect to the supply rate ψ Δk if there exists a non-negative storage function V(Δx) := Δx T P i Δx, P i > 0, such that for all Δx(k) and k ∈ ℤ + , the following dissipation inequality is satisfied: In the framework of MPC for interconnected systems, the closedloop system S is locally asymptotically stable if under the control u = K x, system S is incrementally dissipative, and there exist k 0 ∈ ℤ + and 0 < γ < 1 such that the following inequality is fulfilled [37]:

System implementation
Experiments have been conducted to evaluate the validity of the proposed approach.

Experimental testbed
The testbed for this paper is part of a rooftop microgrid for a 12floor building with renewable energy sources including a PV array and a PV tracking system, as shown in Fig. 6. The solar tracker panel is assigned with a coordinate system to show its azimuth angle θ and elevation angle ϕ in terms of orientation. A weather station is used to measure the speed and wind direction so that the solar tracker can be switched to the protective mode in the case of strong winds via the optimisation process presented in Section 4.4. The solar tracking system includes two 24 VDC motors allowing to control its azimuth and elevation, respectively, within the range of 0-360° and 0-90°, as reported in [38]. For validation, the solar radiation is measured by using a sensor having an operating range of 0-1800 W/m 2 with an accuracy of 1 W/m 2 , attached to the PV panel, as shown in Fig. 7a. A Modbus-to-Ethernet converter and a network switch are also installed for connecting Modbus RS485 to the energy management network. In addition, two networked cameras are also fixed on the rooftop for visual monitoring of the whole system, as shown in Fig. 7b. The solar radiation sensor is connected to the network via an IoT board installed in the interfacing box, as depicted in Fig. 7c, to provide interfaces for the DC motors as well as other weather sensors.
The PV array has 72 modules, each has a maximum power of 280 W with an efficiency of 17.2%. The harvested solar energy is fed to the microgrid with separate power inverters and AC inverter isolators while communication gateways are installed to convert signals from Modbus Serial to TCP data frames. The IoT boards used to control the solar tracker with various control structures and configurations comprise a quad-core Intel Atom processor 2.4 GHz and a quad-core 1.2 GHz Broadcom BCM2837 64 bit CPU, as shown in Fig. 8. They run Linux operating systems and are connected to the network via wireless 802.11. Here, the interfaces between the weather station and the control systems as well as the peer-to-peer communication were enabled with distributed software architecture as used in [39]. The data communication is carried out by using the TCP protocol via socket programming. Fig. 9 shows the communication structure between hardware components for the experimental testbed.  The state-space model of the solar tracking system for the PV panels driven by DC motors is where the state vector x includes the motor position θ (rad), motor speed θ˙ (rad/s) and armature current i (A), V is the armature voltage and y is the output, with the drive specifications for J, b, K, R and L given in Table 1. The controllers are locally executed using the cascade principle whereby the inner loop is governed by a built-in PID controller and the outer loop is regulated by the MPCbased dependable controller. The sampling time is 100 ms. The solar direction information for creating set points is retrieved online with network service APIs and inputs to be 151.1990°E in the longitude and −33.8840°S in the latitude corresponding to the location of solar trackers in the southern hemisphere.

Fault-tolerant control results
In the first experiment, we tested the system capability to track a reference by providing set points. Fig. 10 shows the output responses of the solar tracker with 40° set point. Both azimuth and elevation reference angles are reached with no overshoots and ripples. The response curves are rather linear from the inner PID loops with a settling time of 100 s, which is suitable for a change of the sun direction and solar radiation correspondingly. We next evaluated the reliability and self-recovery capability of the system subject to a network failure by simply disconnecting the network cable of the duty controller at sampling time 713. In this network fault, a time-out event was detected after ten steps of no information exchanged and a backup controller took over the control duty so that the tracking performance of the PV panels is seamlessly guaranteed. As compared to Fig. 10a, despite the network incident under the proposed dependable control, the output response of the solar tracker, shown in Fig. 10b, can reliably take another standby controller as a new duty controller and drive the PV panel to the expected operating angles to maintain the resilience of the system. Figs. 10c and d present the zoomed-in responses of the azimuth and elevation angles during this period. It can be seen of some small deviation starting from time index 713. Fig. 11a shows the control inputs in normal conditions. Since leadscrews are used to convert the rotary motion of motors to a    Fig. 11b. Due to the network failure in this period, the controllers are not able to update system states and use instead the prediction values of the sequence u * (k). It should be noted that with the dependable control strategy, the operation of the system can be successfully recovered after this incident while with a regular backup controller it would be difficult to compute the increment dissipation for maintaining the system stability.
In another scenario, the power supply of the duty controller was intentionally unplugged to demonstrate the system resilience against power failure. This incident caused an interruption in data communication and led to the time-out event, which is set to 1000 ms, to be broadcast in the system. Again, a standby controller in our dependable system could detect the time-out event and switched to the duty mode to take control of the system. It loaded control data recorded from previous communications including the set points, state variables and sensory outputs in order to compute the increment dissipation and new control inputs. These results have confirmed that with the solar tracker design using the proposed IoT network and dependable control scheme, as shown in Figs. 3 and 4, the system reliability and resilience are always viable unless the whole system hardware or communication channels are collapsed at the same time. Fig. 12 shows the network computational time for the control process, which is around 55 ms on average, rather small compared to the control sampling time (100 ms) and settling time (100 s). This indicates that the control performance can be maintained regardless of the network latency. However, at some sampling instances, the computing time of the redundancy system for solar tracker dependable control may rise up to 120 ms due to the network jitter, and in the worst case, may cause a time delay of the control signal. In those cases, robust techniques for delay compensation should be considered, see e.g. [40].

Resilient networked control results
In this experiment, we evaluated the effectiveness of using online information for solar energy management. Specifically, the desired azimuth and elevation angles are extracted in real time from the website of Geoscience Australia [41] and used to calculate set points for the solar tracker system. Fig. 13a shows the estimated azimuth and elevation angles of the sun within 1 day by using the online resource. If using an offline algorithm for computation of the sun position reference, as in [42], then the angle errors obtained for both azimuth and elevation directions were <1°. This was also verified from the records of solar radiation collected from the sensor depicted in Fig. 6a. Indeed, as shown in Figs. 13b and c, the radiation data recorded online by using the proposed system are almost identical with set points provided by an offline algorithm [23]. Thus, the results indicate that the online distributed resources can be used for reliable control of the PV panels to reduce the processing burden at a local site as well as to ease the implementation and maintenance without affecting the performance of the microgrid energy management. It is also worth noting that the best time to harvest solar energy is from 11:30 am to 1:30 pm and, of course, solar radiation may vastly vary during daytime depending on meteorological conditions such as cloud density and wind speed. Fig. 14 shows the real data recording the energy generated by our system within 4 days. In each day, the energy is accumulated from 6 am to 5 pm. It can be seen that the energy harvested is rather stable with the average value of 48 kWh/day. This amount from the microgrid is sufficient to supply power for various facilities of the local building contributing to its cost reduction, energy diversity and sustainable operations.

Discussion and application
The obtained experimental results have indicated the validity of the proposed dependable control scheme and effectiveness in achieving reliability and resilience of the solar tracking system. It is noted that with the successful implementation of the IoT-enabled controllers, the harvested solar energy met the requirement with good performance of fault-tolerant control. However, as can be seen from 10, the settling time subject to wind disturbances may fluctuate around the desired value of 100 s. Specifically, as our system is implemented on the roof of a tall building, the wind level is strong and given the size of the PV panel, the resultant force sometimes exceeds a safety threshold. While robust control techniques can be used to overcome this issue, a small variation in settling time is not an issue due to the slow change in the direction of the sun and also due to the fact that two other control criteria, the overshoot and steady-state error, are all well maintained.
On another note, the energy harvested is quite significant ranging up to 40-60 kWh/day, as shown in Fig. 14, which is sufficient for the energy usage of several floors of the building. When combining with other renewable sources of the whole microgrid, the system can provide power for a medium-size building and thus plays a key role towards net-zero buildings, as part of smart cities.
From the implementation aspect, our design, based on the use of IoT and cloud computing (Fig. 2), can be readily integrated into other smart homes or buildings as those systems are also IoT-  enabled [43]. In fact, the dependable control framework can be used beyond the energy management to maintain resilience, reliability, and sustainability of smart buildings. While current energy management systems are mainly centralised, our approach enables the potential for using IoT in distributed management which is essential in future smart cities. In addition, the system is scalable to apply not only small systems of residential houses but also large assets such as renewable energy farms.

Conclusion
In this paper, we have presented an IoT-enabled DepCS for achieving resilience and reliability for energy harvesting in microgrids with solar trackers installed on a building rooftop used as a testbed. The control development, hardware and system architecture have been successfully implemented to demonstrate the reliable performance while generating the required PV energy.
The developed system is not only energy sustainable but also fault tolerant owing to its capability of ubiquitous computing and supporting timely self-recovery against power supply or network problems. The proposed control scheme, system connection and transport protocol for real-time data communication are enabled via the IoT, and hence, ready to be integrated for management of smart buildings and scalable to more complicated energy systems. Experimental results are provided to show the effectiveness of the proposed approach. Future study will focus on extending the IoTenabled dependable control approach to multiple smart buildings with interconnected microgrids.