Model Predictive Control for Primary Regulation of Islanded Microgrids