Advanced Line Following 2

Ok here is another Idea for line following only this time it is not my own. (see link)

I successfully implemented this idea with 3 sensors but it only works if the middle sensor is at least partially on the line. This means that it can follow a mostly straight line very well (with zero saw pattern). Let me know if this works for you.
or if you can get it to work better

note: To get the above theory to work I had to mount my sensors about .75 in above the line


The idea looks great!

Would you be able to post your code (if it’s robotc)



I made my code in Easy C so… sorry. By the way this code was really desgned for someone using say 15 sensors. They would set it up so that three sensors can see the line at a time but only the middle of those three sensors would be fully on the line.

This does not mean that you can’t use this code though I think I will try and make it so that if the middle sensor can see at least part of the line it will run this code. If only 1 outside sensor can see the line it will run a more simple code that makes a turn based on how well that given outside sensor can see the line (this way the robot will turn sharper if the outside sensor can only see part or none of the line)

so summing this up just remember that that equation can only work if all 3 sensors can see at least part of the line (it helps to mount the sensors about 1’’ away)