Design and control of an advanced PV inverter