Microgrid is a combination of Distributed Energy Resources (DERs) and loads that are connected within a locality. Microgrids are connected to the main grid through a Point of Common Coupling (PCC) which separates the former from the latter. In grid connected mode all the Distributed Generators (DGs) are PQ controlled with pre-defined set-points and the power imbalance is imported from or exported to the main grid. At the time of an intentional islanding or fault at the main grid level, a microgrid is able to disconnect itself from the rest of the grid and operate by itself. A microgrid may contain both directly connected and inverter interfaced sources with different control configurations. When disconnected or islanded from the main grid there are various approaches to share the load, one of them being the master-slave control where a storage device (battery) becomes the reference DG to set the nominal voltage and frequency for the entire microgrid. The State Of Charge of the battery is considered for the battery dynamics when in islanded mode for bi-directional flow. All the microsources, power electronics and their control with power management were developed in Matlab/Simulink.