scieee AI-readable full text Open interactive document viewer

A Hierarchical MPC Framework to Mitigate Faults and Risks in Microgrids

Zafra Cabeza, Ascensión; Velarde Rueda, Pablo; Bordons Alba, Carlos; Ridao Carlini, Miguel Ángel

Abstract

This paper presents a hierarchical MPC-based control framework for a real microgrid including solar panels and batteries, that considers the uncertainty from the point of view of faults and risks (F&R) mitigation. While fault management is applied during plant operation, risk management considers external factors that can change microgrid planning in the medium-long term. Due to their different time-scales, a two-layer control scheme is proposed using Model Predictive Control (MPC) at both levels. At the bottom layer, the fault-tolerant predictive controller optimizes the operation by manipulating inputs to follow microgrid set-points. A reconfiguration strategy is implemented using structured residuals and stochastic thresholds. On the other hand, the upper layer develops an optimal mitigation strategy, also based on MPC, to reduce the effects of risks obtained from external information, i.e., unexpected changes in demands, maintenance costs, or deviations in generation. The decision variables of this layer are the selection of mitigation actions to be undertaken, which minimise a proposed multicriteria objective function. different simulations have been carried out to show the efficacy of this methodology in a F&R scenario from a stochastic point of view.

Full text

IFAC PapersOnLine 58-14 (2024) 313–318 ScienceDirect ScienceDirect Available online at www.sciencedirect.com 2405-8963 Copyright © 2024 The Authors. This is an open access article under the CC BY-NC-ND license . Peer review under responsibility of International Federation of Automatic Control. 10.1016/j.ifacol.2024.08.355 A Hierarchical MPC Framework to Mitigate Faults and Risks in Microgrids ⋆ Ascension Zafra-Cabeza ∗Pablo Velarde ∗∗ Carlos Bordons ∗∗∗ Miguel A. Ridao ∗ ∗Systems Engineering and Automation Department, University of Seville, Spain (e-mails: {asunzafra, miguelridao}@us.es). ∗∗ Department of Engineering, Universidad Loyola Andalucia, Spain.(e-mail: [email protected]). ∗∗∗ ENGREEN Laboratory of Engineering for Energy and Environmental Sustainability, University of Seville, Spain.(e-mail: bordon[email protected]s). Abstract: This paper presents a hierarchical MPC-based control framework for a real microgrid including solar panels and batteries, that considers the uncertainty from the point of view of faults and risks (F&R) mitigation. While fault management is applied during plant operation, risk management considers external factors that can change microgrid planning in the medium-long term. Due to their different time-scales, a two-layer control scheme is proposed using Model Predictive Control (MPC) at both levels. At the bottom layer, the fault-tolerant predictive controller optimizes the operation by manipulating inputs to follow microgrid set-points. A reconfiguration strategy is implemented using structured residuals and stochastic thresholds. On the other hand, the upper layer develops an optimal mitigation strategy, also based on MPC, to reduce the effects of risks obtained from external information, i.e., unexpected changes in demands, maintenance costs, or deviations in generation. The decision variables of this layer are the selection of mitigation actions to be undertaken, which minimise a proposed multicriteria objective function. Different simulations have been carried out to show the efficacy of this methodology in a F&R scenario from a stochastic point of view. Keywords: Microgrids, Energy Management Systems, Risk Management, Model Predictive Control, Fault Tolerant Control, Hierarchical control 1. INTRODUCTION Given the significant complexities involved in integrating renewable energy sources and energy storage systems into energy management systems (EMSs), it is necessary to address the uncertainty associated with these components as part of the control strategy. The uncertainty that may arise can be associated with internal factors, such as faults in the operation of the plant, or, instead, with external factors, such as the price of energy or generation with solar or wind plants, which are highly dependent on the weather. Microgrids (MGs) are energy distribution systems that operate autonomously or in connection with the main grid, providing greater flexibility and resilience in energy management. From the point of view of control systems applied to microgrids, the work (Garcia-Torres et al., 2021) presents a review of different control strategies and trends applied to microgrids. Among them, Model Predictive Control (MPC) (Bordons et al., 2020) stands out for the relevant characteristics it presents compared to other control policies, such as the use of a model to predict ⋆This work has been funded by MCIN/AEI/ 10.13039/501100011033 under grant PID2019-104149RB-I00 (project SAFEMPC) and PID2022-142069OB-I00. the output, easy handling of constraints, weighting factors for the error and control effort, and the incorporation of delays. There are contributions in control systems with MPC on MGs that deal with the uncertainties of different approximations. For example, stochastic time-varying disturbances are used in the work of Bahakim and Ricardez- Sandoval (2014) to be considered in the optimization problem of the controller. Also, tree-based scenarios and probabilistic constraints describe the uncertainties in the MPC controller and the proposals are evaluated on a real MG benchmark. In Petrollese et al. (2016), an MPC strategy is applied where planning considers both the short and long term. For long-term planning, statistical weather and load forecasts are obtained, and for real-time management, the microgrid makes use of a predictive controller that considers the previous forecasts. Other works can be found in the scope of hierarchical and stochastic EMS based on MPC, such as Minciardi and Robba (2017) or S. Raimondi Cominesi and Scattolini (2018). The latter proposes a bilevel scheme where an MPC approach is employed to strategically outline the deployment of MG components throughout the prediction horizon. Simultaneously, oper- 10.1016/j.ifacol.2024.08.355 2405-8963 A Hierarchical MPC Framework to Mitigate Faults and Risks in Microgrids ⋆ Ascension Zafra-Cabeza ∗Pablo Velarde ∗∗ Carlos Bordons ∗∗∗ Miguel A. Ridao ∗ ∗Systems Engineering and Automation Department, University of Seville, Spain (e-mails: {asunzafra, miguelridao}@us.es). ∗∗ Department of Engineering, Universidad Loyola Andalucia, Spain.(e-mail: [email protected]). ∗∗∗ ENGREEN Laboratory of Engineering for Energy and Environmental Sustainability, University of Seville, Spain.(e-mail: bordon[email protected]s). Abstract: This paper presents a hierarchical MPC-based control framework for a real microgrid including solar panels and batteries, that considers the uncertainty from the point of view of faults and risks (F&R) mitigation. While fault management is applied during plant operation, risk management considers external factors that can change microgrid planning in the medium-long term. Due to their different time-scales, a two-layer control scheme is proposed using Model Predictive Control (MPC) at both levels. At the bottom layer, the fault-tolerant predictive controller optimizes the operation by manipulating inputs to follow microgrid set-points. A reconfiguration strategy is implemented using structured residuals and stochastic thresholds. On the other hand, the upper layer develops an optimal mitigation strategy, also based on MPC, to reduce the effects of risks obtained from external information, i.e., unexpected changes in demands, maintenance costs, or deviations in generation. The decision variables of this layer are the selection of mitigation actions to be undertaken, which minimise a proposed multicriteria objective function. Different simulations have been carried out to show the efficacy of this methodology in a F&R scenario from a stochastic point of view. Keywords: Microgrids, Energy Management Systems, Risk Management, Model Predictive Control, Fault Tolerant Control, Hierarchical control 1. INTRODUCTION Given the significant complexities involved in integrating renewable energy sources and energy storage systems into energy management systems (EMSs), it is necessary to address the uncertainty associated with these components as part of the control strategy. The uncertainty that may arise can be associated with internal factors, such as faults in the operation of the plant, or, instead, with external factors, such as the price of energy or generation with solar or wind plants, which are highly dependent on the weather. Microgrids (MGs) are energy distribution systems that operate autonomously or in connection with the main grid, providing greater flexibility and resilience in energy management. From the point of view of control systems applied to microgrids, the work (Garcia-Torres et al., 2021) presents a review of different control strategies and trends applied to microgrids. Among them, Model Predictive Control (MPC) (Bordons et al., 2020) stands out for the relevant characteristics it presents compared to other control policies, such as the use of a model to predict ⋆This work has been funded by MCIN/AEI/ 10.13039/501100011033 under grant PID2019-104149RB-I00 (project SAFEMPC) and PID2022-142069OB-I00. the output, easy handling of constraints, weighting factors for the error and control effort, and the incorporation of delays. There are contributions in control systems with MPC on MGs that deal with the uncertainties of different approximations. For example, stochastic time-varying disturbances are used in the work of Bahakim and Ricardez- Sandoval (2014) to be considered in the optimization problem of the controller. Also, tree-based scenarios and probabilistic constraints describe the uncertainties in the MPC controller and the proposals are evaluated on a real MG benchmark. In Petrollese et al. (2016), an MPC strategy is applied where planning considers both the short and long term. For long-term planning, statistical weather and load forecasts are obtained, and for real-time management, the microgrid makes use of a predictive controller that considers the previous forecasts. Other works can be found in the scope of hierarchical and stochastic EMS based on MPC, such as Minciardi and Robba (2017) or S. Raimondi Cominesi and Scattolini (2018). The latter proposes a bilevel scheme where an MPC approach is employed to strategically outline the deployment of MG components throughout the prediction horizon. Simultaneously, oper- A Hierarchical MPC Framework to Mitigate Faults and Risks in Microgrids ⋆ Ascension Zafra-Cabeza ∗Pablo Velarde ∗∗ Carlos Bordons ∗∗∗ Miguel A. Ridao ∗ ∗Systems Engineering and Automation Department, University of Seville, Spain (e-mails: {asunzafra, miguelridao}@us.es). ∗∗ Department of Engineering, Universidad Loyola Andalucia, Spain.(e-mail: [email protected]). ∗∗∗ ENGREEN Laboratory of Engineering for Energy and Environmental Sustainability, University of Seville, Spain.(e-mail: bordon[email protected]s). Abstract: This paper presents a hierarchical MPC-based control framework for a real microgrid including solar panels and batteries, that considers the uncertainty from the point of view of faults and risks (F&R) mitigation. While fault management is applied during plant operation, risk management considers external factors that can change microgrid planning in the medium-long term. Due to their different time-scales, a two-layer control scheme is proposed using Model Predictive Control (MPC) at both levels. At the bottom layer, the fault-tolerant predictive controller optimizes the operation by manipulating inputs to follow microgrid set-points. A reconfiguration strategy is implemented using structured residuals and stochastic thresholds. On the other hand, the upper layer develops an optimal mitigation strategy, also based on MPC, to reduce the effects of risks obtained from external information, i.e., unexpected changes in demands, maintenance costs, or deviations in generation. The decision variables of this layer are the selection of mitigation actions to be undertaken, which minimise a proposed multicriteria objective function. Different simulations have been carried out to show the efficacy of this methodology in a F&R scenario from a stochastic point of view. Keywords: Microgrids, Energy Management Systems, Risk Management, Model Predictive Control, Fault Tolerant Control, Hierarchical control 1. INTRODUCTION Given the significant complexities involved in integrating renewable energy sources and energy storage systems into energy management systems (EMSs), it is necessary to address the uncertainty associated with these components as part of the control strategy. The uncertainty that may arise can be associated with internal factors, such as faults in the operation of the plant, or, instead, with external factors, such as the price of energy or generation with solar or wind plants, which are highly dependent on the weather. Microgrids (MGs) are energy distribution systems that operate autonomously or in connection with the main grid, providing greater flexibility and resilience in energy management. From the point of view of control systems applied to microgrids, the work (Garcia-Torres et al., 2021) presents a review of different control strategies and trends applied to microgrids. Among them, Model Predictive Control (MPC) (Bordons et al., 2020) stands out for the relevant characteristics it presents compared to other control policies, such as the use of a model to predict ⋆This work has been funded by MCIN/AEI/ 10.13039/501100011033 under grant PID2019-104149RB-I00 (project SAFEMPC) and PID2022-142069OB-I00. the output, easy handling of constraints, weighting factors for the error and control effort, and the incorporation of delays. There are contributions in control systems with MPC on MGs that deal with the uncertainties of different approximations. For example, stochastic time-varying disturbances are used in the work of Bahakim and Ricardez- Sandoval (2014) to be considered in the optimization problem of the controller. Also, tree-based scenarios and probabilistic constraints describe the uncertainties in the MPC controller and the proposals are evaluated on a real MG benchmark. In Petrollese et al. (2016), an MPC strategy is applied where planning considers both the short and long term. For long-term planning, statistical weather and load forecasts are obtained, and for real-time management, the microgrid makes use of a predictive controller that considers the previous forecasts. Other works can be found in the scope of hierarchical and stochastic EMS based on MPC, such as Minciardi and Robba (2017) or S. Raimondi Cominesi and Scattolini (2018). The latter proposes a bilevel scheme where an MPC approach is employed to strategically outline the deployment of MG components throughout the prediction horizon. Simultaneously, oper- A Hierarchical MPC Framework to Mitigate Faults and Risks in Microgrids ⋆ Ascension Zafra-Cabeza ∗Pablo Velarde ∗∗ Carlos Bordons ∗∗∗ Miguel A. Ridao ∗ ∗ Systems Engineering and Automation Department, University of Seville, Spain (e-mails: {asunzafra, miguelridao}@us.es). ∗∗ Department of Engineering, Universidad Loyola Andalucia, Spain.(e-mail: pavelar[email protected]). ∗∗∗ ENGREEN Laboratory of Engineering for Energy and Environmental Sustainability, University of Seville, Spain.(e-mail: bor[email protected]). Abstract: This paper presents a hierarchical MPC-based control framework for a real microgrid including solar panels and batteries, that considers the uncertainty from the point of view of faults and risks (F&R) mitigation. While fault management is applied during plant operation, risk management considers external factors that can change microgrid planning in the medium-long term. Due to their different time-scales, a two-layer control scheme is proposed using Model Predictive Control (MPC) at both levels. At the bottom layer, the fault-tolerant predictive controller optimizes the operation by manipulating inputs to follow microgrid set-points. A reconfiguration strategy is implemented using structured residuals and stochastic thresholds. On the other hand, the upper layer develops an optimal mitigation strategy, also based on MPC, to reduce the effects of risks obtained from external information, i.e., unexpected changes in demands, maintenance costs, or deviations in generation. The decision variables of this layer are the selection of mitigation actions to be undertaken, which minimise a proposed multicriteria objective function. Different simulations have been carried out to show the efficacy of this methodology in a F&R scenario from a stochastic point of view. Keywords: Microgrids, Energy Management Systems, Risk Management, Model Predictive Control, Fault Tolerant Control, Hierarchical control 1. INTRODUCTION Given the significant complexities involved in integrating renewable energy sources and energy storage systems into energy management systems (EMSs), it is necessary to address the uncertainty associated with these components as part of the control strategy. The uncertainty that may arise can be associated with internal factors, such as faults in the operation of the plant, or, instead, with external factors, such as the price of energy or generation with solar or wind plants, which are highly dependent on the weather. Microgrids (MGs) are energy distribution systems that operate autonomously or in connection with the main grid, providing greater flexibility and resilience in energy management. From the point of view of control systems applied to microgrids, the work (Garcia-Torres et al., 2021) presents a review of different control strategies and trends applied to microgrids. Among them, Model Predictive Control (MPC) (Bordons et al., 2020) stands out for the relevant characteristics it presents compared to other control policies, such as the use of a model to predict ⋆This work has been funded by MCIN/AEI/ 10.13039/501100011033 under grant PID2019-104149RB-I00 (project SAFEMPC) and PID2022-142069OB-I00. the output, easy handling of constraints, weighting factors for the error and control effort, and the incorporation of delays. There are contributions in control systems with MPC on MGs that deal with the uncertainties of different approximations. For example, stochastic time-varying disturbances are used in the work of Bahakim and Ricardez- Sandoval (2014) to be considered in the optimization problem of the controller. Also, tree-based scenarios and probabilistic constraints describe the uncertainties in the MPC controller and the proposals are evaluated on a real MG benchmark. In Petrollese et al. (2016), an MPC strategy is applied where planning considers both the short and long term. For long-term planning, statistical weather and load forecasts are obtained, and for real-time management, the microgrid makes use of a predictive controller that considers the previous forecasts. Other works can be found in the scope of hierarchical and stochastic EMS based on MPC, such as Minciardi and Robba (2017) or S. Raimondi Cominesi and Scattolini (2018). The latter proposes a bilevel scheme where an MPC approach is employed to strategically outline the deployment of MG components throughout the prediction horizon. Simultaneously, oper- A Hierarchical MPC Framework to Mitigate Faults and Risks in Microgrids ⋆ Ascension Zafra-Cabeza ∗Pablo Velarde ∗∗ Carlos Bordons ∗∗∗ Miguel A. Ridao ∗ ∗Systems Engineering and Automation Department, University of Seville, Spain (e-mails: {asunzafra, miguelridao}@us.es). ∗∗ Department of Engineering, Universidad Loyola Andalucia, Spain.(e-mail: [email protected]). ∗∗∗ ENGREEN Laboratory of Engineering for Energy and Environmental Sustainability, University of Seville, Spain.(e-mail: bordon[email protected]s). Abstract: This paper presents a hierarchical MPC-based control framework for a real microgrid including solar panels and batteries, that considers the uncertainty from the point of view of faults and risks (F&R) mitigation. While fault management is applied during plant operation, risk management considers external factors that can change microgrid planning in the medium-long term. Due to their different time-scales, a two-layer control scheme is proposed using Model Predictive Control (MPC) at both levels. At the bottom layer, the fault-tolerant predictive controller optimizes the operation by manipulating inputs to follow microgrid set-points. A reconfiguration strategy is implemented using structured residuals and stochastic thresholds. On the other hand, the upper layer develops an optimal mitigation strategy, also based on MPC, to reduce the effects of risks obtained from external information, i.e., unexpected changes in demands, maintenance costs, or deviations in generation. The decision variables of this layer are the selection of mitigation actions to be undertaken, which minimise a proposed multicriteria objective function. Different simulations have been carried out to show the efficacy of this methodology in a F&R scenario from a stochastic point of view. Keywords: Microgrids, Energy Management Systems, Risk Management, Model Predictive Control, Fault Tolerant Control, Hierarchical control 1. INTRODUCTION Given the significant complexities involved in integrating renewable energy sources and energy storage systems into energy management systems (EMSs), it is necessary to address the uncertainty associated with these components as part of the control strategy. The uncertainty that may arise can be associated with internal factors, such as faults in the operation of the plant, or, instead, with external factors, such as the price of energy or generation with solar or wind plants, which are highly dependent on the weather. Microgrids (MGs) are energy distribution systems that operate autonomously or in connection with the main grid, providing greater flexibility and resilience in energy management. From the point of view of control systems applied to microgrids, the work (Garcia-Torres et al., 2021) presents a review of different control strategies and trends applied to microgrids. Among them, Model Predictive Control (MPC) (Bordons et al., 2020) stands out for the relevant characteristics it presents compared to other control policies, such as the use of a model to predict ⋆This work has been funded by MCIN/AEI/ 10.13039/501100011033 under grant PID2019-104149RB-I00 (project SAFEMPC) and PID2022-142069OB-I00. the output, easy handling of constraints, weighting factors for the error and control effort, and the incorporation of delays. There are contributions in control systems with MPC on MGs that deal with the uncertainties of different approximations. For example, stochastic time-varying disturbances are used in the work of Bahakim and Ricardez- Sandoval (2014) to be considered in the optimization problem of the controller. Also, tree-based scenarios and probabilistic constraints describe the uncertainties in the MPC controller and the proposals are evaluated on a real MG benchmark. In Petrollese et al. (2016), an MPC strategy is applied where planning considers both the short and long term. For long-term planning, statistical weather and load forecasts are obtained, and for real-time management, the microgrid makes use of a predictive controller that considers the previous forecasts. Other works can be found in the scope of hierarchical and stochastic EMS based on MPC, such as Minciardi and Robba (2017) or S. Raimondi Cominesi and Scattolini (2018). The latter proposes a bilevel scheme where an MPC approach is employed to strategically outline the deployment of MG components throughout the prediction horizon. Simultaneously, oper- A Hierarchical MPC Framework to Mitigate Faults and Risks in Microgrids ⋆ Ascension Zafra-Cabeza ∗Pablo Velarde ∗∗ Carlos Bordons ∗∗∗ Miguel A. Ridao ∗ ∗Systems Engineering and Automation Department, University of Seville, Spain (e-mails: {asunzafra, miguelridao}@us.es). ∗∗ Department of Engineering, Universidad Loyola Andalucia, Spain.(e-mail: [email protected]). ∗∗∗ ENGREEN Laboratory of Engineering for Energy and Environmental Sustainability, University of Seville, Spain.(e-mail: bordon[email protected]s). Abstract: This paper presents a hierarchical MPC-based control framework for a real microgrid including solar panels and batteries, that considers the uncertainty from the point of view of faults and risks (F&R) mitigation. While fault management is applied during plant operation, risk management considers external factors that can change microgrid planning in the medium-long term. Due to their different time-scales, a two-layer control scheme is proposed using Model Predictive Control (MPC) at both levels. At the bottom layer, the fault-tolerant predictive controller optimizes the operation by manipulating inputs to follow microgrid set-points. A reconfiguration strategy is implemented using structured residuals and stochastic thresholds. On the other hand, the upper layer develops an optimal mitigation strategy, also based on MPC, to reduce the effects of risks obtained from external information, i.e., unexpected changes in demands, maintenance costs, or deviations in generation. The decision variables of this layer are the selection of mitigation actions to be undertaken, which minimise a proposed multicriteria objective function. Different simulations have been carried out to show the efficacy of this methodology in a F&R scenario from a stochastic point of view. Keywords: Microgrids, Energy Management Systems, Risk Management, Model Predictive Control, Fault Tolerant Control, Hierarchical control 1. INTRODUCTION Given the significant complexities involved in integrating renewable energy sources and energy storage systems into energy management systems (EMSs), it is necessary to address the uncertainty associated with these components as part of the control strategy. The uncertainty that may arise can be associated with internal factors, such as faults in the operation of the plant, or, instead, with external factors, such as the price of energy or generation with solar or wind plants, which are highly dependent on the weather. Microgrids (MGs) are energy distribution systems that operate autonomously or in connection with the main grid, providing greater flexibility and resilience in energy management. From the point of view of control systems applied to microgrids, the work (Garcia-Torres et al., 2021) presents a review of different control strategies and trends applied to microgrids. Among them, Model Predictive Control (MPC) (Bordons et al., 2020) stands out for the relevant characteristics it presents compared to other control policies, such as the use of a model to predict ⋆This work has been funded by MCIN/AEI/ 10.13039/501100011033 under grant PID2019-104149RB-I00 (project SAFEMPC) and PID2022-142069OB-I00. the output, easy handling of constraints, weighting factors for the error and control effort, and the incorporation of delays. There are contributions in control systems with MPC on MGs that deal with the uncertainties of different approximations. For example, stochastic time-varying disturbances are used in the work of Bahakim and Ricardez- Sandoval (2014) to be considered in the optimization problem of the controller. Also, tree-based scenarios and probabilistic constraints describe the uncertainties in the MPC controller and the proposals are evaluated on a real MG benchmark. In Petrollese et al. (2016), an MPC strategy is applied where planning considers both the short and long term. For long-term planning, statistical weather and load forecasts are obtained, and for real-time management, the microgrid makes use of a predictive controller that considers the previous forecasts. Other works can be found in the scope of hierarchical and stochastic EMS based on MPC, such as Minciardi and Robba (2017) or S. Raimondi Cominesi and Scattolini (2018). The latter proposes a bilevel scheme where an MPC approach is employed to strategically outline the deployment of MG components throughout the prediction horizon. Simultaneously, oper- Copyright © 2024 The Authors. This is an open access article under the CC BY-NC-ND license ( https://creativecommons.org/licenses/by-nc-nd/4.0/ ) 314 Ascension Zafra-Cabeza et al. / IFAC PapersOnLine 58-14 (2024) 313–318 ating at a faster frequency, an SMPC regulator at the lower layer aims to balance uncertainties. Few studies have explored MPC methodologies in the context of Fault Detection and Isolation (FDI) as well as Fault Reconfiguration (FR). FDI is a widely discussed topic with a substantial and significant body of literature (Issermann (2006)). In Izadi et al. (2010), a fault-tolerant MPC approach is introduced, wherein fault identification is utilized to adapt the system to the post-fault model. The work of Marquez et al. (2021) proposes an enhanced MPC technique with a fault mitigation method designed specifically for microgrids, where faults are associated with reconfiguration actions (RAs). On the other hand, Risk Management (RM) has emerged as a highly regarded approach to address uncertainties (Baron and Pat´e-Cornell (1999)). Although initially implemented for the prevention of natural disasters and macroeconomic systems, it has become a widespread practice in all systems that are susceptible to uncertainties. RM considers the identification of potential risks, their quantification, and the formulation of a strategic plan to address and reduce those challenges. Therefore, obtaining information from sources such as weather forecasts or operational failures, is crucial to the effectiveness of this approach. In this line, the works of (Eising et al., 2008; Zafra-Cabeza et al., 2020) show the potential benefits of RM, especially remarkable as contributions of risk mitigation on MGs based on MPC. As can be concluded, there are contributions of control systems integrating FDI or otherwise, risk management. Both areas have been widely studied but not together. As far as the authors are aware, there are no established frameworks available for calculating optimal control strategies that resolve the conflicting objectives of maximizing short-term profits in microgrid fault-tolerant operations while considering medium to long-term risk perspectives. This work focuses on the development of a novel and hierarchical EMS based on MPC that integrates FDI as well as RM to consider external information. Figure 1 describes the two different layers: •The high-level layer is devoted to addressing RM in an optimal way using the controller MPC-1. In this case, risks are modeled and evaluated using external data and forecasts, and mitigation actions (MAs) are delivered to the low level to be executed. •The low-level controller is dedicated to power dispatching and fault management. Faults are detected and corrected using quantitative models and stochastic threshold estimation. Reconfiguration actions (RAs) are determined to mitigate faults. The MPC-2 controller computes the decision variables of the plant u, driving the MG to satisfy the demands and also considering the MAs and RAs. This paper has been divided into the following parts. Section 2 proposes the formulation for risk management, describing the controller MPC-1 at the higher level. Section 3 describes the control methodology for the lower level, integrating MPC-2 and the fault management strategy. The case study of Section 4 describes the real microgrid located in the ENGREEN laboratory of the University Fig. 1. Control scheme framework. of Seville. Simulations are also outlined in this section. Finally, some conclusions are drawn in Section 5. 2. DESCRIPTION OF THE HIGHER LEVEL This level is responsible for risk mitigation. Consider R={R1,··· ,R nr}, the set of nr risks, which could cause changes named effects, with a certain probability. Thus, consider Pr={pr 1(t),··· ,p r nr(t)}, the set of probability functions and C={C1,··· ,C nc}the set of criteria. ER ={er1(t),··· , ernr(t)}are the effects of the risks evaluated on the relevant criteria. Thus, eri(k,j) is the effect of risk i, about the criterion kat the sampling time j. In this work, the optimization of risk mitigation is based on the execution of MAs that reduce the effects of risks. Consider A={A1,...A na}the set of na MAs. Every MA is characterized by a trio of attributes: Ai={ui M,Hi,G i},i={1,...na}(1) where -uM={u1 M,...,u na M}is the vector of decision variables and ui Mrepresents the decision variable associated with action Ai. -Hi={hj i(ui M):ℜ→ℜ}being the set of functions hj i that influence the decrease of the impacts on criterion jas a function of ui Mat each time, when the action Aiis applied. -Gi={gj i(ui M):ℜ → ℜ} being the set of functions gj ithat calculate the additional values to be added to criterion j, if action Aiis executed. Next, terms EXRj iare described, which mean the exposure to risk Riover the criterion jas: EXRj i(uM,t)=pr i(t)eri(j, t)− na  a=1 Γr(i, a)hj a(ua M)+ + na  a=1 Γr(i, a)gj a(ua M),∀j∈{1...nc},∀i∈{1...nr}(2) with Γr∈{0,1}nr×na the matrix representing the actions to be launched to mitigate risks. Γr(i, a) = 1 means that Riis mitigated by action Aa, otherwise, Γr(i, a) = 0. nc is the number of criteria. Consider zjthe function value Ascension Zafra-Cabeza et al. / IFAC PapersOnLine 58-14 (2024) 313–318 315 of the criterion j. These functions are defined as follows, considering the risk exposure: zj(t+ 1) = zj(t)+ nr  i=1 EXRj i(uM,t).(3) The multicriteria performance index for MPC-1 to mitigate risks is stated as follows: Jr(z,uM)=(z(t)−zref )Tβr(z(t)−zref ),(4) with zref (t) are the reference to reach in the outputs and βris the weighting vector for the criteria. The optimization problem to solve is: min uM,t Nr  i=0 Jr(z(t),u M(t)),(5) with Nrthe prediction horizon for the MPC-1. MAs provided for this controller will be sent to the lower level. This proposal is open to decide on the nature of the MAs. In this study, these adjustments will be implemented as modifications to the parameters of MPC- 2, which controls the plant. This may involve alterations to constraints, references, weighting factors, or adjustments to the model. 3. DESCRIPTION OF THE LOWER LEVEL As mentioned above, this layer drives the optimization of the MG operation, as well as fault management, including detection, isolation, and reconfiguration, also using MPC. The control oriented model of the MG can be represented by a discrete state space model as follows: x(t+ 1) = f(x(t),u(t),v(t)),(6) where x(t)∈ℜ nx represents the vector of states, u(t)∈ ℜnu represents the input vector, and v∈ℜ nv the disturbance. The objective function, denoted as J, utilized in MPC-2 can be expressed as J(x(t),u(t))=(x(t)−xref (t))Tδ(x(t)−xref (t)) + (7) +∆uT(t)λ∆u(t). It encompasses the error between the predicted states x(t) and the reference vector xref , and the control effort ∆u, which are weighted by matrices δand λ, respectively. The optimization problem solved at each time instant t is formulated as: min {u(t),...,u(t+N−1)} N−1  i=0 J(x(t+i),u(t+i),v(t+i)),(8) subject to x(t+ 1) = Ax(t)+Bu(t)+v(t),∀t∈ZN−1 0, x(0) = x(t), x(t+ 1) ∈X,∀t∈ZN−1 0, u(t)∈U,∀t∈ZN−1 0, v(t)∈V,∀t∈ZN−1 0 where ZN−1 0is the set of integers from 0 to N−1 and N is the prediction horizon. A more detailed description can be found in (Marquez et al., 2021). 3.1 Fault Management approach At this level, a fault-tolerant approach is included, addressing the fault detection and isolation (FDI) and also, a fault reconfiguration mechanism. In this work, FDI relies on parity equations and structured residuals to identify faults. This approach generates nres residual signals denoted as rqto quantify deviations between actual and expected behavior. In the presence of a fault, the deviations will be significant and will be considered as potential fault indications. For a more comprehensive understanding of the FDI methodology, refer to (Marquez et al., 2021). However, it is acknowledged that this method is susceptible to false fault indications arising from uncertainties in the process. To enhance the method’s reliability, a strategy is employed to dismiss false faults by assessing whether rqvalues fall within a range determined by time-varying thresholds. These thresholds, denoted by [αq(t),β q(t)], are stochastic and dynamically calculated using chance constraints. To ascertain whether a nonzero residual rq(t) means a true fault, a new boolean variable rb q∈{0,1}is introduced and associated with rq. Its calculation is based on: rb q(t)=1 if rq(t)>β q(t) or rq(t)<α q(t) 0 if αq(t)≤rq(t)≤βq(t)(10) ∀t, q. This process involves utilizing an structural matrix S∈ {0,1}nf×nres , with nf the potential number of faults. This matrix represents the procedure for identifying the vector of fault signatures, f∈{0,1}nf , through the vector rbas follows: fi=1 if Si,q =rb q∀q∈{1,...,n res}.(11) Therefore, in every sampling instance, the vector fis computed to indicate detected faults and therefore, to launch reconfiguration actions (RAs), if acceptable. In addition, the vector fcan be used at the high level to update the probabilities of the coupled risks to detected faults. The reconfiguration plan for faults is defined by matrices L∈{0,1}(nf×nar),M∈R(nf×nar), with narthe number of RAs. The matrix Lrepresents the RAs, denoted by RAi, to be executed for each fault, and the matrix M describes the intensity. If element Lij = 1, the fault Fican be reconfigured by the action RAjand Lij = 0 otherwise. On the other hand, the intensity of the action RAjto reconfigure the fault Fiis Mij. Taking into account the previous settings, the RAs to be executed and their magnitude denoted by uRare as follows: uR={ui R},∀i={1, ..., na r},(12) with ui R= max(B(i)),(13) ating at a faster frequency, an SMPC regulator at the lower layer aims to balance uncertainties. Few studies have explored MPC methodologies in the context of Fault Detection and Isolation (FDI) as well as Fault Reconfiguration (FR). FDI is a widely discussed topic with a substantial and significant body of literature (Issermann (2006)). In Izadi et al. (2010), a fault-tolerant MPC approach is introduced, wherein fault identification is utilized to adapt the system to the post-fault model. The work of Marquez et al. (2021) proposes an enhanced MPC technique with a fault mitigation method designed specifically for microgrids, where faults are associated with reconfiguration actions (RAs). On the other hand, Risk Management (RM) has emerged as a highly regarded approach to address uncertainties (Baron and Pat´e-Cornell (1999)). Although initially implemented for the prevention of natural disasters and macroeconomic systems, it has become a widespread practice in all systems that are susceptible to uncertainties. RM considers the identification of potential risks, their quantification, and the formulation of a strategic plan to address and reduce those challenges. Therefore, obtaining information from sources such as weather forecasts or operational failures, is crucial to the effectiveness of this approach. In this line, the works of (Eising et al., 2008; Zafra-Cabeza et al., 2020) show the potential benefits of RM, especially remarkable as contributions of risk mitigation on MGs based on MPC. As can be concluded, there are contributions of control systems integrating FDI or otherwise, risk management. Both areas have been widely studied but not together. As far as the authors are aware, there are no established frameworks available for calculating optimal control strategies that resolve the conflicting objectives of maximizing short-term profits in microgrid fault-tolerant operations while considering medium to long-term risk perspectives. This work focuses on the development of a novel and hierarchical EMS based on MPC that integrates FDI as well as RM to consider external information. Figure 1 describes the two different layers: •The high-level layer is devoted to addressing RM in an optimal way using the controller MPC-1. In this case, risks are modeled and evaluated using external data and forecasts, and mitigation actions (MAs) are delivered to the low level to be executed. •The low-level controller is dedicated to power dispatching and fault management. Faults are detected and corrected using quantitative models and stochastic threshold estimation. Reconfiguration actions (RAs) are determined to mitigate faults. The MPC-2 controller computes the decision variables of the plant u, driving the MG to satisfy the demands and also considering the MAs and RAs. This paper has been divided into the following parts. Section 2 proposes the formulation for risk management, describing the controller MPC-1 at the higher level. Section 3 describes the control methodology for the lower level, integrating MPC-2 and the fault management strategy. The case study of Section 4 describes the real microgrid located in the ENGREEN laboratory of the University Fig. 1. Control scheme framework. of Seville. Simulations are also outlined in this section. Finally, some conclusions are drawn in Section 5. 2. DESCRIPTION OF THE HIGHER LEVEL This level is responsible for risk mitigation. Consider R={R1,··· ,R nr}, the set of nr risks, which could cause changes named effects, with a certain probability. Thus, consider Pr={pr 1(t),··· ,p r nr(t)}, the set of probability functions and C={C1,··· ,C nc}the set of criteria. ER ={er1(t),··· , ernr(t)}are the effects of the risks evaluated on the relevant criteria. Thus, eri(k,j) is the effect of risk i, about the criterion kat the sampling time j. In this work, the optimization of risk mitigation is based on the execution of MAs that reduce the effects of risks. Consider A={A1,...A na}the set of na MAs. Every MA is characterized by a trio of attributes: Ai={ui M,Hi,G i},i={1,...na}(1) where -uM={u1 M,...,u na M}is the vector of decision variables and ui Mrepresents the decision variable associated with action Ai. -Hi={hj i(ui M):ℜ→ℜ}being the set of functions hj i that influence the decrease of the impacts on criterion jas a function of ui Mat each time, when the action Aiis applied. -Gi={gj i(ui M):ℜ → ℜ} being the set of functions gj ithat calculate the additional values to be added to criterion j, if action Aiis executed. Next, terms EXRj iare described, which mean the exposure to risk Riover the criterion jas: EXRj i(uM,t)=pr i(t)eri(j, t)− na  a=1 Γr(i, a)hj a(ua M)+ + na  a=1 Γr(i, a)gj a(ua M),∀j∈{1...nc},∀i∈{1...nr}(2) with Γr∈{0,1}nr×na the matrix representing the actions to be launched to mitigate risks. Γr(i, a) = 1 means that Riis mitigated by action Aa, otherwise, Γr(i, a) = 0. nc is the number of criteria. Consider zjthe function value 316 Ascension Zafra-Cabeza et al. / IFAC PapersOnLine 58-14 (2024) 313–318 where B(i) is the i-th column of L⊗M, with ⊗being the Schur product. The reconfiguration actions to execute represented by uR can encompass actions of different natures. In the case study, they are considered as changes in the MPC-2. However, other types of actions could be considered. 4. CASE STUDY This section outlines the actual MG employed to showcase the method’s results, situated in the ENGREEN laboratory at the University of Seville. The microgrid’s schematic representation is illustrated in Figure 2. For a more comprehensive understanding of the microgrid’s components and configuration, a detailed description is available in (Bordons et al., 2015). Fig. 2. ENGREEN Microgrid. Renewable energy generation is emulated using a programmable power supply (6kW) designed to replicate the dynamic characteristics of a solar photovoltaic field. To emulate energy consumption demand, an electronic load (1kW) is employed. Additionally, the plant incorporates a battery bank comprising a lithium-ion battery (400Ah) and a lead-acid battery (370Ah). Moreover, the microgrid is connected to the distribution network, facilitating the buying and selling of energy. The system is connected through a 48VDC bus regulated by the lead-acid battery bank. The model used to implement the control law of the MPC- 2 has been taken from Bordons et al. (2020): SOCle(t+ 1) = SOCle(t)−KleTsPle(t),(14) SOCli(t+ 1) = SOCli(t)−KliTsPli(t),(15) with the following balance equation: Pdem(t)=Ple(t)+Pli(t)+Pgrid(t)+Pres(t),(16) Pnet(t)=Pres(t)−Pdem(t),(17) where x=[SOCle SOCli] is the state vector, u= [Pgrid Pli] is the vector of manipulated variables and finally, v=Pnet, is the disturbance that affects the system. Ple and Pli are, respectively, the power provided/absorbed by the lead-acid battery and the ion-lithium bank. The power of the lead-acid battery Ple is determined by Eq. (17). Pres is the power produced by renewable energy sources, Pdem is the power demanded by the load, and Pgrid is the power exchange with the main grid. A sign criterion has been chosen in which the energy contribution to the power bus has a positive sign, otherwise a negative value. Taking into account the expressions (17)-(17), the resulting model in matrix form is: x(t+ 1) = Ax(t)+Bu(t)+Ev(t), y(t)=Cx(t), with A=10 01 ,B=0.0468 0.0468 −0.1369 0 ,E=0.0468 0 C=10 01 , (18) where the values of matrices Band Ehave been obtained experimentally considering that the conversion coefficient for the lead-acid battery is Kle =ηle Cmax le =1.56×10−3% kW s , and for the Li-ion battery is Kli =ηli Cmax li =1.254 × 10−3% kW s . To guarantee the correct performance of the system, the MG is subject to hard constraints. Limits are set on the manipulated variables and their incremental values: −2.5 kW ≤Pgrid(t)≤6.0 kW,(19a) −3.0 kW ≤Pli(t)≤3.0 kW,(19b) −1.0 kW ≤△Pgrid(t)≤1.0 kW,(19c) −1.0 kW ≤△Pli(t)≤1.0 kW,(19d) and in the state variables: 40 % ≤SOCle(t)≤75 %,(20a) 30 % ≤SOCli(t)≤80 %.(20b) 4.1 Experiments Profiles representing the usual patterns of household energy consumption and photovoltaic panel generation on a sunlit day have been extracted from the site https://demanda.ree.es/movil/peninsula. The selected day was September 27, 2023, and the data are from the Spanish city of Seville. The considered period is 17 hours, approximately from 06:00 to 23:00 hours. Figure 3a shows the demand, solar generation and disturbance, Pnet =Pres − Pdem. The disturbance takes a negative value when the demand is higher than the generation power. The control strategy must decide according to an economical optimization whether to buy or sell energy depending on the state of the microgrid and the sale price of the kWh, denoted by pkwh(t). For that, a profile of this variable is shown in Figure 3b. Also, the upper threshold value has been depicted in this figure to set regions where to buy or sell. This information was taken from the site https://www. esios.ree.es/ on the same day that the experiments were done. For all tests, the sampling time was set to 30s for MPC- 2 and for MPC-1 (risks management) was 1 min. The prediction horizons were N= 5 and Nr= 10. The considered criteria comprise C1to C5in the objective functions of MPC-1, as described below: •C1: economic benefit. •C2: demand fulfilment. •C3: usage of the main grid. •C4: usage of the lithium battery. •C5: usage of the lead-acid battery. Ascension Zafra-Cabeza et al. / IFAC PapersOnLine 58-14 (2024) 313–318 317 6 8 10 12 14 16 18 20 22 Time (Hours) -1000 -500 0 500 1000 1500 2000 Power (W) Pren Pdem Pnet (a) Renewable production, demand, and Pnet. 6 8 10 12 14 16 18 20 22 Time(Hours) 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 Price(€/kWh) Threshold Risk Fault (b) Prices on the electrical market. Fig. 3. Demand, Generation, Disturbance, and price of the kWh for the experiments. Furthermore, weighting vectors are set as βr= [1,0.5,0.5,1,1] in Equation (4) of the MPC-1, and δ= [1,0; 0,10−5], λ= [1.6×10−2,0; 0,1×10−2] in Equation (7) in the MPC-2. Scenario 1: Normal operation In this experiment, no faults or risks were considered, and the system operated normally. The battery state of charge and control variables over time are shown in Figures 4 and 5, respectively. The MPC-2’s objective was to minimize the variation in SOCle (blue line) while allowing SOCli to absorb any changes. The weighting factor of SOCle is higher than that of SOCli. Ion-Lithium batteries were used to store excess energy from renewable sources. They can be flexibly charged and discharged and even exchanged with the grid. Any excess renewable energy was either stored or exported, ensuring efficient energy utilization. At the beginning of the period Pnet is negative (the demand is higher than the generation), and the MPC-2 prioritizes the use of the battery (discharging process). In addition, energy is taken from the main grid (Pgrid >0). Afterward, Pnet is positive and the batteries increase the SOC values. 6 8 10 12 14 16 18 20 22 Time (Hours) 45 50 55 60 65 70 75 80 State of charge (%) SOCle SOCli Fig. 4. Levels of the outputs in experiment 1. Scenario 2: Operation with F&R In this scenario, the following items are involved: •R1: the estimation of the price of kWh is higher than the upper threshold. It presents an effect er1 1(t)=0.30pkwh(t) on the parameter benefit (C1) and er2 1(t)=0.1Pdem, meaning a decreasing rate of demand unsatisfied. The proposed MAs for R1are: (i) A1: change the estimation of the price of kWh in the MPC-2 optimization problem and (ii) A2: decrease the weighting factor of the control effort, λof Pgrid and δin Eq. (7) in MPC-2 to favor the sale of energy if 6 8 10 12 14 16 18 20 22 Time (Hours) -40 -20 0 20 40 Power (W) Ple 6 8 10 12 14 16 18 20 22 Time (Hours) -1000 0 1000 Power (W) Pli 6 8 10 12 14 16 18 20 22 Time (Hours) -50 0 50 Power (W) Pgrid Fig. 5. Control variables in experiment 1. SOCli is above 60%. The decision variables for these actions are u1 Mand u2 M∈{0,1}. •F1: fault in the lithium battery. It reveals significant differences between the estimated and the real variable SOCli. With this fault, the battery can follow with the operation, but the following RAs are proposed: (i) RA1: Stop possible sales (Pgrid ≥0 and (ii) RA2: use the lead-acid battery relaxing δ= [10−2,0; 0,10−5], λ= [1,0; 0,10−3] in Equation (7). Thus, L= [1,1] and M= [0,10−2]. Table 1 describes the properties of the proposed MAs for R1. To put in context the performance of this proposal, the probability of R1was pr 1=0.99 during the period t1= [18,23] hours and an artificially designed F1is provoked from t= 21 hours. A1allows change the estimation of pkwh(t) with no cost, and A2decreases the benefits a 10% (h1 2), reduce the unsatisfied demand (h2 2) and add an extra fee to pay, Pfee, to make possible the sale. Table 1. Mitigation actions for R1. Aihj igj i A1h1 1=er1 1u1 Mg1 1=0 A2h1 2=0.1er1 1u2 M,h2 2=er2 2u2 Mg1 2=−Pfeeu2 M When the plant is operating, both MPC-1 and MPC-2 are running simultaneously. In this case, MPC-1 takes into consideration R1and its probability. It determines A1and A2to mitigate R1, considering the effects, probability, functions hand g, and weighting factors for the criteria. Figure 6 shows as these actions are obtained through variables u1 Mand u2 Min the optimization problem stated in Eq. (5). Figure 3b has been used again to illustrate as the price of kWh has increased as a consequence of R1and the MG starts to sell energy (Pgrid <0) (see the first part of Fig 8). Fig. 6. Actions to execute for mitigating R1in scenario 2. where B(i) is the i-th column of L⊗M, with ⊗being the Schur product. The reconfiguration actions to execute represented by uR can encompass actions of different natures. In the case study, they are considered as changes in the MPC-2. However, other types of actions could be considered. 4. CASE STUDY This section outlines the actual MG employed to showcase the method’s results, situated in the ENGREEN laboratory at the University of Seville. The microgrid’s schematic representation is illustrated in Figure 2. For a more comprehensive understanding of the microgrid’s components and configuration, a detailed description is available in (Bordons et al., 2015). Fig. 2. ENGREEN Microgrid. Renewable energy generation is emulated using a programmable power supply (6kW) designed to replicate the dynamic characteristics of a solar photovoltaic field. To emulate energy consumption demand, an electronic load (1kW) is employed. Additionally, the plant incorporates a battery bank comprising a lithium-ion battery (400Ah) and a lead-acid battery (370Ah). Moreover, the microgrid is connected to the distribution network, facilitating the buying and selling of energy. The system is connected through a 48VDC bus regulated by the lead-acid battery bank. The model used to implement the control law of the MPC- 2 has been taken from Bordons et al. (2020): SOCle(t+ 1) = SOCle(t)−KleTsPle(t),(14) SOCli(t+ 1) = SOCli(t)−KliTsPli(t),(15) with the following balance equation: Pdem(t)=Ple(t)+Pli(t)+Pgrid(t)+Pres(t),(16) Pnet(t)=Pres(t)−Pdem(t),(17) where x=[SOCle SOCli] is the state vector, u= [Pgrid Pli] is the vector of manipulated variables and finally, v=Pnet, is the disturbance that affects the system. Ple and Pli are, respectively, the power provided/absorbed by the lead-acid battery and the ion-lithium bank. The power of the lead-acid battery Ple is determined by Eq. (17). Pres is the power produced by renewable energy sources, Pdem is the power demanded by the load, and Pgrid is the power exchange with the main grid. A sign criterion has been chosen in which the energy contribution to the power bus has a positive sign, otherwise a negative value. Taking into account the expressions (17)-(17), the resulting model in matrix form is: x(t+ 1) = Ax(t)+Bu(t)+Ev(t), y(t)=Cx(t), with A=10 01 ,B=0.0468 0.0468 −0.1369 0 ,E=0.0468 0 C=10 01 , (18) where the values of matrices Band Ehave been obtained experimentally considering that the conversion coefficient for the lead-acid battery is Kle =ηle Cmax le =1.56×10−3% kW s , and for the Li-ion battery is Kli =ηli Cmax li =1.254 × 10−3% kW s . To guarantee the correct performance of the system, the MG is subject to hard constraints. Limits are set on the manipulated variables and their incremental values: −2.5 kW ≤Pgrid(t)≤6.0 kW,(19a) −3.0 kW ≤Pli(t)≤3.0 kW,(19b) −1.0 kW ≤△Pgrid(t)≤1.0 kW,(19c) −1.0 kW ≤△Pli(t)≤1.0 kW,(19d) and in the state variables: 40 % ≤SOCle(t)≤75 %,(20a) 30 % ≤SOCli(t)≤80 %.(20b) 4.1 Experiments Profiles representing the usual patterns of household energy consumption and photovoltaic panel generation on a sunlit day have been extracted from the site https://demanda.ree.es/movil/peninsula. The selected day was September 27, 2023, and the data are from the Spanish city of Seville. The considered period is 17 hours, approximately from 06:00 to 23:00 hours. Figure 3a shows the demand, solar generation and disturbance, Pnet =Pres − Pdem. The disturbance takes a negative value when the demand is higher than the generation power. The control strategy must decide according to an economical optimization whether to buy or sell energy depending on the state of the microgrid and the sale price of the kWh, denoted by pkwh(t). For that, a profile of this variable is shown in Figure 3b. Also, the upper threshold value has been depicted in this figure to set regions where to buy or sell. This information was taken from the site https://www. esios.ree.es/ on the same day that the experiments were done. For all tests, the sampling time was set to 30s for MPC- 2 and for MPC-1 (risks management) was 1 min. The prediction horizons were N= 5 and Nr= 10. The considered criteria comprise C1to C5in the objective functions of MPC-1, as described below: •C1: economic benefit. •C2: demand fulfilment. •C3: usage of the main grid. •C4: usage of the lithium battery. •C5: usage of the lead-acid battery. 318 Ascension Zafra-Cabeza et al. / IFAC PapersOnLine 58-14 (2024) 313–318 After the risk event, the fault F1is detected through the variables r1and rb 1(see Fig. 7). In this case, the reconfiguration plan executes RA1and RA2, which causes the sale to stop and the lead-acid battery to satisfy the demand, respectively. This happens despite having previously sold to the network, highlighting the priority of reconfiguring rather than mitigating risks. Figures 8 and 9 show the control variables and the microgrid output, respectively, with the mitigation of risk and the occurrence of the fault. In these figures, it can be observed that from fault detection at 21h, Pgrid = 0, the discharge of the lithium battery is less pronounced, complementing the satisfaction of demand with the lead-acid battery. Fig. 7. Residual signals for r1in experiment 2. Fig. 8. Control variables in experiment 2. Fig. 9. Levels of the outputs in experiment 2. 5. SUMMARY AND CONCLUSIONS The work described here integrates approaches to risk mitigation and fault diagnosis with different time scales to be applied in EMSs. Results show the effectiveness of the proposed hierarchy control strategy when some devices and events take place. Under this methodology, different objective functions, constraints and sampling rates differ at both levels are allowed. 6. ACKNOWLEDGEMENTS This work has been funded by PID2022-142069OB-I00/ AEI/10.13039/501100011033/ FEDER, UE REFERENCES Bahakim, S.S. and Ricardez-Sandoval, L.A. (2014). Simultaneous design and mpc-based control for dynamic systems under uncertainty: A stochastic approach. Computers and Chemical Engineering, 63, 66–81. Baron, M.M. and Pat´e-Cornell, M.E. (1999). Designing risk-management strategies for critical engineering systems. IEEE Transactions on Engineering Management, 46(1), 87–100. Bordons, C., Garcia-Torres, F., and Ridao, M. (2020). Model Predictive Control of Microgrids. Springer. Bordons, C., Garc´ıa-Torres, F., and Valverde, L. (2015). Gesti´on ´optima de la energ´ıa en microrredes con generaci´on renovable. Revista Iberoamericana de Autom´atica e Inform´atica Industrial RIAI, 12(2), 117–132. Eising, J.W., van Onna, T., and Alkemade, F. (2008). Towards smart grids: Identifying the risks that arise from the integration of energy and transport supply chains. Applied Energy, 123, 448–455. Garcia-Torres, F., Zafra-Cabeza, A., Silva, C., Grieu, S., Darure, T., and Estanqueiro, A. (2021). Model predictive control for microgrid functionalities: Review and future challenges. Energies, 14(5). doi: 10.3390/en14051296. URL https://www.mdpi.com/ 1996-1073/14/5/1296. Issermann, R. (2006). Fault-Diagnosis Systems: An Introduction from Fault Detection to Fault Tolerance. Springer. Izadi, H.A., Gordon, B.W., and Zhang, Y. (2010). A data-driven fault tolerant model predictive control with fault identification. In Proceedings of the Conference on Control and Fault-Tolerant Systems, 732–737. Marquez, J., Zafra-Cabeza, A., Bordons, C., and Ridao, M.A. (2021). A fault detection and reconfiguration approach for mpc-based energy management in an experimental microgrid. Control Engineering Practice, 107, 104695. Minciardi, R. and Robba, M. (2017). A bilevel approach for the stochastic optimal operation of interconnected microgrids. IEEE Transactions on Automation Science and Engineering, 4(2), 482–493. Petrollese, M., Valverde-Isorna, L., Cocco, D., Cau, G., and Guerra, J. (2016). Real-time integration of optimal generation scheduling with mpc for the energy management of a renewable hydrogen-based microgrid. Applied Energy, 166, 96–106. doi:10.1016/j.apenergy.2016.01. 014. S. Raimondi Cominesi, M. Farina, L.G.B.P. and Scattolini, R. (2018). A two-layer stochastic model predictive control scheme for microgrids. IEEE Transactions on Control Systems Technology, 26(1), 1–13. Zafra-Cabeza, A., Velarde, P., and Maestre, J.M. (2020). Multicriteria optimal operation of a microgrid considering risk analysis, renewable resources and model predictive control. Optimal Control Application Methods, 41, 94–106.