In this paper, three PID controllers for anti-swing, rope length and position control of a gantry crane is designed based on the parameters tuning method by particle swarm optimization (PSO). The method searches the PID parameters that realizes the expected step response of the plant. The PID parameters are computed by PSO-based PID tuning method according to the obtained model. Simulation results have demonstrated satisfactory responses with the proposed controllers under conditions based on control system performances