  Modeled after the hierarchical control architecture of power transmission
systems, a layering of primary, secondary, and tertiary control has become the
standard operation paradigm for islanded microgrids. Despite this superficial
similarity, the control objectives in microgrids across these three layers are
varied and ambitious, and they must be achieved while allowing for robust
plug-and-play operation and maximal flexibility, without hierarchical decision
making and time-scale separations. In this work, we explore control strategies
for these three layers and illuminate some possibly-unexpected connections and
dependencies among them. Building from a first-principle analysis of
decentralized primary droop control, we study centralized, decentralized, and
distributed architectures for secondary frequency regulation. We find that
averaging-based distributed controllers using communication among the
generation units offer the best combination of flexibility and performance. We
further leverage these results to study constrained AC economic dispatch in a
tertiary control layer. Surprisingly, we show that the minimizers of the
economic dispatch problem are in one-to-one correspondence with the set of
steady-states reachable by droop control. In other words, the adoption of droop
control is necessary and sufficient to achieve economic optimization. This
equivalence results in simple guidelines to select the droop coefficients,
which include the known criteria for power sharing. We illustrate the
performance and robustness of our designs through simulations.
