# A Contribution Towards Predictive Control for Energy Management in Micro-grids Systems: Application into a Smart and Energy Efficient Buildings

Elmouatamid Abdellatif

<figure><img src="image_1.png" /></figure>

## To cite this version:

Elmouatamid Abdellatif. A Contribution Towards Predictive Control for Energy Management in Micro-grids Systems: Application into a Smart and Energy Efficient Buildings. Engineering Sciences [physics]. Chouaib Doukkali University, Faculty of sciences, 2020. English. NNT: tel-04610196

HAL Id: tel-04610196

https://hal.science/tel-04610196

Submitted on 12 Jun 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Chouaib Doukkali University

Faculty of sciences

PhD Thesis in

**Energy Engineering and Automation**

Presented by

**Abdellatif EL MOUATAMID**

A thesis submitted in fulfillment of the requirements for the degree of
**PhD of Chouaib Doukkali University**

**A Contribution Towards Predictive Control for Energy Management in Micro-grids Systems: Application into a Smart and Energy Efficient Buildings**

Presented on December 30, 2020 in front of the jury members:

<table><tr><td>HILAL Rachid</td><td>PES</td><td>UCD - Presidency - El Jadida</td><td>President</td></tr><tr><td>EL OUADGHIRI Driss</td><td>PES</td><td>UMI - Faculty of Sciences - Meknès</td><td>Reviewer</td></tr><tr><td>KISSI Mohamed</td><td>PES</td><td>UH2C - Faculty of Sciences and Technics - Mohammed</td><td>Reviewer</td></tr><tr><td>KANDOUSSI Khalid</td><td>PH</td><td>UCD - ENSA - El Jadida</td><td>Reviewer</td></tr><tr><td>BOUSMAH Mohamed</td><td>PH</td><td>UCD - ENSA - El Jadida</td><td>Examiner</td></tr><tr><td>ZINE-DINE Khalid</td><td>PES</td><td>U Med V - Faculty of Sciences - Rabat</td><td>Co-supervisor</td></tr><tr><td>BAKHOUYA Mohamed</td><td>PES</td><td>International University of Rabat</td><td>Co-supervisor</td></tr><tr><td>EL KAMOUN Najib</td><td>PES</td><td>UCD - Faculty of Sciences - El Jadida</td><td>Supervisor</td></tr><tr><td>OULADSINE Radouane</td><td>PA</td><td>International University of Rabat</td><td>Invited</td></tr></table>
Dedication . . .

à mes parents ; j'espère que ce travail soit une prière pour mes parents et pour l'âme de mon père qui nous a quittés pendant la préparation de cette thèse. Ce travail est le fruit des sacrifices de mes parents et de leurs efforts fournis jour et nuit pour mon éducation et mon bien être

à ma famille

à mes collègues

à mes encadrants
ACKNOWLEDGMENTS

This research work was conducted under a partnership (Thesis co-supervision agreement)
between Two Moroccan universities (Chouaib Doukkali University and Al-Akhawayn
University in Ifran) and one US university (University of Houston). The work was supervised
and realized at STIC-Lab (Science and Technology for Information and Communication
Laboratory) at the Faculty of Sciences of Chouaib Doukkali University in El-Jadida.

Firstly, I would like to thank Professors Rachid HILAL, Driss EL OUADGHIRI, Mohamed KISSI, Khalid KANDOUSSI, and Mohamed BOUSMAH for being part of my Dissertation Committee and for agreeing to review and comment on my research work. I sincerely thank them for their time and the hard work they have spent reading and commenting on my Dissertation work.

A special recognition goes to my dissertation advisors Profs. Najib EL KAMOUN, Khalid ZINE-DINE, Radouane OULADSINE and Mohamed BAKHOUYA for their guidance, help, and support throughout my dissertation and project. Furthermore, I would like to extend my sincere respect and thanks to Prof. Mohammed KHAIDAR who have helped me undertaking my research and for his valuable guidance throughout my doctoral program. You provided me with the tools which were needed to successfully complete my dissertation. Special respect and thanks go to Profs Mohamed BAKHOUYA and Radouane OULADSINE for ensuring the smooth orientation of my dissertation and for the professional management of the project. I appreciate the long hours they spent with me brainstorming and discussing new ideas.

I sincerely thank the USAID and IRESEN board and staff for their support and dedication to the advancement of MIGRID and HOLSYS projects. In addition, I would like to thank the rest of the research project team for their collaborative effort during the project.

I also would like to extend my sincere gratitude to all my colleagues, especially the EEBLab team, Youssef NAIT-MALEK, Hamza ELKHOUKHI, Anass BEROUINE, Abdelhak KHARBOUCH, Soukayna BERRABAH, Sarah HADRI, Sofia BOULMGHARJ, and Youssef ALIDRISSI for all the good discussions, help, the support they provided me, and ideas that we have worked on and implemented together.

Finally, I could not have completed this dissertation without the support of my family,
who provided stimulating discussions as well as happy distractions to rest my mind outside of
my research. I sincerely thank my parents for their efforts and sacrifices for my education and
my well-being.
# The Framework of the Thesis Work

This thesis's work is carried out within the project MIGRID (Towards Smart Grids: Renewable Energy Integration into Smart Buildings), funded NAS (National Academy of Sciences) under USAID PEER (Partnership for Enhanced Engagement in Research) program, Cycle 5 - 398 (2017-2020).

MIGRID involves two Moroccan universities (Chouaib Doukkali University, Al-Akhawayn University in Ifran) and one US university (University of Houston). Its main objective is the development and the deployment of Smart Grids technology in Morocco, via the promotion of Renewable Energy Integration into Smart Buildings.
ABSTRACT

The general context of this thesis concerns the integration of RESs (Renewable Energy Sources) into smart MGs (micro-grids) for buildings in order to support the continuous growth of buildings' electricity demands. However, their intermittent nature and unpredictable variability represent the main challenge of their efficient and seamless integration into buildings. Energy storage systems are considered among the most promising technologies that could balance RESs production with buildings' energy consumption. Electrochemical (batteries) storage systems are the most deployed in buildings. This is due to their multiple advantages, mainly modularity, cleanliness, and high efficiency. However, the unpredictable and discontinuous nature of the power production and consumption make the power management in MG systems a difficult task. Therefore, intelligent control strategies are required for efficient energy management in MG systems.

This thesis focuses on the development and deployment of an intelligent and predictive control strategy for energy balance in MG systems. A predictive control approach, named MAPCASTE (Measure, Analyze, Plan, ForeCAST, and Execute), is developed and deployed in real-sitting scenarios. Mainly, MPC (Model Predictive Control) and GPC (Generalized Predictive Control) have been investigated in order to carry out the proposed MAPSASTE. This later was deployed and evaluated by assessing its effectiveness for energy management in MG systems. In particular, modeling, simulation, experimentation, and performance assessment of the deployed MG system, together with the developed control approach, have been performed. Experimentations have been conducted using a real MG platform, which was deployed in the frame of two research & development projects.

**Keywords:** Micro-grid systems, energy management, predictive control, renewable energy sources, battery storage system, information and communication technologies, IoT/Big-Data.
Résumé

Le contexte général de cette thèse concerne l'intégration des sources d'énergie renouvelables (RES) dans les micro-réseaux (MG) afin de faire face à la croissance continue de la demande en électricité des bâtiments. Cependant, le caractère intermittent et la variabilité imprévisible des RESs représentent le principal défi à relever afin de permettre leur intégration efficace dans les bâtiments. Les systèmes de stockage d'énergie sont considérés parmi les technologies les plus prometteuses qui pourraient équilibrer la production des RES avec la consommation d'énergie. Les systèmes de stockage électrochimiques (batteries) sont les plus déployés dans les bâtiments. Cela est dû à leurs multiples avantages, principalement la modularité, la propreté et le rendement élevé. Cependant, la nature imprévisible et discontinue de la production et de la consommation d'énergie rend la gestion de l'énergie dans les systèmes MG une tâche difficile. Par conséquent, des stratégies de contrôle intelligentes sont nécessaires pour une gestion efficace de l'énergie dans ces systèmes.

Dans la présente thèse, une approche de contrôle intelligent et prédictif est proposée afin de permettre une gestion efficace d'énergie dans les systèmes MG. Cette approche, nommée MAPCASTE (Mesurer, Analyser, Planifier, ForeCAST et Exécuter), est développée et déployée dans des scénarios réels. Principalement, les techniques MPC (Model Predictive Control) et GPC (Generalized Predictive Control) ont été étudiés afin de réaliser l'approche MAPSASTE. Cette dernière a été déployée et son efficacité pour la gestion de l'énergie dans les systèmes MG est évaluée. En particulier, la modélisation, la simulation, l'expérimentation et l'évaluation des performances du système MG déployé, ainsi que l'approche de contrôle développée, ont été effectuées. Des expérimentations ont été menées sur une plateforme MG, qui nous avons déployée dans le cadre de deux projets de recherche.

**Mots clés :** Système micro-réseaux, gestion de l'énergie, contrôle prédictif, sources d'énergie renouvelables, système de stockage batterie, technologies de l'information et de la communication, IoT / Big-Data.
# TABLE OF CONTENTS

<table><tr><td>ACKNOWLEDGMENTS</td><td>i</td></tr><tr><td>The Framework of the Thesis Work</td><td>ii</td></tr><tr><td>ABSTRACT</td><td>iii</td></tr><tr><td>Résumé</td><td>iv</td></tr><tr><td>TABLE OF CONTENTS</td><td>v</td></tr><tr><td>LIST OF FIGURES</td><td>viii</td></tr><tr><td>LIST OF TABLES</td><td>xi</td></tr><tr><td>LIST OF ACRONYMS</td><td>xii</td></tr><tr><td>General Introduction</td><td>1</td></tr><tr><td>Chapter 1: Micro-Grid Systems for Smart and Energy Efficient Buildings</td><td>8</td></tr><tr><td>1. Introduction</td><td>8</td></tr><tr><td>2. The traditional electrical grid problems</td><td>9</td></tr><tr><td>2.1. Traditional electrical grid structure</td><td>10</td></tr><tr><td>2.2. The increase of residential sector demand</td><td>11</td></tr><tr><td>2.3. Peak of demand</td><td>13</td></tr><tr><td>3. Local energy production: renewable energy sources and storage</td><td>15</td></tr><tr><td>3.1. Renewable energy benefits and challenges</td><td>15</td></tr><tr><td>3.2. Benefits of electrical energy storage systems</td><td>18</td></tr><tr><td>4. Towards smart MG systems</td><td>19</td></tr><tr><td>4.1. MG system as a part of smart grid system</td><td>19</td></tr><tr><td>4.2. MG system types and benefits</td><td>22</td></tr><tr><td>4.3. MG systems for smart buildings</td><td>25</td></tr><tr><td>4.4. International MG standards</td><td>26</td></tr><tr><td>4.5. MG system architecture</td><td>31</td></tr><tr><td>4.6. Operational modes of Micro-grid system</td><td>35</td></tr><tr><td>5. System optimization and control constraints in MG systems</td><td>38</td></tr><tr><td>6. Conclusions</td><td>40</td></tr><tr><td>Chapter 2: Review of Control and Energy Management Approaches in Micro-Grid Systems</td><td>41</td></tr><tr><td>1. Introduction</td><td>41</td></tr><tr><td>2. Control architectures</td><td>42</td></tr><tr><td>2.1. Centralized control</td><td>45</td></tr></table>
<table><tbody><tr><td>2.2.</td><td>Decentralized control</td><td>46</td></tr><tr><td>2.3.</td><td>Hierarchical control</td><td>47</td></tr><tr><td>3.</td><td>Control strategies</td><td>50</td></tr><tr><td>3.1.</td><td>Objective functions and constraints</td><td>52</td></tr><tr><td>3.2.</td><td>Optimization and control methods</td><td>54</td></tr><tr><td>4.</td><td>Comparison of control approaches for MG systems</td><td>62</td></tr><tr><td>5.</td><td>State of the art synthesis and our contribution</td><td>65</td></tr><tr><td>6.</td><td>Conclusions</td><td>66</td></tr><tr><td colspan="2">Chapter 3: The Deployed Micro-grid System Integrating Renewable Energy Sources: IoT/Big Data Platform and used Models</td><td>68</td></tr><tr><td>1.</td><td>Introduction</td><td>68</td></tr><tr><td>2.</td><td>MG layers structure for energy efficient buildings</td><td>69</td></tr><tr><td>3.</td><td>Renewable energy sources modeling</td><td>70</td></tr><tr><td>3.1.</td><td>Photovoltaic systems and electrical energy production</td><td>70</td></tr><tr><td>3.2.</td><td>Wind energy production</td><td>74</td></tr><tr><td>3.3.</td><td>Energy storage</td><td>77</td></tr><tr><td>4.</td><td>Experimental platform of MG systems: EEBLab</td><td>83</td></tr><tr><td>4.1.</td><td>Data sensing and communication</td><td>83</td></tr><tr><td>4.2.</td><td>IoT/Big-data platform for data collection</td><td>86</td></tr><tr><td>4.3.</td><td>Weather station</td><td>88</td></tr><tr><td>4.4.</td><td>Building envelope</td><td>89</td></tr><tr><td>4.5.</td><td>Active/Passive equipment control</td><td>89</td></tr><tr><td>4.6.</td><td>RESs integration</td><td>90</td></tr><tr><td>5.</td><td>Conclusions</td><td>92</td></tr><tr><td colspan="2">Chapter 4: The Deployed Micro-grid System Integrating Renewable Energy Sources: Experimental Evaluation and Validation</td><td>93</td></tr><tr><td>1.</td><td>Introduction</td><td>93</td></tr><tr><td>2.</td><td>RESs deployment and validation</td><td>93</td></tr><tr><td>2.1.</td><td>PV panels</td><td>93</td></tr></tbody></table>
<table><tr><td>2.2. Wind turbine</td><td>96</td></tr><tr><td>2.3. Battery storage device</td><td>98</td></tr><tr><td>3. Real-time control scenarios for EM in MG system</td><td>102</td></tr><tr><td>3.1. RESs coupling and control card deployment</td><td>102</td></tr><tr><td>3.2. PV-battery-grid control scenario</td><td>105</td></tr><tr><td>3.3. PV-WD-battery-grid control scenario</td><td>107</td></tr><tr><td>4. Conclusions</td><td>113</td></tr><tr><td>Chapter 5: A Predictive Control Strategy for Energy Management in Micro-grid Systems</td><td>114</td></tr><tr><td>1. Introduction</td><td>114</td></tr><tr><td>2. Power forecasting for MG systems</td><td>115</td></tr><tr><td>2.1. Classification of power forecasting techniques</td><td>115</td></tr><tr><td>2.2. Deployed forecasting technique</td><td>117</td></tr><tr><td>2.3. Control strategy based on forecasting method and simulation results</td><td>121</td></tr><tr><td>3. MPC-based control for energy balance in MG Systems</td><td>126</td></tr><tr><td>3.1. MG modeling and control approach</td><td>127</td></tr><tr><td>3.2. MPC strategy deployment and validation</td><td>131</td></tr><tr><td>4. MG system modeling for GPC integration</td><td>135</td></tr><tr><td>4.1. GPC modeling, constraints and objective functions</td><td>135</td></tr><tr><td>4.2. Single-phase modeling for MG synchronization</td><td>140</td></tr><tr><td>5. Results and performances evaluation</td><td>145</td></tr><tr><td>5.1. EM scenarios using GPC control approach</td><td>146</td></tr><tr><td>5.2. The benefit of GPC model on the electricity price</td><td>152</td></tr><tr><td>5.3. Power quality for GPC controller</td><td>155</td></tr><tr><td>6. Conclusions</td><td>160</td></tr><tr><td>General Conclusions and Perspectives</td><td>161</td></tr><tr><td>Author's Publications</td><td>163</td></tr><tr><td>REFERENCES</td><td>165</td></tr></table>
LIST OF FIGURES

<table><tr><td>Figure 0.1. Global primary energy demand growth by scenario, 2019-2030</td><td>1</td></tr><tr><td>Figure 0.2. A holistic system architecture of RES and data monitoring platform</td><td>4</td></tr><tr><td>Figure 1.1. Electricity demand by sector, 2018-2040</td><td>8</td></tr><tr><td>Figure 1.2. The international installed power generation capacity by source, 2000-2040</td><td>9</td></tr><tr><td>Figure 1.3. TEG system architecture</td><td>10</td></tr><tr><td>Figure 1.4. Power consumption for household appliances by region, 2000-2030</td><td>12</td></tr><tr><td>Figure 1.5. a) Global air conditioner stock; b) Heating technology sales</td><td>12</td></tr><tr><td>Figure 1.6. RES share in the final energy consumption for residential sector</td><td>13</td></tr><tr><td>Figure 1.7. Frequency variability depending on power D/R variability</td><td>14</td></tr><tr><td>Figure 1.8. Daily consumption example from the installed EEBLab</td><td>15</td></tr><tr><td>Figure 1.9. Storage systems usefulness for RES deployment</td><td>19</td></tr><tr><td>Figure 1.10. Global architecture: From SG to smart MG</td><td>20</td></tr><tr><td>Figure 1.11. SG and smart MG presented as a combination of IoE, IoT and IoS</td><td>21</td></tr><tr><td>Figure 1.12. MG system types and benefits</td><td>23</td></tr><tr><td>Figure 1.13. Hybrid system of RESs</td><td>24</td></tr><tr><td>Figure 1.14. Energy efficiency and occupants' comfort metrics</td><td>26</td></tr><tr><td>Figure 1.15. The DC topology</td><td>32</td></tr><tr><td>Figure 1.16. The AC topology</td><td>33</td></tr><tr><td>Figure 1.17. DC/AC coupling topology</td><td>35</td></tr><tr><td>Figure 1.18. The MG system operating modes</td><td>35</td></tr><tr><td>Figure 2.1. Control structure for energy management in MG systems</td><td>45</td></tr><tr><td>Figure 2.2. Centralized control structure</td><td>46</td></tr><tr><td>Figure 2.3. Decentralized control structure</td><td>47</td></tr><tr><td>Figure 2.4. Hierarchical control structure</td><td>48</td></tr><tr><td>Figure 2.5. Hierarchical control levels</td><td>50</td></tr><tr><td>Figure 2.6. Objective functions, constraints and optimization methods for optimum operation of MG systems</td><td>51</td></tr><tr><td>Figure 2.7. Control approaches for energy management systems</td><td>54</td></tr><tr><td>Figure 2.8. MG and EM system specification and underlying construction steps</td><td>55</td></tr><tr><td>Figure 2.9. The proposed control approach schemes with operation process</td><td>66</td></tr><tr><td>Figure 3.1. The main MG system's layers for smart and energy-efficient buildings</td><td>69</td></tr></table>
<table>
  <tr>
    <td>Figure 3.2. The holistic model of the deployed MG system</td>
    <td>70</td>
  </tr>
  <tr>
    <td>Figure 3.3. PV cell equivalent circuit model; a) Ideal single diode model, b) PV cell with series resistance, c) PV cell with series and shunt resistances</td>
    <td>71</td>
  </tr>
  <tr>
    <td>Figure 3.4. The power coefficient Cp average for different types of WT</td>
    <td>76</td>
  </tr>
  <tr>
    <td>Figure 3.5. The deployed battery modeling</td>
    <td>78</td>
  </tr>
  <tr>
    <td>Figure 3.6. Lead-Acid battery discharge characteristic</td>
    <td>80</td>
  </tr>
  <tr>
    <td>Figure 3.7. Monitoring platform architecture</td>
    <td>86</td>
  </tr>
  <tr>
    <td>Figure 3.8. IoT/Big-Data platform architecture</td>
    <td>87</td>
  </tr>
  <tr>
    <td>Figure 3.9. a) Internal/external temperature b) weather monitoring</td>
    <td>88</td>
  </tr>
  <tr>
    <td>Figure 3.10. The hybrid system of RESs installed in our EEBLab</td>
    <td>91</td>
  </tr>
  <tr>
    <td>Figure 3.11. EEBLAB: the deployed energy efficient building laboratory</td>
    <td>92</td>
  </tr>
  <tr>
    <td>Figure 4.1. Real data during 12 hours, (a) Temperature, (b) Irradiance</td>
    <td>95</td>
  </tr>
  <tr>
    <td>Figure 4.2. Simulation and experiment data, a) PV current, b) PV voltage, c) PV power</td>
    <td>95</td>
  </tr>
  <tr>
    <td>Figure 4.3. WT generation scenario, a) Wind speed profile, b) Simulation and experiment power generation</td>
    <td>97</td>
  </tr>
  <tr>
    <td>Figure 4.4. a) Wind speed variation during one hour, b) The equivalent wind power generation</td>
    <td>98</td>
  </tr>
  <tr>
    <td>Figure 4.5. Battery characterization system (Naitmalek et al., 2019)</td>
    <td>99</td>
  </tr>
  <tr>
    <td>Figure 4.6. Battery voltage characterization for four charging steps</td>
    <td>100</td>
  </tr>
  <tr>
    <td>Figure 4.7. a) SoC estimation from voltage variation, b) The deployed battery modeling validation, c) The battery SoC estimation using the measured voltage by our deployed platform</td>
    <td>101</td>
  </tr>
  <tr>
    <td>Figure 4.8. a) Schematic view of the control card, b) The deployed Hw/Sw control card</td>
    <td>103</td>
  </tr>
  <tr>
    <td>Figure 4.9. PV-WT power generated during 24 hours</td>
    <td>104</td>
  </tr>
  <tr>
    <td>Figure 4.10. Power measurement scenario in our deployed MG system platform</td>
    <td>105</td>
  </tr>
  <tr>
    <td>Figure 4.11. a) Production and SoC variation b) Consumption from battery-grid and SoC status</td>
    <td>106</td>
  </tr>
  <tr>
    <td>Figure 4.12. The test scenario architecture</td>
    <td>108</td>
  </tr>
  <tr>
    <td>Figure 4.13. Flowchart of the power flow management</td>
    <td>110</td>
  </tr>
  <tr>
    <td>Figure 4.14. Hybrid system implemented in the EEBLab</td>
    <td>110</td>
  </tr>
  <tr>
    <td>Figure 4.15. Buffer battery current variation</td>
    <td>111</td>
  </tr>
  <tr>
    <td>Figure 4.16. Main storage C/D current variation with PV production</td>
    <td>112</td>
  </tr>
  <tr>
    <td>Figure 4.17. a) The power generated from RESs to the loads, b) Power consumed from traditional grid</td>
    <td>112</td>
  </tr>
  <tr>
    <td>Figure 5.1. EM schemes with GPC operation process</td>
    <td>114</td>
  </tr>
  <tr>
    <td>Figure 5.2. Time scale forecasting classification</td>
    <td>116</td>
  </tr>
  <tr>
    <td>Figure 5.3. Power forecasting methods</td>
    <td>117</td>
  </tr>
</table>
<table>
  <tr>
    <td>Figure 5.4. Different iterative steps of ARIMA model</td>
    <td>118</td>
  </tr>
  <tr>
    <td>Figure 5.5. a) Forecasting and real PV power, b) Forecasting and real SoC, c) The real and the forecasted power consumption</td>
    <td>122</td>
  </tr>
  <tr>
    <td>Figure 5.6. Control decision: a) The switching moment based on real-time values, b) The switching moment based on forecast values</td>
    <td>123</td>
  </tr>
  <tr>
    <td>Figure 5.7. a) Predictive and real PV generation, b) Predictive and real SoC, c) Predictive and real loads consumption</td>
    <td>125</td>
  </tr>
  <tr>
    <td>Figure 5.8. A schematic view of the predictive control model</td>
    <td>131</td>
  </tr>
  <tr>
    <td>Figure 5.9. a) Battery C/D current variability, b) Comparison of the current for the different methods</td>
    <td>133</td>
  </tr>
  <tr>
    <td>Figure 5.10. a) SoC variability for the different methods, b) The obtained SoC comparison for the different methods</td>
    <td>134</td>
  </tr>
  <tr>
    <td>Figure 5.11. A schematic view of GPC concept and control mechanism</td>
    <td>135</td>
  </tr>
  <tr>
    <td>Figure 5.12. EM and control strategy</td>
    <td>138</td>
  </tr>
  <tr>
    <td>Figure 5.13. Single-phase MG system</td>
    <td>141</td>
  </tr>
  <tr>
    <td>Figure 5.14. Predictive control operation, a) Ideal case: calculation time is negligible, b) Practical case: calculation time is significant</td>
    <td>143</td>
  </tr>
  <tr>
    <td>Figure 5.15. Predictive control with significant calculation time: operation of delay compensation method</td>
    <td>144</td>
  </tr>
  <tr>
    <td>Figure 5.16. GPC control for autonomous operation mode</td>
    <td>146</td>
  </tr>
  <tr>
    <td>Figure 5.17. EM scenarios based on GPC model controller for grid-connected mode and static setpoint</td>
    <td>148</td>
  </tr>
  <tr>
    <td>Figure 5.18. GPC controller for grid-connected mode and dynamic setpoint</td>
    <td>150</td>
  </tr>
  <tr>
    <td>Figure 5.19. EM scenarios based on GPC model, a) Case 1: without battery-grid interaction, b) Case 2: with battery-grid interaction</td>
    <td>152</td>
  </tr>
  <tr>
    <td>Figure 5.20. Power regulation for GPC and PID controller</td>
    <td>155</td>
  </tr>
  <tr>
    <td>Figure 5.21. Power regulation for GPC and PID controller, a) Battery power regulation, b) Grid power exchange</td>
    <td>156</td>
  </tr>
  <tr>
    <td>Figure 5.22. Current and voltage regulation, a) DC bus voltage, b) DC bus current, c) the current across the filter capacitor</td>
    <td>157</td>
  </tr>
  <tr>
    <td>Figure 5.23. a) Load current variation, b) Load voltage variation</td>
    <td>158</td>
  </tr>
  <tr>
    <td>Figure 5.24. Frequency spectrum, a) Inverter output current, b) Inverter output voltage, c) Load voltage</td>
    <td>159</td>
  </tr>
</table>
LIST OF TABLES

<table><tr><td>Table 1.1. Voltage-level standards in DC and AC bus of MG</td><td>27</td></tr><tr><td>Table 1.2. International standards for distributed energy integration in MG systems</td><td>28</td></tr><tr><td>Table 1.3. Communication technologies for MG building systems</td><td>30</td></tr><tr><td>Table 2.1. Survey through collection of EM for hybrid MG system</td><td>42</td></tr><tr><td>Table 2.2. Hybrid system control overview, approaches and contributions</td><td>43</td></tr><tr><td>Table 2.3. Control architectures for hybrid system, advantages and inconveniences</td><td>49</td></tr><tr><td>Table 2.4. Brief comparison of control approaches</td><td>63</td></tr><tr><td>Table 3.1. The main electrical components of EEBLab</td><td>91</td></tr><tr><td>Table 4.1. PV Characteristics</td><td>94</td></tr><tr><td>Table 4.2. Parameters of the wind-turbine conversion system</td><td>96</td></tr><tr><td>Table 4.3. Parameters of the deployed battery</td><td>100</td></tr><tr><td>Table 4.4. Operating mode of the batteries</td><td>105</td></tr><tr><td>Table 5.1. The minimum AIC, b) The errors for ARIMA parameters determination</td><td>124</td></tr><tr><td>Table 5.2. MG system parameters</td><td>146</td></tr><tr><td>Table 5.3. Electricity price benefit for case 1</td><td>153</td></tr><tr><td>Table 5.4. Electricity price benefit for case 2</td><td>154</td></tr></table>
LIST OF ACRONYMS

<table><tr><td>AC</td><td>Alternative Current</td></tr><tr><td>AIC</td><td>Akaike Information Criterion</td></tr><tr><td>ANN</td><td>Artificial Neural Network</td></tr><tr><td>ARIMA</td><td>AutoRegressive Integrated Moving Average</td></tr><tr><td>ARX</td><td>Auto Regressive model with external inputs</td></tr><tr><td>BIC</td><td>Bayesian Information Criterion</td></tr><tr><td>C/D</td><td>Charge/Discharge</td></tr><tr><td>CARMA</td><td>Controller Auto-Regressive Moving-Average</td></tr><tr><td>CAS</td><td>Collective Adaptive Systems</td></tr><tr><td>CC</td><td>Central Controller</td></tr><tr><td>CCS-MPC</td><td>Continuous Control Set MPC</td></tr><tr><td>D/R</td><td>Demand/Response</td></tr><tr><td>DC</td><td>Direct Current</td></tr><tr><td>EEBLab</td><td>Energy Efficient Building Laboratory</td></tr><tr><td>EM</td><td>Energy Management</td></tr><tr><td>FCS-MPC</td><td>Finite Control Set MPC</td></tr><tr><td>FL</td><td>Fuzzy Logic</td></tr><tr><td>GPC</td><td>Generalized Predictive Control</td></tr><tr><td>HVAC</td><td>Heating, Ventilation and Air Conditioning</td></tr><tr><td>ICT</td><td>Information and Communication technologies</td></tr><tr><td>IGBT</td><td>Insulated Gate Bipolar Transistor</td></tr><tr><td>IGDT</td><td>Information Gap Decision Theory</td></tr><tr><td>IoE</td><td>Internet of Electricity</td></tr><tr><td>IoS</td><td>Internet of Services</td></tr><tr><td>IoT</td><td>Internet of Things</td></tr><tr><td>LC</td><td>Local Controller</td></tr><tr><td>LPPT</td><td>Limited Power Point Tracking</td></tr><tr><td>LSTM</td><td>Long Short-Term Memory</td></tr><tr><td>MAB</td><td>Multi-Agent-Based</td></tr><tr><td>MAE</td><td>Mean Absolute Error</td></tr><tr><td>MAPCASTE</td><td>Measure, Analyze, Plan, ForeCAST, and Execute</td></tr><tr><td>MG</td><td>Micro-Grid</td></tr><tr><td>MILP</td><td>Mixed Integer Linear Programming</td></tr><tr><td>ML</td><td>Machine Learning</td></tr></table>
<table><tr><td>MPC</td><td>Model Predictive Control</td></tr><tr><td>MPPT</td><td>Maximum Power Point Tracking</td></tr><tr><td>MQTT</td><td>Message Queue Telemetry Transport</td></tr><tr><td>MSE</td><td>Mean Square Error</td></tr><tr><td>NLP</td><td>Nonlinear Programming</td></tr><tr><td>NZEB</td><td>Net Zero Energy Building</td></tr><tr><td>OCV</td><td>Open Circuit Voltage</td></tr><tr><td>OSS-MPC</td><td>Optimal Switching Sequence MPC</td></tr><tr><td>OSV-MPC</td><td>Optimal Switching Vector MPC</td></tr><tr><td>PID</td><td>Proportional Integral Derivative</td></tr><tr><td>PMSG</td><td>Permanent Magnet Synchronous Generator</td></tr><tr><td>PV</td><td>Photovoltaic</td></tr><tr><td>RES</td><td>Renewable Energy Sources</td></tr><tr><td>RTU</td><td>Remote Terminal Units</td></tr><tr><td>SCADA-EMS</td><td>Supervisory Control and Data Acquisition-Energy Management System</td></tr><tr><td>SG</td><td>Smart Grid</td></tr><tr><td>SoC</td><td>State of Charge</td></tr><tr><td>SVM</td><td>Space Vector Modulation</td></tr><tr><td>TEG</td><td>Traditional Electrical Grid</td></tr><tr><td>WT</td><td>Wind Turbine</td></tr></table>
# General Introduction

According to recent statistics from the International Energy Agency, the global energy demand grew fast pace during the last decades. This exceptional increase is due mainly to the robust economy and high heating and cooling needs. For that, fossil sources are still the most suitable solution to tackle the constant rise in energy consumption. As a result, global energy-related CO₂ emissions rose by 1.7% to 33.5 Gigatonnes in 2019 causing an increase in the greenhouse effect and global warming. However, electrical energy is considered as the “fuel” of the future with a global electricity demand growing by 4.4% in 2019 to more than 23000 (TWh). Face to this increase in the global electricity demand, more urgent actions are needed to develop all clean energy solutions and to improve efficiency, especially the building sector, which represents 20% of the total energy consumption. However, recent studies predict a drop in global energy demand of 5% in 2020 due to the impacts of the health crisis Covid-19 pandemic (IEA, 2020), as shown in Figure 0.1. Especially for the main energy sources, the consumption of petroleum and coal is expected to decline by 8% and 7% respectively.

<figure><img src="image_3.png" /><figcaption>Figure 0.1. Global primary energy demand growth by scenario, 2019-2030 (IEA, 2020)</figcaption></figure>

The international energy agency also expects demand will not be returned to pre-coronavirus levels. It will account for less than 20% of energy consumption by 2040, for the first time since the industrial revolution. The agency suggested that it is the best period to make more efforts to never become to traditional energy sources revolution. In this way, only structural changes, in the power production and consumption methods, can improve the revolution towards clean energy sources. Previously, electrical energy was produced almost exclusively from pollutant sources in centralized environments and consumed completely in decentralized locals. For environmental and economic reasons, this old structure of energy
production generated more greenhouse gas and it required the establishment of a network to transport the energy produced in a few production plants to the final consumers. Therefore, the consumers are encouraged to develop decentralized means of electricity production based on the use of RESs in order to increase the energy efficiency of production, which contributes to producing “cleaner” energy.

Mainly, renewable energies come from solar, wind, water stream (hydraulic), wood energy, and from other plants or urban waste (biomass). Mostly, solar and wind energy are considered as the main renewable sources that are more reliable, safe, and very easy solutions for being integrated in buildings. However, the integration of renewable energy into buildings can cause challenges and impacts for the system operation. Three main types of problems could appear concerning RESs integration:

* RESs have a significant cost and consume a lot of energy in their fabrication. To compensate for this ecological debt and to maximize profitability, the production of these sources should be maximized. In fact, wind energy is the energy extracted from the wind using an aero generator device, such as a WT. Among RESs, wind power is, currently, the best in terms of economic profitability. By considering the energy and materials necessary for the construction and assembling equipment, the deployment of one MW of WT on a windy site avoids an annual injection of 2000 tons of CO2 in case if the electricity produced came from fossil sources. In addition, a 2.5 MW WT has a lifecycle of around 20 years under normal operating conditions and can produce, in just two to three months, all the energy consumed for its realization. However, the cost of this installation is expensive and cannot be insured by a simple consumer. In fact, dimensioning a small turbine should be combined with other solutions like PV panels. However, solar energy constitutes the easily exploitable energy in a very strong evolution in the two types that are PV and thermal energy. The inconvenience of PV systems is their yield of 3 to 15% and their significant investment cost/energy produced ratio. According to the German Ministry of the Environment (BMU) report, PV systems need 2 to 5 years to amortize the energy consumed for their construction, including the cost of manufacturing and assembly. To maximize the efficiency of RESs, hybrid PV and wind systems have been developed.

* Storage devices are the most critical component of the system, having a very limited life depending on charge-discharge cycles and being to be changed when the yield decrease. For that, a good control strategy to manage the D/R of the storage devices is needed. For example, by considering the different factors that can damage the batteries, the yield of the
installation can be increased and the profitability of the system will be more significant. However, the environmental conditions of the batteries, cyclic life, depth discharge, temperature, and recharge rate are the different factors that can cause fast damage to the batteries. In fact, the batteries will be changed more frequently and automatically in the long term, the profitability of the installation decreases due to the high cost of the storage devices (batteries).

* The main limitation of RESs is that they depend entirely on weather conditions, which have a stochastic nature and very changeable behaviors during the day and the season. Mainly, the production is limited during some periods that cannot have a coincidence with the consumption periods and the generated power should be stored or injected during peak production. For example, the PV system generates power during sunny days, the consumers can use the power generated totally or partially and the surplus could be stored to be used during the night. Moreover, during the night or cloudy day, the system cannot satisfy the demand and the consumer should have other sources to accumulate the energy need. For the wind generation, the production is very variable compared to the PV systems due to the variable nature of the wind speed and direction for the same period. However, this stochastic nature of the weather conditions generates a large variability on the RESs production and a time lag between the electrical power production and real consumption. Generally, this factor decreases the flexibility and the reliability of the system and the balance of the power flows will be more complex.

Face to these problems, a hybrid system of RESs can be used to increase the reliability of the system (Figure 0.2). However, it requires efficient sizing, modeling, and analysis of its components together with intelligent platforms in order to ensure the balance between production and consumption (D/R control), while maintaining the storage devices in their good state of health. At the same time, the building is connected to the TEG to ensure the power to the loads if the RES cannot satisfy the demand. Such systems require a good strategy for monitoring, control, and effective management. In fact, the management of these hybrid systems of RES requires the use of ICT for developing intelligent control strategies. For instance, in the context of buildings management, an MG consists of household appliances (Loads) connected by an energy network (e.g., RES, storage devices, TEG), and by a communication infrastructure allowing the interaction between the different components of the MG system (Figure 0.2).
<figure><img src="image_4.png" /><figcaption>Figure 0.2. A holistic system architecture of RES and data monitoring platform</figcaption></figure>

In our studies, and in order to take the abovementioned constraints into account, we consider that the MG system can be structured in one vertical and three horizontal layers. The first horizontal layer concerns all architectural design aspects and the building's envelope (e.g., orientation, insulation materials). The second layer focuses on the integration and the control of all passive/active systems (e.g., HVAC, lighting), while the third layer concerns the integration and the management of hybrid RESs system (e.g., solar energy, wind). A vertical layer has been incorporated, and includes recent technologies (e.g., IoT/Big-data, wireless communications). It is worth noting that this work is a part of the work we are undertaking under MIGRID project, which aims to develop techniques and tools for sizing, modeling, simulation, and experimentation of a smart MG system. As shown in Figure 0.2, this system is mainly developed and deployed for investigating innovative approaches in the context of energy efficiency in buildings.

The work described in this dissertation concerns the third layer by investigating RESs connection, integration, and management. In this layer, the aim is to determine, on-the-fly, the best energy assignment plan as well as a good compromise between energy production and energy consumption in order to increase the energy efficiency of buildings while keeping at maximum as possible the occupants' comfort. Unfortunately, the unpredictable and discontinuous nature of the power production and consumption make the power management in the MG system a difficult task in order to satisfy the control constraints and to maximize a
ratio between user satisfaction and cost. Moreover, such systems require a good strategy for monitoring, control and effective management.

In this dissertation, an intelligent predictive control approach, named MAPCASTE (Measure, Analyze, Plan, ForeCAST, and Execute over knowledge base) is investigated and developed to perform an instantaneous equilibrium of the D/R balance. In fact, the developed approach should be able to predict, estimate, and control the interaction between power production, storage devices, and building demands. However, integrating RES into the MG systems requires real-time tracking of the amount of expected consumption (Demand) and the amount of produced energy (Response) in order to smooth electricity flow and avoid blackouts. Therefore, a holistic platform, including RES, storage devices, IoT/Big-Data platform, and context-awareness control, have been developed and deployed. More precisely, a hybrid system of RES is developed with the different layers that constitute the MG system concept. This hybrid system is connected to an advanced metering infrastructure using the recent IoT/Big-data technologies for measurement, data monitoring, and processing. The RESs (e.g., PV system, WT) coupled with storage systems (e.g., batteries) are modeled, simulated, and experimented. This aspect of modeling is important because the overall efficiency of the control algorithm will depend on the ability of the model to monitor simultaneously the evolution of the multi-source energy system and the consumption of the building. From the simulation model, experiments are carried out to validate the obtained results.

In summary, the main contributions of this work are as follows:

* A Demand/Response control strategy is developed to balance the power flows between RES (e.g., PV, WT), storage devices (e.g., batteries), and the utility grid. For this part, the work focuses on two approaches. The first approach concerns the classical control approaches (e.g., On/Off, PID). Most of these methods are based on real-time data processing to generate control actions according to predefined rules and fixed schedules. The second approach concerns the control predictive approaches. For these approaches, different constraints and optimization functions are modeled and integrated in order to generate the control actions. In this work, a MPC control strategy is developed to control the whole system. The deployed predictive control strategy approach manages the MG in order to maximize the usage of the RES and to minimize the usage of the utility grid by considering the storage devices' limits. Simulations and experimentations have been conducted to study the usefulness of the platform and the effectiveness of the proposed D/R control approaches. Therefore, the GPC model is
integrated based on the deployed MPC strategy, and the usefulness of this new predictive control is presented to minimize the electricity bill for consumers.

* A platform that integrates IoT/Big-data technologies is developed for data monitoring and real-time processing. In this platform, different sensors are installed in the MG for data measurement (e.g., current, voltage, power, temperature). Data collected from these sensors need to be processed in real-time in order to figure out the right control decision according to actual situations (e.g., occupancy, energy consumption-production patterns, and weather conditions data). Furthermore, these data have to be stored for further analysis, especially for developing predictive control strategies using ML (machine learning) algorithms. In addition, the platform integrates both IoT/Big-data technologies for data acquisition and data processing/visualization.

This Dissertation is structured into five chapters as follows. In the first chapter, actual statistics for energy demand are presented together with the principal problems encountered in the TEG. It analyzes the challenges for the actual electrical network and presents the benefits that can be ensured by integrating the concept of the MG system in the traditional electrical networks. The chapter presents the context of the MG buildings system, which is a complex and major energy consumer node.

The second chapter presents a state of the art of control approaches associated with the energy balance in MG systems. Principally, this study is carried out in order to define the suitable control approach for MGs for EM in buildings by identifying the interconnection method and the main components of the system. Classification of approaches is also given in order to shed more light on the need for predictive control for EM in MGs. A general overview of the main predictive control approaches for EM systems is introduced.

In chapter three, the concept of the MG system is presented with the different main layers that constitute the MG structure. In fact, the different energetic components are modeled in order to have both real and experimental MG system modeling offering the possibility to test and validate the studied control approaches. Moreover, an MG system infrastructure is developed together with a platform for data gathering, monitoring, and processing. We put more emphasis on MG systems as crucial infrastructures for leveraging energy-efficient and smart buildings by developing and deploying a holistic IoT/Big-Data platform in which sensing and actuation tasks are performed according to the actual contextual changes.
In chapter four, simulation and experiment results are presented to validate the different
components in our deployed MG system together with naïve control scenarios. The aim is to
show the usefulness of this holistic platform for monitoring, data processing, and control in
energy-efficient buildings. An MG system platform is deployed and validated with a control
card for EM approaches deployment. This MG is used to validate and to deploy the different
scenarios presented in this work. It is named EEBLab located at the International University
of Rabat, in Morocco. The EEBLab MG system is used actually as a research platform for
MG systems development and test of research works.

Chapter five focuses on the development of a model predictive control strategy, named MAPCASTE, for energy balance in MG systems. This later was deployed and evaluated by assessing its effectiveness for EM in MG systems. In fact, the main aspect of the proposed MAPCASTE approach is to measure, in real-time, the main input control parameters; analyzing and processing data, predicting future behaviors, forecasting suitable commands to reach the desired setpoint depending on the predefined constraints and objective functions, and correcting the errors depending on the real measurements. The main objective is to connect efficiently the electricity generators and consumers by predicting the most suitable actions for energy flow management. More precisely, based on energy production and consumption profiles as well as the availability of energy storage systems, the proposed control strategy selects the best suitable energy source for supplying the building’s loads. The electricity price is integrated as a cost function to be minimized while respecting the defined constraints. Simulations have been conducted and results are presented to validate the proposed predictive control approach by showing its effectiveness for MG systems control. The powerful of the MAPCASTE for the EM system was shown by minimizing the electricity bill.

Finally, general conclusions and perspectives are presented. This part gathers the most
relevant results and the main contribution of the thesis. The main challenges and ongoing
works are presented concerning the implementation of the proposed control strategies.
# Chapter 1: Micro-Grid Systems for Smart and Energy Efficient Buildings

## 1. Introduction

The past decades have seen strong growth in global energy demand, in particular gas, oil, and electricity. Electricity is one of the main resources for modern economic development and it is providing a rising share of energy services. Demand for electricity is set to increase as a result of rising household demand, with the electrification of transport (e.g., electrical vehicle) and increasing demand for digitally connected devices and air conditioning systems (Figure 1.1). Furthermore, the increase in electricity demand was one of the key reasons why global CO₂ emissions from the power sector reached a high record in the past decades. Innovative solutions and actions should be developed, especially for high electricity consumers, in order to reduce greenhouse gas emissions. For instance, the consumption in buildings has increased and it accounts currently for over 40% of total energy consumption due to increased demand for building services and indoor environmental quality (e.g., heating, cooling) (Cao, Dai, & Liu, 2016). A significant energy saving can be, however, achieved if buildings are correctly constructed, controlled and operated.

<figure><img src="image_5.png" /><figcaption>Figure 1.1. Electricity demand by sector, 2018-2040 (International Energy Agency, 2019)</figcaption></figure>

RESs are considered as the main solution to decrease electricity consumed from TEG. The share of these sources to the global electricity demand is increased constantly (Figure 1.2). Unfortunately, the unpredictable and discontinuous nature of these renewable energies makes these RES difficult to control and manage. Therefore, it is necessary to characterize as precisely as possible the production of these sources. The influence of unpredictable and
discontinuous nature can be diminished by coupling two or more RESs (e.g., solar thermal energy, PV, wind, hydraulic, biomass). In some locations, the wind is more stable and almost permanent and the WT can produce significant power. For other places, sunny days are relatively more important along the year and the PV system can be more efficient. For that, a hybrid system of RES that combines several sources together with storage devices (e.g., batteries, fuel cells) is highly recommended. The objective of this system is to combine the advantages and the best operational characteristics of each energy source in order to increase the reliability and the flexibility of the whole system.

<figure><img src="image_6.png" /><figcaption>Figure 1.2. The international installed power generation capacity by source, 2000-2040
(International Energy Agency, 2019)</figcaption></figure>

However, due to the intermittent and irregular nature of the RES production and the limit of storage devices, the electric grid could be integrated in order to eventually ensure the power demands while ensuring the quality and the reliability of electrical services. This simple hybrid system needs to be automatically controlled accordingly. In fact, D/R control approaches are required for balancing the intermittent RES generation while handling the delay, which might occur between the power production and the actual building's consumption. In fact, a controllable building that integrates these elements together with the TEG is known as MG systems.

In this chapter, the concept of MG buildings systems is presented by highlighting the need for integrating hybrid systems of RESs together with EM for efficiently operating and controlling the MG systems.

## 2. The traditional electrical grid problems
This section is dedicated to the TEG structure and the problems related to energy transport, distribution, and consumption. The aim is to show the usefulness of the new concept of MG systems.

## 2.1. Traditional electrical grid structure

For technical, environmental and economic reasons the current production of electrical energy is geographically distributed. While consumers are, at the same time, grouped and concentrated at some distributed locations. In order to supply energy to customers, electricity networks are established between these two units. Electricity is amplified at the high voltage on the transport network and regularly it becomes medium on the distribution networks in order to be, finally, on low voltage for the end consumer (Figure 1.3).

<figure><img src="image_7.png" /><figcaption>Figure 1.3. TEG system architecture</figcaption></figure>

The major objective of this structure of the electricity network is to maintain a permanent balance between electricity consumption and production. While the structure of this electrical network is well organized, it suffers, however, from different problems that can be simplified as follows:

*   Electrical distance: to understand the structure of the electrical network, we need a measure of electrical connectivity distance. This electricity transport distance is variable depending on the consumer's location, voltage, the section of the line, and its power. These
parameters combined to generate a “voltage drop” proportional to the section and the length of the line. The voltage drop is closely related to the losses (Hines et al., 2010).

*   **Voltage drop:** its origin is mainly due to the heating of the cables that are used to transport higher currents and to the natural resistance of the cable as well. A visible “voltage drop” is generated at the end of the receiver line. The transformer at the end of the line generally compensates these falls causing a loss of power. For example, on a 300 km line, a “voltage drop” of 450 V is observed, depending on the section and the length of the line. For a 6000 V line, it corresponds to a “voltage drop” of 7.5%, which is not negligible. This “voltage drop” will be 600 V, for a 225 kV line, presenting 0.2% of the initial voltage and it is partially negligible. The problem is that the line voltage cannot exceed a limit due to the materials used for cables’ insulation (Salvador, 2012).

*   **Frequency:** in an electrical network, active and reactive power has to be in balanced condition with the power demanded by the consumers including the losses in the transport lines. The unbalance condition that happens from power production is not equal to the demanded power. The unbalance between both elements causes a deviation of the system frequency from its setpoint value (50/60Hz). Maintaining the frequency at the selected values is a critical issue because all the elements of the network are sized and optimized to work at the same value (50 or 60 Hz). If the frequency is above or below this threshold value, the losses on the network increase and the machines can probably be damaged causing a blackout of the whole system.

*   **Cable resistance:** the current limit is imposed by the section of the cable of the line that can act as a resistance. It heats and expands when it is crossed by a high current and it can generate enormous problems for the electrical network. This phenomenon rises exponentially when the upper load limit is exceeded and it can cause a blackout of the whole network (Granizo et al., 2018).

## 2.2. The increase of residential sector demand

Energy demand from buildings continues to rise due to the robust development of household appliances and to the HVAC systems usage (Figure 1.4). Various techniques could be used to increase the energy efficiency of buildings. The envelope and the design of the building could improve the thermal performance of buildings. The second key aspect is related to the control of active equipment (e.g., lighting, HVAC) and services (Berouine,
Ouladsine, & Bakhouya, 2019a; Lachhab et al., 2018b) (Figure 1.5). Recently, many studies have shown the necessity of integrating and deploying RES in buildings.

<figure><img src="image_8.png" /><figcaption>Figure 1.4. Power consumption for household appliances by region, 2000-2030 (International Energy Agency, 2019)</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Figure 1.5. a) Global air conditioner stock; b) Heating technology sales (International Energy Agency, 2019)</figcaption></figure>
The aim is to increase significantly the energy efficiency in buildings and to minimize the consumption from the TEG. This topic is one of the main focuses of regional, national, and international energy policies. For example, the European Commission has adopted the “20-20-20” strategy, which focuses on three principles: 20% reduction of greenhouse gas emissions, 20% decrease of electrical energy demand by increasing energy efficiency, and 20% share of the RES production in total energy consumption compared to 1990 levels. The project is extended to 2030 with new objectives and charges (European Commission, 2020a, page: 4) (Figure 1.6). However, despite the willingness of integrating these systems, still many issues have to be addressed, especially the EM for their seamless integration with buildings.

<figure><img src="image_10.png" /><figcaption>Figure 1.6. RES share in the final energy consumption for residential sector (International Energy Agency, 2019)</figcaption></figure>

## 2.3. Peak of demand

Due to the variability of the electricity consumption profile during the day and season, peak periods of consumption can be produced as a result of the variable nature of the potential demand. This major problem of the electricity network operation generates significant problems of the whole system operation, especially, frequency and voltage variability. For the proper grid's operation, the operator must constantly balance production and consumption of both active and reactive power, in order to maintain the frequency and voltage amplitude close to their nominal values. In fact, maintaining the frequency on the nominal value is a crucial issue because all the elements of the electrical network are sized and optimized to work at the selected frequency (50 or 60 Hz). On the electrical network, an excess of power results in an increase in voltage and frequency, which is not desirable. To regulate this situation, a balance must be ensured between the produced and consumed power. Certainly, a difference between
the supply and electricity demand causes braking or acceleration of the alternators, which
produce the voltage of the electrical network. For the alternators, the voltages produced have a
frequency proportional to the speed of rotation and three cases can be mentioned (Figure 1.7):
i) the power consumption is higher than power production, in this case, the frequency
decreases compared to the nominal value; ii) the power consumption is lower than the power
production and the frequency increases compared to the nominal value; iii) a balance between
power production and power consumption, in this case, the frequency is established to the
nominal values.

<figure><img src="image_11.png" /><figcaption>**Figure 1.7. Frequency variability depending on power D/R variability**</figcaption></figure>

Moreover, this frequency variability is due to the voltage variability between the
generators and consumers. For that, matching electricity generation precisely to the consumer
on a second-by-second basis is the main challenge and the overriding principle of operation of
any large-scale electricity network. The failure to manage this issue will result in a blackout of
the network. To tackle these problems, the operators look to balancing services by controlling
the alternators. However, in the TEG, the operators do not have any control or management of
power consumption; they can only interact with the power production variability. Therefore,
the residential consumption present generally two interesting peaks demand observed during
the daily consumption curve, as shown in Figure 1.8. The daily consumption curve, as
depicted in Figure 1.8, shows two peaks of demand, one in the morning and the second in the
evening. This daily electricity consumption curve is a daily reflection of our lifestyles, which
also depends on the season of the year. Especially in winter, over 24 hours, electricity
consumption represents a peak in the morning, with an increase from 06:00 AM to 08:00 AM.
<figure><img src="image_12.png" /><figcaption>Figure 1.8. Daily consumption example from the installed EEBLab</figcaption></figure>

At this hour, daytime life restarts its rhythm, the peoples switch ON the light, operate household appliances for breakfast, and take shower. As shown in the curve, the morning pear covers the noon period and a dip in the afternoon is observed. Around 07:00 PM, it is the evening peak and, therefore, the consumption increases to the maximum due to the different activities and household operations (e.g., TV, HVAC, lighting). During these peaks, the operators should manage this variability of consumption by interacting in the generator's operation and a forceful possibility of a blackout is present.

# 3. Local energy production: renewable energy sources and storage

## 3.1. Renewable energy benefits and challenges

The development and the exploitation of renewable energies have improved significantly in the past decades years due to the capability of RES to meet the rising power demands and reduce environmental pollution. Renewables, including solar, wind, hydraulics, biomass, and others, are at the center of the transition to fewer greenhouse gas emission sources and more sustainable energy systems. Generally, this decentralized electricity, which is produced from RESs, provides greater security to supply the power to consumers when the main energy source is unavailable. RESs are locally integrated into buildings allowing an additional energy source to be added to the system and can replace some (or all) of the energy coming from the network (TEG). However, a system for electricity generation, which depends entirely on the RESs, is not reliable due to the available nature of these renewable sources, which cannot be
constantly assured. This electrical generating system involves natural phenomena that are
replenished constantly, such as sunlight and wind. In fact, the fundamental issues that should
be addressed to improve the deployment of these sources can be summarized in the following
sub-sections.

**3.1.1. Production delay**

The RES power production cannot be adapted to the consumption profile of users during the day. Generally, the peak demand is displayed during the morning and the evening periods as mentioned in the previous sections. During this time, the RESs power generations (especially the PV production) are not available and other sources are required. In addition, during peak production, the generated power cannot be consumed totally by the demand and should be stored or injected in the TEG.

**3.1.2. Sources not guaranteed**

The RESs depend entirely on weather conditions and unfortunately, we cannot guarantee
the presence of the sun or wind. For that, other guaranteed sources should be installed together
with storage systems. In fact, a good sizing of storage devices is required, but for a large scale,
this solution makes the installation more expensive. However, storage devices are the most
critical component of the system, having a very limited life depending on charge-discharge
cycles and being changed when the yield decreases.

**3.1.3. Service quality**

PV system and wind power installations do not offer kinetic energy due to the electronic
technologies used for the different equipment for PV and for wind power installations, which,
therefore, tends to increase the frequency and voltage variation rates. Mainly, RESs should
offer the possibility of power frequency adjustment to ensure safety and good quality to the
electricity injected in the TEG. When the presence of these sources is massive on an electrical
network, the characteristics make it more difficult to maintain the stability of the system and
can be incompatible with the dynamic of the security management of the electrical network.
Moreover, PV and wind installations present rapid variations in their production. This
instability requires the use of intelligent and predictive control strategies in order to adjust in
real-time the D/R balance.

**3.1.4. Installation cost**
RESs equipment consumes a lot of energy in their fabrication and the cost of these solutions stays a little higher compared to other traditional generators. Unlike traditional technologies, the efficiency of renewable technologies is generally very specified by the environmental constraints and more the sources are worked at their maximum more the profitability of the system will be maximized. Therefore, comparisons should be made based on optimal usage conditions. For example, RESs energy is locally delivered and the cost should be compared to the delivered energy from traditional sources including transport and distribution cost. However, the cost difference still favors fossil fuel technologies than RESs due to their higher cost. Mainly, significant policy actions enhanced levels of investment in research and development to minimize the RESs production cost by developing other technologies for PV and wind systems.

### 3.1.5. Difficult to predict

The weather conditions have a direct effect on the RESs power generation and the stochastic nature of these inputs parameters (e.g., temperature, irradiance, wind speed) makes it difficult to predict the output of the system (power generation). Research work focusing on the power forecast is one of the main solutions that can be used to minimize the effect of the different RES problems. For example, the very short-term forecast can be used to avoid the cut of electricity in a local installation range by interacting with the storage devices. The aim is to make more stable the variability of the frequency and the voltage. In addition, a short-term forecast can be used to optimize the production planning of the different means of the system, in particular, start/stop actions for hydraulic inventory management policies, which take normally a long time to interact with the electricity demand variability. Moreover, a long-term forecast makes it possible to anticipate potential breaks in D/R balance by adjusting the operating program of the various production sources. It can be used to design correctly the economic strategies for a country, to guarantee the electricity offer and to plan the maintenance time for large scale PV and WTs installations.

Actually, to maximize the efficiency of the RES, hybrid PV and wind systems have been developed. The objective of this system is to combine the advantages and the best operational characteristics of each energy source. However, the integration of storage systems is recurred to reduce the intensity of different problems. In the next section, different storage systems that can be combined with RES are presented by focusing on those that are used in our deployed MG system.
## 3.2. Benefits of electrical energy storage systems

Different kinds of technical and technological solutions are proposed face to the intermittent problem of RES. The integration of storage systems is considered as one of the effective solutions to eliminate or to minimize the intensity of the different mentioned problems. The electrical energy storage systems can balance the variability and the intermittency of power supply for a system, which is based partially or totally on RESs power generation. They can help to eliminate some fundamental services problem in an electrical network, such as frequency and voltage stability.

The necessity of an energy storage system is to provide flexibility and improve the reliability of renewable energy systems. It is one of the main solutions to balance the energy supply and demand for RES systems. In fact, the deployment of an energy storage system is not only for balancing the power flow but also for reducing significantly the cost of the electricity bill. However, in a TEG network, the peak demand periods are managed by starting up fuel, coal, or nuclear plans. For decentralized electricity generation systems, the storage systems can be used locally to supply power during peak demand. In addition, electrical equipment can deteriorate due to the intermittent production of electricity from RES. For that, using storage devices, the service quality can be ensured on the distribution network by adjusting the frequency and voltage variability. Moreover, according to the size and to the technical specifications, storage systems can offer warranties in terms of power predictability, stability, or even provide a programmable energy dispatch while ensuring the system services, which are required for the proper functioning of electrical systems. For example, the power generated by the fuel-cells in an MG system varies on voltage and frequency and the use of batteries is recommended to stabilize this variability and to ensure some quality to the electrical service.

In the current context of renewable energies development, storage systems, therefore, appear as an essential solution to promote the insertion of the predictive control for EM and to improve energy efficiency. It is also a solution to increase the safety and flexibility of systems, which are connected to the electrical network by regulating the frequency and voltage variability caused by the power D/R variability. Especially, for the predictive control strategies, energy storage promotes an important role in energy balance with the possibility to have decentralized storage that can be controlled centrally. Furthermore, the cost optimization function can be integrated into the control strategies for EM-based storage devices. This
minimization of cost bill can be achieved by charging the storage system during the periods of least demand and discharging during the peak demand. Generally, different services can be rendered by the storage systems as illustrated in Figure 1.9.

<figure><img src="image_13.png" /><figcaption>Figure 1.9. Storage systems usefulness for RES deployment</figcaption></figure>

It is recommended to conduct more research work in order to reduce the costs of the different kinds of storage devices, which should make it possible to respond to significant deployment challenges and to increase the profitability of the system as well. However, it is required for the EM control strategies to consider the state of health of storage devices (e.g., batteries) by minimizing as much as is possible the cycle of C/D while keeping a good service quality for consumers.

# 4. Towards smart MG systems

## 4.1. MG system as a part of smart grid system

The integration of RESs for large-scale of electrical energy production has recently accelerated because of evident climate change, insufficiency of fossil resources, and greenhouse gas emissions. RES are clean and eco-friendly sources and their abundance and renewable nature are among the most important factors for their integration into SG networks.
However, these green energy sources come with new challenges, mainly their seamless integration with existing electrical networks. In addition, another important challenge for this new electricity infrastructure is real-time monitoring and data processing, which requires new ICT-based infrastructures (Figure 1.10). The main aim is to ensure sustainable and reliable renewable energy generation systems (Berouine et al., 2019b; Kabalci & Kabalci. Y, 2019). Therefore, this integration of ICTs, energy distribution systems, as well as distributed energy generation systems (e.g., RESs), creates what is commonly named “Smart Grid” (SG). In fact, SG represents the new smart electrical network, since it brings the flexibility to integrate new electrical services, such as electrical vehicles, and enables consumers to be energy producers by integrating RESs using a bidirectional communication network (Asaad et al., 2019). This depends mainly on the fast advances in ICT-based infrastructures covering then all aspects of the electricity grid and its associated services. In fact, due to the development of IoT infrastructures and their related intelligent services, the electricity grid has new capabilities to monitor, manage, and control its components and then takes advantage of sophisticated bidirectional interactions. Moreover, the ICTs integration enables various smart and automatic services, such as smart metering infrastructure, smart control and management for D/R balance, advanced electricity marketing, and intelligent energy storage for electrical vehicles integration.

<figure><img src="image_14.png" /><figcaption>Figure 1.10. Global architecture: From SG to smart MG</figcaption></figure>

However, despite this progress, some research work stated that the SG is experiencing new challenges. Mainly, it is able to manage only electrical energy neglecting other existing
types of energy (e.g., thermal, chemical, and electrochemical). In addition, the SG is based on the actual infrastructures of power distribution grids, which are limited by the unidirectional exchange of the electricity (Wang et al., 2017). Therefore, face these challenges; other concepts have been developed together with the revolution of SG, such as the IoE, the IoT, and the IoS, as mentioned in Figure 1.11 (Tsiatsis et al., 2018). Especially, the development and the emergence of smart MG systems could resolve some of the abovementioned SG challenges. MG could simplify the management of electrical energy, from centralized to distribute EM. In addition, in MG systems, different types of energy can be managed locally with the possibility to interconnect different MGs in a distributed manner.

Depending on the scale of the system, numerous definitions for MG systems have been proposed. For two European projects, named “Microgrids” and “More Microgrids”, the MG system is considered as a basic feature of future active distribution networks and it is composed of more than one building (Kanchev, 2014). For instance, in Greece, the “Kythnos Island Microgrid” is composed of 12 houses connected to a solar PV plant and battery bank. The PV plant comprises 10 kW of PVs for energy generation, a nominal 53-kWh for the battery bank, and a 5-kW diesel generation. A second PV plant of about 2 kW, mounted on the roof of the control system building, is connected to 32-kWh of the battery bank in order to provide power for monitoring and communication (Hatziargyriou et al., 2007).

<figure><img src="image_15.png" /><figcaption>Figure 1.11. SG and smart MG presented as a combination of IoE, IoT and IoS</figcaption></figure>

Another system in Germany for “More Microgrids” project, named “MVV Residential Demonstration”, is installed at Mannheim-Wallstadt. The project prepares about 20 families for a continuous long-term field test site that are considered as one MG. In fact, the first goal of the experiment is to involve customers in load management. For that, 30 kW of PV is already installed. Based on PV power availability information from their neighborhood, the
families shifted their consumption when it is possible to use directly solar energy. As a result, participating families shifted their consumption significantly from the typical residential evening peak toward hours with the higher solar insolation, and from cloudy days toward sunny days (Hatziargyriou et al., 2007; European Commission, 2020b).

In the United States, there are many projects in universities and military bases already developed with an estimated global market rise from about 3.2 GW in 2019 to 15.8 GW by 2027 (including all types of MG systems, as it is depicted in Figure 1.12), where only the United States accounted for almost 35% of this market in 2018 (Microgrid Knowledge, 2020). The most well-known researches and development project, named “Consortium for Electric Reliability Technology Solutions” (CERTS), is developed for the power system reliability of emerging technology in MG systems. The project is provided for relatively small sites (~<2 MW at the peak) and it is delivered for a research platform, which is considered as an MG installed in a laboratory at the University of Wisconsin, Madison (Consortium for Electric Reliability Technology Solutions, 2020). Another interesting international standard is Japan, which sets ambitious targets for increasing the contribution of RESs in MG systems. In fact, the research funding and management agencies of the Ministry of Economy, Trade, and Industry have started different MG projects. Mainly, a recent project named “Integrating renewables into the Japanese power grid by 2030” is involved. In this project, Japan’s Renewable Energy Institute (REI) and “Agora Energiewende” attempt to integrate renewables energy into Japan’s power grids without endangering grid stability, the study also promotes data transparency. International experience has shown, however, that a number of technical measures, not yet widespread in Japan, can be safely implemented to improve grid stability (Renewable Energy Institute, 2018).

## 4.2. MG system types and benefits

### 4.2.1. MG system types

A large part of research projects considers large-scale buildings and RESs plants as MG systems. For instance, according to the MG operation mode, different types of MG systems are classified as depicted in Figure 1.12.a. Similarly, by considering the applications and the objectives (Guimaraes, 2020), another classification is presented in Figure 1.12.b. Other academic researches present the MG system as a single building, which integrates ICTs infrastructure, RESs, and energy storage with the electrical power grids. For instance, in (Zhang, Gatsis, & Giannakis, 2013; Dagdougui, Ouammi, & Sacile, 2017), the MG systems
are defined as smart power systems that are grouped together within a limited geographic area. They include loads, distributed generation units, and energy storage systems (batteries, electric vehicles, hydraulic storage, etc.). The main advantage of MG is to enable customers to have both a bidirectional communication platform and control devices to manage their energy needs and excesses. In addition, with an adequate communication structure, it is possible to shape the users' load demand curves by means of D/R strategies.

<figure><img src="image_16.png" /><figcaption>Figure 1.12. MG system types and benefits</figcaption></figure>

Other works present the MG as a systematic and efficient approach for managing the power system by integrating all distributed generating sources into a micro-power system (Kumar, Zare, & Ghosh, 2017; Fathima et al., 2018). For example, in (Kumar, Zare, & Ghosh, 2017), authors defined the MG system as a low-voltage power network with distributed energy generation (e.g., PV arrays, micro-wind turbines, fuel cell, energy storage), which offers better control capability over network operation. It is considered as a solution to meet the local energy demand by connecting distributed power generation to distribution networks,
such as local substations without further expansion of costly centralized utility grids. In addition, the United State Department of Energy (DOE) defines an MG as follows: “An MG is a group of interconnected loads and distributed energy sources within clearly defined electrical boundaries that act as a single controllable entity with respect to the grid” (Chauhan & Chauhan, K, 2019).

### 4.2.2. MG system benefits

Distributed energy resources is a new structure of electricity network that improved the concept of MG system, in which the classical consumers are becoming a producer of electricity with the possibility to store locally the electricity. Mainly, the hybrid system notices the energetic layer of an MG system while combining this layer with communication and envelope layers presents the MG system concept. The hybrid system of RESs combines several sources connected together with energy storage devices and the utility grid in order to deal with the problem of renewable energy intermittent power. The main objective of this system is to profit from the advantages and the best operational characteristics of each energy source. Generally, a hybrid system of RESs is connected to an energy storage system using an identified interconnection topology. Depending on the location and on the dimensioning of the components, it can be autonomous (standalone) or connected to the TEG (grid-connected). For the MG system, PVs panels, small or medium-sized WTs, and batteries are the most components that are used to provide the power demanded by consumers (Figure 1.13).

<figure><img src="image_17.png" /><figcaption>Figure 1.13. Hybrid system of RESs</figcaption></figure>

The integration of different RESs in a hybrid system, as mentioned above, is a significant approach towards realizing reliable, secure, and efficient electrical power systems for
buildings. However, in order to ensure the proper integration of the hybrid system into buildings and especially in the MG system, different standards and requirements are developed to normalize the usage of this architecture. For example, the standards IEC 61000 and EN 50160 are defined in Europe and IEEE C37.95, IEEE 37.118, and IEEE 1547 in the US (Elmouatamid et al., 2020a). These standards present the principal requirements and criteria concerning the secure integration and protection of the MG system.

### 4.3. MG systems for smart buildings

For our specific definition, the MG systems for smart buildings can be seen as socio-technical systems that integrate different heterogeneous entities (e.g., sensors, actuators, lighting, HVAC, occupants, RES, storages), which could interact dynamically and in a collective manner to balance between energy efficiency, occupants' comfort, sustainability, and the adaptability. More precisely, making buildings more energy-efficient while ensuring occupants' comfort require incorporating mechanisms and techniques, which allow entities interacting in order to perform suitable actions (e.g., turning On/Off HVAC and lighting, balancing the fluctuation between power production and consumption) as shown in Figure 1.14. As stated in (De Florio et al., 2013; Bakhouya et al., 2017; Lachhab et al., 2017a), systems operating in dynamic environments with these capabilities are qualified as socio-technical CAS. These systems should learn and evolve by performing distributed decisions at different temporal and spatial scales while self-organize when entities join or leave the collective (e.g., occupants' number and presence). For instance, platforms for buildings' EM could react to the dynamic changes (e.g., buildings occupants' preference, number, presence) for lowering energy consumption while making occupants' life more comfortable and consequently, increasing the energy efficiency in buildings. Mainly, one of the most important factors that define the “Smart Buildings” is the adaptability. It is defined as the characteristic of buildings to use information gathered from a range of sources to prepare the building for a particular event before that event has happened (e.g., predictive control, occupants forecasting) (Elkhoukhi et al., 2018a). The adaptability allows the differentiation between previous generations of buildings and Smart Buildings. In fact, using IoT/Big-Data technologies, the buildings gather data externally (e.g., weather conditions, RES production) and internally (e.g., occupancy, loads consumption) to adapt its operations depending on the context-awareness principles.
<figure><img src="image_18.png" /><figcaption>Figure 1.14. Energy efficiency and occupants’ comfort metrics (Bakhouya et al., 2017)</figcaption></figure>

The collected data is used to develop ML algorithms that are used to forecast the actions, which are required to perform and operate different buildings' services. For example, the forecast of weather conditions can be used to predict the RESs production, which allows flexible management of energy D/R. In addition, by measuring the energy production/consumption and by forecasting the occupant's activities, the adaptive buildings modify the starting time of temporary end-user services (e.g., washing machine service, cooking service). However, these above-mentioned aspects represent the main factors to develop the concept of "Micro-Grid" systems. It is due to the capabilities of recent ICTs techniques (e.g., ML, IoT) to forecast future events, which are required to develop efficient EM approaches.

## 4.4. International MG standards

The MG concept is relatively new and the regulatory framework is still under development. It should be standardized for being integrated into the existing electrical grid network. In this way, several research groups within the International Electro-technical Commission (CEI) are working on the question of standardizing systems that use renewable energies. The standards consider the power quality (e.g., frequency, voltage, harmonic noise), the components (e.g., inverters, converters), the architecture and design of MG, and the size of the integrated renewable sources (e.g., generated power, low-voltage, medium voltage). In addition, the MG systems should respect the existing electrical norms and their deployments.
Especially, for MG that are connected to the electrical network, the inverter should ensure the electricity quality avoiding then the injection of noise in the utility grid.

### 4.4.1. International standards for distributed energy integration

Realizing specific technical standards are difficult and the standards concerning RESs integration have some differences in different worldwide locations due to the different operational methods, the EM strategies, and the different penetration levels and types of RESs and storage devices. For instance, in the United States, the IEEE-1547 series of standards covers all aspects related to the interconnection of distributed energy resources with the electrical grid. These standards impose requirements on the quality of the energy produced in terms of voltage, frequency, and harmonics. It provides requirements relevant to the interconnection and interoperability performance, operation, testing, safety, maintenance, and security considerations. The first revision of 1547 assembles several participants whose investor affiliations, manufacturers and integrators, test labs, research groups, and academia. The full revision of 1547 issues, concerns, and updates are being coordinated with corresponding standards and codes, such as the Nippon Denki (NEC) and Underwriters Laboratories (UL) safety standards. This full revision included participants from various states, covering all United States regions and some other regions, such as the United Kingdom, Canada, and Japan (Basso, 2014; Gaiceanu, Arama, & Ghenea, 2020; IEEE Standards Association, 2020). Therefore, depending on the MG topologies, buses (Table 1.1), and electricity architectures, different standards are considered, as presented in (Moussa et al., 2019; Yamashita, Vechiu, & Gaubert, 2020).

<table><caption>Table 1.1. Voltage-level standards in DC and AC bus of MG</caption><thead><tr><th>Micro-Grid buses</th><th>Normalized voltage levels</th><th>Micro-grid applications</th><th>Principal standards</th></tr></thead><tbody><tr><td rowspan="3">DC</td><td>48V</td><td>Standalone systems</td><td>IEC-60038 and IEEE-2030.10</td></tr><tr><td>380V-400V</td><td>Grid-connected systems<br>Commercial and industrial buildings</td><td>IEC-60038</td></tr><tr><td>1500V</td><td>Commercial and industrial buildings</td><td>IEEE Std 1709</td></tr><tr><td>AC</td><td>230V and 400V</td><td>MG connected to the TEG</td><td>IEEE-1547</td></tr></tbody></table>

Alike the USA, several works in European Renewable Energy Council (EREC) are urged to improve new integration standards of distributed energy resources. The standardization of the system helps the power system operators to share experiences with manufacturers and
developers in order to internationalize their items and consequently normalize the system for future deployment while avoiding the alteration between electricity participants. The main European standards applicable to MG systems are EN-50160 and IEC-61000.

These standards describe and specify the main characteristics of the voltage supplied by a low-voltage, medium-voltage, and high-voltage AC public network under normal operating conditions. They describe the limits and levels of the voltage characteristics that can be expected at each delivery point of the public network (BUILD UP, 2020; European renewable energy council, 2020; Hannan et al., 2020). Table 1.2 summarizes the United States and European standards that are appropriate to the deployment of MG systems.

<table><caption>Table 1.2. International standards for distributed energy integration in MG systems</caption><thead><tr><td>Standards</td><td>Description</td><td>Standards specifications</td></tr></thead><tbody><tr><td>IEEE-1547 (US)</td><td>Requirements on power quality and distributed energy sources integration in the electrical grid.</td><td>• Integration, protection system design and operation of distributed system.</td></tr><tr><td>IEEE-1547.4 (US)</td><td>It includes the planning and operation of the MG systems (IEEE Standards Coordinating Committee 21, 2020). The SCC21 develops a guide to help the operators, the specialists, and the manufacturers to use the technical aspects of the MG operation and implementation.</td><td>• Control/monitoring and application guide.<br>• Interconnection requirement for distributed system higher than 10 MVA.<br>• Testing and measurement techniques.</td></tr><tr><td>IEC-61850-7-420<br>IEC-61968-9<br>EN-13757-4 & 5</td><td>This series of standards concerns: Communications for distributed energy resources, meter reading and control, radio mesh meter bus, wireless meter bus.</td><td>• Rules and guidelines regarding the connection with secondary distribution networks (Hannan et al., 2020).<br>• Studies on the impact of DES interconnection.</td></tr><tr><td>IEC-60364-1</td><td>Recommendations for human safety, guaranteeing the safety of persons against life dangers, verification of electrical installation of Nominal-Voltages.</td><td>• Recommended practice for establishing procedures and methods.</td></tr><tr><td>IEC-61851</td><td>Electrical vehicle integration in MG, charging station regulations for single-phase (levels up to 250V) and three-phase (levels up to 480V).</td><td>• Ideal grid–consumer connection configurations.<br>• Supply methods and loads considerations.</td></tr><tr><td>IEEE-C37.95 (US)</td><td>It is a guide for grid-consumer interconnection with a number of different protective information. It covers applications involving service to a consumer that normally requires a transformation between the utility's supply voltage and the consumer's utilization voltage.</td><td>• Time tags and synchronization applications.<br>• Verification methods of standards compatibility with measurements.<br>• Phasor Synchronised definition and measurement unit methods.</td></tr><tr><td>IEEE-C37.118 (US)</td><td>Standard for Phasor Synchronization with power system and data transformation for the grid system operating and interconnection.</td><td>• Specify the main voltage characteristics at the PCC in low, medium and high voltages during steady-state operation.</td></tr><tr><td>IEEE-2030.10</td><td>DC energy providers for off-grid system, communication protocols, recommendation for low DC voltage designated to standalone systems.</td><td>• Determine the power frequency, harmonics, voltage unbalance, voltage variation and flicker limits at PCC.</td></tr><tr><td>IEEE-2030.7</td><td>EM system, control level associated to the proper operation, configuration, and regardless topology.</td><td></td></tr></tbody></table>
<table><tr><td>IEEE Std 1709</td><td>Power quality recommendation and voltage tolerances for Medium-Voltage DC bus.</td><td><ul><li>Describe the indicative values for some power quality events.</li></ul></td></tr><tr><td>IEEE Std 115</td><td>Electromagnetic compatibility and regulations about power quality limitations for AC and DC buses.</td><td><ul><li>Electromagnetic compatibility levels.</li></ul></td></tr><tr><td>EN-50160 (Europe)</td><td>It describes and specifies the main characteristics of the voltage supplied by AC public network under normal operating conditions of distribution systems.</td><td><ul><li>Integrity requirements and safety functions.</li><li>Requirements for safety and protection.</li></ul></td></tr><tr><td>IEC-61000 (Europe)</td><td>It contains specifications for Electromagnetic compatibility (emission standards, immunity, installation, testing and measurement techniques), it is required to keep interference between electronic devices under control to reduce disturbance and improve immunity in residential, industrial, and commercial environments.</td><td><ul><li>Short interruptions, voltage sags and voltage variation protection tests.</li><li>Mitigation methods and installation guidelines.</li><li>Progress on constructing high-performance buildings (near-zero energy buildings).</li></ul></td></tr><tr><td>ISO 52000-1</td><td rowspan="3">Standard for energy performance of buildings, which establishes a systematic and comprehensive structure for assessing building energy performance.</td><td rowspan="3"><ul><li>Regulations to define the concept of (NZEB) Net Zero Energy Building.</li></ul></td></tr><tr><td>ISO 52003-1</td></tr><tr><td>ISO 52010-1</td></tr><tr><td>ISO 52018-1</td><td rowspan="2">Efficient thermal energy in MG, important response time for HVAC to respect building thermal-zone standards, such as the estimation of energy needed for heating and cooling.</td><td rowspan="2"></td></tr><tr><td>ISO 52016-1</td></tr></table>

However, despite this progress in deploying MG systems and advancing standards, still their integration into existing and smart buildings requires efficient and holistic management platforms. Especially, the integration of recent IoT/Big-data technologies for real-time monitoring and data processing in order to develop new predictive control approaches, which allow ensuring the sustainability and the reliability of these new energy generation systems.

### 4.4.2. Communication technology used for MG system

The ICTs have a fundamental role in the performance of MG systems operation and its practical deployment. In an MG system, a large number of distributed components, such as the end-users, generators, and energy storage systems, require a reliable, sophisticated, and fast communication infrastructure to reach the mandatory of such systems. Therefore, effective communication systems should be normalized to enable real-time exchange of data in MG systems in order to collect the necessary information used for the EM of the system. Mainly, the communication technologies that are used actually in MG systems can be classified into two categories, wired and wireless technologies. Table 1.3 presents the different communication technologies, which can be used in the MG system with the specified international standards.
<table><caption>Table 1.3. Communication technologies for MG building systems</caption><thead><tr><th></th><th>TYPE</th><th>TECHNOLOGY</th><th>STANDARD</th><th>CONTROL LEVEL APPLICATION</th><th>ADVANTAGE</th><th>DISADVANTAGE</th></tr></thead><tbody><tr><td rowspan="10">WIRED</td><td>Power line</td><td>PLC</td><td>ISO/IEC 14908-3</td><td>Primary and Secondary (Smart home and smart buildings)</td><td>• Easy interfacing and programming<br>• High bandwidth<br>• High reliability</td><td></td></tr><tr><td>Serial</td><td>RS-232, RS-422, RS-485</td><td></td><td>Secondary (Smart home, smart buildings)</td><td>• Robust against cyber attack<br>• Fast rate</td><td>• The number of connected devices is limited to physical connections</td></tr><tr><td>Ethernet</td><td>Ethernet IEEE 802.3</td><td>IEC-61968<br>IEC-61970</td><td>Primary, Secondary, and Tertiary (Smart home, smart buildings, and cities)</td><td>• Less signal degradation<br>• Long life<br>• Fast response and convergence time</td><td>• Expensive implementation<br>• High risk of Single Point of Failure<br>• Difficult to expand the network</td></tr><tr><td rowspan="3">Bus-based</td><td>CANBus</td><td></td><td>Primary, Secondary (Secondary (Smart home, smart buildings))</td><td>• Can handle extensive data<br>• Remote terminal units (RTU) connection is possible</td><td>• Repeater required for long distance<br>• Difficult in error debug</td></tr><tr><td>Modbus</td><td></td><td>Primary, Secondary (Smart home, smart buildings)</td><td></td><td>• Skilled operator is required</td></tr><tr><td>Profibus</td><td>IEC61850</td><td>Primary, Secondary, (Smart home, smart buildings)</td><td>• Preferred for centralized EM systems</td><td></td></tr><tr><td>SCADA</td><td>PLC RS Ethernet IEEE 802.3</td><td>IEEE STD. 1815-2012, IEEE 60870</td><td>Primary, Secondary, and Tertiary (Smart Microgrids, Smart buildings)</td><td></td><td></td></tr><tr><td rowspan="10">WIRELESS</td><td rowspan="5">WLAN</td><td>Wifi</td><td>IEC61850</td><td>Primary, Secondary, and Tertiary (Smart home, smart buildings, and cities)</td><td>• Less interference<br>• Can serve multiple services connectivity</td><td>• Not robust against cyber attack<br>• High power consumption</td></tr><tr><td>Lifi</td><td>IEC61850</td><td>Primary, Secondary (Smart home, smart buildings)</td><td></td><td></td></tr><tr><td>Bluetooth</td><td>IEEE 802.15.1</td><td>Primary (Smart home)</td><td>• Less interference<br>• Cost-effective</td><td>• Not robust against cyber attack<br>• Less privacy<br>• Lower bandwidth<br>• Short transmission range</td></tr><tr><td>ZigBee</td><td>IEC-61968<br>IEC-61970</td><td>Primary, Secondary (Smart home, Smart buildings)</td><td>• Self-organization property<br>• Self-healing property<br>• Large number of devices can be connected</td><td>• Not robust against cyber attack<br>• Less privacy<br>• Low transmission rate</td></tr><tr><td>WiMax</td><td>IEEE 802.16j/m</td><td>Primary, Secondary, and Tertiary (Smart home, smart buildings, and cities)</td><td>• Suitable for AMI<br>• Suitable for centralized and decentralized structure</td><td>• High installation cost<br>• Interference problem is affected by weather<br>• Not robust against cyber attack</td></tr><tr><td rowspan="2">Cellular networks</td><td>3G</td><td rowspan="2">IEC61850</td><td>Primary, Secondary (Smart cities)</td><td>• Easy upgrade<br>• Handy in nature</td><td>• Higher initial cost<br>• Vulnerable in nature</td></tr><tr><td>4G</td><td>Tertiary (Smart cities)</td><td>• High bandwidth compared to other</td><td></td></tr></tbody></table>
<table><tr><td></td><td></td><td>5G</td><td>Tertiary (Smart cities)</td><td>wireless technologies<br/>• Adaptable to automation applications</td></tr></table>

The common standard, which is used for power system automation and communication technologies in MG systems, is the IEC-61850 standard (Dede et al., 2016). It is an international standard for substation automation and a part of the International Electrotechnical Commission's Technical Committee 57 (TC57) architecture for electric power systems (Parhizi et al., 2015). Its main benefit is to guarantee a normalized communication structure among MG systems. The standard describes the exchange information and the data-frame structure in an MG system communication. The family of this standard results in improvements in both costs and the performance of utility grids. Therefore, the communications systems in MG provide a means to exchange information and monitor the different elements for control and protection purposes.

## 4.5. MG system architecture

The main advantage of MG is to enable customers to have both a bidirectional communication platform and control devices to manage their energy needs and excesses. In addition, with an adequate communication structure, it is possible to shape the users' load demand curves by means of D/R strategies. The MG is considered as a solution to meet the local energy demand by connecting distributed power generation to distribution networks, such as local substations without further expansion of costly centralized utility grids. Therefore, the architecture of a hybrid system of RES is an important issue that needs to be considered when the different sources are deployed together in order to supply the power to the loads. Different topologies can be defined depending on the nature of the delivered energy AC or DC, and the nature of the loads to be supplied. Generally, they are three main configurations, which are DC/Bus configuration, AC/Bus configuration, and AC/DC configuration. In fact, according to the integration of this hybrid system, different studies have been focused to improve the control strategies for optimal EM in the MG (Kenzelmann, 2012; Veneri, 2017). The study of a control strategy must begin with a study of the interconnection architecture of the sources and the AC/DC bus installation.

### 4.5.1. DC bus topology

In DC common bus topology, all energy generators and storage devices of the system are connected to a DC bus through the appropriate electronic converters (AC/DC, DC/DC).
Generally, it is used when the power is generated and consumed locally without transport or distribution network, which is the case for the MG. In this type of topology, the phase and frequency control is not considered and the transmission system is stable. Additionally, the frequency and voltage synchronization and reactive power management issues are eliminated making the operating system easier than that in the AC. In fact, batteries are the main element of the DC bus and act as a buffer element, for current peaks, and for short-term energy storage. For that, a charge controller is used to generate the power to the batteries. Mainly, in this architecture, the system supplies the power to the loads by a centralized inverter and the energy flow is bidirectional (Figure 1.15). When it is needed, the electrical network is connected separately to the loads. This configuration offers more flexibility for controlling each generator.

<figure><img src="image_19.png" /><figcaption>Figure 1.15. The DC topology</figcaption></figure>

However, the RES output power is typically DC power, which should be converted into AC power to supply the electricity to the existing AC loads. Consequently, the AC/DC/AC energy conversion for some generators leads to low efficiency and power losses. Usually, the power is transmitted to the batteries before the conversion to AC power. For that, the batteries must have a large capacity and they are constantly subjected to C/D cycles. In addition, one interface is linked to the AC loads and a failure of the inverter causes a total cut of the electrical supply. To avoid this problem, multiple synchronized inverters should be installed, which increases the installation cost.
### 4.5.2. AC bus topology

The AC bus topology is the main solution, which is used actually in electrical systems. In this topology, all energy generators and storage devices of the system are connected to an AC bus through the appropriate electronic inverter (AC/AC, DC/AC) (Figure 1.16). This solution is more suited for the large transport and distribution network due to the low loss of energy during the transport phase for a long distance. Due to the distributed nature of the power generators in the TEG, and due to the necessity to transport the energy to consumers, this choice is judicious.

In this topology, the interconnection point with the electrical network requires the use of special and expensive equipment to connect the RES with the main utility grid, which is known as the Point of Common Coupling to adapt the high and medium or low voltage lines. Generally, a three-phase AC bus is commonly employed as the point of common coupling. On the other hand, in some cases, AC must be reconverted to DC because some equipment uses DC power. In addition, the voltage and frequency of the AC topology must be regulated in very strict limits in order to ensure the stable operation of the whole system.

<figure><img src="image_20.png" /><figcaption>Figure 1.16. The AC topology</figcaption></figure>

### 4.5.3. DC/AC coupling topology

The DC/AC coupling configuration has higher performance compared to the previous configurations. In this configuration, RESs generators can supply the power directly to the AC loads using an inverter. At the same time, these sources are connected to the batteries for
eventually storing extract energy. In fact, when there is a surplus of energy from RESs, it can charge the batteries or inject them in the TEG. Also, the bidirectional inverter can supply the loads or charge the batteries depending on the deployed control strategy. This topology does not require RESs and energy storage dimensioning due to the possibility to inject or to extract, partially or totally, the energy to the TEG, which increases the system efficiency and reduces the installation cost. For high performances of the system, this topology is used and generally, the DC bus is used for coupling the RES inside the MG system together with the storage system while the AC bus is used to interconnect the whole MG to the TEG as depicted in Figure 1.17.

This configuration allows connecting each generator or loads (DC or AC) to the corresponding bus, then to exchange the power between the buses by a bidirectional DC/AC inverter. However, by comparing the conversion efficiency, the DC bus is more efficient than the AC bus when energy storage is involved in power flow due to fewer conversion levels. For example, for a PV generation to the battery charging case, the power in an AC Bus is converted through DC/DC to DC/AC in order to reach the AC bus, and it is converted through AC/DC charge controller for the storage process. Therefore, the DC bus eliminates these losses, which are caused by DC/DC, DC/AC, and AC/DC conversions. Moreover, for the transmission efficiency, a significant feature of DC transmission is planned, especially for MG systems installation, because there is no reactive power and as result, the transmission losses, caused by reactive power in AC systems, are eliminated. In addition, the same amount of real power delivered by a DC line tends to produce less copper loss than AC over the same line resistance (Veneri, 2017). For an AC power line, the voltage amplitude and the frequency angle should be regulated simultaneously. Consequently, as the AC grids are three-phase systems, sophisticated techniques should be employed to manage the unbalanced components (voltage, frequency), which principally come from the vast adoption of single-phase of the MG equipment and loads in a low voltage power system. Unlike the AC power system, for DC power, a constant DC voltage can ensure the stability of the installation. These essential factors indicate better controllability for DC MG systems over AC.
<figure><img src="image_21.png" /><figcaption>Figure 1.17. DC/AC coupling topology</figcaption></figure>

## 4.6. Operational modes of Micro-grid system

MG systems are designed to operate efficiently and resiliently since they are not only dedicated to a high penetration level of RESs and storage systems but also due to their capability to operate in isolated mode when RESs can satisfy the demand or during the faults, which occur in the main electrical network. Therefore, MG systems offer greater reliability and efficiency for the electrical network system, especially by locally controlling the generated power while improving the energy quality, as well as smoothing the power curve by the deployed storage devices. In addition, the losses of energy, which are caused by the transport and distribution system to the end-consumer, are reduced and, consequently, the blackouts of electricity, created by the peak demand, can be avoided.

<figure><img src="image_22.png" /><figcaption>Figure 1.18. The MG system operating modes</figcaption></figure>
However, MG systems are operated, as shown in Figure 1.18, into two distinctive modes: grid-connected and islanded modes (Guimaraes, 2020). Other literature works consider another mode, named self-consumption mode, by controlling buildings' services, i.e., identifying those that can be connected to the main grid (Bridier, 2016).

### 4.6.1. Isolated mode

For isolated mode, named standalone mode, the RESs production and storage devices are dimensioned in order to satisfy totally the demand. Generally, another source is integrated, such as diesel motors, to satisfy the demand during the low or the absence of RESs generation. This mode is useful in critical applications, such as the isolated site that requires a high cost for electricity transport and distribution. For isolated sites, it is necessary and practical that the hybrid system has total autonomy requiring the use of storage systems not only to smooth the variable nature of RESs but also to ensure the power availability and the continuous supply of energy. However, energy storage represents a very significant part of the cost and maintenance of the MG installation, and the lifetime of storage devices is much lower than PV panels, the WT, and the converters. For that, good strategies are required for sizing the storage devices and the RESs generation. Several works are presented in the literature to dimension the optimal configuration for isolated sites according to the weather conditions including technical and economic characteristics of all specific MG components (Abbes, 2012; Aristizábal et al., 2019; Mekontso et al., 2019; Al-Ghussain et al., 2020). In addition, the island mode is studied in various research projects of MG systems (Nichols et al., 2006; Bellido et al., 2018). The specific standards IEEE Std 1547.4-2011 is the only international reference for MG systems, which are operating in island mode (IEEE, 2011).

### 4.6.2. Grid-connected mode

Unlike isolated mode, the grid-connected mode is considered as the major key for RESs integration in buildings in order to develop the concept of “Smart Grid” and consequently the MG systems. A real MG system is connected to the electrical network to increase the reliability of the production system and to realize the main objective of such systems. This mode offers a high benefit for both energy and financial cost by reducing the size of the installation (e.g., battery capacity, number of PV panels) on the one hand, and by integrating the cost of energy in the management strategies on the other hand. In fact, the majority of hybrid systems, connected to the electrical grid, have a limited capacity of energy storage systems that are used to reinforce the power quality and to smooth the RESs generation. In
this case, they are dimensioned to ensure the power during the failure of TEG or during the
perturbed RESs production periods, and as results minimizing the size of storage devices.
However, the architecture of MG connected mode necessitates certainly the inclusion of
inverters, both to convert, when necessary, from direct to alternating currents and to provide
some level of frequency and voltage control as well. Principally, the inverter is the interface
that provides the interconnection to the electrical network by respecting the norms of power
quality (e.g., frequency, voltage) and by deploying the EM strategy. Moreover, the inverter
supplies the power to the loads offering then the possibility to charge the storage systems, to
extract or inject the electricity from/to the electrical network, and to serve potentially
heterogeneous sources without loss of synchronization, propagation of harmonics, or loss of
system stability.

It is worth noting that we have considered the connected mode of MG systems as the
main architecture of our deployed MG system. This mode is more adaptable for the actual
structure of buildings by offering the possibility to develop the actual building as an MG
system. This issue is studied by a set of research projects and several testsite are deployed by
considering the connected mode of MG systems (Hirsch, Paraga, & Guerrero, 2018; Castro,
2020; Energy Networks Australia, 2020; Microgrid Knowledge, 2020).

4.6.3. Self-consumption mode

Another mode, named self-consumption, depends strongly on the concept of “internet of
services” in buildings by coupling the two other operating modes. It requires a high
integration of ICTs and IoT/Big-Data technologies to predict and control efficiently the
different components and services of the system. In fact, by deploying ML algorithms, the
internal and external parameters can be forecasted to control and manage powerfully the
power system (i.e., production, consumption) while keeping a high comfort for the building’s
occupants. Mainly, in MG systems, the services can be decomposed into three main
categories: i) permanent end-user services, its energetic assignment plan covers the whole
time range; generally, these services produce directly comfort to occupants; ii) temporary end-
user services, the time range of these services can be modified by the EM system (e.g.,
modification of the starting time of a washing machine service, cooking service); iii)
intermediate services, which produce electrical power to the whole end-users by managing the
previous end-user services with the energy production services (e.g., RES, storage devices,
grid).
Therefore, the self-consumption mode modifies the starting time of temporary end-user services (e.g., electrical vehicle C/D, washing machine service, cooking service) and the buildings can be supplied by electricity from both RESs and electrical network at the same time. In addition, in a given situation, the control strategy can switch some services that consume a high level of energy to the electrical network while keeping the RESs connected only to defined building's loads. This operating mode is more useful to ensure a continuous supply of electricity to some principal services that are not designed to support the cut of electricity (e.g., data-center, networking equipment, IoT/Big-Data platforms). Data centers are considered as one of the best examples of an industry with relatively established plans for the blackouts of electricity. For example, the Great East Japan Earthquake on March 11th 2011 killed more than 15 000 people, destroyed 4 nuclear generation plants, and left several million people without electricity and no critical damage to data centers were reported (International Electro-technical Commission, 2014). Furthermore, by coupling the IoT, IoE, and IoS concepts, the household equipment can interact with EM strategies in order to minimize the cost of energy while avoiding the cut of electricity during the failure of the energy sources. For example, by considering the electrical vehicle as a service in the building, the control strategy can use its battery as a source of energy during the night by considering that the electrical vehicle is a smart service, which can communicate its SoC and its targets to the communicated system (Veneri, 2017). Different literature works are realized to develop this new concept of service control in buildings (Basu et al., 2011; Tsiatsis et al., 2018; Kabalci & Kabalci, Y, 2019; Birleanu & Bizon, 2020).

**5. System optimization and control constraints in MG systems**

The main constraint for MG system is being able to supply, as much as possible, the energy demanded by consumers from renewable sources. The control strategy should be able to smooth the large variations of energy production and consumption, while keeping a good state of health of the energy storage with high service quality. For that, two main aspects must be considered to deploy the control approaches and to improve the system operation: i) the EM, which includes decisions and actions related to the energy flow and cost for a scale of several minutes, hours, or days; ii) the control for energy quality and power maximization for a scale of the second or millisecond and it concerns frequency/voltage stability and power maximization for the different installed sources (e.g., PV, wind). The main objective is the development of an intelligent EM strategy for EM, towards smart MG systems.
Therefore, one of the main constraints is the optimization criterion that should be considered to minimize the cost of the kilowatt-hour (kWh) of electricity production. In this type of criterion, the initial equipment costs are not the only parameters that should be considered. The studies of this criterion take a long time to be analyzed during the lifetime of the system by considering the different parameters that can influence the installation cost. The global costs over the lifetime of the installation are also considered, including future maintenance, the electricity costs, the replacements of certain parts of the system (e.g., batteries, regulators). Principally, the calculation of the life-cycle cost for the system is an economic calculation form, which allows a direct comparison of various and envisaged solutions. However, to establish a valid study of the cost optimization, the analysis period is the longest lifetime of the system operation. During this time, different criteria are considered: i) initial investment/capital including the buying of equipment and installation of the system; ii) maintenance and operation, some maintenances are necessary each year for a good operation of the system; iii) the cost of electricity including the price spent annually to supply electrical power from the TEG; iv) replacement costs of each component having a shorter service life than the whole system.

In another case, system dimensioning has an important role in cost optimization. In fact, some studies considered that the dimensioning of the equipment (e.g., PV panels, batteries) in order to have an autonomous system is the main key to increase the profitability of the installation. Practically, it is more profitable when an intelligent and predictive control strategy is deployed. For example, it is possible to install a high number of PV panels and batteries to have an autonomous system and, consequently, a high installation cost. The work presented in (Stoyanov, Notton, & Lazarov, 2007) showed that it is not desirable to configure the system with a storage capacity greater than three days of autonomy because beyond this value the impact of increasing the capacity becomes negligible. However, it will be more profitable by deploying a control strategy for EM to make switching decisions that consider the electricity cost and the C/D battery cycle. An intelligent and predictive control strategy can manage the system in order to plan the optimal consumption period. For example, the control strategy could charge the batteries when the electricity price is cheap for being used during morning peak consumption. Furthermore, when the price is expensive the batteries could be discharged by supplying the power to consumers while the surplus can be injected into the grid. The next chapter presented a state of the art of the main control approaches that are used for EM in MG systems. A comprehensive description of control and optimization
methods is highlighted, particularly to identify the most common and effective method for
EM in MG systems.

**6. Conclusions**

Demand for electricity is increased due to the development of the industry, the electrification of transport, the rise of household demand, and the increase in demand for digitally connected devices and air conditioning systems. For that, solutions and actions should be developed for higher consumers of the electricity with the aim to minimize the electrical energy demands. For instance, buildings are one of the main consumers of electricity and if they are correctly constructed, controlled, and operated, a significant energy saving can be attained. One of the main solutions to minimize the energy demanded from the utility grid is RESs integration. In this chapter, actual statistics for energy demand are presented together with the principal problems encountered in the TEG. As a solution, a hybrid RESs system is proposed to reduce or eliminate the problems caused by the transport and the destruction of electricity in TEG. This hybrid system contains different renewable generators connected to energy storage systems. It allows producing locally a part of energy in order to minimize the consumption from TEG. The different components of the system are detailed and the main topologies for RES interconnection are presented especially for the MG systems. However, the management of these hybrid systems of RES requires the use of information and communication technologies (ICT) for developing intelligent control strategies. The integration of hybrid RESs system with ICT infrastructures allowed the emergence of the new concept named micro-grid (MG). Therefore, control approaches should be developed for the reliable and efficient operation of MG system. The use of ICT in the MG system allows the deployment of intelligent and predictive control strategies, which can predict the suitable actions to balance the Demand/Response of electricity by considering multiple objective functions and constraints. These control approaches can be deployed to manage the energy in the MG system in order to keep a high service quality for consumers and the maximum profitability of the systems.
# Chapter 2: Review of Control and Energy Management Approaches in Micro-Grid Systems

## 1. Introduction

Proper management of energy flow in the MG system must be carried out in order to improve the global performances of the system, to minimize the cost of the electrical bill, and to extend the lifetime of its components (e.g., converters, batteries, fuel cells). In general, EM approaches involve an objective function, which could be used to maximize the efficiency of the hybrid RES system and to minimize energy consumption while improving the consumers’ quality of services. For instance, an EM control strategy that considers only the availability of the electricity can be developed to switch, at each time, from RES to storage devices or to the TEG without considering the electricity price or the profitability of the system. In other cases, control strategies can interact with the generators by limiting the power generation. The aim is to ensure the electrical quality of services and, consequently, minimize the profitability of the installation. However, despite that these strategies could reach the defined objective, they might decrease the performance of other criteria like batteries’ lifetime, the system’s installation cost, and profitability.

Actual commercial inverters provide high-performance energy balance by interconnecting RESs, energy storage systems, and the utility grid, by taking into consideration only a single-objective function. This later is mainly implemented in order to increase the availability of the electricity for building’s loads. With a limited configuration, the inverter can use batteries or the TEG at any moment without taking into account other constraints, such as the electricity cost and the C/D cycle of the batteries. For instance, high and frequent cycles of C/D of batteries could decrease their performance, while reducing the system’s profitability. EM strategies that are deployed in the actual inverters use “if-else” statements to perform real-time decisions. For instance, the defined setpoint values (i.e., control inputs) cannot be adjusted according to predictive variations of RESs production, load demand, and battery SoC. Such EM strategies are considered as “passive strategy” in their decisions and actions (Higuita, 2017). Control strategies incorporating multiple-objective functions are, therefore, required for efficient EM (i.e., ensuring electricity availability) while taking into consideration operational constraints (e.g., costs, reliability, and flexibility). In fact, “active strategies”, for EM should be developed in order to adapt the setpoint values accordingly. These strategies could use intelligent and predictive control techniques together
with recent IoT/Big-data technologies (e.g., data monitoring, data analysis, data mining, ML) for efficient EM in hybrid RESs systems. In this chapter, control structures and strategies, from literature, are presented by highlighting their advantages and drawbacks in the context of MGs for smart buildings.

## 2. Control architectures

In hybrid energetic systems or MG systems, distributed and hybrid RESs generators (e.g., PV panels and WTs) are used to produce clean energy (e.g., solar, wind) while energy storage systems are installed to compensate the fluctuation between RESs generation and load consumption. These hybrid systems can operate either on grid-connected or standalone modes depending on desired and fixed objectives. However, while the penetration of these distributed generators is continuously growing, new EM approaches are required for their seamless integration within the existing electricity network. Table 2.1 presents recent literary works concerning the deployment of hybrid systems. As highly stated in Table 2.1, batteries are the most used devices for energy storage.

<table><caption>Table 2.1. Survey through collection of EM for hybrid MG system</caption><thead><tr><th>Ref</th><th>Grid</th><th>DG</th><th>PV</th><th>WT</th><th>Biomass</th><th>FC</th><th>Hydrogen</th><th>Battery</th><th>Diesel</th><th>Super-capacitor</th><th>EV</th></tr></thead><tbody><tr><td>(Indragandhi et al., 2018)</td><td></td><td>✓</td><td>✓</td><td>✓</td><td></td><td>✓</td><td></td><td>✓</td><td></td><td></td><td></td></tr><tr><td>(Zhang et al., 2018)</td><td></td><td></td><td>✓</td><td>✓</td><td></td><td>✓</td><td></td><td>✓</td><td></td><td></td><td></td></tr><tr><td>(Ghaffari & Askarzadeh, 2020)</td><td></td><td>✓</td><td>✓</td><td></td><td></td><td>✓</td><td>✓</td><td></td><td>✓</td><td></td><td></td></tr><tr><td>(Dali et al., 2010)</td><td>✓</td><td></td><td>✓</td><td>✓</td><td></td><td></td><td></td><td>✓</td><td></td><td></td><td></td></tr><tr><td>(Zhang et al., 2020)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>✓</td><td></td><td>✓</td><td>✓</td></tr><tr><td>(Chandan et al., 2020)</td><td></td><td></td><td></td><td></td><td></td><td>✓</td><td></td><td>✓</td><td></td><td>✓</td><td>✓</td></tr><tr><td>(Sandgani & Sirouspour, 2017)</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td></td><td></td><td></td><td>✓</td><td></td><td></td><td></td></tr><tr><td>(Zheng et al., 2018)</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td></td><td></td><td>✓</td><td></td><td></td><td></td></tr><tr><td>(Lin et al., 2016)</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td></td><td></td><td></td><td>✓</td><td></td><td></td><td></td></tr><tr><td>(Li, Roche, & Miraoui, 2017)</td><td></td><td></td><td>✓</td><td></td><td></td><td>✓</td><td>✓</td><td>✓</td><td></td><td></td><td></td></tr><tr><td>(Mazzola et al., 2015)</td><td></td><td></td><td>✓</td><td>✓</td><td>✓</td><td></td><td></td><td>✓</td><td></td><td></td><td></td></tr><tr><td>(Rabiee et al., 2016)</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td></td><td>✓</td><td></td><td>✓</td><td></td><td></td><td>✓</td></tr><tr><td>(Dash & Bajpai, 2015)</td><td></td><td>✓</td><td>✓</td><td></td><td></td><td>✓</td><td></td><td>✓</td><td></td><td></td><td></td></tr></tbody></table>

Therefore, the deployment of an EM approach should be able to enhance the dynamic response of distributed energy resources under different operating conditions and maximize
the usage of RESs power generation, while ensuring stability when one or more sources are connected or disconnected into/from the system. In this way, different approaches from the literature have been proposed for EM (Table 2.2). As shown in this Table, the most suitable control strategies could be selected according to fixed constraints and objective functions. These control strategies can be classified into three main categories: centralized, decentralized, and hierarchal control, as mentioned in Figure 2.1. These control strategies are presented in the rest of this section.

<table><caption>**Table 2.2. Hybrid system control overview, approaches and contributions**</caption><thead><tr><td>Ref</td><td>Main objective</td><td>EM approach</td><td>MG scale</td><td>Control structure</td></tr></thead><tbody><tr><td>(Elkazaz et al., 2020)</td><td>Authors present an EM system to minimize the daily operating cost of an MG and maximize the self-consumption of the deployed RES by selecting the best setting for a central battery storage system based on a defined cost function.</td><td>Convex Programming, Model Predictive, and Rolling Horizon Predictive Control</td><td>Medium</td><td>Hierarchical</td></tr><tr><td>(Ghaffari & Askarzadeh, 2020)</td><td>A method is developed to size an off-grid PV/diesel/FC hybrid energy system in order to optimize the number of system components with respect to the cost minimization of the installation.</td><td>Crow search algorithm</td><td>Large</td><td>Hierarchical</td></tr><tr><td>(Kuznetsova et al., 2015)</td><td>An analysis of EM system of an MG using a robust optimization taking the uncertainties of wind power and solar power generations and energy consumption into consideration.</td><td>Agent-based modelling</td><td>Large</td><td>Decentralized</td></tr><tr><td>(Zhang et al., 2018)</td><td>A methodology for modeling and optimally sizing a hybrid system for renewable energy considering two energy storage devices: hydrogen and batteries.</td><td>Wavelet transform, Neural network and FL</td><td>Large</td><td>Not specified</td></tr><tr><td>(Zheng et al., 2018)</td><td>A deterministic constrained optimization and stochastic optimization approaches to estimate the uncertainties in biomass-integrated MG supplying both heat and electricity. The work developed an economic linear programming model with a sliding time window to assess design, scheduling of biomass-combined power and heat based MG systems.</td><td>Linear programming model with a sliding time window</td><td>Small</td><td>Decentralized</td></tr><tr><td>(Lin et al., 2016)</td><td>An MG energy management strategy by considering RES integration into the distribution network. The time-of-use, other technical constraints, and an enhanced bee colony optimization is proposed to solve the daily economic dispatch of MG systems.</td><td>Enhanced bee colony optimization</td><td>Small</td><td>Centralized</td></tr><tr><td>(Aghdam et al., 2018)</td><td>A method known as contingency-based EM for system of MGs. A stochastic optimization is proposed according to various scenarios of the</td><td>Contingency-based EM</td><td>Large</td><td>Hierarchical</td></tr></tbody></table>
<table><tr><td></td><td>contingencies.</td><td></td><td></td><td></td></tr><tr><td>(Arcos-Aviles et al., 2017)</td><td>A fuzzy EM approach is deployed to smooth the power flow of an MG containing heat and power unit. The aims is to use the surplus of electrical power of the MG for storing in electrical energy storage systems and ensuring the water temperature of the thermal storage system in the desired value in order to supply residential buildings.</td><td>Fuzzy energy management strategy</td><td>Medium</td><td>Not specified</td></tr><tr><td>(Sandgani & Sirouspour, 2017)</td><td>An EM method is deployed in an MG system containing energy storage devices and renewable energy based distributed generators in grid-connected MG. In the studied approach, the neighboring MG share the capacity of their distributed resources and energy storage devices aiming at reducing the operational costs.</td><td>Lexicographic programming, Linear programming, Receding horizon control</td><td>Large</td><td>Hierarchical</td></tr><tr><td>(Marzband et al., 2016)</td><td>An algorithm for EM system of an MG using multi-layer ant colony approach pointing on determining the optimum point of operation for local distributed energy generation with least electricity production cost. The studied algorithm has the capability of analyzing the constraints related to economic and technical aspects of the problem.</td><td>Multi-layer ant colony approach</td><td>Medium</td><td>Not specified</td></tr><tr><td>(Olivares et al., 2014)</td><td>A model predictive control technique to determine the optimal operation of the MG system using an extended horizon of evaluation and recourse. The EM problem is decomposed into Unit Commitment and Optimal Power Flow problems in order to avoid a mixed-integer non-linear formulation.</td><td>Model predictive control</td><td>Large</td><td>Centralized</td></tr><tr><td>(Li, Roche, & Miraoui, 2017)</td><td>Authors proposed a combined EM and sizing methodology, formulated as a leader follower problem. The leader problem focuses on sizing and aims at selecting the optimal size for the MG components. The problem is solved using a genetic algorithm and the follower problem is formulated as a unit commitment problem and is solved with a mixed integer linear program.</td><td>Mixed integer linear program</td><td>Small</td><td>Centralized</td></tr><tr><td>(Dash & Bajpai, 2015)</td><td>Authors proposed an EM approach to divert excess energy of PV to the electrolyzer.</td><td>Linear Programming</td><td>Small</td><td>Centralized</td></tr><tr><td>(Helal et al., 2017)</td><td>The operating cost of MG is minimized, while considering droop controlled active and reactive power dispatch of AC side MG as a constraint.</td><td>Mixed integer nonlinear programming</td><td>Small</td><td>Centralized</td></tr></table>
<figure><img src="image_23.png" /><figcaption>Figure 2.1. Control structure for energy management in MG systems</figcaption></figure>

## 2.1. Centralized control

Centralized control approaches use a single CC, which is characterized by a high performance computing unit and secure communication infrastructure in order to manage different entities of the system (e.g., RESs, Storage systems, TEG). Each entity uses an LC in order to communicate and directly interact with the CC. Moreover, by using recent communication and computing technologies (e.g., IoT, Big-Data), the CC is able to monitor, collect, and analyze in real-time data. This allows all entities to collaborate with the central EM controller while ensuring a flexible MG operation in both grid-connected and standalone mode (Figure 2.2). The CC collects data, such as RESs energy production, energy consumption pattern, the energy price from market operators, and weather condition and then executes the optimal and efficient system’s control. Numerous research works, for literature, have developed and deployed centralized EM strategies. For instance, in (Tsikalakis & Hatziargyriou, 2007), authors proposed a centralized controller in order to optimize the operation of MG by maximizing the production of distributed RESs generators while establishing energy transfer back and forth with the main utility grid. The efficiency of the proposed solution on the MG system is investigated by considering a typical case network operating under various market policies and spot market prices.

Moreover, authors in (Olivares et al, 2014) developed a centralized EM system for a standalone MG system based on model predictive control method in order to reduce the
computational loads. In fact, the studied problem is solved iteratively by NLP and MILP techniques. Other centralized control strategies are summarized in Table 2.2. However, despite that centralized strategies are easy to implement, they showed their limit, especially when dealing with large-scale hybrid systems (Warnier et al., 2017).

<figure><img src="image_24.png" /><figcaption>Figure 2.2. Centralized control structure</figcaption></figure>

## 2.2. Decentralized control

Unlike centralized strategies, in decentralized control, each entity is considered autonomous by using an LC. This means that groups of entities are controlled separately by a leader. In literature, the terms decentralized and distributed controls are often used in place of each other (Kermani et al., 2020; Yamashita et al., 2020). The distributed control can be considered as a decentralized control in which LCs use local measurements, such as frequency and voltage values, to elect the leader entity. They are also allowed to share information with neighbors. For a distributed control, LCs do not only use local measurements but also are able to send and receive the required information to other LCs (Pourbabak et al., 2019). In decentralized control approaches, limited local connections are required and the control decisions are made based only on local measurements (Figure 2.3). It does not require a high-performance computing unit and high-level connectivity (Senjyu et al., 2005).

As depicted in Figure 2.3, each LC operates individually on managed energy sources, storage systems, and loads without central control. The control decisions are determined locally based on local measurements, which are shared among controllers using peer-to-peer communication. However, monitoring, processing and data visualization is considered critical in order to coordinate various distributed controllers and then achieve a global operation goal.
<figure><img src="image_25.png" /><figcaption>Figure 2.3. Decentralized control structure</figcaption></figure>

This process is standardized by the norm IEC-61968 for a single building EM system and by IEC-61850 for interoperability between building MG systems (Liu et al., 2016; Aftab, Hussain, & Ali, 2019). Depending on the communication network availability, the decentralized control can be classified into three operation modes: i) fully dependent, in which the distributed controllers generate local control decision while communicating information with each other via a CC, ii) partially independent operation mode, in which LCs communicate with each other and share information with the CC in order to generate central decisions, iii) fully independent operation mode, in which the distributed controllers communicate directly with each other and independently from the CC (Celik et al., 2017). However, despite the flexibility of these operational modes, the decentralized control structure presents low performances compared to centralized control (Feng et al., 2017; Espín-Sarzosa et al., 2020; Rathor & Saxena, 2020; Yamashita et al., 2020). This is due to the low response time and the incomplete information about the total MG system installation.

## 2.3. Hierarchical control

Hierarchical control is mainly proposed for SG systems. In fact, the extended geographic areas of these systems, the extensive communication and computation requirements made the implementation of fully centralized approaches a difficult task. At the same time, the higher coupling between the different LCs requires a maximum level of coordination, which cannot
be achieved by decentralized control structures. However, a compromise between the fully centralized and decentralized control structures is realized by providing hierarchical control structures (Molzahn et al., 2017; Van et al., 2020), according to three control levels: primary, secondary, and tertiary, as depicted in Figure 2.4.

<figure><img src="image_26.png" /><figcaption>Figure 2.4. Hierarchical control structure</figcaption></figure>

The primary control level stabilizes the voltage and frequency generated from each source in order to respect the limits required by the standards (Elmouatamid et al., 2020a; Elmouatamid et al., 2020b; Gaiceanu et al., 2020). In addition, the primary control level detects the operating mode of MG systems offering then the ability to operate in grid-connected and standalone modes (Prabaharan et al., 2018). For the secondary control level, the MG voltage and frequency are restored after the system's load variation. The aim is to ensure and enhance, within the required standards values, the power quality. It allows the synchronization between the MG systems and the main electrical network (González-Romera et al., 2020). The main objectives of tertiary control are the power flow control in the grid-connected mode, ensuring the optimal operation in both modes like capacitance and inductance (Guerrero et al., 2012). Figure 2.5 includes the structures of each level of the hierarchical control. The control levels differ in the response time frame speed in which they operate as well as the infrastructure requirements, especially for the communication, which is normalized by the standards IEC-61850-7-420 and EN-13757-4 (Elmouatamid et al., 2020).
<table><caption>Table 2.3. Control architectures for hybrid system, advantages and inconveniences</caption><thead><tr><th>Control structure</th><th>Advantages</th><th>Inconveniences</th></tr></thead><tbody><tr><td>Centralized</td><td><ul><li>Strong controllability and real-time observability of the whole MG system;</li><li>Provides strong supervision and wide control of the whole system;</li><li>Mature and established approaches for control of many systems;</li><li>Suitable for small size MG systems where the collected information is performed by low bandwidths communication (Sahoo et al., 2017);</li><li>Suitable for the internal control in MG system;</li><li>Global optimization of all entities of the same MG;</li><li>Offers high-performance computing unit and a secure communication infrastructure;</li><li>Holds the control strategy that considers the MG entirely; it depends on the simple architecture of the system to build a global knowledge making the EM control easier to be deployed;</li><li>Straightforward implementation, the CC allows economic implementation and it is easy to maintain;</li><li>Optimal decision is guaranteed.</li></ul></td><td><ul><li>The failure of the CC affects the whole system operation;</li><li>Heavy computation burden is a technical barrier for the deployment;</li><li>Not well designed to support plug-and-play functionalities of a large number of entities;</li><li>Need a high level of connectivity due to the direct interaction of each entities with the central;</li><li>Requiring high processing unit for the CC;</li><li>More prone to failures since only one unit regulates the voltage and leads to reduce life spam of Battery bank stack (Kumar et al., 2019);</li><li>Poor scalability and responsible for shorter battery life (Cupelli et al., 2016);</li><li>Since all information is collected and handled at one CC, the computational burden increases making the control less effective for real-time communication requirements;</li><li>Reliability is degraded for the whole system.</li></ul></td></tr><tr><td>Decentralized</td><td><ul><li>Distributed processing system with autonomous control capability;</li><li>Peer-to-peer nodes communication, allowing greater flexibility of operation, and avoiding single-point failure;</li><li>Higher reliability due to the redundancy of controllers and communication;</li><li>Distributed generators are controlled by independent controllers through their local variables offering redundancy communication link;</li><li>Insufficient information about other entities of the MG systems;</li><li>Droop control strategy is usually used to avoid circulating currents between the converters without the use of digital communication link;</li><li>Avoiding single-point failure, enhancing the expandability, and allowing greater flexibility of operation;</li><li>High privacy for the entities and less amount of information;</li><li>Reduction of the computational need and releasing the traffic on the communication network;</li><li>Reduces computational burden and increases reliability and robustness;</li><li>Easy realization of plug-and-play functionality.</li></ul></td><td><ul><li>Incomplete information about the overall MG status;</li><li>Voltages and currents average regulation requires more data transmission through the MG;</li><li>Local optimization in EMS is not able to provide a global solution for operating cost minimization of the total MG;</li><li>The distributed processing does not guarantee global optimal results for the whole MG system;</li><li>A high complexity of implementation compared to centralized and hierarchical control;</li><li>Load dependency problem, responsible for the circulating currents in distributed generators, accuracy of load sharing can be achieved with the compromise of deviation in the voltages compared to their rated values;</li><li>Unsuitability for non-linear loads due to harmonics and inability to achieve coordinated performance of multiple components with different characteristics, and poor transients performance;</li><li>Requires effective synchronization and strong communication to achieve synchronicity;</li><li>Requires fast periodical reconfiguration.</li></ul></td></tr></tbody></table>
<table><tr><td rowspan="10">Hierarchical</td><td>• More suitable for DC MG systems;</td><td>• The distributed generators should participate in voltage regulation and frequency control;</td></tr><tr><td>• The voltage and the current are regulated locally by the source converters;</td><td>• Some generators operates in limited power mode while supplying only the power planned by the electricity market;</td></tr><tr><td>• Flexible regulation of the system voltage within acceptable intervals;</td><td>• The distributed generators are responsible for adjusting the differences between the planned demand and the actual loads, therefore, the demand should be forecasted to plan correctly the output of the generators;</td></tr><tr><td>• Economic power dispatch among the converters, between the MG, the utility grid as well as the neighboring-MG;</td><td>• Adjacent layers coordination is required;</td></tr><tr><td>• Synchronous generators with the same frequency for all over the grid;</td><td>• There is no transfer of information and energy if there is a communication fault in the upper layer;</td></tr><tr><td>• The operation constraints are dispatched to different levels reducing the processing time;</td><td>• Less computation burden.</td></tr><tr><td>• Improving the current mismatches among the controllers;</td><td></td></tr><tr><td>• Combining the previous control structures;</td><td></td></tr><tr><td>• Optimal decision is possible.</td><td></td></tr></table>

<figure><img src="image_27.png" /><figcaption>Figure 2.5. Hierarchical control levels</figcaption></figure>

The hierarchical control can be implemented in parallel in both centralized and distributed structure. The advantages and disadvantages of each control structure are presented in Table 2.3.

### 3. Control strategies

The deployment of more than one energy source in the MG systems requires the use of efficient control strategies/approaches for managing energy flow. This requires the development and the deployment of EM systems. EM systems should be able to coordinate effectively the energy sharing and trading among all electrical networks while supplying loads according to the operational conditions and economic constraints with secure, reliable, and efficient power system operation. In fact, optimization techniques, for D/R, demand-side
management, and power quality management, are needed to achieve different EM system objectives while satisfying multiple constraints, such as electricity price minimization and occupants' comfort maximization, as mentioned in Figure 2.6.

The concept of EM system is not new and began with the first electrical networks, known as “Energy Control Center”. In the past decade, the electrical network is developed and new challenges have been evolved, consequently, new ICTs are deployed in order to improve the electrical power sector. The EM system is also developed to be renamed as a SCADA-EMS, which is charged to deploy various control techniques like services control, distributed management systems, and demand-side management (Rathor & Saxena, 2020). With the deployment of RESs, the EM system should be capable to create an energy balance between the variable demand and the stochastic RES generations in an efficient manner. It could have a control center, which is capable to supervise, monitor, manage, and optimize the operation of distributed generators, diversify consumers and the transport/distribution facility of the electricity. Actually, the EM system is not limited to the classical control objective but is developed to work for real-time applications, predictive control scheduling, and transmission security management.

<figure><img src="image_28.png" /><figcaption>Figure 2.6. Objective functions, constraints and optimization methods for optimum operation of MG systems</figcaption></figure>

Several approaches have been proposed and use diversified objective functions and constraints while using optimization methods for efficient EM, as depicted in Figure 2.6.
## 3.1. Objective functions and constraints

The deployment of EM control strategies specifies the main objective functions, which could be related to the operation cost, pollution, reliability, and power quality (Li, Roche, & Miraoui, 2017; Cannata et al., 2019; Jiménez-Fernández et al., 2019; Hannan et al., 2020). For instance, the main aim of using economic objective functions is to minimize the electricity price. Different formulations are studied for cost minimization in MGs. For instance, in (Liu, Y., et al., 2014), authors proposed an EM strategy for electricity cost minimization in residential MG, which is constituted by multiple households with distributed energy resources. This EM strategy considers predefined purchasing/selling decisions, at each time slot, for reducing the electricity cost as well as scheduling decisions for the shifted loads. In (Kamboj et al., 2016), authors formulate cost minimization as a dynamic economic load dispatch problem. A meta-heuristic algorithm is introduced and compared with other methods, such as differential evolution algorithm, genetic algorithm, and particle swarm optimization. The work presented in (Haidar et al., 2020), proposed an optimal strategy by evaluating the performance of different hybrid MG systems. A mathematical model is studied for sizing the component of the MG in order to meet the lowest possible cost while maximizing load demand under varying weather conditions. In (Elkazaz et al., 2020), authors present an EM system to minimize the daily operating cost of an MG while maximizing the self-consumption of the deployed RES by selecting the best setting for a central battery storage system according to a defined cost function. A simple comparison is made to show the advantages of two different layer controllers: rolling horizon predictive controller and modem predictive controller. Another interesting work is presented in (Corchero et al., 2014), in which the authors introduced an optimization model for managing a residential MG, which contains RESs and a charging spot with a “vehicle-to-grid” system.

The deployment of EM approaches, which consider the pollution factor as an objective function, take time for being validated since the whole procedure should consider the life cycle of the different deployed equipment. In fact, every new energy source technology, which is promoted as being “renewable” or “sustainable”, is subject to an energy balance analysis in order to calculate the net energy yield. The energy analysis does not consider only the data for present generation systems, but also for the probable improvements in production and energy system technology (Alsema, 2012). The equivalent CO₂, generated during the fabrication of each component, should be calculated and compared to the equivalent energy, which is generated during its life cycle. While we consider that this energy is generated by
traditional sources in order to estimate the equivalent CO₂ emission and by comparing these
two elements of CO₂ generation, the profitability of the system concerning the pollution
objective can be defined. For example, authors (Mason et al., 2006) studied the life cycle of
the balance system component of 3.5 MWp multi-crystalline PV installation. The life cycle
and the boundary conditions are calculated for each component of a PV installation (e.g., PV
metal support, aluminum frames). Authors in (Alsema, 2012) present estimations of the
energy requirements for manufacturing PV systems and evaluate the energy balance for an
example of the PV system applications. The work investigated the effects of future
developments in PV generation technology in order to assess the long-term predictions of PV
system as a candidate for a sustainable energy supply and for CO₂ mitigation. Authors
considered the energy payback time to estimate the CO₂ mitigation potential and conclude that
90% of greenhouse gas emissions during the PV system life cycle are caused by the energy
used during system manufacturing and not during the system operation.

Alike economic and pollution aspects, the term reliability covers different aspects concerning the system operation cost, profitability, failure and maintenance, and productivity. Consequently, as mentioned above, RESs have a significant cost and consume a lot of energy in their fabrication. In order to maximize the profitability and system's reliability, the production of these sources should be maximized. Therefore, the main aim is to maximize the use of renewable energy generation, minimizing the loss of energy, keeping the storage energy system in a good state of health, and ensuring a safe and efficient supply of energy to the loads. In this way, (Jafari et al., 2020) presented an electricity market strategy for reliability enhancement of islanded multi-MG systems. A techno-economical objective function is deployed to account the profit of MG owners and to enhance the reliability of the system as well. Distribution functions are used for probabilistic modeling of RESs and loads and an electricity market strategy is proposed to improve the profit of the MG owners. However, the power quality, in particular the power loss, is still the main issue for the system's reliability and, therefore, several works propose suitable EM methods and control techniques to minimize the power loss in MG systems. For instance, in (Yenealem et al., 2020), the authors integrated an MG with static synchronous compensator controller in order to ensure a higher power flow with an enhanced voltage profile and reduced power loss. They conclude that a static synchronous compensator controller raises the capacity of the distribution line and contributes to voltage profile improvements and power loss reduction.
Similar works consider the concept of power loss minimization as stated in (Maknouninejad et al., 2014; Shieh et al., 2019; Barakat et al., 2020).

After defining the system’s constraints together with objective functions, suitable optimization methods are required to ensure accordingly the exchange of the power flow between the installed RESs/storage and the MGs on the one hand, and between MGs and the utility grid on the other hand. The rest of this section is dedicated to an overview of the main methods from literature.

## 3.2. Optimization and control methods

Numerous research works are carried for MG control according to the system’s topologies, structures, and operation modes (Ontiveros et al., 2017; Shayeghi et al., 2019; Rathor & Saxena, 2020). For example, optimization and control methods should manage the stochastic nature of the installed RES generators by ensuring a reliable supply of power to consumers, while keeping the storage system, the electricity bill, and the occupants comfort at the acceptable operating conditions.

<figure><img src="image_29.png" /><figcaption>Figure 2.7. Control approaches for energy management systems</figcaption></figure>

Figure 2.7 presents a proposed classification of MG control methods commonly used in MG operations. A brief description of each method is presented in the rest of this section. Furthermore, various steps should be specified, as depicted in Figure 2.8, for EM in MG.
<figure><img src="image_30.png" /><figcaption>Figure 2.8. MG and EM system specification and underlying construction steps</figcaption></figure>

### 3.2.1. Predictive control methods

Recently, predictive control approaches have been proposed for advanced systems' control according to defined constraints. Their aim was to develop predictive controllers for efficient energy flow in MG systems. These controllers could forecast future actions and decisions, but they require forecasted inputs' values (e.g., power consumption/production). With recent progress in IoT and Big-data technologies together with ML, it now possible to deploy sensors for gathering contextual data (Elmouatamid et al., 2019a). These data could be processed and used for predicting n-step-ahead values. Therefore, the forecasted values are the main inputs for generating the most suitable and future actions by predictive control approaches (Elmouatamid et al., 2019b; Elmouatamid et al., 2019c).

MPC and GPC are the well-known approaches having the capabilities of predicting future events and forecasting right control decisions accordingly. In fact, they have the ability to incorporate optimization mechanisms, which allows integrating the system's constraints and disturbances in forecasted control decisions. For instance, the GPC is widely used in advanced control applications, such as in EM and buildings' automation systems (Buyak et al., 2017; Rahmani-Andebili et al., 2017). For example, the work presented in (Hemmati et al., 2017), introduced a home EM system for battery storage and PV systems. The proposed planning, for the optimal operation strategy, is expressed as a stochastic mixed-integer nonlinear programming. The power generated by the PV system is considered as an uncertain parameter and modeled by a probability distribution function. The battery storage system is used to store
energy during off-peak/low-cost hours and discharge energy during on-peak/high-cost hours. However, the main limitation of this EM strategy is the passive reaction of the system with the cost and the peak demand variability. It is programmed by a fixed time interval that presents predefined periods of on-peak and high-cost and it is not defined by an active function for the interactive variability of the cost and the electricity demand. Moreover, authors (Rahmani-Andebili et al., 2017) proposed an adaptive and dynamic optimization technique based on the stochastic MPC approach. The proposed EM approach is applied for distributed energy resources scheduling problem for a set of smart homes with different sources of energy. Its aim is to address the uncertainty and variability issues of the PV power generation. This study is designed for large-scale smart houses by taking into consideration their cooperation with their neighbors. Another interesting work is presented in (Bordons et al., 2019), in which authors proposed an EM system using the MPC where a simple state-space model is used for the performance modeling of an MG system. This work considered the RESs power production and the consumption as measured disturbances parameters for the EM system. Therefore, the storage systems and the cost are modeled as constraints for the MG system, which are solved by the state-space equations. In addition, other works are presented in the literature, which refer to optimal control of RES in MG systems considering hybrid storage systems, as detailed in (Petrollese et al., 2015). In (Negenborn et al., 2009), the authors used the MPC for optimal control of distributed energy resources with a battery storage system. In other works, the MPC is used for EM of MG systems that are connected to the charging station for electrical vehicles (Mendes et al., 2016; Garcia-Torres et al., 2018; Chen et al., 2020). Generic MPC models are introduced in (Bozchalui et al., 2012; Parisio et al., 2014) for economic optimization in MG systems.

It is worth noting that the MPC family was proposed for electronic power, and especially for power converter control. The GPC is one of the CCS-MPC (Continuous Control Set MPC) methods that calculate a continuous control command in order to generate the desired output of the power converter. The CCS-MPC models have a lower computational cost than the other existing methods like FCS-MPC (Finite Control Set), OSV-MPC (Optimal Switching Vector), and OSS-MPC (Optimal Switching Sequence) (Bordons et al., 2015). It can be used for long predictive horizon problems by calculating the control actions beforehand and then limiting the online computation burden. Mainly, the calculation time is the main factor for the deployment of MPC control families. In past decades, the development of computing units and the integration of ICTs and ML algorithms for power electronic applications encourage
the use of predictive control for the power converter. For instance, in (Linder et al., 2005; Rodriguez et al., 2007), an FCS-MPC is used for the current control of three-phase inverter. It is studied in (Gregor et al., 2009) for multiphase inverter, in (Lezana, Aguilera, & Quevedo, 2008; Cortes et al., 2010) for multilevel inverter, and in (Correa et al., 2009; Vargas et al., 2010) for matrix converter. For more details, we refer readers to an interesting review, which is related to predictive control applications in power electronics (Vazquez et al., 2014). These approaches offer the possibility to integrate multiple objective functions and constraints with the possibility of its integration in the different control levels. Mainly, with the integration of the new ICT, the predictive control can be developed to present high performance for control commands and actions prediction. In addition, the use of ML algorithms to forecast the control input parameters offers more reliability and flexibility to the predictive control approaches.

### 3.2.2. Classical approaches

Many EM optimization approaches are based on classical approaches, such as mixed-integer linear and nonlinear programming. These approaches can be considered as efficient methods for the MG system’s control according to the specified objective and constraints. For instance, authors in (Sukumar et al., 2017) proposed an MG EM system for power-sharing, power trading with the main grid, continuous run, and on/off mixed-mode based on linear programming optimization method. In this study, on/off mode is solved by a MILP solution approach, which optimizes the operation of MG with respect to the operation mode of the main grid, fuel cell, and energy storage system. The work presented in (Nemati et al., 2018) developed a real-coded genetic algorithm and a MILP-based method to schedule the unit commitment and economic dispatch of MG units. The work considers the voltages limits, equipment loadings, and unit constraints in its formulation and the proposed algorithm deploys a flexible set of sub-functions, intelligent convergence behavior, as well as diversified searching approaches and penalty methods for constraint violations. At the same, a method is investigated to deal with the constraints of the MILP algorithm for handling the nonlinear network topology constraints. Another interesting work is presented in (Shekari et al., 2019), authors present a MILP-based approach for managing electrical and heat demands in a multiple MG environment. The proposed strategy considers different energy converters and storages, distributed energy generators, and electricity/heat storage units for optimal scheduling of MG including technical and economic ties between electricity and natural gas systems. The deployed algorithm is developed based on AC power flow, while the deployed
model respects reactive power and voltage security constraints allowing the MG system to
minimize the operation cost. Moreover, several other works are presented using these
approaches as presented in (Helal et al., 2017), in which operating cost of MG is minimized
using MINLP while considering, as a constraint, droop controlled active and reactive power
dispatch of AC side MG. In (Panwar et al., 2017), an EM approach for MG is proposed under
the operation system of transformer nominal operation and voltage security. Three objective
functions of customer benefits, load leveling, and network losses are studied.

Generally, the objective function and constraints, deployed in linear programming
methods, are linear functions with whole-valued and real-valued decision variables. This
family of approaches is often used for system analysis and optimization as it presents a
flexible and powerful method for solving large and complex problems, such as distributed
generation and MG systems.

Dynamic programming methods are used to solve more complex problems that can be
sequenced and discretized. The studied problems are usually fragmented into sub-problems
that are optimally solved, while, the obtained solutions are super-imposed to develop an
optimal solution for the original problem (García Vera et al., 2019). Therefore, the rule-based
methods are generally used to implement the EM system because they do not require any
future data profile to make a decision, thus making them more suitable for real-time
applications. For example, authors in (Bukar et al., 2020) presented a rule-based EM system,
in which a rule-based algorithm is used to implement the priority of RES usage and manage
the power flow of the proposed MG components. A nature-inspired optimization algorithm is
used to optimize the MG system’s operations for long-term capacity planning. The main goal
of the proposed objective function is to minimize the cost of energy in MG systems as well as
the deficiency of power supply probability. Other works proposed rule-based methods to
control and optimize the energy flow in MG systems. For example, the work presented in
(Merabet et al., 2016) developed a control algorithm to provide power compatibility and EM
for different resources in the MG. A real-time control system is used to validate,
experimentally, the hybrid system in the MG. Results showed that the proposed approach
provides stable operation of the MG subsystems under various power generation and
consumption conditions. In (An & Quoc-Tuan, 2015), a method is studied to build the optimal
EM for the MG-connected system, which includes energy trading cost with the main grid and
battery aging cost. The authors used a dynamic programming algorithm to minimize the cash
flow of the system while maximizing the power supply from the main grid.
Alike other classical methods, a dynamic programming algorithm can be considered as a
mathematical optimization method, which can be used to simplify a complicated problem to
simpler sub-problems for being solved in a recursive manner. They are able to provide
optimal decisions; however, they required high computational cost, which makes them
difficult to be implemented in embedded devises.

**3.2.3. Heuristic and meta-heuristic approaches**

Heuristic and meta-heuristic approaches are used in many disciplines, such as in telecommunications and transportation systems. Recent studies have developed EM approaches for MG systems. For instance, in (Papari et al., 2017), authors introduce a heuristic method for optimal operation and EM of DC MG systems. The studied problem is formulated in form of a single-objective optimization problem by focusing only on cost minimization. Authors in (Khan et al., 2019a) proposed a meta-heuristic based system by integrating the harmony search algorithm and the enhanced differential evolution. To ensure that the power consumption does not exceed a fixed threshold value during peak periods, multiple knapsacks are used and the proposed system outperforms the existing meta-heuristic techniques in terms of cost and peak to average ratio. (Chen et al., 2011) proposed an economical model for energy storage system together with a real coded-genetic algorithm model for MG systems operating in a grid-connected mode. The developed algorithm maximizes the present cost of an energy storage system over its lifespan based on its capital, energy arbitrage revenue, operation cost, and maintenance cost. In (Radosavljević et al., 2016), an optimal EM system is proposed for a grid-connected MG system based on a genetic algorithm, which considers the electricity price, power consumption, and the uncertainty of RESs generation. The work showed that the particle swarm optimization method is more efficient in terms of finding the best solution to the studied optimization function in comparison with genetic algorithm and combinatorial particle swarm optimization. A deterministic EM problem is solved, in the work presented by (Marzband et al., 2014), via a multi-period gravitational search algorithm. In (Aghajani et al., 2015), a multi-objective particle-swarm-optimization algorithm is used to solve the EM system problem, considered as a multi-objective problem. However, in (Alavi et al., 2015; Rabiee et al., 2016) the EM system problem is solved by single-objective using particle swarm optimization based algorithms.
Generally, heuristic optimization approaches use exploratory methods, in a reasonable time, to solve the optimization problems; however, they are unable to assure optimality of the obtained results (Khan et al., 2016a).

### 3.2.4. Artificial intelligent methods

Artificial neural networks are examples of artificial methods. They are considered stochastic methods, which could be used to solve optimization problems for the system having random variables. For MG systems, RESs have a variable nature caused by the weather conditions, which affect the power generation. An example, authors (Motevasel et al., 2014) presented an expert system for EM in MG systems using neural networks in order to predict the power generation of the installed RESs. In (Solanki et al., 2017), the authors proposed a mathematical model for smart load management in a standalone MG system. The studied loads are modeled by neural networks and predictive control is used to manage the energy according to predicted load variation. In (Venayagamoorthy et al., 2016), an EM system for an MG system, connected to the utility grid, is presented with the main objectives to maximize the use of renewable energies while minimizing carbon emission. Two neural networks are used to model the proposed EM system using evolutionary adaptive dynamic programming and learning concepts. For the deployed neural networks, one is used for the management strategy, and the other is used to check the optimal system's performance. Authors in (Li et al., 2013) used a neural network to control a bidirectional rectifier/inverter. A dynamic programming algorithm is implemented and it is trained using back propagation through time. The deployed neural networks show a high ability to trace rapidly changing reference commands for frequency and voltage, and satisfying control requirements for a faulted power system. The neural network controller used in this work is performed and studied under typical vector control conditions. Authors in (Wang et al., 2019) proposed a Lagrange-programming neural networks method for efficient control and management of the MG system with the main objective to minimize the overall cost of MG. In this work, the load is classified into different categories of controllable load, thermal load, price sensitive load, and critical load, while, variable neurons and Lagrange neurons are combined to obtain optimal scheduling of MG operation.

Mainly, neural networks can control, optimize, and identify the system's parameters, in online or offline applications. Unlike the previous approaches, neural networks can solve problems with nonlinear data in large-scale MG systems, because of their ability to solve the
system's stability via self-learning and prediction capabilities (Mahmoud et al., 2017; Roslan et al., 2019).

Alike neural networks, FL method is considered as one of the non-linear techniques that are used for power regulation with power electronics-based converters. This intelligent control consists of a fuzzifier, rule evaluator, and a defuzzifier; while, a set of rules known as rule-base and database is considered for the control strategy deployment. Mainly, the FL method is used to control space vector PWM based three-phase rectifier and it is used with intelligent techniques-based Droop-Control to manage multiple distributed energy DC-MG systems (Diaz et al., 2014). For instance, in (Kakigano et al., 2012), the authors proposed a voltage control technic using FL based centralized controller with gain scheduling control for DC-MG with electric-double-layer-capacitor as energy storage. A fuzzy-based control strategy, proposed in (Agnoloetto et al., 2016; De Nadai et al., 2017), is capable to determine small voltage and frequency steps regulations to improve the performance of Droop-Control by diminishing the mismatch in the common bus without heavy communication links. This work considers the frequency and voltage as variables uncoupled and then correct each one separately by considering that the voltage is local and the frequency is global variables of the system. The proposed fuzzy method changes the frequency and the voltage reference values in the droop equation of the Voltage Sources Inverters to correct its variation. In (EI-Bidairi et al., 2018), FL and a meta-heuristic algorithm known as Grey-Wolf optimization are used to optimize the interconnection between multiple MG systems. The main aims of this method are to minimize both the costs for the generators units and the emission levels of the fossil fuel sources. Several works studied the use of FL for EM in MG systems. In (Jafari et al., 2018), a mode transition strategy is deployed to smooth the mode variation and a fuzzy controller is used to determine the operation mode of coupled MG system with 20 different grid-connected and standalone MG systems. The FL is also considered as a deterministic algorithm for frequency and voltage regulation in both primary and secondary control levels and it is characterized by low computational cost and easiness of implementation. In the literature, FL is the most deterministic approaches used together with PI controller.

MAB control approaches are generally used in MGs because they are decentralized while allowing multiple interacting agents to follow their specified rules and goals and to perform autonomously dedicated functions (Dou et al., 2015). The principal element of MAB methods is the agent, which can be a virtual or physical entity situated in a specified system (e.g., buildings, MG). It is capable to autonomously react depending on the changes in the system's
environment (Mao et al., 2014; Sahoo et al., 2017). In (Khan et al., 2019b), a comprehensive description of different optimization techniques applied to EM is highlighted, and a comparison with other techniques is realized including MAB. Authors in (Raju et al., 2017), presented an EM-based on the differential evolution algorithm, developed in JADE (Java Agent Development Environment) for grid outage. The proposed MAB approach showed its efficiency in minimizing load's uncertainty as well as the generation costs from the intermittent nature of RESs generation. The approach also considered the price variation in the utility grid, and the critical loads are considered while selecting the best solution. In (Anvari-Moghaddam et al., 2017), a fault-tolerant multi-agent control approach is proposed for coordinated energy and comfort management in integrated buildings and MG systems. Several cooperative agents are presented and trained in order to reach global coordination, to satisfy related constraints, and to meet the system's objectives. The integrated buildings and MG systems are mathematically formulated as a multi-objective optimization problem, which is solved under different operating conditions. Other interesting research works, which consider the MAB control approaches for EM in MG systems, are presented in (Karavas et al., 2015; Kofinas et al., 2018; Samadi et al., 2020).

The usage of the MAB method is rapidly growing in power systems, especially for EM in MG systems. MABs, combined with system modeling, make the arrangements of MG units autonomously directed making the scheme more intelligent and protective. The deployment of MAB control in the MG system considers each agent as an intelligent unit, which can communicate with their neighboring agents in a collaborative way to determine future control actions to achieve the common objective. The communication with neighboring agents requires the deployment of advanced ICTs in order to benefit from the advantage of such approaches.

Despite the efficiency of the abovementioned methods, still real-time and predictive control approaches are required for intelligent EM in smart MG systems.

**4. Comparison of control approaches for MG systems**

The choice of an EM approach is an essential requirement for reliable and stable operation of the MG system. Depending on the characteristics of the deployed system (e., topologies, operation modes, structure), EM can be selected. However, the deployment of an approach does not signify that the others are not reliable, while the studied constraints and the fixed objective of the control strategy are the main issues in order to identify the utility of the
deployed method. In the rest of this section, the advantages and the disadvantages of different control techniques are presented (see Table 2.4).

<table><caption>Table 2.4. Brief comparison of control approaches</caption><thead><tr><td>Control approach</td><td>Application</td><td>Advantage</td><td>Disadvantage</td></tr></thead><tbody><tr><td>Model predictive control<br>(Vazquez et al., 2016; Castilla et al., 2020; Vazquez et al., 2014)</td><td><ul><li>Reliable for power sharing between MG and the utility grid</li><li>Hybrid AC/DC coupled MG</li></ul></td><td><ul><li>Robust against uncertainty</li><li>Power smoothing</li><li>Multiple control objective and constraint functions are implemented for the same control strategy</li><li>Optimal control</li></ul></td><td><ul><li>Requiring the use of advanced ICTs</li><li>Control parameters information should be defined in advance</li></ul></td></tr><tr><td>Adaptive droop<br>(Augustine et al., 2015; Djebbri et al., 2020)</td><td><ul><li>Hybrid system of RESs</li><li>Parallel DC/DC converter</li><li>Heavy loading conditions</li></ul></td><td><ul><li>The different operation modes eliminate the overload conditions between generator unites, storage devices, and utility grid;</li><li>Minimizing circulating current.</li></ul></td><td><ul><li>Difficult to select the proper voltage levels</li><li>Generating interconnection resistances between the installed converter and requiring information about the DC bus</li><li>Control parameters should be known in advance.</li></ul></td></tr><tr><td>Artificial neural networks<br>(Moon et al., 2019; Reynolds et al., 2019)</td><td><ul><li>Distributed power generation units</li><li>Multiple MG system interconnection</li></ul></td><td><ul><li>The approach can control, optimize, and identify the system's parameters in online or offline applications</li><li>Solve problems with nonlinear data approaches in large-scale systems in MG</li><li>Solve the system's stability and fault tolerance via self-learning and prediction</li></ul></td><td><ul><li>Complexity of the model structure</li><li>Experimental interpretation of the model is difficult (black boxes)</li><li>Difficult to determine the best network structure in case of adding or raising units from the MG topology</li><li>Possibility only on stable system structure</li></ul></td></tr><tr><td>Distributed cooperation control<br>(Huang et al., 2014; Liu et al., 2018; Xing et al., 2019)</td><td><ul><li>The control is optimal for DC-MG system</li><li>Improving voltage levels for DC-MG</li></ul></td><td><ul><li>Flexible, robust, and, extensible</li><li>Optimal coordination control and improved voltage profile</li></ul></td><td><ul><li>Less security for the communication system</li><li>Frequency response nature cannot be visualized</li></ul></td></tr><tr><td>Conventional droop<br>(Huang et al., 2010; Peyghami et al., 2019)</td><td><ul><li>Reliable for DC-MG</li><li>Linear loads</li><li>Inductive transmission lines</li></ul></td><td><ul><li>Easy implementation for the primary control</li></ul></td><td><ul><li>Voltage regulation is not ensured</li><li>The voltage drop across the bus resistance causing a current sharing degradation</li><li>Active and reactive power bandwidth variation of the controllers affects the voltage and frequency controls</li></ul></td></tr><tr><td>FL based control<br>(Erdinc et al., 2019)</td><td><ul><li>Reliable for primary control</li></ul></td><td><ul><li>Improved voltage and frequency regulation</li></ul></td><td><ul><li>Requiring a high processing unit</li></ul></td></tr></tbody></table>
<table><tr><td>2009; Abd-El Baset et al., 2020)</td><td><ul><li>Voltage and frequency regulation</li></ul></td><td>and power sharing for multiple MG</td><td><ul><li>Errors methods adopted for the participation function and time consuming process</li></ul></td></tr><tr><td>Multi-agent based control (Khan et al., 2016b; Prinsloo et al., 2018; Xiong et al., 2020)</td><td><ul><li>Distributed power generation units</li><li>Multiple MG system interconnection</li></ul></td><td><ul><li>The group of agents can address larger problems than any individual is capable to do in MG system</li><li>Redundancy and economies of large scale</li><li>The ability to meet global constraints</li><li>Flexibility to work in uncertain environments under unforeseen conditions</li></ul></td><td><ul><li>Potential for conflicts; need for increased agent sophistication</li><li>Short term benefits may not outweigh organization construction costs for the installed MG systems</li><li>Requiring a high connectivity between agents and the LC</li><li>The agent should operate at the same parameters of the other agents, especially for voltage and frequency regulation</li></ul></td></tr></table>

A good approach must consider the stochastic nature of different control parameters, the installation cost, the components lifetime, the distributed resources, and the reliable and safe operation of the MG system. In fact, the deployment of an EM control strategy requires the classification of the whole system into different levels, while, each level should operate by coordinating with the other levels from the sources (e.g., maximum power point tracking) to the end consumers, which can be a local consumer or a neighboring MG consumer. Nowadays, smart components are installed for each source and for each MG system, which can cooperate with them due to the new ICTs. Especially, the actual inverters can execute different control strategies from the source power regulation to the interconnectivity to the utility grid or to the neighboring MG. In addition, the inverters can be installed for a large scale of MG systems creating clusters of data and electricity exchange, while, these inverters could be connected to the internet in order to store the historic data in the cloud. Mainly, the main objective function for each inverter is ensuring continuous power supply to the consumers, without considering the lifetime of the battery storage system or the cost of electricity. In this context, the development of an EM control strategy that considers the electricity price variation and minimizes the battery C/D cycle is required. These two issues allow the maximization of the system profitability by minimizing the electricity bill and avoiding a frequent replacement of battery storage in an MG system. The main idea is to develop an intelligent and predictive control strategy that can control optimally the distributed resources in the MG by considering multiple constraints and objective functions at the same time.
**5. State of the art synthesis and our contribution**

Control strategies, generally, use single-objective function procedures (e.g., maximizing the quality of the services). Without considering different operating constraints, these procedures are easier to implement and to deploy in real-sitting scenarios. Moreover, control strategies, which take into consideration only the energy availability within MG components (e.g., energy sources, storage devices, traditional electric grid), could be implemented by simple algorithms. These algorithms implement procedures that switch, at each time, from RES to either storage devices or to the TEG. For instance, actual commercial inverters are able to manage efficiently the interconnection between RESs, energy storage systems, and the utility grid by incorporating a single-objective function. In particular, the MG system's EM takes into consideration only the availability of the electricity for being supplied to buildings loads. The inverter can use once either batteries or the utility grid without taking into account other parameters, such as the actual electricity cost as well as batteries C/D cycles. However, high batteries C/D cycles, in a limited time, could decrease their performances, which impact the profitability of the system. In other cases, controllers can interact, in real-time, with energy sources generators (e.g., solar, wind) in order to limit the power generation (LPPT). The aim is to ensure the quality of the electrical services (e.g., frequency, voltage), and consequently minimizing the profitability of the MG system's components. Despite their advantages, they could have, however, negative impacts on the batteries' lifecycle and system's profitability. Therefore, context-awareness principles and predictive analytics could be exploited for developing context-driven control approaches.

Our thesis's contribution to the current state of knowledge aims to develop context-driven control approaches for EM of MG systems in the context of smart buildings. Mainly, a predictive control approach, named MAPCASTE (Measure, Analyze, Plan, foreCAST, and Execute), is developed and deployed in real-sitting scenarios for EM in MG systems (see Figure 2.9). Unlike the control approaches from literature, MAPCASTE considers multiple objectives functions, which take into consideration batteries C/D cycles as well as the electricity price forecasting. The main aim is to ensure, in an optimal way, the continuous electricity supply from different installed sources (e.g., RESs, batteries, TEG) to the building's services. The proposed approach is based on predictive control models, which are able to generate a sequence of future control actions over a prediction horizon.
<figure><img src="image_31.png" /><figcaption>**Figure 2.9. The proposed control approach schemes with operation process**</figcaption></figure>

However, in order to carry out the MAPCASTE, several forecasted inputs values are required, mainly the power production/consumption and batteries SoC. This requires an advanced metering infrastructure, which allows measuring and predicting all input values. Therefore, an MG was deployed together with an IoT/Big data platform in order to conduct experiments and validate developed models. The deployed MG system contains RESs and battery storage systems, which are connected together with the TEG in order to supply the electrical energy to the building's loads (e.g., lighting, ventilation). The IoT/Big data platform was developed and deployed in order to allow measuring and forecasting RESs power generation, loads consumption, and batteries SoC. Sensing/actuating components with a control card are installed in order to monitor and manage the whole MG system offering the possibility to test the developed control techniques in the real context.

**6. Conclusions**

The EM and the optimization control in MG systems are becoming multiple objectives “management/optimization” function to be satisfied by solving simultaneously technical, economic, and environmental problems. Therefore, several approaches (e.g., exact, stochastic, and predictive) have been proposed for EM. These approaches are chosen based on their practicality, reliability, and resource availability in the MG environment. This chapter reviewed recent research work related to EM in MG systems. In particular, we focused on different control approaches that have been proposed to efficiently operate MG systems including centralized, decentralized, and hierarchical management structures. A comprehensive description of control and optimization methods is highlighted, particularly to identify the most common and effective method for EM in MG systems. Predictive control
showed to be a good candidate since it integrates optimal control, multivariable processes and
it is a flexible control scheme that allows easy inclusion of system constraints and
optimization functions. It is robust against uncertainty and power smoothing problems, thus,
multiple control objective and constraint functions can be implemented for the same control
strategy. However, despite the power of these predictive control techniques, their deployment
in real-sitting scenarios requires a holistic platform that integrates MG components together
with all equipment for measuring and predicting important input data. With recent
technological advances in microprocessors, data analysis, and ML, predictive control can be
seen, therefore, as a promising alternative for EM in MG systems. In the frame of this thesis,
the MG system's modeling, together with experimental platforms are developed and deployed
for being used in conducting both simulations and experimentations for performance
evaluation of the proposed control approaches.
# Chapter 3: The Deployed Micro-grid System Integrating Renewable Energy Sources: IoT/Big Data Platform and used Models

## 1. Introduction

The decentralization of energy production, via the integration of RESs, makes the electrical system more complex and more difficult to control in order to keep a suitable electricity balance (i.e., D/R). Consequently, the transition from unidirectional to bidirectional interconnection and from centralized to decentralized energy production requires the use of smart equipment (e.g., smart metering, smart inverter, smart transformer) (Llorente et al., 2012). This equipment should be able to interact with different building's services taking into consideration its surrounding environment. In this context, an MG system is defined as an “intelligent building” that can produce, consume, and store locally the electrical energy. The MG, via a well-established ICT-based infrastructure, can interact with consumers, with neighboring MGs, and with the TEG. The main objective of such systems is to connect efficiently the producers and consumers of electricity with a high level of security, stability, and continuity of energy supply (the increase of services quality). As a result, the MG has the possibility to smoothen the electrical peaks demand in the electrical network, which represents a major challenge for the TEG. It also allows for managing the electricity flows by considering economic and environmental constraints. Accordingly, the electricity bill can be minimized by avoiding peaks demands and, therefore, the consumption can be maximized from RESs while minimizing subsequently the carbon impact. Therefore, as state above, the interaction of different buildings' components needs to integrate ICT-based infrastructures for data collection, analysis, and processing. This integration of ICT together with RES and storage has enabled the emergence of “Micro-Grid” systems (Ali et al., 2013). MG systems remain important and necessary building blocks for the development of SG systems as well as smart cities applications and services (Hatziargyriou, 2014).

In this chapter, a new holistic architecture of smart buildings is presented by improving the main layers of MG systems. This architecture is proposed in order to integrate all buildings' aspects with the main trade-off is to minimize energy consumption while maintaining a suitable occupants' comfort. In fact, an MG system is structured into three layers following the proposed holistic architecture. More precisely, we shed more light on the MG system's components modeling in order to have a real platform with its virtual models
offering the possibility to validate our system by comparing simulation and experimentation results. In addition, another layer is added to integrate recent IoT/Big-Data technologies for data gathering, processing, and control.

## 2. MG layers structure for energy efficient buildings

As shown in Figure 3.1, our MG system is structured into three horizontal layers: passive building layer (e.g., building envelope and insulation, architecture design), active building systems layer (e.g., HVAC system, Lighting), and RESs system layer (e.g., PV, wind, storage). These layers are monitored by one vertical layer for communication and ICTs integration. This layer integrates mainly an IoT/Big-Data platform in order to measure, analyze, predict, and forecast actions depending on the actual and predicted context.

<figure><img src="image_32.png" /><figcaption>Figure 3.1. The main MG system’s layers for smart and energy-efficient buildings</figcaption></figure>

In particular, our MG system is a smart and active building that combines ICTs/Big-data infrastructure, RESs/storage systems, EM/control strategies, and electrical power grids. This new concept of a building is more interactive for both consumers and energy producers. In fact, consumers will reduce the cost of their energy consumption based on the used control approaches, which take into account the real-time cost of the power and the predictive power generation, for efficient D/R management (Elmouatamid et al., 2020b). In addition, the household equipment (e.g., refrigerators, washing machines, microwaves, lighting) are becoming intelligent devices, which may be actively controlled using IoT devices, as well as adjusted and controlled by interacting with other systems (e.g., power generation, EM system). Moreover, this MG structure offers the possibility to integrate new buildings' services, such as electrical vehicles, which can be used as a storage device to compensate the
energy in the building by integrating the “Grid-to-Vehicle & Vehicle-to-Grid” techniques.

Mainly, the main component of the energetic system is presented in Figure 3.2, which is installed in our deployed MG system.

In the next sections, we focused on the modeling of each components of MG layers,
especially for RESs, storage devices, and ICTs/Big-data infrastructure.

<figure><img src="image_33.png" /><figcaption>Figure 3.2. The holistic model of the deployed MG system</figcaption></figure>

**3. Renewable energy sources modeling**

**3.1. Photovoltaic systems and electrical energy production**

The PV module is the interface that converts sunlight into electricity. The sunlight can be converted directly into electricity using PV panels or indirectly by concentrating the solar radiation to heat water that can be also used to provide electrical power. In fact, PV technologies use semiconductor materials to convert sunlight directly into electricity. The electronic component that is used to generate electricity is the PV cell. They are grouped together to form a PV panel that can produce current directly from solar radiation (Seyedmahmoudian et al., 2013). A PV plant is usually composed of several PV panels; it contains decades of panels for a building or thousands for a power plant. The majority of PV installations are connected to the distribution networks (low voltage). However, the high penetration of the PV system in the MG system is encouraged due to the simplicity of the installation and the clean nature that they have. In this section, the mathematical models are
presented for each RESs units based on the studies that are realized in (El mouatamid et al., 2017).

### 3.1.1. Photovoltaic cell modeling

The PV system is integrated as a main RES in MG systems together with WT in order to supply the power to the loads. For that, the system should be modeled and characterized by mathematical equations for easy and efficient integration into simulation tools. In fact, modeling this system requires taking weather data (e.g., temperature, irradiance) as input variables. Various mathematical models are developed to characterize the highly nonlinear behavior resulting from semiconductor junctions that constitute the solar cell. In our study, we consider the single diode model (Habbati et al., 2014). Principally, to describe a single diode model, three equivalent circuit models can be defined as shown in Figure 3.3: the ideal PV cell model, the PV cell with series resistance, and PV cell with series and shunt resistances.

<figure><img src="image_34.png" /><figcaption>Figure 3.3. PV cell equivalent circuit model; a) Ideal single diode model, b) PV cell with series resistance, c) PV cell with series and shunt resistances</figcaption></figure>

For Figure 3.3.a, the ideal single diode model does not take into consideration the internal losses of the current due to the resistance of the electrical wires. A diode is connected in anti-parallel with the light generated current source. The generated current $I$ is obtained by Kirchhoff law:

$$I = I_{ph} - I_{d}, \qquad (3.1)$$

where, $I_{ph}$ is the photocurrent generated by the incidence of light, and $I_{d}$ is the current through the diode, which is proportional to the reverse saturation current $I_{o}$ and it is presented by the following equation:
$$I_d = I_o \cdot [\exp\left(\frac{V}{N_s \cdot n \cdot V_t}\right) - 1], \qquad (3.2)$$

where V is the diode voltage, N_s is the number of PV cell connected in series, n is the ideality factor of the cell and it depends on PV cell technology, V_t is the thermal voltage presented by equation (3.2.a), k is the Boltzmann constant (1.38×10⁻²³ J K⁻¹), q is the electronic charge (1.602×10⁻¹⁹ C), and T_op is the PV cell temperature (K).

$$V_t = \frac{k \cdot T_{op}}{q} \qquad (3.2.a)$$

To develop de accuracy of the model, Figure 3.3.b presents a PV cell model with series resistance R_s. For a real model, it is impossible to neglect the resistance of the wires, which can be integrated into the previous saturation current equation and it can be written as follows:

$$I_d = I_o \cdot [\exp\left(\frac{V+I \cdot R_s}{N_s \cdot n \cdot V_t}\right) - 1], \qquad (3.3)$$

However, in reality, leakage of current has occurred between the terminals of the PN junction of the PV cell. As mentioned in Figure 3.3.c, this leakage of current is modeled by a shunt resistance R_p. By applying Kirchhoff law, the current will be expressed by the following equation:

$$I = I_{ph} - I_o \cdot [\exp\left(\frac{V+I \cdot R_s}{N_s \cdot n \cdot V_t}\right) - 1] - \frac{V+I \cdot R_s}{R_p}, \qquad (3.4)$$

In equation (3.4), both sides contain the unknown current parameter I, which is a typical implicit transcendental equation. This implicit equation can be resolved by the Newton iteration method, which is based on some approximation for the unknown parameters (Shinong et al., 2020).

### 3.1.2. Parameters calculation

The chosen PV cell model is the single diode model with both series and shunt resistances in order to obtain a better accuracy of the model. For the studied model, we consider that the unknown parameters are I_{ph}, I_0, R_s, and R_p. To calculate these parameters,