Speed control

The direction depends on the sign of the speed setpoint. A positive setpoint corresponds to a positive motor direction of rotation.