Four-leg converter topology has played a major role in three-phase four-wire systems for mitigating harmonics, load balancing, reactive power compensation, etc. This paper presents a novel algorithm for detection and compensation for unbalanced non-linear loads, based on double reduced-order generalized integrators (DROGI) with improved proportional resonant (PR) controller. The first integrator of DROGI is used to extract the required reference unbalanced harmonic compensation currents for power quality improvement. The second integrator is used to decouple the currents of the converter side for DC link voltage regulation. As a result, the compensation mode (DC-AC) and rectification mode (AC-DC) of the converter are decoupled and regulated. An improved PR controller is used for current regulation. Thus, four-leg converter operation with fast dynamic response, robust performance, and flexible controllability is achieved. The effectiveness of the proposed algorithm is validated by both simulation and experimental results for a 1 KW system.