I. Introduction
Widespread contribution of distributed energy resources (DERs), in the form of either distributed generation (DG) or distributed energy storage (DES) systems, will make the whole system more reliable, but this will add another concern to previous ones. The basic and the most commonly used control structure for microgrids (MGs) is the hierarchical control, including primary control (droop control and primary stabilization), secondary control (restoration of voltage and frequency), and tertiary control (optimal operation). MG can be operated both in grid-connected or islanded mode. In islanded operations, the task of voltage and frequency regulation is the responsibility of the primary layer. As due to primary layer operation, the voltage and frequency have some deviation from their nominal values, and the secondary controller is responsible for compensation of these deviations [1]–[3].