A connectionist method for autotuning PID controllers is proposed. This technique, which is applicable both in open and in closed loops, employs multilayer perceptrons to approximate the mappings between the identification measures of the plant and the optimal PID values. The neural network controller is designed to adapt to changing system structures and parameter values online. To achieve this objective, the network weighting coefficients are determined during an offline training phase. Simulation results are presented to illustrate the properties of the controller. In the proposed approach, multilayer perceptrons are employed for nonlinear function approximation. As a consequence, the neurons have a linear activation function in their output layer. It is shown that a new learning criterion can be defined for this class of multilayer perceptrons, which is commonly found in control systems applications. Comparisons of the standard and the reformulated criteria, using different training algorithms, show that the new formulation achieves a significant reduction in the number of iterations needed to converge to a local minimum.