A method for controlling power produced by a renewable energy source , the method comprising: regulating active power produced by the renewable energy source towards an apparent power setpoint ; based on whether a state of a switch corresponds to selection of a power factor foldback or a voltage foldback, selectively regulating voltage based on the power factor foldback or the voltage foldback associated with the renewable energy source ; wherein: when power factor foldback is selected, the method comprises regulating the power factor associated with the renewable energy source based at least in part on a power factor angle magnitude setpoint , and reducing the power factor angle magnitude setpoint towards zero when apparent power produced by the renewable energy source approaches or exceeds the apparent power setpoint; when voltage foldback is selected, the method comprises regulating voltage of the renewable energy source based at least in part on measured volt-amps reactive, VARs, and an apparent power ratio , wherein the apparent power ratio is about equal to the apparent power divided by the apparent power setpoint ; the reducing of the power factor angle magnitude setpoint towards zero further comprises folding back a power factor setpoint angle utilizing a foldback function based at least in part on measured apparent power , the apparent power setpoint , and a power factor foldback threshold ; and the foldback function is based at least in part on a ratio of measured apparent power to the apparent power setpoint , and wherein the foldback function reduces the power factor angle magnitude setpoint when the measured apparent power of the renewable energy source is greater than the apparent power setpoint . regulating active power produced by the renewable energy source towards an apparent power setpoint ; based on whether a state of a switch corresponds to selection of a power factor foldback or a voltage foldback, selectively regulating voltage based on the power factor foldback or the voltage foldback associated with the renewable energy source ; when power factor foldback is selected, the method comprises regulating the power factor associated with the renewable energy source based at least in part on a power factor angle magnitude setpoint , and reducing the power factor angle magnitude setpoint towards zero when apparent power produced by the renewable energy source approaches or exceeds the apparent power setpoint; when voltage foldback is selected, the method comprises regulating voltage of the renewable energy source based at least in part on measured volt-amps reactive, VARs, and an apparent power ratio , wherein the apparent power ratio is about equal to the apparent power divided by the apparent power setpoint ; the reducing of the power factor angle magnitude setpoint towards zero further comprises folding back a power factor setpoint angle utilizing a foldback function based at least in part on measured apparent power , the apparent power setpoint , and a power factor foldback threshold ; and the foldback function is based at least in part on a ratio of measured apparent power to the apparent power setpoint , and wherein the foldback function reduces the power factor angle magnitude setpoint when the measured apparent power of the renewable energy source is greater than the apparent power setpoint . <EOS>