Linear PID controller is adopted by electro-hydraulic servo system widely. The proportional, integral and derivative coefficients of a linear controller are fixed which brings the contradiction in speediness and overshoot. This paper designs a series of nonlinear functions which are used for nonlinear PID control for electro-hydraulic servo system. The proportional, integral and derivative parts of this nonlinear PID controller adjust themselves according to the error. In order to determine parameters of the nonlinear functions, PSO Algorithm and ITAE guideline are applied in the paper. Results of simulation indicate that the nonlinear PSO-PID controller using the functions proposed in this paper presents a better dynamic response than the linear PID controller.