In this study a novel approach of designing automatic control systems with the help of AI tools is proposed. Given plant dynamics, expected references, and expected disturbances, design of optimal neural-network based controller is done automatically. Several common reference types are studied including step, square, sine, sawtooth and trapezoid functions. Expected reference-disturbance pairs are used to train the system for finding optimal neural-network controller parameters. A separate test set is used to test the system for unexpected reference-disturbance pairs to show the generalization performance of the proposed system. Parameters of a real DC motor are used to test the proposed approach. Real DC motor’s parameters are estimated using particle swarm optimization (PSO) algorithm. Initially, a proportional-integral (PI) controller is designed using PSO algorithm for finding simple controller’s parameters optimally and automatically. Starting with neural-network equivalent of optimal PI controller, optimal neural-network controller is designed using PSO algorithm for training again. Simulations are conducted with estimated parameters for diverse set of training and test patterns. Results are compared with optimal PI controller’s performance and reported in the corresponding section. Encouraging results are obtained suggesting further research in the proposed direction.