Backlash acceleration compensation when inversing, reversing direction