This paper proposes a high performance control scheme for a double function grid-tied double-stage PV system. It is based on model predictive power control with space vector modulation. This strategy uses a discrete model of the system based on the time domain to generate the average voltage vector at each sampling period, with the aim of canceling the errors between the estimated active and reactive power values and their references. Also, it imposes a sinusoidal waveform of the current at the grid side, which allows active power filtering without a harmonic currents identification phase. The latter attempts to reduce the size and cost of the system as well as providing better performance. In addition, it can be implemented in a low-cost control platform due to its simplicity. A double-stage PV system is selected due to its flexibility in control, unlike single-stage strategies. Sliding mode control-based particle swarm optimization (PSO) is used to track the maximum power of the PV system. It offers high accuracy and good robustness. Concerning DC bus voltage of the inverter, the anti-windup PI controller is tuned offline using the particle swarm optimization algorithm to deliver optimal performance in DC bus voltage regulation. The overall system has been designed and validated in an experimental prototype; the obtained results in different phases demonstrate the higher performance and the better efficiency of the proposed system in terms of power quality enhancement and PV power injection.Energies 2018, 11, 3516 2 of 26 and in the center of a big city [6], because sunlight is available almost everywhere. Photovoltaic electricity can be produced as close as possible to its place of consumption in a decentralized way [7], directly to the user, which makes it accessible to a large part of the world's population.Much research and development are conducted about the critical elements of photovoltaic energy; starting with energy generation [6], conversion, then injection into the network [8], as well as energy management [9]. The key problem with photovoltaic energy generation is the difficulty of achieving the highest energy yield for PV panels. The voltage of a PV panel strongly depends on the connected load due to the non-linear behavior of the PV cell [10]. Therefore, various Maximum Power Point Tracking (MPPT) algorithms have been established to allow panels operate in optimal conditions, and thus, to track the maximum power point [6,11]. Among these algorithms are "Perturbation & Observation (P&O)" [12] and "incremental conductance (InCon)" [13] which are the most used due to the simplicity of their implementation. However, the abovementioned methods are constrained by the amplitude of the injected perturbations, which determines the importance of the oscillations around the Maximum power point (MPP) as well as the convergence time. To overcome this problem, several algorithms have been developed based on techniques derived from artificial intelligence such as Fuzzy Logic [14], Neural Network [15], Neuro-Fuz...