A new proposal for the placement, integration, and control of unified power quality conditioner (UPQC) in distributed generation (DG)-based grid connected/autonomous microgrid/microgeneration (μG) system has been presented here. The DG converters (with storage) and the shunt part of the UPQC Active Power Filter (APFsh) is placed at the Point of Common Coupling (PCC). The series part of the UPQC (APFse) is connected before the PCC and in series with the grid. The dc link can also be integrated with the storage system. An intelligent islanding detection and reconnection technique (IR) are introduced in the UPQC as a secondary control. Hence, it is termed as UPQCμG-IR. The advantages of the proposed UPQCμG-IR over the normal UPQC are to compensate voltage interruption in addition to voltage sag/swell, harmonic, and reactive power compensation in the interconnected mode. During the interconnected and islanded mode, DG converter with storage will supply the active power only and the shunt part of the UPQC will compensate the reactive and harmonic power of the load. It also offers the DG converter to remain connected during the voltage disturbance including phase jump.