Motor management system