  With the rising adoption of distributed energy resources (DERs), microgrid
dispatch is facing new challenges: DER owners are independent stakeholders
seeking to maximize their individual profits rather than being controlled
centrally; and the dispatch of renewable generators may affect the microgrid's
exposure to uncertainty. To address these challenges, this paper proposes a
two-stage robust microgrid dispatch model with real-time energy sharing and
endogenous uncertainty. In the day-ahead stage, the connection/disconnection of
renewable generators is optimized, which influences the size and dimension of
the uncertainty set. As a result, the uncertainty set is endogenously given. In
addition, non-anticipative operational bounds for energy storage (ES) are
derived to enable the online operation of ES in real-time. In the real-time
stage, DER owners (consumers and prosumers) share energy with each other via a
proposed energy sharing mechanism, which forms a generalized Nash game. To
solve the robust microgrid dispatch model, we develop an equivalent
optimization model to compute the real-time energy sharing equilibrium. Based
on this, a projection-based column-and-constraint generation (C&CG) method is
proposed to handle the endogenous uncertainty. Numerical experiments show the
effectiveness and advantages of the proposed model and method.
