Position sensors and object detection