A microcontroller-based power management system for standalone microgrids with hybrid power supply