  With the gradual transformation of power generation towards renewables,
distributed energy resources are becoming more and more relevant for grid
stabilization. In order to involve all participants in the joint solution of
this challenging task, we propose a distributed, model-based and unifying
controller for frequency and voltage regulation in AC microgrids, based on
steady-state optimal control. It not only unifies frequency and voltage
control, but also incorporates the classic hierarchy of primary, secondary and
tertiary control layers with each closed-loop equilibrium being a minimizer of
a user-defined cost function. By considering the individual voltage limits as
additional constraints in the corresponding optimization problem, no
superordinate specification of voltage setpoints is required. Since the dynamic
model of the microgrid has a port-Hamiltonian structure, stability of the
overall system can be assessed using shifted passivity properties. Furthermore,
we demonstrate the effectiveness of the controller and its robustness against
fluctuations in active and reactive power demand by means of numerical
examples.
