0% found this document useful (0 votes)
26 views

Control Lab

Control Engineering lab

Uploaded by

Raja Harjai
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Control Lab

Control Engineering lab

Uploaded by

Raja Harjai
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

A Project Report on

Object Following Robot

By
Student Name Registration No.
Gul Nawab Ahmad BME193062
Sheikh Muhammad Suleman BME193081

A Project Report submitted to the


DEPARTMENT OF MECHANICAL ENGINEERING
in partial fulfillment of the requirements for the Course of
Control Engineering Lab

of the degree of
BACHELOR OF SCIENCE MECHANICAL ENGINEERING

Faculty of Engineering
Capital University of Science and Technology
Islamabad
January 2023
Copyright  2023 by CUST Student

1
All rights reserved. Reproduction in whole or in part in any form requires the prior
written permission of , GUL NAWAB AHMAD - BME193062 & SHEIKH
MUHAMMAD SULEMAN - BME193081 or designated representative.

2
DECLARATION

It is declared that this is an original piece of my own work, except where


otherwise acknowledged in text and references. This work has not been submitted in
any form for another degree or diploma at any university or other institution for
tertiary education and shall not be submitted by me in future for obtaining any degree
from this or any other University or Institution.

GUL NAWAB AHMAD


BME193062

SHIEKH MUHAMMAD SULEMAN


BME193081

January 2023

3
CERTIFICATE OF APPROVAL

It is certified that the project titled “Object Following Robot” carried out by Gul
Nawab - BME193062 and Sheikh Muhammad Sulaiman - BME193081, Capital
University of Science and Technology, Islamabad, is fully adequate, in scope and in
quality, as a semester project for the course of Control Engineering Lab

Supervisor:
Sir Attabik Tabib
Lab Instructor
Department of Mechanical Engineering
Faculty of Engineering
Capital University of Science and Technology, Islamabad

4
Abstract

In today’s world robotics are an expeditious growing and fascinating field. The robot
has sufficient smartness to cover the maximum area of provided space. It has
ultrasonic sensors and infrared sensors which are trained to sense the obstacles
coming in between the path of the robot. Autonomous smart robots are robots that can
perform desired tasks in unstructured environments without constant human guidance.
The minimum number of gear motor measures the moving robot to minimize the
power consumption while constructing a program that can create a coordination of
multi-degree of freedom for the kinetics of the robot.
The project calls for the use of an appropriate controller to control a system. For this
very purpose we have fabricated a human following robot using an Arduino controller
to control the movements of the robot. Additionally, we have compiled it with
ultrasonic sensors which can detect an object in its way.

5
Table of Contents

1 INTRODUCTION..............................................................................9
1.1 Overview........................................................................................9
1.2 Purpose of this Project...................................................................9
1.3 Report Organization.......................................................................9
2 LITERATURE REVIEW.................................................................10
2.1 Related Terminologies.................................................................10
2.1.1 Arduino UNO.....................................................................10
2.1.2 IC L293D............................................................................10
2.1.3 Ultrasonic Sensor (HC-SR04)............................................11
2.1.4 DC Gear Motor...................................................................12
2.1.5 Wheel..................................................................................13
2.1.6 Robot Chassis.....................................................................13
2.1.7 Jumper Wire.......................................................................14
2.2 Tools Used...................................................................................15
3 PROJECT DESIGN AND IMPLEMENTATION...........................16
3.1 Schematic Diagram......................................................................16
3.2 Arduino Programming.................................................................17
3.2.1 Arduino Code.....................................................................17
4 RESULTS.........................................................................................21
4.1 Limitations of the Project............................................................21
4.2 Further Improvements & Future Scope.......................................21
5 CONCLUSION................................................................................22

6
LIST OF FIGURES
Figure 1: Schematic Diagram of Arduino UNO...............................................................
Figure 2: Pin Diagram of IC I293D.................................................................................
Figure 3: Pin Diagram of Ultrasonic Sensor (HC-SR04).................................................
Figure 4: DC Geared Motor.............................................................................................
Figure 5: Robot Wheels.....................................................................................................
Figure 6: Robot Chassis....................................................................................................
Figure 7: Jumper Cables...................................................................................................
Figure 8: Schematic Diagram of Human Following Robot..............................................
Figure 9: Block Diagram of Human Following Robot.....................................................
Figure 10: Arduino Logic Entity Relationship Diagram..................................................

7
CHAPTER 1

1 INTRODUCTION
This part of the text provides a general review of the report. The main aim to write
this report is the design and working of Human Following Robot.

1.1 Overview
AI and robotics are the future. For that purpose, we have coupled a feedback
controller (Arduino) with a couple of motors and a drive train and with the help of
different sensor, the robot can follow and stop following an object automatically.

1.2 Purpose of this Project


The main purpose of this project is

1. To get a know how of feedback controllers.


2. To see real life applications of closed loop feedback controllers.

1.3 Report Organization


 In this report, the reader will firstly come across chapter 1. This chapter
provides the most basic information and an overall review about the whole
report.
 Moving forward, there comes Chapter 2. This part of the entire context
focuses more on the terminologies that will be used when evaluating the
controller. This chapter will help the readers to have better concepts of the
expressions that were acknowledged from this course. Here the engineering
terms will be converted into simpler words and conveyed to all types of
readers.
 Further into the report, Chapter 3 will be having the most essential content. It
will include the schematic diagrams. It will also include the Arduino code.
 Moving on, there will come chapter 4. In this chapter, the results will be
evaluated.
 Lastly, the reader will come to chapter 5. It is the concluding chapter. It will
be a short summary of all the analysis done through-out the report.

8
CHAPTER 2

2 METHODOLOGY
This chapter provides a better understanding of all the engineering terms that will be
used through-out the report. It is to give reader a better judgement on the analysis of
the wing

2.1 Related Terminologies


2.1.1 Arduino UNO
Arduino is a programmable electronic circuit broad that can integrate into a wide
variety of projects both easy and difficult. It has a microcontroller which is capable to
write a program for sensing and controlling objects in the real world. The Arduino is
fit to communicate with an astronomically immense array of outputs such as motors,
LED and displays by reacting to sensors and inputs. Arduino becomes a very popular
compiler for inventors looking to design interactive hardware projects because of its
versatility and affordable

Figure 1: Schematic Diagram of Arduino UNO.

2.1.2 IC L293D
The L293D is a dual H-bridge motor driver IC (Integrated Circuit). This motor driver
IC acts as a current amplifier as it takes low current control signals and provides
higher current signals. This higher current signal is utilized to run the motor. The IC

9
L293D consists of two built-in H-bridge driver circuits. The common mode of in its
operation, two DC motors can be operated concurrently both in forwards and
backward direction. The operation of the two motors can be regulated by input logic
pin 2,7 and 10,15. The input logics 00 or 11 will pull up the corresponding motor. The
input logics 01 and 10 will rotate the motor in clockwise and anticlockwise directions
sequentially. The enable pin 1 and 9 (like 36 for two motors) must be high for two
motors to start working. When the enable input pin is high, the correlated driver
becomes enabled. As a result, the output gets activated and work in phase with its
input. When the enable input pin is low, the driver is disabled, and its output is off and
in the high impedance state.

Figure 2: Pin Diagram of IC I293D

2.1.3 Ultrasonic Sensor (HC-SR04)


The ultrasonic sensor is called for quantifying the characteristics of sound waves with
the frequency above the audible range of human. It is working on three basic
principles: Flight time, Doppler Effect, and the decrease of sound waves. The
ultrasonic sensor is non-intrusive in that it has no need for physical connection with
its target and it can identify specific shiny or clear targets Otherwise, it is unclear
from some vision-oriented sensors. Otherwise, its measurement is highly sensitive to
temperature and the angle of targets. 3.2.4.b Working process of ultrasonic sensor
(HC-SR04)

10
The ultrasonic sensor (HC SR04) is a four pins module as shown in Fig 3.5 above
whose pin names are Vcc pin, Trigger pin, Echo pin, and Ground pin sequentially.
This sensor is the most famous sensor applied to various purposes where distance
measurements or sensing elements are needed. This sensor (HC SR04) has two
devices like a human eye which acts as an ultrasonic transmitter and receiver. This
sensor acts with easy high school formulas that are

Distance = Speed × Time

Now, we measure the distance by utilizing the formula above and have to know the
speed and time. Whereas we are utilizing the ultrasonic wave we know the general
speed of the ultrasonic wave at room conditions that is 330 m/s. The device built-in on
the module that will measure the time taken for the ultrasonic wave to get back and
witch on the echo pin high for that equal certain amount of time. In this way, we can
also realize the time taken. Now we can easily measure the distance by utilizing a
microcontroller or microprocessor.

Figure 3: Pin Diagram of Ultrasonic Sensor (HC-SR04)

2.1.4 DC Gear Motor


DC gear motors can be determined as an extension of the DC motor which meantime
had its insight. A dc gear motor has a gear part affixed to the motor. The speed of the
motor is computed in terms of revolutions of the shaft per minute and is called RPM.
The gear system employs in incrementing the revolution and decreasing the speed. In
a DC gear motor, the gear connects the motor, and the Gearhead is quite minute.
Hence it adds more speed to the immensely colossal teeth and makes it rotated. The

11
more sizable voluminous portion of the gear additional turns the more minuscule
twice port. The compressed twice port receives the torque but not the haste of its
ancestor which shifts to a more sizable voluminous part of other gear and so on. The
third gears twice part has more teeth than others and so it adds extra torque to the gear
that is attached to the shaft.

Figure 4: DC Geared Motor

2.1.5 Wheel
A wheel is the main components to move an object adherent robot. Here we utilize
plastic wheel covered by quantifying rubber tire whose diameter is 1.65" (42 mm) and
it is set the output shafts on our gear motors. Those gear motors should mount on the
side of the hub with the overhanging teeth. The output shaft will shift into the socket
easily at first but achieve a snug fit when pushed through the other side of the hub.

Figure 5: Robot Wheels

12
2.1.6 Robot Chassis
Chassis play a vital role to hold all hardware of Object follower such as
microcontroller, power unit, motor, motor driver, etc. For this project, there used
chassis which is known as magician chassis because it is suitable for all types of
mobile robot hardware. The Chassis is the latest robot platform from Dagu. It can
hold a couple of gear motors with 65 mm wheels and a ball caster. The chassis plate is
made of acrylic with a spacious range of mounting slots or holes for controllers,
sensors, motor drivers, battery, camera etc. We can easily bolt the two pre-cut
platforms mutually and possible to attach some desired robotics controller. This
chassis can hold 4x AA battery holder and have sufficient space to keep any other DC
battery

Figure 6: Robot Chassis

2.1.7 Jumper Wire


A jump wire is a short electrical wire with a solid tip at each end (or sometimes
without them, simply "tinned"), which is normally used to interconnect the
components in a breadboard. Depending up on its two-end tip or tip hole jumper
wire has several types of Male-Females, Female- male, Male-Male etc. In our
project we used male to female jumper wire which is connected to the robots
MCU to the sensor. And in bread board for different connection another simple
jumper wire was used. The picture of several jumpers is given below

13
Figure 7: Jumper Cables

2.2 Tools Used


Following are the tools used for this project

 Soldering Iron
 Glue gun
 Wire Cutter
 Knife
 Digital Multimeter
 Screwdriver
 Tweezer

14
CHAPTER 3

3 PROJECT DESIGN AND IMPLEMENTATION


In this context, the reader will come across the schematic diagrams of the human
following robot. It will describe all the motion of the robot and the Arduino code
included in it.

3.1 Schematic Diagram

Figure 8: Schematic Diagram of Human Following Robot

Figure 9: Block Diagram of Human Following Robot

15
3.2 Arduino Programming
The basic logic for the working of ultrasonic sensors can be described using the
following diagram

Figure 10: Arduino Logic Entity Relationship Diagram

3.2.1 Arduino Code


The following code was written on Arduino Software (IDE).

#include<NewPing.h>

#include<Servo.h>

#include<AFMotor.h>

#define RIGHT A2

#define LEFT A3

#define TRIGGER_PIN A1

#define ECHO_PIN A0

#define MAX_DISTANCE 100

16
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

AF_DCMotor Motor1(1,MOTOR12_1KHZ);

AF_DCMotor Motor2(2,MOTOR12_1KHZ);

AF_DCMotor Motor3(3,MOTOR34_1KHZ);

AF_DCMotor Motor4(4,MOTOR34_1KHZ);

Servo myservo;

int pos =0;

void setup() {

// put your setup code here, to run once:

Serial.begin(9600);

myservo.attach(10);

for(pos = 90; pos <= 180; pos += 1){

myservo.write(pos);

delay(15);

} for(pos = 180; pos >= 0; pos-= 1) {

myservo.write(pos);

delay(15);

}for(pos = 0; pos<=90; pos += 1) {

myservo.write(pos);

delay(15);

pinMode(RIGHT, INPUT);

pinMode(LEFT, INPUT);

void loop() {

// put your main code here, to run repeatedly:

delay(50);

unsigned int distance = sonar.ping_cm();

Serial.print("distance");

Serial.println(distance);

int Right_Value = digitalRead(RIGHT);

int Left_Value = digitalRead(LEFT);

Serial.print("RIGHT");

Serial.println(Right_Value);

17
Serial.print("LEFT");

Serial.println(Left_Value);

if((Right_Value==1) && (distance>=10 && distance<=30)&&(Left_Value==1)){

Motor1.setSpeed(120);

Motor1.run(FORWARD);

Motor2.setSpeed(120);

Motor2.run(FORWARD);

Motor3.setSpeed(120);

Motor3.run(FORWARD);

Motor4.setSpeed(120);

Motor4.run(FORWARD);

}else if((Right_Value==0) && (Left_Value==1)) {

Motor1.setSpeed(200);

Motor1.run(FORWARD);

Motor2.setSpeed(200);

Motor2.run(FORWARD);

Motor3.setSpeed(100);

Motor3.run(BACKWARD);

Motor4.setSpeed(100);

Motor4.run(BACKWARD);

}else if((Right_Value==1)&&(Left_Value==0)) {

Motor1.setSpeed(100);

Motor1.run(BACKWARD);

Motor2.setSpeed(100);

Motor2.run(BACKWARD);

Motor3.setSpeed(200);

Motor3.run(FORWARD);

Motor4.setSpeed(200);

Motor4.run(FORWARD);

}else if((Right_Value==1)&&(Left_Value==1)) {

Motor1.setSpeed(0);

Motor1.run(RELEASE);

Motor2.setSpeed(0);

Motor2.run(RELEASE);

Motor3.setSpeed(0);

Motor3.run(RELEASE);

18
Motor4.setSpeed(0);

Motor4.run(RELEASE);

}else if(distance > 1 && distance < 10) {

Motor1.setSpeed(0);

Motor1.run(RELEASE);

Motor2.setSpeed(0);

Motor2.run(RELEASE);

Motor3.setSpeed(0);

Motor3.run(RELEASE);

Motor4.setSpeed(0);

Motor4.run(RELEASE);

19
CHAPTER 4

4 RESULTS
In this project, the object following robot has been made to follow the object or
human. This robot has an ultrasonic sensor which detects the object and sends the
information to the comparator (L293D) and H-bridge which controls the process of
the wheels and microcontroller controls the whole operation. The object following
robot was lastly finished by a lot of effort. For this robot, we spent a lot of time in
designing, implementing, writing, and debugging the code sitting in front of the
computer. The robot was eventually working with a little error hither and thither.
which were sorted in the later reviews of the firmware. The object following robot has
a few weaknesses yet but gains most of the purposes.

4.1 Limitations of the Project


The steering mechanism is not simply accomplished in enormous vehicles and
difficult for nonelectric vehicles as like petrol powered. Lack of a three-wheel drive,
makes it not suitable for a rough terrain. Lack of speed control makes the robot
unstable at times.

4.2 Further Improvements & Future Scope


There are huge beneficial uses of this project in various fields whether medical or
military purpose. A wireless communicating system can be added with the robot to
make it more manifold and control it from an exceptionally large distance. This ability
of a robot could be appropriated for military purposes. We can observe the
circumstances by simply sitting in our rooms by attaching a real-time video recorder.
We can change some corrections in the algorithm and the construction as well to suit
it for any other purpose e.g., a vehicle follower. Similarly, it can use the public in
shopping malls. So it can behave as a luggage carrier hence no requirement to carry
up the loads and pull that. The robot will automatically be followed that person using
this algorithm.

20
CHAPTER 5

5 CONCLUSION
Today we are in the world of robotics. Knowingly or unknowingly, we have been
using different types of robots in our daily life. In this project, we have planned an
object follower robot. This robot does not require any remote controller like GSM,
Wi-Fi, Bluetooth, driver etc. It will automatically be run with tracking an object or
human. This robot is affordable but highly effective for the different purpose. Our
project can be utilized in many areas like delivering medicine in hospitals, delivering
products in several places, spying, and inspection and so on. In the future, we can
attach various sensors and cameras to get more features. In this way, we believe that
our project will be helpful for many purposes & hence our purpose will be successful.

21
References
1. (Shahid, 2021) “Human Following Robot Using Arduino”
2. Hassan, M. S., Khan, M. W., & Khan, A. F. (2015). Design and Development of Human
Following Robot. Student Research Paper Conference, 2(15), 79–86.

22

You might also like