This paper presents a dc-link voltage ripple compensation method for flying-capacitor (FC)-based active neutral- point-clamped multilevel converters operating under selective harmonic elimination pulsewidth modulation. The method is based on feedforward modifcation of the modulation index according to the ripple on the dc-link voltage, effectively altering the switching control functions. The low-order harmonics in the output due to the presence of the dc-link ripple are eliminated. In addition, a control strategy that actively regulates the flying capacitor voltages of each phase to the reference value and controls the neutral point voltage deviation is implemented. The performance of the dc ripple harmonic compensation method and regulation strategies are evaluated through simulation and experimental results from a three-phase, five-level laboratory prototype.