This paper presents an efficient and fast method for fine tuning the controller parameters of robot manipulators in constrained motion. The stability of the robotic system is proved using a Lyapunov-based impedance approach whereas the optimal design of the controller parameters are tuned, in offline, by a Particle Swarm Optimization (PSO) algorithm. For designing the PSO method, different index performances are considered in both joint and Cartesian spaces. A 3DOF manipulator constrained to a circular trajectory is finally used to validate the performances of the proposed approach. The simulation results show the stability and the performances of the proposed approach.