You are on page 1of 10

PROJECT NAME

“Master Slave Robot”

LINEAR CONTROL SYSTEM

COMPLEX ENGINEERING PROBLEM


Report

BEE SPRING 2023 SEMESTER


Name:
QAISAR ZIA
AWAIS KHAN
REHAN ABBASI
Enrollment # 01-133202-167
01-133202-162
01-133202-144

Course Instructor: Ma’am Maryam Iqbal


Lab Instructor: Ma’am Ayesha Waqar

Semester: BEE-6B
DEPARTMENT OF ELECTRICAL ENGINEERING

1
Thursday, June 8, 2023
Contents
Introduction ............................................................................................................................................ 3
Abstract................................................................................................................................................... 3
Objectives ............................................................................................................................................... 3
Beneficiaries: .......................................................................................................................................... 3
Circuit Design ......................................................................................................................................... 4
Programming .......................................................................................................................................... 4
Simulation............................................................................................................................................... 4
Component Names: ................................................................................................................................ 4
Schematic Diagram................................................................................................................................. 5
................................................................................................................................................................5
Code:....................................................................................................................................................... 5
Results and Discussion ........................................................................................................................... 9
References ............................................................................................................................................ 10
Appendix: ............................................................................................................................................. 10
Conclusion ............................................................................................................................................ 10

2
Thursday, June 8, 2023
Introduction:
Master-slave robot systems refer to a type of robotic arrangement in which one robot, called the master,
controls the actions of another robot or multiple robots, called the slave. This concept is inspired by the
hierarchical relationship between the human operator and the robot he controls. The master-slave
configuration allows for improved controllability, accuracy, and coordination in various applications.

In such a system, the master robot usually acts as the main operator, while the auxiliary robots perform
assigned tasks under the direction of the master. The host robot can be operated remotely by the operator
or automated with pre-programmed instructions. The slaves receive commands from the master and
execute them, working synchronously to achieve a specific goal.

Abstract:
Master-slave robot systems have admiring astronomical attention in the field of robotics due to their ability
to advance control, certainty, and coordination in various applications. This gizmo provides an overview of
master-slave robotic systems, discussing their conceptual structure design considerations, and applications.
Master-slave robotic systems find applications in a assortment of fields, such as medical robotics,
manufacturing and assembly, exploration and mining, and remote operations. In medical robotics, surgeons
can use primary subsystems for minimally invasive surgeries, through developing precision and dexterity.
Industrial environments use master-slave systems to optimize management and assembly processes,
advance fertility and diminish human labor.
Objective:
The goal of a master-slave robot system is to improve control, efficiency and coordination in various
applications. The system aims to establish a hierarchical relationship between the master robot and one or
more slave robots, the master robot controlling the actions of the slaves.
The specific objectives of a master-slave robot system can vary depending on the application, but some
common goals include:
• Advanced control: Master-slave configuration allows precise control of sub-robot movements and actions.

• Increased accuracy: Master-slave systems aim to improve the accuracy and precision of robot operations.
By providing direct control or guidance, the master robot ensures that the sub-robots perform tasks with
high precision, minimizing errors and achieving the desired level of accuracy. .

• Synchronization and coordination: Coordinating the actions of a few robots is every constitutional goal in
many master-slave systems.

• Adaptability and complaisance Master-slave robotic systems often seek to accommodate to different tasks
and environments. The goal is to design systems that can handle a wide variety of tasks, allowing them to
be easily reconfigured or customized to meet specific application exigencies.

Beneficiaries:
Master-slave robotic systems offer several advantages in terms of precision control and operation. The
hierarchical structure of these systems allows for better and more precise control over the actions of the
slave robot. Host robots, whether human-operated or automated, provide precise control, which improves
accuracy and precision in performing tasks. This level of accuracy is especially valuable in applications
such as surgical procedures, where even small deviations of
can have significant consequences. Synchronized actions between slave robots, coordinated by the master,
further contribute to precise operations, enabling seamless collaboration and ensuring tasks are performed
in a proportional manner. meticulous.

3
Thursday, June 8, 2023
Circuit Design:

4
Thursday, June 8, 2023
Programming:
The programming component of this project is done using the Arduino Integrated Development
Environment (IDE). We have written a program that reads data from the sensor and controls the motor
based on the input. The program has two main functions: following the line and avoiding obstacles. In
rowing mode, the robot follows the black line using the bar sensor. In obstacle avoidance mode, the robot
stops and changes direction when it detects an obstacle ahead.

Simulation:
Simulation is an essential component of any robotics project. This helps to identify potential design
problems before the robot is built. In this project, we use Proteus software to simulate circuit design and
programming. Simulation allows us to test the robot's performance in different situations, such as changing
the width of the road or adding more obstacles.

Code:
//*****************************************************
//
// Line Following & Obstacle Avoiding robot
// master robo
//*****************************************************
//
#include <Servo.h>
Servo myservo;

#define LMPWM 5
#define RMPWM 6
#define L_M_1 A0
#define L_M_2 A1
#define R_M_1 A3
#define R_M_2 A2

#define L_IR 3
#define R_IR 4
#define TX_4 10
#define TX_3 11
#define trigPin 7
#define echoPin 8
#define limit 15

long duration;
int distance,dist_R,dist_L;
int start=1;
int go=1;
int go_done = 0;
int L_IR_S,R_IR_S;

void setup() {
Serial.begin(9600);
myservo.attach(9);

5
Thursday, June 8, 2023
myservo.write(90);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(L_IR,INPUT);pinMode(R_IR,INPUT);
pinMode(L_M_1,OUTPUT);pinMode(L_M_2,OUTPUT);pinMode(R_M_1,OUTPUT);pinMode(
R_M_2,OUTPUT);pinMode(TX_4,OUTPUT);pinMode(TX_3,OUTPUT);
analogWrite(LMPWM,150);
analogWrite(RMPWM,150);
digitalWrite(TX_4,HIGH);
digitalWrite(TX_3,HIGH);
delay(7000);
}

void loop() {

L_IR_S = digitalRead(L_IR);
R_IR_S = digitalRead(R_IR);

if(go==1)
{
if(L_IR_S==1 && R_IR_S==1)
{
Stop();
delay(1000);
myservo.write(0);
delay(1000);
sonar();
dist_R = distance;
delay(100);
myservo.write(180);
delay(1000);
sonar();
dist_L = distance;
delay(100);
myservo.write(90);
delay(1000);
check();
go=0;
go_done=1;
}
}

if(go_done==1)
{

if(L_IR_S==1 && R_IR_S==1)


{
Stop();
}

6
Thursday, June 8, 2023
}
Serial.print(L_IR_S);
Serial.print(":");
Serial.println(R_IR_S);
Line_Follow();

}
void Line_Follow()
{ if(L_IR_S==0 && R_IR_S==0) //Move Straight
{Forward();}
else if(L_IR_S==0 && R_IR_S==1) //left Cross
{Right();}
else if(L_IR_S==1 && R_IR_S==0) //left Cross
{Left();}
else
{
Stop();
}

void Forward(){
analogWrite(L_M_1,0);analogWrite(L_M_2,1023);analogWrite(R_M_1,0);analogWrite(R_M_2,1
023);}
void
Left(){analogWrite(L_M_1,0);analogWrite(L_M_2,0);analogWrite(R_M_1,0);analogWrite(R_M_
2,1023);}
void
Right(){analogWrite(L_M_1,0);analogWrite(L_M_2,1023);analogWrite(R_M_1,0);analogWrite(
R_M_2,0);}
void
Stop(){analogWrite(L_M_1,0);analogWrite(L_M_2,0);analogWrite(R_M_1,0);analogWrite(R_M
_2,0);}

void sonar()
{
digitalWrite(trigPin, LOW);delayMicroseconds(2);digitalWrite(trigPin,
HIGH);delayMicroseconds(10);digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);distance = duration * 0.034 / 2;Serial.print("Distance:
");Serial.println(distance);
}

void check()
{
if(dist_R<limit && dist_L>limit)
{
digitalWrite(TX_4,LOW);
delay(1000);
digitalWrite(TX_4,HIGH);
Left();
7
Thursday, June 8, 2023
delay(1500);

}
else if(dist_L<limit && dist_R>limit)
{
digitalWrite(TX_3,LOW);
delay(1000);
digitalWrite(TX_3,HIGH);
Right();
delay(1500);
}
}

//slave

#include <Servo.h>
Servo myservo;

#define LMPWM 9
#define RMPWM 10
#define L_M_1 4
#define L_M_2 5
#define R_M_1 3
#define R_M_2 2

#define L_IR 6
#define R_IR 8
#define RX_D0 11
#define RX_D1 12
#define RED A4
#define YELLOW A1

int L_IR_S,R_IR_S;
int R_turn=0;
int L_turn=0;
int go=1;

void setup() {
Serial.begin(9600);

pinMode(L_IR,INPUT);pinMode(R_IR,INPUT);pinMode(RX_D0,INPUT);pinMode(RX_D1,INPUT);
pinMode(L_M_1,OUTPUT);pinMode(L_M_2,OUTPUT);pinMode(R_M_1,OUTPUT);pinMode(R_M_2,OUTP
UT);

Stop();
while(R_turn==0 && L_turn==0)
{
L_turn=digitalRead(RX_D0);
R_turn=digitalRead(RX_D1);
Serial.println("Waiting...");
}

analogWrite(LMPWM,130);

8
Thursday, June 8, 2023
analogWrite(RMPWM,130);
if(R_turn==1)
{
analogWrite(YELLOW,1023);
}
else if(L_turn==1)
{
analogWrite(RED,1023);
}
delay(10000);
}

void loop() {
L_IR_S = digitalRead(L_IR);
R_IR_S = digitalRead(R_IR);

Line_Follow();

if(go==1)
{
if(L_IR_S==1 && R_IR_S==1)
{
Stop();
delay(1000);
check();
go=0;
}}}
void Line_Follow()
{ if(L_IR_S==0 && R_IR_S==0) //Move Straight
{Forward();}
else if(L_IR_S==0 && R_IR_S==1) //left Cross
{Right();}
else if(L_IR_S==1 && R_IR_S==0) //left Cross
{Left();}
else
{
Stop();
}

void Forward(){
digitalWrite(L_M_1,LOW);digitalWrite(L_M_2,HIGH);digitalWrite(R_M_1,LOW);digitalWrite(R_M_2,HIG
H);}
void
Left(){digitalWrite(L_M_1,HIGH);digitalWrite(L_M_2,LOW);digitalWrite(R_M_1,LOW);digitalWrite(R_M_
2,HIGH);}
void
Left1(){digitalWrite(L_M_1,LOW);digitalWrite(L_M_2,LOW);digitalWrite(R_M_1,LOW);digitalWrite(R_M
_2,HIGH);}
void
Right(){digitalWrite(L_M_1,LOW);digitalWrite(L_M_2,HIGH);digitalWrite(R_M_1,HIGH);digitalWrite(R_
M_2,LOW);}
void
Right1(){digitalWrite(L_M_1,LOW);digitalWrite(L_M_2,HIGH);digitalWrite(R_M_1,LOW);digitalWrite(R_
M_2,LOW);}
void
Stop(){digitalWrite(L_M_1,LOW);digitalWrite(L_M_2,LOW);digitalWrite(R_M_1,LOW);digitalWrite(R_M_
2,LOW);}

9
Thursday, June 8, 2023
void check()
{
if(L_turn==1)
{
Right1();
delay(1500);

}
else if(R_turn==1)
{
Left1();
delay(1500);
}
}
Results and Discussion:
The robot was tested in a controlled environment and its performance was evaluated based on various
criteria, such as accuracy, speed, and obstacle avoidance. obstacle. The robot was able to follow the host
robot. Accuracy and precision at the receiver and transmitter side can be improved by using more
powerful motors or by optimizing the control algorithm.

References:
The following references were used in this project:
Arduino website:
https://www.arduino.cc/
Proteus website: https://www.labcenter.com/
PID control algorithm: https://en.wikipedia.org/wiki/PID_controller

Addendum:
The following files are included in addendum: Circuit
Arduino program code schematic simulation file.
Conclusion:
In summary, master-slave robotic systems provide a powerful approach to achieving improved control,
accuracy, coordination, and efficiency in a variety of applications use. The hierarchical relationship
between the master robot and the sub-robot allows precise control over the actions of the sub-robot, which
improves accuracy and precision in performing tasks. Synchronization and coordination between sub-
robots, guided by the master, further enhances the system's capabilities and enable seamless collaboration
of the Distributing tasks among multiple assistants maximizes efficiency and productivity, improving
overall performance.
As research and development in this area continues, master-slave robot systems promise further
advancements and wide adoption, contributing to the advancement of robotics and automation in various
fields.

------------------------------------------------------------- Thankyou! ----------------------------------------------

10
Thursday, June 8, 2023

You might also like