A Battery Management System for LiFePO4 Battery with Special Emphasis on Aging Effect