The paper considers a novel method of setting a neural networks controller that takes part in the control of a dynamic plant with unknown parameters. The uncertainties are usually overcome by using sliding mode for controller with a switching input signal. Consequently, as a result the obtained system not sufficiently reliable by reason of high frequency switching control signal and long processing time. To remove this deficiency, the paper considers the neural network controller that is set by means of its learning based on the results of the latest testing. The characteristic feature of the algorithm is its ability to fix the faulty control situations introduced into the learning algorithm, thus giving it the properties of self-learning. The suggested algorithm provides the control quasi-optimality on time and accuracy in controlling a dynamic object. Finally, numerical examples are presented to demonstrate system efficiency for developed method