I'm really sorry to ask this here, probably this is really simple stuff for must of you, but I've been researching on how to program a line follower using a PID algorithm, for the past two months, and still haven't come up with anything useful.
I would like to be able to use a color sensor to follow the line and nothing else. That's just for efficiency and simplicity. I could use IR sensors (and/or whatever) if needed.
Could you guys give me any hints or good tips on how to get started?
The car only needs to follow a line (black on white bg or vice-versa) and take sharp 90 degree turns. I could achieve this with a simple back-and-forth program, but I'm really trying to create something more ellegant and learn the tools to possibly use on something more complicated in the future.
For sensible steering, you need to know whether the vehicle is veering to the right or left of the line, and most people use 3 to 7 IR or B&W sensors. What "color sensor" did you have in mind?
I've seen line followers that use a single point sensor, and the wobbling movement required to find the line is anything but elegant.
I have long thought that the thing should be called IPD rather than PID because the I-Term seems to be the most important. It keeps track of the accumulated error. In a line following system the I-Term would be zero when the device is on track, but that does not mean it is irrelevant.