It initiates line following using the PID algorithm and stops the robot when the checkpoint is detected. You must set the IR threshold to stop the robot at the checkpoint. Adjust the PID parameters for optimal line following performance. To start line following, you need to set the PID speed and constant parameters.”
dolinefollowingwithPID()
“Notes:
– Set the correct threshold for the IR sensor for better results.
– If your robot is not stopping at the checkpoint or not following the line, consider making modifications to align the external IR sensor parallel to the caster wheel.
– Experiment with the PID speed parameter and overall speed value to achieve better line following.
– Please ensure the position of your external IR sensor is not placed not too high from the ground and not too low, you need to calibrate on the arena .