A method for motion/force control of robot arms with model uncertainties is presented. Tracking control of complex trajectories is guaranteed using a Lyapunov approach with high-precision performance ensured using a particle swarm optimization (PSO) algorithm. Tracking performance and robustness are simulated for a robotic device for limb rehabilitation that is designed to be adapted easily to different subjects by considering model parameter uncertainties. Controller parameters are optimized offline using the PSO algorithm with Lyapunov stability conditions considered as inequality constraints. Using the control scheme, the robot can guide limbs on smooth and non-smooth trajectories, under model uncertainties and measurement noise.