Wobble Line Following
This is the most basic line-following method, commonly known as the "ducky" line-following method.
Many people who have never programmed a robot to follow a line assume that the robot moves forward along the line and only turns toward it when it veers off. While some robots can be programmed that way, the reality is that most robots follow one of the two edges of the line. This is because, although moving forward along the line is easy to program, determining whether the robot has deviated to the left or right side of the line can be more challenging.
An easy solution to this problem is to control the robot’s deviation by having it actively turn in a specific direction while following the line, rather than just moving straight forward. This way, we always know which direction the robot has deviated, and we can return it to the line by programming it to turn in the opposite direction. Moving forward in this manner creates a "wobble"-like motion.
Дъки - SPIKE Prime робот за следване на линия
Този прост робот е създаден, за да демонстрира най-простите методи за следване на линии, които познаваме. Основно така нареченото "патешко" следване на линия.
Ducky Line Following
This program is designed to be used with the Ducky Line Follower Robot. It demonstrates the simplest two-state line-following method we know.
Multistate Line Following
While "multistate line following" can describe a variety of algorithms, this tutorial will cover its implementation using the ducky line-following method.
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:
- If the robot is on the line, turn in one direction.
- 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:
- If the robot is on the line, turn in one direction.
- If the robot is partly on the line, move forward.
- 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:
- If the light sensor detects black, the robot is on the line, so turn in the set direction.
- 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:
- If the light sensor detects very little reflected light, the robot is on the line, so turn in the set direction.
- If the light sensor detects a moderate amount of reflected light, the robot is partly on the line, so it should move forward.
- 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.
3-State Line Following
This program is designed for use with the Ducky Line Follower Robot. It demonstrates how a third state can be added to the simple wobble/ducky line-following program. The main takeaway is understanding how to add the third state, allowing for additional states to be included if needed.
Pros and Cons of the Multistate Line Following
Here, we discuss the effects of applying this method to the two-state duck-following algorithm.
Cons:
- Each state must be programmed individually.
- Each state must be tested and fine-tuned to the robot and the field, which can become cumbersome with more states.
- Any change to the construction of the robot will require each state to be fine-tuned again.
Pros:
- With each new state added correctly, the robot becomes faster.
- Having multiple states allows us to adjust the robot's speed depending on the state, which can significantly increase the robot's overall speed.
3-State Line Following with Varying Speeds
This program is designed for use with the Ducky Line Follower Robot. It demonstrates the advantages of a multistate program, allowing for customization possibilities in each state.