This study proposes a classical control algorithm for solving the transcendental set of equations for the unequal DC sources of five-level multilevel inverters (MLIs). Such sources can be generated from renewable energy sources. Two DC sources with different values are used to produce an output voltage with five levels. Then, a set of two transcendental equations is formulated with two targeted functions to control the fundamental component and cancel the stipulated single harmonic order. The proposed solution uses a simple classical proportional control with two loops to generate two switching angles. The first switching angle is assigned with an initial value, whereas the second one is calculated from the inner loop. The outer loop is used to cancel the specified harmonic by sending the error signal to the proposed proportional control that tunes the switching angles. The proposed algorithm is easy, fast, and accurate, and has a wide-range solution in terms of modulation index (MI ) and input DC source ratio (x=V1V2≤1). The proposed algorithm is tested for a wide range of MI and x to verify its feasibility. Moreover, several simulation and laboratory tests are presented to further validate the applicability of the proposed approach.