This paper presents a dq power flow based energy storage control system for reliable and stable operation of a renewable power generation based microgrid system. The control objectives are storing the excess energy from the microgrid into the storage unit or supplying energy deficit from the storage unit to the microgrid to achieve power equity between the generation and load, and regulation of voltage and frequency during stand-alone microgrid operation. Whereas during grid-connected microgrid operation, the control objective is to ensure storing energy in the storage unit and exchange power between the microgrid and the utility grid. The proposed controller is developed for inverter interface energy storages using dq power flow. The dq power flow is formulated using bus voltage components and the bus admittance matrix in dq frame. The dq power flow in the developed controller generates command (reference) active and reactive powers for the inverter interfaced storage unit connected to the microgrid buses. In addition, the implemented current controller of the inverter assures such command powers exchange between the storage unit and the microgrid. The developed dq power flow based storage unit (DQPFSU) control system is tested under various operating conditions for both in grid-connected and stand-alone microgrid operation. The test results of the developed DQPFSU controller illustrates satisfactory performance in generating fast control actions to ensure reliable and stable microgrid operation under various changing conditions. Moreover, the validity of such control actions has examined from the frequency response and bus voltages of the case study microgrid under various tested operational conditions. INDEX TERMS Energy storage, dq power flow, storage control, microgrid, inverter control.