Optimization of manipulator workspace