The assembled Zumo Robot has an array of 6 reflectance sensors on the lower surface. Using the output from the 6 sensors we can detect the relative position of the Zumo Robot with respect to the black line. For any generic line follower, you would have to combine the output ofall the reflectance sensors in a sensible way. Fortunately, the 'ZumoReflectanceSensor' block in the ZumoBot library does that for us and gives us one single numeric value ranging from 0 - 5000. From the numeric value, we can get an idea of where the black line is relative to the Zumo Robot. This is illustrated in the diagrams below:
If the numeric value exceeds 2500, then the robot is on one side of the black line, and if the numeric value is below 2500, then the robot is on the other side of the black line.
To make things easier, we can subtract 2500 from the output of the 'ZumoReflectanceSensor' block in which case any positive difference implies that the robot is on one side of the line, and a negative difference implies that the robot is on the other side of the black line. This difference between the reference value and the actual value is also known as the 'error' signal
The block diagrams responsible for these steps are shown below: