Moved PWM invert into the motion code