Tutorials | A.C.R.O.S.S
Introduction
First of all let us review the problem statement:
"Build two autonomous robots that communicate and collaborate to cross a series of chasms."
On analysing the problem statement, we find that we need to make two different completely autonomous bots for this event. The first/ upper bot has to track a line on a raised continuous platform, which has a few gaps along its path. To navigate across this path, the upper bot must take assistance from the lower/second bot. Meanwhile the lower bot has navigate a grid to assist the upper bot. For the assistance purpose, the robots have to communicate with each other.
This tutorial discusses a possible approach to the problem statement. This approach is explained as follows :
Algorithm Used
In this approach, the upper robot [Navigator] begins moving first while the lower robot [Helper] remains stationary. When the upper robot senses a gap in its path it communicates the position of the gap to the lower robot which then positions itself at this gap and signals (via communication) the upper robot to cross the gap. Then the upper bot continues on its path until it reaches the next gap with the lower bot remaining stationary. This process is repeated until the the upper bot has reached the finish coordinates. Thus the upper bot navigates the lower one as the lower helps the upper in crossing the gaps.
Bot Capabilities
To solve the problem statement using the above algorithm we need two bots. The upper bot[Navigator] should be able to traverse a grid and update its location on it. It should be able to detect the gaps in its path ahead and send those to the lower bot. The lower bot[Helper] should also be able to traverse a grid while avoiding obstacles and update its coordinates. It should be able to move to any point on the grid on receiving a signal from the upper bot. It should have a bridging mechanism to enable the upper bot to cross.
Therefore we would be discussing the following things in this tutorial:
- Drive mechanism
- Grid Following & Obstacle Detection
- Sensors
- Gap Detection
- Microcontrollers
- Communication between the two bots
- Pseudo Code
- Summary
Drive Mechanism
To traverse the arena, the robot needs a control mechanism for which a differential drive is a simple and efficient method. A differential drive contains two wheels and two separate DC motors driving them. In this event, DC motors of 60/100 rpm should be ideal for completing the task to be done in this event.
In this control method, the robot is able to traverse in a direction of its choice by rotating each DC motors in a particular direction. The different types of motion that can be achieved using a differential drive have been illustrated in the figure below:
Both the robots in this event are made using this differential drive.
For more details on differential drives, visit here.
For details regarding the circuitry involved in making a differential drive, visit here.
If u have any queries u can post them on our technical forum here.
Grid Following
In this event positions of both the robots on the grid will have to be monitored. The starting point of the Navigator will be known and its position can be tracked further with the help of node indicators on the raised platforms in the arena. So the Navigator must know its position on the 2D grid. The position of the Helper can be tracked by using standard grid following algorithms that incorporate obstacle detection. The Helper should be able to move to any point on the grid on receiving the coordinates from the upper robot.
A grid follower is essentially a line follower only. The basic principle used for grid following is detecting the intersection to determine a robot’s position on the grid and taking a turn accordingly. To ascertain position on a grid many ways can be employed. One of the ways is by looking at the grid in a two dimensional system where we will assume the starting node to be the origin and then we will have 2 axis system with every node being represented by a point on the 2-D coordinate system. Also do note that the white lines will be 3 cm wide for grid following.
For a detailed tutorial on grid following, click here.
For a detailed tutorial on line following, click here.
Obstacle Detection
Path planning for the lower[Helper] autonomous robot requires that it can detect the obstacles(Path Blockers) on the grid. Coming in contact with the path blockers will result in a penalty. Hence sensing the same is necessary. To achieve this purpose the most effective way is to use IR sensors (see Sensors below).
Sensors
LED-LDR Sensor
An LED-LDR sensor is generally used for following a white line on a black surface as is the case in this event. These are used to detect and differentiate between surfaces due to the difference in the intensity of the light reflected. The resistance of an LDR decreases with increase in the intensity of light incident on its surface.
For more details, refer to the sensory System section over here.
IR SENSORS
The IR sensors work on the same principle as the LED-LDR. It is a set of a Infrared source and a light detector which detects the intensity of the infrared light incident on it. Its working is same as described above.
Gap Detection
As stated earlier the upper bot will locate positions of gaps in its path and communicate them to the lower bot.
Gap detection can be achieved by employing any of the above mentioned sensors. The sensor is placed on the upper robot such that it will be suspended slightly ahead of the main body of the robot and would be facing downwards towards the floor. When the sensor is just above the floor (normal scenario), the amount of reflected light reaching the sensor will be more than when there is a gap underneath the sensor i.e. no floor just below the sensor. Using this concept we can configure the sensor to detect gaps in the path of the upper robot.
We do not require gap detection on the lower bot since it is receiving the coordinates of the gaps directly.
Microcontroller
Now we have a drive mechanism to steer the robots, sensing mechanisms to determine the location of the gaps present in the path of the upper robot and we also have an wall detection system for the lower robot to help it traverse in the grid without colliding with the walls or Path blockers. Now to control all these systems simultaneously, we need a microcontroller.The event rules specify that we must use an on board processor. The most generally used microcontroller user interface is AVR. It is quite a good option because it is quite easy to program with the help of the serial/parallel ports of the desktop computer. The programming can be done in most of the common languages such as C.
There are several companies which sell fabricated microcontroller boards. Here is one such link. You can also buy programmer circuits from these robotics shops. An example for a programmer is here.
For more details on microcontrollers, see the processing unit section in this link.
For tutorials on Arduino, visit here.
Communication Between Robots
Communication between robots is required because the Navigator will send coordinates of the gaps to the Helper bot. After the Helper has positioned itself in the gap it will signal the Navigator to indicate that it is now safe to cross. Thus two way communication is necessary. To implement this one of the good options is to use USART on the AVR platform. USART can be learnt once the user is comfortable with programming micro-controllers.
For more information, visit the following links:
http://www.ip-extreme.com/IP/usart.shtml
Other Algorithms
- In this approach we use the concept of grid mapping. Here the lower robot maps the entire grid of the arena. Now, the lower robot has the locations of all the gaps and places itself in the first gap that the upper robot has to cross. Then it communicates the upper robot to begins its journey. The upper robot on receiving the directive to move, start its traversal of the arena and stops as soon as it crosses the first gap. This process is repeated until the upper robot reaches its destination.
Pseudo Code
Line following:
This pseudo code will guide you in writing the code for line following using four sensors.
void ADC_INIT() // Function for Initialisation of ADC for analog to digital conversion of sensor output received.
int main(void)
{
/* DYNAMIC THRESHOLDING */
/* This involves manually placing the robot on white and black surfaces sequentially such that the sensor which is being read is completely on a black surface or on white surface */
/*WHITE THRESHOLDING*/
<set the MUX to take input from the first sensor >
for(i=0;i<4;i++)
{
<take each of the sensor values when on the white line as input and store it in an array
}
/*BLACK THRESHOLDING*/
<set the MUX to take input from the first sensor >
for(i=0;i<4;i++)
{
<take each of the sensor values when on the black line as input and store it in an array
}
//Calculating the threshold value for the sensors
for(i=0;i<4;i++)
{
<take average of black and white threshold values and store it in an array>
}
/*LINE FOLLOWING */
while(1)
{
for(i=0;i<4;++i)
{
<take current value input from all the sensors and store it in an array
}
if(<Either the centre sensors are on the white line else three consecutive sensors are on the white line>)
{
<Both the motors are set to move forward>
}
else if(<the rightmost sensor(s) are on the white line>)
{
<The left motor is set to move forward whereas the right motor is stopped. This results in the robot taking a right turn>
}
else if(<the leftmost sensor(s) are on the white line>)
{
<The right motor is set to move forward whereas the left motor is stopped. This results in the robot taking a left turn>
}
else if(<none of the sensors is on the line>)
{
<Random motion. We can one of the motors is set to move forward while the other is set reverse so that the robot starts taking zero radius turn. This may result in the robot detecting the white track again>
}
}// End of while loop
}//End of main function
Summary
Taking a look into the tutorial what we have discussed here is a simple process for making an efficient robot for the event A.C.R.O.S.S. The above given modules are just to guide you in the various aspects in your process of making a bot. Now we would discuss a couple of thing which have to be kept in mind while making the bot for this event.
First of all, we have mentioned throughout the tutorial that the robot would cross the gap but it is not discussed how. One thing clear to us is that the lower robot has to act as the bridge for the upper robot but this bridge can be of different types. The bridging platform can be a simple platform painted black with a white line on it for the upper robot to follow. Another possible option is that the bridge has walls of 5cm height so that the upper robot crosses the bridge using wall following.
Event link: www.robotix.in/across
Event video link: http://www.youtube.com/watch?v=IGNplFDOAmA
Event Facebook page: https://www.facebook.com/groups/475078035864616/