A position sensor is a sensor that detects an object's position. A position sensor may indicate the absolute position of the object (its location) or its relative position (displacement) in terms of linear travel, rotational angle or three-dimensional space. Different from the displacement sensor, the position sensor has two types: contact type and proximity type. The contacts of the contact sensor are moved by the contact and extrusion of two objects, and the common ones are the travel switch and the two-dimensional matrix position sensor. The travel switch has simple structure, reliable action and low price. When an object is in motion and encounters the travel switch, its internal contacts will act to complete the control. For example, if travel switches are installed at both ends of the X, Y, and Z axes of the machining center, the movement range can be controlled. The two-dimensional matrix position sensor is installed on the inside of the robotic palm to detect the contact position between itself and an object. Proximity switch refers to a switch that can send an "action" signal when an object is close to a set distance, and it does not need to be in direct contact with the object. There are many types of proximity switches, mainly electromagnetic type, photoelectric type, differential transformer type, eddy current type, capacitive type, reed switch, Hall type, etc. The applications of proximity switches on CNC machine tools are mainly tool rest tool selection control, table travel control, oil cylinder and cylinder piston travel control, etc. Also, there are potentiometer position sensor, Lvdt position sensor and so on.
http://www.brgsensor.com/potentiometer-position-sensor/