Design and Development of Model Predictive Primary Control of Micro Grids