BATTERY MANAGEMENT SYSTEM FOR MICROGRID APPLICATIONS