The response ability of ant colony algorithm and Ziegler Nichols method to unit step signal is compared and analyzed. Ant colony algorithm has excellent control ability, such as small overshoot and short steady-state response time. Therefore, ant colony algorithm can be effectively applied to the control of underground search and rescue robot. It is found that the introduction of ant colony algorithm with node activity can solve the problem of premature convergence before the improvement. The control scheme of hardware and software is designed and studied. Through 20 simulation experiments of obstacle avoidance in complex environment, it is found that the improved ant colony algorithm can achieve up to 95% accurate obstacle avoidance rate in the control system, and the average path planning time is 4.4 Ms. It has good search accuracy and control effect, which is of great significance to improve the search and rescue effect.