A microgrid control strategy to save energy and curb global carbon emissions