Employing synchronous optimal pulsewidth modulation (PWM) techniques permits operating the PWM inverter of medium-voltage drives at very low switching frequency. The switching losses of the power semiconductor devices are thus reduced. The benefit is that a given inverter produces higher fundamental power. The optimal pulse patterns are determined by offline calculation, assuming steady-state operation of the drive machine. Dynamic modulation errors and high overcurrents, as a consequence, are therefore encountered when the operating conditions change. To overcome this problem, the harmonic components of the stator flux linkage vector are subjected to closed-loop control. The target trajectory is derived from the respective pulse pattern in use, while the actual stator flux trajectory is estimated. The approach is insensitive to parameter variations. It eliminates excessive transients when the operating conditions change. Experimental results obtained from an industrial 1-MVA 4.16-kV three-level inverter ac drive are presented.