The avoidance of obstacles placed in the workspace of the robot is a problem which makes controlling them more difficult. The known avoidance methods used for the robots control are based on bypass trajectory programming or on using the sensors that detect the position of the obstacle. This paper describes a method of training industrial robots in order for them to avoid certain obstacles in the workspace. The method is based on the modelling of the robot's kinematics by means of an artificial neural network and by including the neural model in the robot's controller. The neural model simulates the robot's inverse kinematics, and provides the joint coordinates, as referential values for the controller. The novelty of the method consists in the deliberately erroneous training of the network, so that, when programming a direct trajectory in the workspace, the robot avoids a known obstacle.