Also, does anyone have a sample code for one they can give me? I checked out the sample one from EasyC but it is still confusing.
Help would be appreciated!!!
I am in the process of reading it and sort of get the concept, still not having a great hold on it though. Do you know of any other readings/sites/articles?
I did this a few years ago with 5 sensors I created a formula that took the analog value from all of the sensor and computed how far on/off the line the robot was.
I did something like: Direction = (LeftOutside2) + LeftInside + (RightInside-1) + (RightOutside*-2)
Speed = GetAnalog(5) - MiddleSensorZeroValue;
You need to get the no line value from each sensor at startup . Then subtract that from the actual reading so the sensor returns 0 off the line and a number on the line. One side should be positive and the other should be negative. The middle most sensor should only be used for speed.
As a note I’ve been told the new Revision of the line following sensors are smaller and track standard electrical tape better. If you have the old rev sensors use wider electrical tape to avoid dead zones.
I found two excellent books that explain PID Control using LEGO Mindstorm and Rugwarrior based robots. The books are “MOBILE ROBOTS: Inspiration to Implementation” by Joseph L. Jones and Anita M. Flynn and “Robotic Explorations” by Fred G. Martin. The concepts and examples are easily applied to VEX.