The mechanical engineering requires heat treatment after rough machining to reach the mechanical strength, but the heat treatment can induce workpiece deformation, so that the workpiece cannot be reworked. In this study, the plasma was integrated with a lathe, and the on line heat treatment was performed to achieve the mechanical strength and hardness, so as to reduce the machining process and handling. However, for on line heat treatment, it is important to study the machine and plasma parameters of the lathe and plasma, and the research method is used eventually to optimize the process, reduce the machining cost and machining error. The variable factors in surface on line real-time heat treatment are revolution, feed rate and current, the objective function is the hardness of mechanical properties. In the screening experiment, the interaction of factors was discussed using full factorial experiment. The Central Composite Design was combined with the Lack-of-Fit test for optimization experiment, the R2 coefficient was used to determine whether the regression model is appropriate. The optimum parameters were derived from the contour diagram and response surface diagram. The experimental results show that the significant factors include revolution, feed rate and current, the optimum parameters include revolution 168rpm, feed rate 0.068mm/rev and current 86A. The experimental results of optimum parameters show that the surface hardness is increased from 306HLD to 806HLD, the surface hardening effect is enhanced by 163%, so the on line real-time heat treatment equipment has a best hardening effect.