Aiming at the shortage of the incremental encoder with simple process to change along the count "in the presence of repeatability and anti disturbance ability, combined with its application in a large project in the country, designed an electromechanical switch for generating zero, zero crossing signal. A mechanical zero electric and zero coordinate transformation model is given to meet the path optimality, single, fast and accurate requirements of adaptive fast change algorithm, the proposed algorithm can effectively solve the contradiction between the accuracy and the change of the time change. A test platform is built to verify the effectiveness and robustness of the proposed algorithm. The experimental data show that the effect of the algorithm accuracy is not influenced by the change of the speed of change, change the error of only 0.0013. Meet too fast, the change of system accuracy, and repeated experiments show that this algorithm has high robustness.