Proliferation of nonlinear loads in the power system has led to the appearance of nonsinusoidal voltage waveforms. Asymmetrical distribution of large 1-φ loads further complicates the issue by causing imbalance in the 3-φ supply voltage. Such a supply can adversely affect the equipment sensitive to voltage waveform quality. Hence, voltage compensation is desirable. A series active filter can be used for this purpose, but its performance must be optimized in the presence of distorted line current waveforms. Under nonsinusoidal voltage and current conditions, it is not possible to reduce the voltage distortion to any desired level without compromising with the power factor. This paper presents a new control algorithm for a series active filter which optimizes the power factor, balances the voltages, limits the voltage total harmonic distortion and ensures a high-quality voltage supply to sensitive loads. It does not use p-q theory and is also applicable to 1-φ systems.