This paper proposes new optimization algorithms for the optimal tuning of PI controllers dedicated to a class of second-order processes with integral component and variable parameters. The sensitivity analysis with respect to the parametric variations of the controlled process leads to the sensitivity models. The augmentation of the output sensitivity functions over the integral of absolute error criterion results in the definition of objective functions, and the corresponding optimization problems are solved by Particle Swarm Optimization (PSO) and Gravitational Search Algorithms (GSA). The algorithms are tested in a case study associated with several analyses.