Particle swarm optimization (PSO) is a heuristic optimization algorithm and is commonly used for the tuning of PD/PID-type controllers. In this paper, PSO is applied for control gain tuning of a position domain PID controller in order to improve contour tracking performances of linear and nonlinear contours for a serial multi-DOF robotic manipulator. A new fitness function is proposed for gain tuning based on the statistics of the contour error, and pre-existed fitness functions are also applied for the optimization process, followed by some comparison studies. The PSO tuning technique demonstrated the same effectiveness in position domain controllers as in time domain controllers with the results being quite satisfying with low contour errors for both linear and nonlinear contours, and the proposed fitness function is proved to be on par with the pre-existed fitness functions.