Critical review and functional safety of a battery management system for large-scale lithium-ion battery pack technologies