Opal-RT real-time simulator has been used for hardware implementation of AC, DC and hybrid microgrids. The simulator is used to design control architectures for the microgrid. Using external sensors, the electrical quantities are fed to the real-time controlling running in the simulator and based on the real-time control, digital signals are given to external hardware for firing of power electronic devices. Opal-RT simulator gives capability to design and test controllers for AC microgrid, DC microgrid and hybrid microgrid.In AC microgrids, the primary, secondary and tertiary control of inverter-based systems is developed and tested. In an inverter dominant AC microgrid, a decentralized control and a fully distributed-hierarchical control strategy is developed with key objectives are summarized as follows: • To develop damping controller to mitigate low-frequency oscillation issues. • To restore the frequency to its rated value as well as to achieve the optimal active power sharing using incremental cost. • To restore the average voltage of microgrid and simultaneously maintaining the reactive power-sharing. The experimental hardware setup is developed for the same, considering three inverters followed by LC filters, distribution lines, and resistive and inductive loads. Multiple OPAL-RT real-time controllers were used for signal acquisition and to implement the proposed distributed control scheme. The user interface and interaction with the real-time simulator was provided using the host computer. TCP/IP communication links were established. In DC microgrids, distributed power flow control of two DC microgrids interconnected by a tie-line for microgrids owned by different utilities is achieved. To this end, the work presents a distributed control scheme to regulate tie-line power flow between two autonomous dc microgrid clusters. In this work, a unifying hierarchical control scheme based on distributed communication is proposed where the tie-line power flow control based on a pinning control strategy is unified with the distributed optimization and average voltage regulation control loops. The distributed optimization utilizes economic dispatch to minimize the operating costs of the DG, while the average voltage control regulates the microgrid’s average voltage at its nominal value. With the application of this approach, the responsibility of tie-line regulation is distributed in an economic manner without degrading the voltage quality in the system. Real-time control is achieved using Ethernet based communication system. The power system is modeled in OPAL-RT simulator while the communication system is implemented using TCP/IP based communication system. In the case of AC-DC hybrid microgrid, a PV with its boost converter (BC), battery energy storage (BES) with its bidirectional DC-DC converter (BDC) and diesel generator (DG) with its single phase PWM controlled voltage source converter are connected to a common dc link feeding DC load. Moreover, a three phase PWM controlled voltage source inverter is interfaced at the DC link to feed three/single phase AC load. In this work, a power-management scheme (PMS)is developed to manage the load and source power imbalances and operate the system reliably under min and max SoC limit conditions. A secondary optimal power sharing control is also implemented to share the load power optimally between DG and BES.