A method for controlling a renewable energy solar farm including one or more renewable energy sources, the method comprising: measuring aggregate power factor and reactive power of the renewable energy solar farm; measuring individual inverter reactive power rating of inverters associated with the one or more renewable energy sources; and controlling energy production from the one or more renewable energy sources via a controller, wherein the controller is configured to receive a power factor setpoint as an input from a remote monitoring ststion; subtract the measured grid power factor from the power factor setpoint and apply the result to a first PI regulator including a voltage limiter, to generate a regulated power factor; input the regulated power factor to a switch to select the mode of operation, and generating a first output based on a voltage setpoint or the regulated power factor; apply the first output to a second PI regulator to generate a net VAR command, the second PI regulator including a Q-min limiter; convert the VAR command to a power setpoint for each individual inverter by multiplying the VAR command by the inverter reactive power rating and dividing by the farm reactive power; and communicate the power setpoint to each individual inverter associated with each renewable energy source. measuring aggregate power factor and reactive power of the renewable energy solar farm; measuring individual inverter reactive power rating of inverters associated with the one or more renewable energy sources; and controlling energy production from the one or more renewable energy sources via a controller, wherein the controller is configured to receive a power factor setpoint as an input from a remote monitoring ststion; subtract the measured grid power factor from the power factor setpoint and apply the result to a first PI regulator including a voltage limiter, to generate a regulated power factor; input the regulated power factor to a switch to select the mode of operation, and generating a first output based on a voltage setpoint or the regulated power factor; apply the first output to a second PI regulator to generate a net VAR command, the second PI regulator including a Q-min limiter; convert the VAR command to a power setpoint for each individual inverter by multiplying the VAR command by the inverter reactive power rating and dividing by the farm reactive power; and communicate the power setpoint to each individual inverter associated with each renewable energy source. receive a power factor setpoint as an input from a remote monitoring ststion; subtract the measured grid power factor from the power factor setpoint and apply the result to a first PI regulator including a voltage limiter, to generate a regulated power factor; input the regulated power factor to a switch to select the mode of operation, and generating a first output based on a voltage setpoint or the regulated power factor; apply the first output to a second PI regulator to generate a net VAR command, the second PI regulator including a Q-min limiter; convert the VAR command to a power setpoint for each individual inverter by multiplying the VAR command by the inverter reactive power rating and dividing by the farm reactive power; and communicate the power setpoint to each individual inverter associated with each renewable energy source.