Wall-following control of mobile robot is an important topic in the mobile robot researches. The wall-following control problem is characterized by moving the robot along the wall in a desired direction while maintaining a constants distance to the wall. The existing control algorithms become complicated in implementation and not efficient enough. Ant colony algorithm (ACA), in terms of optimizing parameters, has a Faster convergence speed and features that are easy to integrate with other methods. This paper adopts ant colony algorithm to optimize PID controller, and then selects ideal control parameters. The simulation results based on MATLAB show that the control system optimized by ant colony algorithm has higher efficiency than the traditional control systems in term of RMSE.