Particle swarm optimization (PSO) is a heuristic optimization algorithm and commonly used for gain tuning of traditional PID controllers. In this paper, PSO is used for gain tuning of our previous developed position domain PID controller for contour tracking. A new fitness function is proposed for gain tuning based on the statistics of the contour error, and pre-existed fitness functions are also used for the optimization. The PSO tuning technique demonstrated the same effectiveness in position domain 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.