A method performed by a network controller of an electrical power microgrid comprising a plurality of energy storages, each energy storage being associated with a respective storage controller, the method comprising: receiving information about a measurement, comprising a voltage measurement, made at a remote location in the microgrid, wherein the remote location is: at a Point of Common Coupling, PCC, of the microgrid with an AC grid, or at a location where a distributed generator, DG, is connected in the microgrid; obtaining respective participation factors in respect of the remote location for each of at least a first energy storage and a second energy storage of the plurality of energy storages, wherein a participation factor for the first energy storage corresponds to an impact of active power injection from the first energy storage on a frequency deviation measured at the remote location and a participation factor for the second energy storage corresponds to influence of reactive power injection from the second energy storage on the voltage measured at the remote location; obtaining respective states of charge of each of said at least first and second energy storages; and for each of the at least first and second energy storages (2a/2b): calculating a reference value for a voltage reference of the energy storage, and sending the reference value to the storage controller (3a/3b) with which the energy storage is associated, wherein the calculating comprises calculating the reference value based on the obtained participation factors and the obtained states of charge. receiving information about a measurement, comprising a voltage measurement, made at a remote location in the microgrid, wherein the remote location is: at a Point of Common Coupling, PCC, of the microgrid with an AC grid, or at a location where a distributed generator, DG, is connected in the microgrid; at a Point of Common Coupling, PCC, of the microgrid with an AC grid, or at a location where a distributed generator, DG, is connected in the microgrid; obtaining respective participation factors in respect of the remote location for each of at least a first energy storage and a second energy storage of the plurality of energy storages, wherein a participation factor for the first energy storage corresponds to an impact of active power injection from the first energy storage on a frequency deviation measured at the remote location and a participation factor for the second energy storage corresponds to influence of reactive power injection from the second energy storage on the voltage measured at the remote location; obtaining respective states of charge of each of said at least first and second energy storages; and for each of the at least first and second energy storages (2a/2b): calculating a reference value for a voltage reference of the energy storage, and sending the reference value to the storage controller (3a/3b) with which the energy storage is associated, calculating a reference value for a voltage reference of the energy storage, and sending the reference value to the storage controller (3a/3b) with which the energy storage is associated, wherein the calculating comprises calculating the reference value based on the obtained participation factors and the obtained states of charge.