In order to analyze the reason for the improvement of the idle stability for a motorcycle engine when equipped with a secondary air compensating device, a model for the original engine is set up by the method of numerical simulation. The validation results of this model reveal relatively high simulation accuracy, and a model for the secondary air engine is established based on the previous model. The influence of secondary air on idle stability analyzed by using those simulation models, and the research reveals the main cause of idle instability for the original engine is that the residual gas fraction is too high. Based on valve timing, this research aims at finding a way to reduce residual gas fraction with relatively low influence on power performance for the original engine. The results indicate that the residual gas fraction for the original engine drops to the level of secondary air engine by advancing exhaust valve timing and the torque maximum value falls no more than 2%.