Multistate Line Following Pro Preview

While "multistate line following" can describe a variety of algorithms, this tutorial will cover its implementation using the ducky line-following method.

content picture

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #2293
  • 02 Aug 2024

As the name implies, we will be adding more states to the ducky line-following method. In its simplest form, the ducky line-following method consists of two states:

  1. If the robot is on the line, turn in one direction.
  2. If the robot is not on the line, turn in the opposite direction.

By adding a third state, we can increase the speed at which the robot completes the track. The third state would look like this:

  1. If the robot is on the line, turn in one direction.
  2. If the robot is partly on the line, move forward.
  3. If the robot is not on the line, turn in the opposite direction.

As you might guess, adding states requires us to use the reflected light property of the light sensor rather than color detection. Instead of detecting the color of the line, the robot must measure the amount of light reflected back to the sensor to determine how well it is positioned on the line. In the two-state program, the state conditions look like this:

  1. If the light sensor detects black, the robot is on the line, so turn in the set direction.
  2. If the light sensor does not detect black, the robot is off the line, so it should turn in the opposite direction.

In the three-state program, the state conditions look like this:

  1. If the light sensor detects very little reflected light, the robot is on the line, so turn in the set direction.
  2. If the light sensor detects a moderate amount of reflected light, the robot is partly on the line, so it should move forward.
  3. If the light sensor detects a lot of reflected light, the robot is off the line, so it should turn in the opposite direction.

By adding more states and fine-tuning them to the robot's construction and the field, the robot will complete the track even faster.

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Line Following
  • 15
  • 0:00
  • 42
Image for Wobble Line Following
  • 3
  • 0
  • 8
  • 3d_rotation 1