The essence of line following is a left-right swinging motion with a sufficient forward bias. Although called Line-following, most line followers are actually edge-followers, typically following either the left-edge or the right-edge of a thick black line.
The best way to teach line following is to first rotate in place (classically a 10-notch turn to left or right using a move block) until the color/light sensor finds the line. This is a tricky step in which you have to play with the mechanical design to find the right amount of ground clearance for the sensor to work properly. Sunlight often throws it off, as do many illumination systems. This is why Scott Evans, the FLL game designer urges everyone to use a light shield to protect the sensor from ambient light. This first phase is called Line Finding, and there are nuances to using light and color sensors which you will discover from practice.
After you have mastered using a light/color sensor for Line Finding, the next step is to start moving forward while still swinging left and right in alternating steps. In plain english, this reduces down to:
1. Swing left, while moving forward until you find (say) the right edge of a black line. Classically, this is a 9-notch left turn using move blocks, but is popularly implemented as differential motor powers using motor blocks.
2. Swing right, while moving forward until the sensor no longer sees black.
Steps 1 and 2 can be repeated ad infinitum to get a basic line follower. If the robot gets stuck because the sensor get a spot that is neither black not while, I often teach the kids to program in a bias step (swing left as in step 1, swing off a fixed amount, repeat).
This is a simple line follower that can be tested on various shapes (sharp turns, smooth turns, hairpins, etc.).
Next up, from a simple line follower is a proportional line follower, in which the left-right swinging motion is matched to the curvature (technically to the "error" from the target zone).
In control systems design, we have three classes of controllers - proportional controllers, integral controllers and derivative controllers. In proportional controllers, the corrective action is proportional to the error (small deviation leads to small correction; large deviation leads to large correction). In derivative controllers, the corrective action is proportional to the slope of the error curve (is the problem getting worse, or better!). In integral controllers, the corrective action is proportional to the area under the error curve (this equates to remembering that there was an error sometime in the recent past, and one is minimizing the area under the error curve). The classical universal controller is called a PID controller -- it includes elements of a proportional controller, an integral controller and a derivative controller.
I saw a NXT-based PID controller at the State Championship a couple of years ago (a top-tier Div. II team). It has been my dream to teach my teams how to build one, just for kicks (it is overkill for FLL). Any year now! (if I ever get that far down my to-do list for the following year!). You rarely need to get beyond a proportional controller for any FLL competition.
You can find examples of a simple controller and a proportional controller at http://www.nxtprograms.com/line_follower/
http://www.nxtprograms.com/line_follower/ . There are downloadable programs there as well, that are well documented. As John said, there are numerous other resources as well.
This same approach also works for a wall-follower.
I hope this helps, and doesn't intimidate anybody who is not technically trained.
Best of luck,
Anant S Narayanan
McLean Robotics Institute
McLean VA 22102
[log in to unmask]
On Tue, Nov 20, 2012 at 10:42 AM, John Barrett <[log in to unmask]> wrote:
Paul,I recommend taking a look at the site that veteran coach Wally Walter put together: http://www.masteringlegorobot.com/using-light-sensorsJohn
On Nov 20, 2012, at 10:07 AM, Emler, Paul wrote:
Dear Fellow FLL Coaches,
Now that the Bruin Brick Builder's season is over we are looking to the future. Our team did a good job this year in programming but we always want to learn more. We saw several robots that had a smooth line follow (not the back and forth motion of our line follow) Does anyone have resources available to teach us how to do that? Are there any book or web site suggestions? Thanks for helping a team to improve their approach.
Bruin Brick Builders
******** Confidentiality Statement: This electronic message and attachments are intended only for the use of the addressee and may contain confidential or privileged information. Receipt of this transmission by any person other than the intended recipient does not constitute permission to examine, copy, or distribute the accompanying material. If you received this electronic message in error, please notify the sender of the message. ********
-- To UNSUBSCRIBE or CHANGE your settings, please visit https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list".
-- VADCFLL administrative announcements are sent via VADCFLL-ANNOUNCEMENTS-L. Visit https://listserv.jmu.edu/archives/vadcfll-ANNOUNCEMENTS-l.html to subscribe.
To UNSUBSCRIBE or CHANGE your settings, please visit https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list".VADCFLL administrative announcements are sent via VADCFLL-ANNOUNCEMENTS-L. Visit https://listserv.jmu.edu/archives/vadcfll-announcements-l.html to subscribe.
To UNSUBSCRIBE or CHANGE your settings, please visit https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list".
VADCFLL administrative announcements are sent via VADCFLL-ANNOUNCEMENTS-L. Visit https://listserv.jmu.edu/archives/vadcfll-announcements-l.html to subscribe.