Brushless DC Motor controller