We present an improved bioinspired optical position sensing device, in which insect-based retinal microscanning movements are used to detect and locate contrasting objects such as edges or bars. The active microvibrations imposed upon the retina endow the sensor with hyperacuity. For the sake of clarity, this is demonstrated here for a two-pixel sensor, but the same principle could be applied to all pairs of neighboring photosensors in a focal plane array. The sensor is able to detect an edge or a bar present within its small field of view (4 degrees) and locate it with a resolution (0.025 degrees) 160-fold finer than the static resolution imposed by the pixel spacing. The sensor features the novel ability to establish whether it is actually facing an edge or a bar, based on the phase difference between the sinusoidally modulated signals of its two photoreceptors. The visual processing algorithm involves simple linear filtering and purely arithmetic operations requiring few computational resources. The complete theoretical framework is presented here, including an analytical model for the microscanning sensor. This high-performance, low-cost angular position sensing device could have many applications in fields such as metrology, astronomy, robotics, automotive design, and aerospace.