Control strategy for renewable energies and smart grids