Minimum-time system inversion based motion planning for residual vibration reduction