Increasing energy needs, pollution of nature, and eventual depletion of resources have prompted humanity to obtain new technologies and produce energy using clean sources and re-newables. In this paper, we design an advanced method to improve the performance of a sliding mode controller combined with control theory for a photovoltaic system. Specifically, we decouple the controlled output of the system from any perturbation source and assess the effectiveness of the results in terms of solution quality, closed-loop control stability, and dynamical convergence of the state variables. This study focuses on the climatic conditions that may affect the behavior of a solar energy plant to supply a motor with the highest possible efficiency and nominal operating condi-tions. The designed method enables us to obtain an optimal performance by means of advanced control techniques and a slime mould stochastic optimization algorithm. The efficiency and performance of this method are examined based on a benchmark model of a photovoltaic system via numerical analysis and simulation.