Optimizing Design and Control Methods for Using Collaborative Robots in Upper-Limb Rehabilitation