figure 2
The second aspect the be considered when building a line sensor, is the cell spacing (or the distance between a cell and the other). To understand the effect of cells spacing, consider the differential drive robot shown in figure 2, with an eight cells line sensor, whose cells are numbered from 1 to 8 (from the left to the right). Three different situations are shown, In the first one, the cells 4 and 5 detect the line, indicating that the robot is perfectly centered on the line. In the first situation, the spacing between the cells is not very critical, but if the robot accidentally makes a 10° turn away from the line (second situation), you will notice that only the cell number 6 detect the line, which is the only indication that the controller will have about that 10° error. This means that, most probably, an error smaller than 10° wont even be noticed.
But in the third situation, the cells are closely collated together, and you can notice that with the same 10° deviation from the line, the sensor’s cells 6 and 7 detected the line, leaving some other possible states in between the perfectly centered position and the 10° deviation. In other words, the closer are the cells from each others, the more will be the resolution of the sensor.
The same effect can be observed by changing the distance between the sensor and the center of steering. In general, It is important to always try to keep the sensor as far as possible from the center of steering, which is the back of the robot in a differential steering one, because this will also help to amplify the deviation detected by the sensor, resulting in a better response from the controller.