In the pursuit of automating the entire underground drilling process in coal mines, the automatic rod feeding technology of drilling robots plays a crucial role. However, the current lack of positional accuracy in automatic rod feeding leads to frequent accidents. To address this issue, this paper presents an algorithm for compensating positioning errors in automatic rod feeding. The algorithm is based on a theoretical mathematical model and manual teaching methods. To enhance the positioning accuracy, we first calibrate the pull rope sensor to correct its measurement precision. Subsequently, we establish a theoretical mathematical model for rod feeding positions by employing spatial coordinate system transformations. We determine the target rod feeding position using a manual teaching-based approach. Furthermore, we analyze the relationship between the theoretical rod delivery position and the target rod delivery position and propose an anisotropic spatial difference compensation technique that considers both distance and direction. Finally, we validate the feasibility of our proposed algorithm through automatic rod feeding tests conducted on a coal mine underground drilling robot. The results demonstrate that our algorithm significantly improves the accuracy of rod feeding positions for coal mine underground drilling robots.