This paper presents an optimal fuzzy PD + I controller designed to control the trajectory of a mobile robot. To tune and obtain the best parameters of the controller, the PSO (Particle Swarm Optimization) algorithm is used. This algorithm minimizes an objective function, in this case, the Integral Square Error (ISE) index of the system, parameter that depends on the linear and angular velocity errors for the optimization process. With this algorithm, the parameters to be optimized are the gains and the membership functions of the fuzzy controller in order to obtain an optimal controller and improve its performance. Finally, in order to validate the proposal, a comparative analysis among the results of a classic PID controller, a conventional Fuzzy PD + I controller and the proposed optimal Fuzzy PD + I controller is performed, evaluating trajectories followed by the robot, the position errors and the control actions of each case.