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 (S1) information about a measurement, comprising a voltage measurement, made at a remote location (RL) in the microgrid, wherein the remote location (RL) 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 (S2) 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 (S3) 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 (S4) a reference value for a voltage reference of the energy storage, and sending (S5) the reference value to the storage controller (3a/3b) with which the energy storage is associated, wherein the calculating (S4) comprises calculating the reference value based on the obtained (S2) participation factors and the obtained (S3) states of charge. receiving (S1) information about a measurement, comprising a voltage measurement, made at a remote location (RL) in the microgrid, wherein the remote location (RL) 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 (S2) 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 (S3) 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 (S4) a reference value for a voltage reference of the energy storage, and sending (S5) the reference value to the storage controller (3a/3b) with which the energy storage is associated, calculating (S4) a reference value for a voltage reference of the energy storage, and sending (S5) the reference value to the storage controller (3a/3b) with which the energy storage is associated, wherein the calculating (S4) comprises calculating the reference value based on the obtained (S2) participation factors and the obtained (S3) states of charge. <EOS>