This paper deals with design of PID controller with the use of methods of global optimization implemented in Matlab environment and Optimization Toolbox. It is based on minimization of a chosen integral criterion with respect to additional requirements on control quality such as overshoot, phase margin and limits for manipulated value. The objective function also respects user-defined weigh coefficients for its particular terms for a different penalization of individual requirements that often clash each other such as for example overshoot and phase margin. The described solution is designated for continuous linear time-invariant static systems up to 4th order and thus efficient for the most of real control processes in practice.