While current control and PWM switching play the most direct role in driving brushless DC motors, the motion profile and position-control loop are also essential.
PID control loops are everywhere, found in flight controllers for drones and the temperature control code for 3D printers. How do you teach PID control loops? [Tim] has a great demonstration for this, ...