This document presents a new multilevel DC-link inverter and control algorithm called the "PV permutation algorithm" to overcome the problem of partial shading of photovoltaic (PV) sources connected in series. The algorithm uses direct pulsewidth modulation, sequential permutation of the PV sources, and output generation to control a seven-level inverter and extract maximum power from each PV source under nonuniform irradiance conditions like partial shading. Experimental results demonstrate the application of the new algorithm for real-time maximum power point tracking of each PV source to deliver all available power to the load.