# Master Slave line follower robots

I have 2 robots that connected wirelessly.
first robot is line follower and second robot must be following first robot with constant distance.
do you have any idea how can i do it?

That is a very short question for such a difficult subject. What are the other rules about the construction and behaviour of the two robots? What range of distances might be required between the robots?

And...

Is this school or college project?

It's called a "tether". Generally a piece of polypropylene cord.

yes it's my college project and i have done most of it.
As i said before, the first robot is line follower with IR sensors and it send his actions to the second robot Such that when the first robot Turned to the Left, the second robot do it Exactly. But the second robot must be execute this actions with a constant delay and also do not deviate from the path.
In this project delay must be indicated by distance. the maximum distance is 20 centimeter.
I am use RF433 TX/RX modules to communicate between robots.
my problem is i can not execute commands correctly in second robots after a delay.

my problem is i can not execute commands correctly in second robots after a delay

Why not?

AWOL:
Why not?

If the second robot is 10 cm behind the first robot, then at this point the first robot will rotate to the left. The Second robot should then execute this command after passing 10 cm. My problem is how the second robot knows that he has traveled 10 centimeters and now has to run the left-turning command. Because if the second robot executes the command at the wrong location, it goes out of the path.

My problem is how the second robot knows that he has traveled 10 centimeters

Odometry? Localisation?

If both robots can measure their speed, with encoders on their wheels, for example, that might be possible. But it's getting quite complicated. Must you use rf to communicate between the robots? Must the following robot follow the line also, or can it stray off the line as long as it remains 20cm behind the lead robot?

These are the kinds of rules I am asking that you explain. If you don't, you will have to tell us each time we suggest something that breaks the rules, and that will be a waste of time for everyone.

PaulRB:
If both robots can measure their speed, with encoders on their wheels, for example, that might be possible. But it’s getting quite complicated. Must you use rf to communicate between the robots? Must the following robot follow the line also, or can it stray off the line as long as it remains 20cm behind the lead robot?

These are the kinds of rules I am asking that you explain. If you don’t, you will have to tell us each time we suggest something that breaks the rules, and that will be a waste of time for everyone.

We have budget problem so for this reason we cannot measure speed of motors with encoders.
we just only use RF for communication between robots, because they are cheap.
and for last question yes the second robot must be 20 cm behind the first robot and also always stay on the line.
and last suppose is, the second robot does not have IR sensors for line detecting.
I hope I could explain my problem.

My reply is based on the info in your original post which suggests the lead robot has IR sensors & RF comms but there are no advanced positioning sensors. I think you will quickly discover that you will need additional sensors and/or environmental aides to make the follower more accurate.

Depending on the type of robot (number of wheels, tracks) & terrain / surface, I expect that you will run into challenges trying to follow the master once it begins making turns. Most line followers are two-wheeled with a caster which makes it easier than other designs.

Without some real efforts put into localization or wheel odometry (as raised by AWOL), small errors at the beginning of the run will be magnified as time passes. Wheel slip during turning can be a real challenge to address, particularly as the speed is increased or the line deviates more.

A line follower is constantly making small turns, and in many cases not usually aware of the effective / absolute turn it made (in the real world) because it can iterate “loose/uncalibrated” motor drivers and still create a “closed loop” control with respect to the line below. How are these “micro turns” communicated to the slave? How often? Are both wheels proportionately powered during the master’s turn or just one?

The line follower control signaling can be very demanding (especially if both wheels are powered during turns), so let’s imagine a much simpler scenario: master drives 10 cm, turns 45 degrees clockwise and drives 100 cm. Now let’s assume your slave robot independently counts out 10cm through wheel encoders (extra sensors) and carefully maintains balanced wheel speeds to attempt a dead-reckoning straight line for 10cm. The master turned what it thought was 45 degrees. The slave will also turn what it thinks is 45 degrees.

Assuming you haven’t added sensors to independently verify your headings, it is very likely that you will have several degrees difference in the effective turn. 2 wheel vs 4 wheel vs tracks, ground material, motor speed and sampling rates will greatly affect the precision.

Now both robots drive 100cm, ideally tracking a “straight line”. If you had 5 degrees turn error, how far apart will the robots be now? If we continue making turns, how far apart will they end up?

Without some independent verification of your absolute position or separation distance / angle, the early errors will accumulate into large deviations, making your 20cm follow requirement very difficult. A constantly “turning” master line follower will only increase the challenges with the above.

No matter what, your project is going to be a great learning experience as what may have seemed like an easy problem may be more involved than you anticipate!

From your very last update it sounds like budget won’t allow for much in the way of additional sensors. If so, then I would suggest the following to help reduce some of the error:

• use a two-wheeled robot with caster
• reduce both robot’s motor drive speed as much as possible.
• consider adding a cheap sensor that provides absolute orientation / heading / compass and communicate this along with your drive/turn commands
• consider adding wheel encoders if your budget allows (you may find some relatively inexpensive motors with integrated encoders).
• “calibrate” each robot so that their left and right wheel drivers are as close matched as possible. Ensure that they can drive “straight”.
• calibrate both robots against each other so that they drive the “same speed”.
• When turning, only drive either left or right motor at a time, and both when going “forward”. Don’t use proportional control (ie. varying wheel speed).
• Depending on how long it takes for you to send your RF commands, you might want to consider keeping track of a “timestamp” associated with each action that the motor driver takes. This could help account for transmission latencies.

daniel25:
We have budget problem so for this reason we cannot measure speed of motors with encoders.

In that case, the most accurate solution that fits your budget will be that suggested in post #2.