Introduction to distributed generation (DG), microgrids and smart grids. Role of DG as an interface between renewable energy sources and electrical networks. Fundamental components of smart grids : control systems, measurement units, communication systems and computer systems. Problems related to smart microgrids : islanding detection and islanding protection. Mathematical tools for the modelling and control of smart microgrids. Active islanding detection and introduction to an enhanced phase-locked loop (PLL). Control strategies of electronically-coupled DG units interfaced to grid through L-filter, LCL-filter and LC-filter. Control of islanded DG units and islanded microgrids with passive loads, balanced/unbalanced loads, and nonlinear loads. Design of robust controllers for microgrid systems based on Linear Quadratic Tracker (LQT). Power quality challenges associated with microgrids and the proposed solutions using enhanced control techniques. Stability analysis of microgrids with uncertain dynamics.