The machining accuracy of a CNC machine tool is determined by the position detection element. The position detection element is composed of a detection element (sensor) and a signal processing device. It is an important part of the closed-loop servo system of the CNC machine tool. Its function is to detect the actual value of the position and speed of the worktable, and send feedback signals to the numerical control device or servo device, thereby forming a closed-loop control. The detection element generally uses the principle of light or magnetism to complete the detection of position or speed. The position detection element is divided into direct measurement element and indirect measurement element according to the detection method. Linear detection elements are generally used when measuring the linear movement of the machine tool, which is called direct measurement, and the position closed-loop control formed is called full-closed-loop control. The measurement accuracy mainly depends on the accuracy of the measuring element and is not affected by the accuracy of the machine tool transmission. Since the linear displacement of the machine tool table has a precise proportional relationship with the rotation angle of the drive motor, the method of driving and detecting the rotation angle of the motor or screw can be used to indirectly measure the moving distance of the table. This method is called indirect measurement. The position closed-loop control is called semi-closed-loop control.