Line Following tasks ==================== Here is a list of things you need to be able get your robot to do. For Line Following. 1) detect start button, and light a LED this can be the button on the robot or an extra sensor detecting a white slip of paper. 2) display the line sensor readings and remember the upper and lower values. display can be on the LEDs and/or via debug. 3) divide up the range of line sensor values into 3 ranges: - to the left, on the line and to the right Then set the motor speeds appropriate to each zone, steering right, ahead and left as required. 4) as 3 above, but divide the sensor value into 5 zones not 3 5) use derivative control, to make up a "corrected" sensor value do this by recording the previous reading and usiong this to detcect the rate of change, and adding this change to the actual reading to calculate a future reading. 6) Stop using 5 zones, with sudden motor speed changes as each boundary is crossed. Instead, use maths to calculate the two motors speeds directly from the sensor reading (or the "corrected" derivative reading). 7) Adjust the "Proportion" ratio (This is the ratio of sensor reading change to motor speed change). Adjust it to suit the speed and the maximum curvature required to get round the track. 8) Adjust the "Derivative" ratio (This is the multiplication factor of the reading difference to be added) Adjust to bring stabilty to the robot. 9) make the overall speed depend on whether the line is straight or curved. this can be based on the instantaneous line sensor reading, - or can be made to slowly follow it. 10) Make the speed drop to zero, or very slow, if it falls off the line. - this can be useful to allow it to recover the line, if the speed is set too high. 11) use the second side sensors to stop the robot at the end of the track. this will require a white line to be seen on one side only! (there will be readings on both sides when the track crosses on itself) Finally tune it all up so that it gets round the course as quickly as possible! ============= J Fisher 20/1/20