When a microgrid is mainly supplied by renewable energy sources (RESs), the frequency deviations may deteriorate significantly the power quality delivered to the loads. This paper proposes a frequency-based control strategy, ensuring the frequency among the strict limits imposed by the Standard EN 50160. The frequency of the microgrid common AC bus is determined by the energy storage converter, implementing a proposed droop curve among the state of charge (SoC) of the battery and the frequency. Therefore, the information of the SoC becomes known to every distributed energy resource (DER) of the microgrid and determines the active power injection of the converter-interfaced DERs. The active power injection of the rotating generators remains unaffected, while any mismatch among the power generation and consumption is absorbed by the energy storage system. Finally, in case of a solid short-circuit within the microgrid, the energy storage system detects the severe voltage decrease and injects a large current in order to clear the fault by activating the protection device closer to the fault. The proposed control methodology is applied in a microgrid with PVs, wind generators and a battery, while its effectiveness is evaluated by detailed simulation tests.