Optimal system inversion based motion planning for servosystems with elastic transmission