This project proposes an advanced frequency locked loop (AFLL) based control algorithm for a three phase double stage grid interfaced solar photovoltaic (PV) system. This AFLL based algorithm extracts fundamental component of the load current and eliminates harmonics, performs grid currents balancing, improves the system performance during distorted grid conditions, and isolates the system during the occurrence of a grid fault. In a long radial network, the far away ends have the problem of voltage quality but this controller maintains the grid power quality by providing required reactive and active powers to the grid. The voltage source converter (VSC) of the PV system supplies the PV energy to the grid even under the worst situations of dc offset, solar insolation variation, load unbalancing, grid faults, voltage distortion, voltage unbalance, and voltage swell/sag. The VSC switching losses are reduced using an adaptive dc link voltage. This system is modeled and simulated in MATLAB.