Considering the environmental, economic, and political context, the integration of renewable energies in electricity production has become essential. Due to its many advantages, solar photovoltaic (PV) energy is one of the most promising solutions. However, the overvoltage of the distribution line network during high power periods and the mismatch between the moments of photovoltaic production and the moments of load consumption impose limits on the integration of photovoltaic systems. This paper proposes a new method to control the integration of photovoltaic systems connected to the grid. This paper proposes a new method of control of the boost chopper for the extraction of the maximum available power (MPPT) and an adequate control system of the inverter interfacing with the grid to solve the problems related to the power quality standards. Indeed, a Modified shuffled frog leaping algorithm (MSFLA) is used to efficiently determine the values of the sliding mode controller (SMC) parameters performing the MPPT task. In addition, the power flow direction is taken into account according to the system architecture to satisfy the grid connection through the coordinated active and reactive power control of the grid side inverter. The found simulation results validate the performance of the proposed control system.