The inconsistent requirement of surface and core section can be solved through system construction of open CNC quenching machine based on PC + motion control card, to realize surface quenching of mechanical parts. The establishment of mathematical model and algorithm researching of the hardening methods is studied in this paper, especially for the outer edge of the non-circular discoid parts, so as to guarantee the consistence of quenching. The result of the experiments shows that the workpiece such as gear, crankshaft, cam and etc. can obtain higher strength, hardness, wear resistance on the surface, while maintaining original good toughness in the core section.