According to the accuracy requirement of the monitoring of the safety distance of the dangerous chemicals warehouse, a precise scanning and positioning device is designed and developed. Control algorithm based on exponential acceleration and deceleration algorithm and closed loop feedback regulation. The algorithm has high precision, stable operation, and can avoid the frequent adjustment and jitter of stepping motor. Experimental results show that the positioning accuracy of the device and algorithm can reach 0.022 degrees. The accuracy requirement of the scanning and monitoring of the safe distance of the warehouse is completely satisfied.