## 2 Microgrid Hierarchical Control Group
### Secondary Control  
The secondary hierarchy control level is subject to reliable monitoring, which guarantees and protects the operation of microgrids in both grid-connected and islanded modes. Monitoring the system variables means supervising both voltage amplitude and frequency deviations to make the required adjustments. It is also referred to as the microgrid energy management system (EMS) by regulating the power flow and power quality within the microgrids. The EMS approach can be classified as centralized and decentralized approaches that serve to manage the unpredictability and intermittent of RESs and load demand [28]. The secondary control guarantees that frequency and voltage deviations are controlled near zero within the load variations or generation in the microgrid and serves the power system by rectifying the grid frequency deviations to within permissible limits [16]. For islanded microgrid operation, the secondary control family is considered as the highest rank in the hierarchical level. According to [2; 6], the secondary control has a slower behavior in dynamic response when the secondary unit is detached from primary control, which lessens the communication bandwidth by using sampled measurements of the microgrid variables to permit enough time to execute intricate calculations. A central controller is relatively essential to ensure that the power system operates as seamlessly as possible during significant disturbances and during grid synchronization and transition between the microgrid modes (islanded to grid mode and vice versa) as per market requirements. It can be realized by utilizing an external centralized controller to restore permanent voltage and frequency deviations produced by the primary control.  
The architecture of the centralized approach consists of a central controller, which delivers pertinent information of each DG unit and load within the microgrid, and the network itself. The implementation of the centralized method allows for the completion of online optimization routines, given that all the relevant information are collected at a sole point. For instance, the measurements of the main grid's frequency and voltage are realized to generate reference signals and are used by the secondary control loop to provide grid-connected operation mode. The optimal dispatch in [29] mainly performs the analyzed offline calculation in terms of cost and system performance in low-voltage microgrids. In addition, at this level, it is significant to interface the DGs and the ESS via master-slave units [30]. Through this approach, all slave converters can be modeled as current sources. In the islanded operation mode, the battery bank itself operates as a master converter that provides the reference voltage and operating frequency for other sources, which act as slave units. Whereas in grid-connected mode, the latter works as master units and serves to provides the reference voltage and frequency to the PCC. The studies in [31; 32] has demonstrated the effectiveness of isolated mode control in an islanded microgrid system including PV system, diesel generator, ESS and even tidal turbine. Other approaches include optimal power flow [33] and terminal sliding mode [34], among others, for several feasible scenarios of the microgrid.  
On the other hand, the decentralized method is primarily addressed in the microgrid central controller (MGCC) throughout the multi-agent system (MAS) framework. MAS consists of multiple intelligent agents that operate by relying upon local information, which interacts with one another to achieve global and local objectives. A comprehensive review of the MAS approach is presented in [35]. Meanwhile, MAS implementation is proposed in [36; 37]. An approach in [38] includes an additional agent (fuzzy cognitive maps) to reduce the risk of total system breakdown since a possible failure of some decentralized agents is not distinguished from a total EMS failure.