The effect of partial shading has a strong influence on the production of photovoltaic solar systems. In fact, when this phenomenon occurs, several power peaks appear on the power-voltage curve (P, V). These peaks are divided between the local maxima and a global maximum. This latter presents the superior maximum compared to the local maxima. Therefore, in this case, the conventional MPPT methods such as Incremental Conductance (INC) and Perturb and Observe (P&O) do not have the ability to detect and track the highest peak. Thus, this causes the important loss of power. To overcome this issue, this study focusses on the design of a new method able to distinguish the global maximum power point (GMPP). This method is composed of two loops of control, the particle swarm optimization (PSO) and the sliding mode controller (SMC). The first loop, which consists of PSO, sweeps the power-voltage curve by looking for the GMPP, after that generates the reference of corresponding optimal voltage. While the second loop is designed to track the voltage reference by acting on the duty cycle of the SEPIC converter. This method is characterized by its robustness against the parameters' changes and the modeling error thanks to the SMC controller designed. In addition, the PSO used improves efficiency of the PV modules subjected to the non-uniform meteorological conditions. The simulation results show the rapidity and accuracy of the proposed method for localizing and tracking the global power maximum. In fact, according to the results, the proposed controller has a convergence time about 63ms depending on the shading pattern. Moreover, it is able to detect the meteorological conditions change. To prove the advantages of the proposed technique, this one is compared with the hybrid controllers those composed of P&O and INC combined with BSC and SMC controllers.