An energy storage system for renewable energy applications, comprising: a renewable energy source; a bidirectional inverter connected to an AC bus and a DC bus, wherein the bidirectional inverter is connected to the renewable energy source and a bidirectional DC/DC converter through the DC bus; an energy storage unit connected to the bidirectional DC/DC converter; a control system comprising one or more controllers coupled to the bidirectional inverter and the bidirectional DC/DC converter, the control system configured to control the operation of the bidirectional DC/DC converter and the bidirectional inverter, wherein the control system is configured to control the bidirectional inverter to operate in a maximum power point tracking, MPPT, mode or a grid storage mode, wherein the control system is configured to control an on-the-fly transition between the MPPT mode and the grid storage mode, wherein the control system is configured to receive a power command, control supplying power to the utility grid for frequency regulation when the power command is a positive power command, control absorbing power from the utility grid when the power command is a negative power command, control receiving a second power command, and control supplying power to the utility grid or absorbing power from the utility grid in accordance with the second power command, characterised in that the controller is configured such that when the power command is positive and the second power command is negative, the bidirectional inverter is initially in the MPPT mode and the control system disables the MPPT mode and enables the grid storage mode, wherein when the power command is negative and the second power command is positive, the bidirectional inverter is initially in the grid storage mode and the control system disables the grid storage mode and enables the MPPT mode, wherein when the power command is positive and the second power command is positive, the bidirectional inverter is initially in the MPPT mode and the control system continues to operate in the MPPT mode, and wherein when the power command is negative and the second power command is negative, the bidirectional inverter is initially in the grid storage mode and the control system continues to operate in the grid storage mode. a renewable energy source; a bidirectional inverter connected to an AC bus and a DC bus, wherein the bidirectional inverter is connected to the renewable energy source and a bidirectional DC/DC converter through the DC bus; an energy storage unit connected to the bidirectional DC/DC converter; a control system comprising one or more controllers coupled to the bidirectional inverter and the bidirectional DC/DC converter, the control system configured to control the operation of the bidirectional DC/DC converter and the bidirectional inverter, wherein the control system is configured to control the bidirectional inverter to operate in a maximum power point tracking, MPPT, mode or a grid storage mode, wherein the control system is configured to control an on-the-fly transition between the MPPT mode and the grid storage mode, wherein the control system is configured to receive a power command, control supplying power to the utility grid for frequency regulation when the power command is a positive power command, control absorbing power from the utility grid when the power command is a negative power command, control receiving a second power command, and control supplying power to the utility grid or absorbing power from the utility grid in accordance with the second power command, characterised in that the controller is configured such that when the power command is positive and the second power command is negative, the bidirectional inverter is initially in the MPPT mode and the control system disables the MPPT mode and enables the grid storage mode, wherein when the power command is negative and the second power command is positive, the bidirectional inverter is initially in the grid storage mode and the control system disables the grid storage mode and enables the MPPT mode, wherein when the power command is positive and the second power command is positive, the bidirectional inverter is initially in the MPPT mode and the control system continues to operate in the MPPT mode, and wherein when the power command is negative and the second power command is negative, the bidirectional inverter is initially in the grid storage mode and the control system continues to operate in the grid storage mode.