SWARM ROBOTS

0
5666
swarm robots
swarm robots

SWARM ROBOTS

 

[nextpage title=”Introduction” ]

INTRODUCTION

Swarm robots is a new approach to the coordination of multirobot systems which consist of large numbers of mostly simple physical robots. It is supposed that a desired collective behavior emerges from the interactions between the robots and interactions of robots with the environment. This approach emerged on the field of artificial swarm intelligence, as well as the biological studies of insects, ants and other fields in nature, where swarm behaviour occurs.

PROBLEM STATEMENT

Our initial aim is to design 4 autonomous robots which can march past through a particular path,during marching they will remember this path and then they will replicate this path.After completing this problem statement, we aim to extend this marching through any arbitiary path.

 

COMPONENTS

1.Chasis

2.Arduino Uno

3.X-Bee

4.Motor Driver L298

5.Wheels

6.Ultrasonic Sensors

7.Metal Shaft Motors 200 RPM

[sam id=”4″ codes=”true”]

 

[/nextpage]

[nextpage title=”EXECUTION OF PROBLEM STATEMENT” ]

EXECUTION OF PROBLEM STATEMENT

[sam id=”4″ codes=”true”]

Four ultrasonic sensors will be mounted at 90 degrees to the adjacent ones on the robot.These sensors give analog output of voltage and these sensors have a range of about 2cm to 4m with an accuracy 0.2cm.Using this principle,robots will detect walls and other robots and pass this information to other robots communicating with the help of X-BEE’s.In this manner robots will execute a coordinated march past through the arena.

[/nextpage]

[nextpage title=”Basic Design of Robot” ]

BASIC DESIGN OF ROBOT

swarm robots
BASIC DESIGN OF ROBOT

X-BEE will be placed at the upper layer whereas the Arduino,Motor drivers and sensors will be sandwiched between the two layers.

[sam id=”4″ codes=”true”]

ARENA

arena swarm robots
Arena

[/nextpage]

[nextpage title=”TimeLine” ]

TIMELINE

May 18th-20th

All the team members assembled.We finalized the problem statement.The biggest problem in front of us was the selection of proximity sensors.We talked to senior so as to sort out this problem,went to Prof. Laxmidhar Behra’s lab.

May 21st-22nd

Learnt how to configure X-BEE.Did research on omni wheels and proximity sensors on internet.Mailed to some persons who had done work on proximity sensors.Observed people’s comments on online forums regarding proximity sensors.

May 23rd

[sam id=”4″ codes=”true”]

We went to the local market in the search of omni wheels,but couldn’t find anything useful.Farid advised us to drop the idea of using omni wheels as importing good quality omni wheels would have took a lot of time.

May 24th-25th

Attended Autodesk Inventor Professional workshop organized by robotics club.It was pretty useful to us for developing design of robot given above.

May 26th-28th

Finally,we decided to use ultrasonic proximity sensor named RKI-1540.But we were in a fix so as to sort out the interference of sound waves emitted by the sensors.We read lots of research papers,observed comments by peoples on the discussion forums,went to Behra sir’s lab so as to find a solution to it.

May 29th-31st

Finally we convinced the coordinators for the interference problem of sensors by the concept of sequential firing.They initially ordered two sensors for testing this concept.

June 1st-2nd

Finally the sensors arrived.We wrote down the code for sequential firing and it resulted positive.

[/nextpage]

[nextpage title=”Code” ]

Code for sequential firing for two sensor

#define trigPin 4 #define echoPin 5 #define trigp 6 #define echop 7 void setup() {

Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(trigp, OUTPUT);
pinMode(echop, INPUT);

}

void loop()

{
float t1,t2, d1,d2;
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

t1=pulseIn(echoPin,HIGH);
d1=t1*0.017;
 Serial.print("A->"); 
 Serial.println(d1);
 Serial.println("cm");
digitalWrite(trigp, HIGH);
delayMicroseconds(10);
digitalWrite(trigp, LOW);

t2=pulseIn(echop,HIGH);
d2=t2*0.017;
Serial.print("B->");  
 Serial.println(d2);
 Serial.println("cm");
 delay(2000);
}[sam id="4" codes="true"]

June 3rd-5th

Now we tried to send the data observed by both the sensors from one x-bee to another x-bee and also wrote some code for blinking LED by applying some conditions on the distance observed.In the mean time,we asked Farid to order the remaining sensors.

Code for x-bee communication of sensor data

#define trigPin 4 #define echoPin 5 #define trigp 6 #define echop 7

void setup() {

Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(trigp, OUTPUT);
pinMode(echop, INPUT);

}

void loop() {

float t1,t2, d1,d2;
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

t1=pulseIn(echoPin,HIGH);
d1=t1*0.017;
 Serial.print("A->"); 
 Serial.print(d1);
 Serial.print("cm");
 delay(100);
digitalWrite(trigp, HIGH);
delayMicroseconds(10);
digitalWrite(trigp, LOW);

t2=pulseIn(echop,HIGH);
d2=t2*0.017;
 Serial.print("B->");  
 Serial.print(d2);
 Serial.print("cm");
 delay(100);
 delay(2000);
}

[sam id=”4″ codes=”true”]

[/nextpage]

[nextpage title=”Summary” ]

June 6th

This day arrived with one more happiness.We tested for interference between sensors without sequential firing by powering these two sensors independently and to our utter surprise,it resulted in no interference against the predections of all seniors and all the discussion forums.Obviously,this succes has made our future path towards the completion of the project easy.:-D

June 7th-10th

Although,yesterday was a happy day for us,but it didn’t curtailed our problems.:-( We were facing some problems in ordering sensors.This period was quite hard for us. We didn’t even have motor drivers,sensors as to check our further experiments.We had written codes,but didn’t have sufficient components to test them. Finally,the sensors were ordered on 10th of june.

June 11th-12th

Our patience was getting tied down in the wait for the sensors.Finally,we got the acrylic cut down.But may be destiny wasn’t in our favor,water jet machine got some defects while cutting.Perforce,we had to change our design.Now,there would be only one layer instead of two layers as decided earlier.

June 13th

Finally we got the hard coding cum communication between the two robots successfully.

June 14th-15th[sam id=”4″ codes=”true”]

14th was our evaluation day. We had to present two bots communicating with each other through X-bee.One robot was acting like leader avoiding obstacles in its path and the second robot was acting like its shadow.

[/nextpage]

[nextpage title=”Code for leader robot” ]

Code for leader robot

[sam id=”4″ codes=”true”]

#define trigpin1 10 #define trigpin2 12 #define sensor1 11 #define sensor2 13 #define PWMELPin 3 Enable PWM Left Motor #define PWMERPin 6 Enable PWM Right Motor #define L1Pin 5 L1 = Left Motor Lead 1 #define L2Pin 4 L2 = Left Motor Lead 2 #define L4Pin 8 L3 = Right Motor Lead 1 #define L3Pin 9 L4 = Right Motor Lead 2 void setup(){

Serial.begin(9600);
pinMode(sensor1,INPUT);
pinMode(sensor2,INPUT); 
pinMode(trigpin1,OUTPUT);
pinMode(trigpin2,OUTPUT);
 pinMode(PWMELPin,OUTPUT);
  pinMode(PWMERPin, OUTPUT);
  pinMode(L1Pin, OUTPUT);
  pinMode(L2Pin, OUTPUT);
  pinMode(L3Pin, OUTPUT);
  pinMode(L4Pin, OUTPUT);

} void loop(){

digitalWrite(3,HIGH);
digitalWrite(6,HIGH);
float distance[1],duration[1];
digitalWrite(trigpin1,HIGH);
delayMicroseconds(10);
digitalWrite(trigpin1,LOW);
duration[0]=pulseIn(sensor1,HIGH);
distance[0]=duration[0]*0.017;
delay(1000);
digitalWrite(trigpin2,HIGH);
delayMicroseconds(10);
digitalWrite(trigpin2,LOW);
duration[1]=pulseIn(sensor2,HIGH);
distance[1]=duration[1]*0.017;
delay(1000);
if(distance[0]<10&&distance[1]<10)
{
  conclude();
  Serial.write('s');
}
else{
if(distance[0]<10&&distance[1]>10)
{
  turnleft();
  Serial.write('l');
}
if(distance[0]>10&&distance[1]<10)
{
  turnright();
  Serial.write('r');
}
if(distance[0]>10&&distance[1]>10)
{
   moveforward();
   Serial.write('m');
}

} } void turnleft(){

digitalWrite(L1Pin, LOW);
digitalWrite(L2Pin, HIGH);
digitalWrite(L3Pin, HIGH);
digitalWrite(L4Pin, LOW);

} void turnright(){

digitalWrite(L1Pin, HIGH);
digitalWrite(L2Pin, LOW);
digitalWrite(L3Pin, LOW);
digitalWrite(L4Pin, HIGH);

} void moveforward(){

digitalWrite(L1Pin, HIGH);
digitalWrite(L2Pin, LOW);
digitalWrite(L3Pin, HIGH);
digitalWrite(L4Pin, LOW);

} void conclude(){

digitalWrite(L1Pin, LOW);
digitalWrite(L2Pin, LOW);
digitalWrite(L3Pin, LOW);
digitalWrite(L4Pin, LOW);

}

[/nextpage]

[nextpage title=”Code for follower robot” ]

Code for follower robot

#define PWMELPin 13 Enable PWM Left Motor #define PWMERPin 8 Enable PWM Right Motor #define L1Pin 12 L1 = Left Motor Lead 1 #define L2Pin 9 L2 = Left Motor Lead 2 #define L4Pin 10 L3 = Right Motor Lead 1 #define L3Pin 11 L4 = Right Motor Lead 2 void setup(){

Serial.begin(9600);
 pinMode(PWMELPin, OUTPUT);
  pinMode(PWMERPin, OUTPUT);
  pinMode(L1Pin, OUTPUT);
  pinMode(L2Pin, OUTPUT);
  pinMode(L3Pin, OUTPUT);
  pinMode(L4Pin, OUTPUT);

} void loop(){

digitalWrite(13,HIGH);
digitalWrite(8,HIGH); 
char temp;
if(Serial.available()){
  temp=Serial.read();
  if(temp=='l')
  turnleft();
  if(temp=='r')
  turnright();
  if(temp=='m')
  moveforward();
  if(temp=='s')
  conclude();
  }

} void turnleft(){

digitalWrite(L1Pin, LOW);
digitalWrite(L2Pin, HIGH);
digitalWrite(L3Pin, HIGH);
digitalWrite(L4Pin, LOW);

} void turnright(){

digitalWrite(L1Pin, HIGH);
digitalWrite(L2Pin, LOW);
digitalWrite(L3Pin, LOW);
digitalWrite(L4Pin, HIGH);

} void moveforward(){

digitalWrite(L1Pin, HIGH);
digitalWrite(L2Pin, LOW);
digitalWrite(L3Pin, HIGH);
digitalWrite(L4Pin, LOW);

} void conclude(){

digitalWrite(L1Pin, LOW);
digitalWrite(L2Pin, LOW);
digitalWrite(L3Pin, LOW);
digitalWrite(L4Pin, LOW);

}

To our luck our both bots work properly. But at this moment of time we came across two major issues-: 1.Current issue- As the batteries become little bit of discharge during testing it highly reduces its current ratings which in turn leads to malfunctioning of the arduino. 2.To move bot in a straight line- As the RPM of two motors could not be the same therefore it leads to turning of bot in one direction. we had done numerous experiments to make our bot move in a straight line path by applying PWM to both the motors and finally we got success. for current issue we had planned to use 7805 to ensure a constant supply of 5V to the arduino.

June 16th-17th

Since the water jet machine developed some problems whilst the process of cutting due to which we couldn’t get the upper layer cut.Perforce,we changed the design of upper layer to a square instead of circular disk as decided earlier.We manually cut the acrylic sheets to form square sheet and joints.So,these two days were engaged in making casing for the robot.

[/nextpage]

[nextpage title=”Swarm Robots” ]

 

swarm robots
swarm robots
Final Swarm Robots
Final Swarm Robots

 

different arrangements of bots that will be followed in pattern following

[sam id=”4″ codes=”true”]

1st arrangement (bee swarm)

bee swarm
bee swarm

 

2nd arrangement (winged ant swarm)

winged ant swarm
winged ant swarm
3rd arrangement honey bees swarm
honey bees swarm
honey bees swarm

[sam id=”4″ codes=”true”]

[/nextpage]