Code for my custom BLDC vontroller.