Optimum Trajectory Planning for Redundant Manipulators Through Inverse Dynamics