Through studying a crossing obstacle model for the ladder shaped obstacle an optimal size design algorithm based on this model is designed. By the trial value method,the design requirement of calculating the optimal mechanical foot size automatically and making the crossing obstacle efficiency of the mechanism achieve the highest is realized. by value method. Then,the feasibility of this algorithm is verified through the experimental,by using MATLAB,the graphical user interface is designed which can output the crossing obstacle time and the optimal mechanical foot size after input the parameters of obstacle and motor. The design efficiency of this crossing obstacle model is improved,and an optimization method for the model parameter design is provided.