This article presents a method for the Maximum Power Point Tracking (MPPT) of a Photovoltaic (PV) panels array with partial shading, applying an Improved Pattern Search Method (IPSM). The method is simulated in PSIM @ and then implemented in hardware in the loop system, emulating the PV array on an industrial computer (Speedgoat) that allows real-time emulations and the IPSM is applied in an Arduino DUE. The experiments were carried out with TP245S-20/WD, KYOCERA KC200GT, YINGLY SOLAR JS65, and MSX60 photovoltaic panels. The results are the proper MPPT with changes in partial shading over time, inducing the increase and decrease of the maximum power point. The results obtained are the search for the global maximum power point in a matrix of panels in which, due to partial shading, it might have several local maximum power points, and thanks to the IPSM algorithm, it always manages to find the global maximum power point. Finally, the results are compared with other methods where it was found that IPSM had faster answers.