Citation: Rehman, K.U.; Sajid, I.; Lu, S.-D.; Ahmad, S.; Liu, H.-D.; Bakhsh, F.I.; Tariq, M.; Sarwar, A.; Lin, C.-H. Fast Tracking of Maximum Power in a Shaded Photovoltaic System Using Ali Baba and the Forty Thieves (AFT) Algorithm. Processes 2023, 11, 2946. https://doi.org/10.3390/ pr11102946 Academic Editor: Luigi Piga Received: 29 August 2023 Revised: 4 October 2023 Accepted: 7 October 2023 Published: 10 October 2023 Copyright: © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). processes Article Fast Tracking of Maximum Power in a Shaded Photovoltaic System Using Ali Baba and the Forty Thieves (AFT) Algorithm Khalil Ur Rehman 1 , Injila Sajid 1 , Shiue-Der Lu 2, * , Shafiq Ahmad 3 , Hwa-Dong Liu 4, * , Farhad Ilahi Bakhsh 5 , Mohd Tariq 6 , Adil Sarwar 1 and Chang-Hua Lin 7 1 Department of Electrical Engineering, ZHCET, Aligarh Muslim University, Aligarh 202002, India; khalilurrehman937@gmail.com (K.U.R.); injila.sajid123@gmail.com (I.S.); adil.sarwar@zhcet.ac.in (A.S.) 2 Department of Electrical Engineering, National Chin-Yi University of Technology, Taichung 411, Taiwan 3 Industrial Engineering Department, College of Engineering, King Saud University, Riyadh 11421, Saudi Arabia; ashafiq@ksu.edu.sa 4 Undergraduate Program of Vehicle and Energy Engineering, National Taiwan Normal University, Taipei 106, Taiwan 5 Department of Electrical Engineering, National Institute of Technology, Srinagar 190006, India; farhad@nitsri.ac.in 6 Department of Electrical and Computer Engineering, Florida International University, Miami, FL 33174, USA; tmohd@fiu.edu 7 Department of Electrical Engineering, National Taiwan University of Science and Technology, Taipei 106, Taiwan; link@mail.ntust.edu.tw * Correspondence: sdl@ncut.edu.tw (S.-D.L.); hdliu@ntnu.edu.tw (H.-D.L.) Abstract: Photovoltaic (PV) generation systems that are partially shaded have a non-linear operating curve that is highly dependent on temperature and irradiance conditions. Shading from surrounding objects like clouds, trees, and buildings creates partial shading conditions (PSC) that can cause hot spot formation on PV panels. To prevent this, bypass diodes are installed in parallel across each panel, resulting in a global maximum power point (GMPP) and multiple local maximum power points (LMPPs) on the power-voltage (P-V) curve. Traditional methods for maximum power point tracking (MPPT), such as perturb and observe (P&O) and incremental conductance (INC), converge for LMPPs on the P-V curve, but metaheuristic algorithms can track the GMPP effectively. This paper proposes a new, efficient, and robust GMPP tracking technique based on a nature-inspired algorithm called Ali Baba and the Forty Thieves (AFT). Utilizing the AFT algorithm for MPPT in PV systems has several novel features and advantages, including its adaptability, exploration-exploitation balance, simplicity, efficiency, and innovative approach. These characteristics make AFT a promising choice for enhancing the efficiency of PV systems under varied circumstances. The performance of the proposed method in tracking the GMPP is evaluated using a simulation model under MATLAB/Simulink environment, the achieved simulation results are compared to particle swarm optimization (PSO). The proposed method is also tested in real-time using the Hardware-in-the-loop (HIL) emulator to validate the achieved simulation results. The findings indicate that the proposed AFT-based GMPP tracking method performs better under complex partial irradiance conditions than PSO. Keywords: Ali Baba and the Forty Thieves algorithm; maximum power point tracking (MPPT); metaheuristic algorithms; conventional algorithms; photovoltaic (PV) 1. Introduction Solar energy receives special attention because of its long-term viability, abundant supply, pollution-free nature, and lack of carbon emissions. Photovoltaic (PV) systems are now used in over 100 nations for both independent and grid-connected applications. PV power, which includes both off-grid remote power supply and grid-connected systems, is the fastest-growing electricity-generating technology, with current annual growth rates of approximately 40%. Numerous devices, including drones, cars, satellites, embedded Processes 2023, 11, 2946. https://doi.org/10.3390/pr11102946 https://www.mdpi.com/journal/processes