This paper proposes a new approach for robust nonlinear proportional derivative (PD) controller. In this approach a nonlinear function (sigmoid) is added to the conventional proportional integral derivative (PID) controller with filtering for the derivative, in order to improve system response and to reduce the effects of the nonlinearity and uncertainty due to variations of hydrodynamic coefficients of ship with the speed. The gains of nonlinear PD controller are tuned by applying particle swarm optimization (PSO) technique. The simulated results by MATLAB program give satisfactory performance with regard to maximum overshoot, settling time and zero steady state error for step, ramp and proposed trajectory as input to the system. The robustness of the autopilot was checked by changing the plant parameters and adding disturbance to the plant input. The used autopilot is nonlinear PD controller because the gain of integral term by PSO is approximately zero which simplifies the controller construction. The results show that the proposed controller has superior transient response and robustness on the conventional PID designed by using symmetrical optimum criterion with pole assignment technique.