In this work, we are interested to the PID control of nonlinear systems and more specially the control of a robot manipulator. The idea is to determine the optimal parameters (K p , K i and K d) of the controller using a novel algorithm of optimization called whale optimizer algorithm (WOA). To study the effectiveness of WOA-PID controller, its performance is compared with other controllers such as particle swarm optimization-PID (PSO-PID) and grey wolf optimizer-PID (GWO-PID). The model of robot manipulator and all controllers were tested using Simulink/MATLAB. Simulation results obtained clearly indicate the superiority of WOA-PID controller over the other controllers for trajectory tracking, better settling time, and ITAE errors.