A microgrid including distributed generation sources (DGS) is generally connected to the other microgrid to provide power to its loads. With the development of microgrids, the influence of transient response is needed to be considered. When microgrids are in their isolated modes, voltages and phase angle are totally different from each other. At the meantime, the microgrids become weak systems with unbalanced and distorted voltages. This thesis presents a synchronization controller for the DGS considering imbalanced three-phase voltages and harmonic voltages. The proposed method can be implemented without altering the traditional phase-locked loop (PLL) circuit. Finally, the proposed synchronization controller is realized using OPAL-RT real time digital simulator.