This paper presents a Unified Power Quality Conditioner (UPQC) with a 27-level inverter based on an asymmetric H-bridge topology. Each phase of the inverter is composed of three H-bridges, supplied by three DC sources scaled in the power of three. The output of the multilevel inverter is connected directly to the point of common coupling (PCC) without the need to a transformer or a filter. The calculation of the Shunt Active Power Filter (SAPF) compensation current is based on the generalized theory of synchronous frame (d-q theory) while the calculation of a series active filter voltage is based on Instantaneous Reactive Power (p-q theory). The control of the SAPF is achieved by using a closed-loop vector control followed by a new multilev...