  The paper proposes an optimal management strategy for a system composed by a
battery and a photovoltaic power plant. This integrated system is called to
deliver the photovoltaic power and to simultaneously provide droop-based
primary frequency regulation to the main grid. The battery state-of-energy is
controlled by power offset signals, which are determined using photovoltaic
energy generation forecasts and predictions of the energy required to operate
frequency regulation. A two level control architecture is developed. A
day-ahead planning algorithm schedules the energy profile which is traded at
the day-ahead market and defines the primary control reserve that the
integrated system is able to provide in the considered day. During the day
operations, a second level algorithm corrects the dispatched plan using updated
information, in order to guarantee a continuous and reliable service. Both
control algorithms take into account the uncertainties of the photovoltaic
generation and of the frequency dynamics using stochastic optimization.
