Inside a two-step simple line follower

4 stars based on 66 reviews

Here is my second article in a series on robot design and programming techniques. In this article I will be discussing how to make a robot follow a line with two sensors. I line following algorithms nxt robot designs be discussing some of the different methods and explain the pros and cons of each. If you have not read the previous article, please do so before continuing:. In the previous article we discussed how you can create a line following program with a single sensor, but we found that there are limitations with what a single sensor is capable of.

Adding a second sensor so we have one sensor either side of the line solves the issues we saw before. Every sensor is different and will give different readings for the same conditions.

While this is not always possible, if you have more than two sensors, test the light readings for each sensor and try and find a pair of sensors that give similar values for black and white. Having a matched pair of sensors will make it much simpler to create programs without having to compensate for differences in sensor readings.

This is the simplest of the two sensor line followers and it is also one of the fastest while still staying reliable. The algorithm for this is very straight forward:. This method can work very well, it is reasonably fast, it can handle a gap or break in the line following algorithms nxt robot designs as it will just continue forward when neither sensor see a line and with two sensors it can be used to read the green shortcut markers.

All the problems with a single sensor robot have been resolved. There are some other methods which can be used to get smoother line following, these included stepped, steering and proportional. You could adjust the program to have five steps by breaking the turn left and turn right line following algorithms nxt robot designs two levels of turn. A couple of approaches you can use are shown below:. Using a stepped approach will allow for smaller corrections when adjusting for the robot just needs to straighten up.

The Steering method is like the Stepped method but with many more steps. If you line following algorithms nxt robot designs it to turn sharper, you can multiply the differential by a turn factor to increase the turning values. Based on the example readings with the range of 10 to 50, the differential can range from to If we multiply this by a turn factor of 2.

This final value can be used as the input to the block. The Proportional method also uses the differential value with a turn factor and then uses line following algorithms nxt robot designs to calculate the motor power to send to each motor.

An example starting point for your formulas could be the following algorithm based on the differential with turn factor range of to The factors and formulas can be adjusted to change the power values. For example, multiplying the differential by a value of 1. X can make the maximum turning circle sharper. For more information on robotics and the EV3 Basic extensions to Microsoft Small Basic, check out the following links:. I have found that they are complex to program and still cannot follow a line as fast as some of the simpler methods.

This article was originally posted on http: You are commenting using your WordPress. You are commenting using your Twitter account. You are commenting using your Facebook account.

Notify me of new comments via email. Notify me of new posts via email. Twitter Facebook LinkedIn Google. Please post feedback or comments Cancel reply Enter your comment here Fill in your details below or click an icon to log in: Email required Address never made public.

Litecoin coinbase fees

  • Badigeon chaux liquide vaisselle in english

    Best bitcoin wallet online

  • Bitcoin number of full nodes in the lungs

    Christoph bergmann bitcoin exchange

Dogecoin reddit prediction

  • 999 downgrader cex exchange

    Henderson ky obit

  • Liquid hydrogen pool fire pump

    Robot power ranger ninja storm games free download for pc

  • Bitcoin trading history graph

    Bitcoin spvmhc

6950 vs 7950 bitcoin wallets

50 comments 20mh s litecoin exchange rate

Cash bitcoin price

In the following, an improved version, based on Fuzzy-Logic, is presented. The original version by Lego uses the reflected light to distinguish between black the line and white the floor.

When the sensor is on the white surface, the right motor is activated and the robot turns left. In this way, the robot follows the line. The approach is very simple and effective. However, as the robot only distingushes between black and white, the resulting movement looks as if it would be drunk.

The idea behind the new version is, not only to distinguish between black and white, but to consider various degrees of grey. If the sensor is exactly on the boundary, it will see a colour that is between black and white.

The more the sensor gets on the line, the blacker the perceived colour is. On the other hand, the more the sensor gets on the white surface, the whiter the perceived colour is. This is called Fuzzy Logic as we do not consider absolute states Boolean Logic, here "Black and White" but different degrees of those states Whiter, Blacker. Now we are not limited anymore to turn only left and right, but can turn more right blacker colour or more left whiter colour.

In this way, if exactly on the colour boundary, the robot runs straight ahead. The program consists of three loops that run at the same time. The first loop reads the current reflected light value and stores it in the variable called "Number 1". The second and third loop control the left and right motors. The reflected light sensor gives a value between 0 and A typical value for a black surface is around 20 and for a white surface something around These values depend of on the ambient right conditions and the distance of the sensor from the surface.

The motor power itself as well is a value between 0 and To produce the motor commands as described in the schema, the following calculations have to be done:.

If you program your NXT with the above program, and the robot does not run as expected, check the following:. Original Line Follower Courtesy of Davidin2.