0% found this document useful (0 votes)
7 views143 pages

Graduation Description

Uploaded by

Quốc Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views143 pages

Graduation Description

Uploaded by

Quốc Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 143

ABSTRACT

Project’s name: Design and manufacture of a robot vacuum cleaner


Students: Nguyen Van Nghia Student ID: 101180310
Vo Anh Dung Student ID: 101180290
Phan Tran Minh Student ID: 101180307
Nguyen Duc Trung Thuc Student ID: 101180322
Truong Dinh Nghia Student ID: 101180311
Class: 18CDTCLC
Supervisors: Dr. Le Hoai Nam
MSc. Tran Quang Khai
Examiner: Dr. Vo Nhu Thanh
Worked content covers issues:
1. Needs of the topic
In the past, cleaning the house took a lot of human energy and time. Since then, they
have used specialized equipment for cleaning the house to replace part of human energy.
Though removing dirt was clear from the house, it was also an energy-draining action done
by humans and they made a lot of noise. Later, automation slowly started increasing and
humans also wanted to rest all the way while everything was being automated in their lives
as machines played roles. One such of the greatest inventions was the automatic robotic
vacuum cleaner.
Under the request and funding of The Danang Software Park, the group decided to
choose the topic Design and manufacture of a robot vacuum cleaner – a practical topic. So
if it has finished, it will help the consumer in their lives.
2. Research scope
- Design and manufacture robot prototype to meet the following requirements:
Specifications of the prototype:
● Cleaning area: 200 m2
● Barrier Cross Height: 15 (mm)
● Suction Power: 2000 (Pa)
● Dustbin Capacity: 400 (ml)
● Side Brushes: 1
● Water Tank Capacity: 100 (ml)
● Battery Capacity: 3200 (mAh)
● Wifi Frequency Band: 2.4 (GHz)
● Weight: 5 (Kg)
● Dimensions: 430mm x 430mm x 100mm
Functions of the prototype:
● The robot can scan the map. During the working process, the robot can avoid the
surrounding obstacles.
● The robot can sweep and mop the house.
- Applying mechanical and electrical design softwares in designing and
manufacturing the mechanical system of prototypes.
● Applying Autodesk Fusion 360 for designing and simulation the mechanical
system of the robot.
● Applying Cura for setting and printing mechanical components.
● Applying Proteus for designing the electrical circuit.
- Applying programming software such as Arduino IDE and Visual Studio Code for
programming control systems of the robot.
- Applying the ROS application for setting and simulation the robot system.
- Applying Javascript for designing the user interface.
3. The content of the topic has been implemented
Number of explanation pages: 143
Number of drawings: 8 A0 drawings
Prototype: 1
4. Results
Theoretical parts:
- Theory of steering mechanisms, transmission mechanisms, mechanical devices, …
related to robots.
- Study of navigation methods for the mobile robot.
- Use the Autodesk Fusion 360 software to design the robot.
Calculation and design parts:
- Design and manufacture mechanical parts.
- Design and manufacture control circuits.
- Study of navigation methods using ROS.
- Successfully designed and manufactured a relatively stable operating robot.
Practical parts:
- Manufacture two prototypes, which include:
● Manufacture a PCB control circuit for the electronics system.
● Manufacture a power supply for the robot system.
THE UNIVERSITY OF DANANG THE SOCIALIST REPUBLIC OF VIETNAM
UNIVERSITY OF SCIENCE AND TECHNOLOGY Independence - Freedom - Happiness
FACULTY OF MECHANICAL ENGINEERING

GRADUATION PROJECT MISSION

TT Student’s name Student ID Class Major

1 Nguyen Van Nghia 101180310 18CDTCLC Mechatronics Engineering

2 Nguyen Duc Trung Thuc 101180322 18CDTCLC Mechatronics Engineering

3 Vo Anh Dung 101180290 18CDTCLC Mechatronics Engineering

4 Phan Tran Minh 101180307 18CDTCLC Mechatronics Engineering

5 Truong Dinh Nghia 101180311 18CDTCLC Mechatronics Engineering

1. Project name: Design and manufacture of a robot vacuum cleaner


2. Subjects covered by: ☐ Having signed an intellectual property agreement for the
implementation results
3. Initial data and figures:
4. Contents of theoretical and calculation sections:
a. General:
TT Student’s name Contents

1 Nguyen Van Nghia

2 Nguyen Duc Trung Thuc


Chapter 1: Introduction
3 Vo Anh Dung
Chapter 5: Conclusion and future research
4 Phan Tran Minh

5 Truong Dinh Nghia


b. Individual:
TT Student’s name Contents

1 Nguyen Van Nghia Chapter 4 Design of control system

2 Nguyen Duc Trung Thuc Chapter 3 Design of electrical system

3 Vo Anh Dung Chapter 2 Design of mechanical system

4 Phan Tran Minh Chapter 2 Design of mechanical system

Chapter 2 Design of mechanical system


5 Truong Dinh Nghia Chapter 3 Design of electrical system
Chapter 4 Design of control system

5. Drawings and graphs (specify types and sizes of drawings):


a. General:
TT Student’s name Contents

1 Nguyen Van Nghia

2 Nguyen Duc Trung Thuc


Robot overall drawing: 1 A0
3 Vo Anh Dung Robot parts assembly drawing : 1 A0
Kinematic diagram drawing: 1 A0
4 Phan Tran Minh

5 Truong Dinh Nghia


c. Individual:
TT Student’s name Contents

1 Nguyen Van Nghia Algorithm flowchart: 1 A0

2 Phan Tran Minh


Part’s drawing: 3 A0
3 Vo Anh Dung

4 Nguyen Duc Trung Thuc


Schematic electrical diagram drawing: 1 A0
5 Truong Dinh Nghia

6. Supervisor’s name: Dr. Le Hoai Nam


MSc. Tran Quang Khai
7. Project assignment date: April 8th, 2022
8. Project completion date: July ……, 2022

Danang, July……, 2022

Head of division Supervisor 1 Supervisor 2

Dr. Le Hoai Nam MSc. Tran Quang Khai


PREFACE

In today’s modern society, the industry with a scientific and technical foundation is
developing very strongly, along with the development of products that are applied in
practice in many fields: agriculture, medicine, and consumer products… With the
knowledge learned from the university and the research and in-depth understanding, and
with the desire to apply that knowledge in practice, our team decided to make a product
that can be applied in our real life. It’s a “Robot Vacuum Cleaner”.
In today’s context, most of the family are busy with work and have little time for
house cleaning. Therefore, owning a “Robot Vacuum Cleaner” will bring great benefits to
housework in the family, thereby having more time for work and family activities.
Finally, we would like to thank Dr. Le Hoai Nam and MSc. Tran Quang Khai for
their support and guidance throughout the process of implementing this thesis. Moreover,
we would like to thank Mr. Pham The Nhan – The Danang Software Park’s Deputy
Director for his attention and help to create the best workspace for us.

Danang, July ……, 2022


Student 1 Student 2 Student 3

Nguyen Van Nghia Vo Anh Dung Phan Tran Minh

Student 4 Student 5

Nguyen Duc Trung Thuc Truong Dinh Nghia

i
DECLARATION OF ACADEMIC INTEGRITY

Dear Faculty of Mechanical Engineering – University of Science and Technology –


The University of Danang
We hereby certify that the project complies with all academic integrity regulations:

⮚ Use no deceptive forms when presenting our academic activities or results.


⮚ Do not invent or provide false information in comparison to the cited source.
⮚ Fake data should not be used in surveys, experiments, practice, internships, or other
academic activities.
⮚ Do not plagiarize, use other people's words, quotations, expressions as if they were
your own, present, copy, translate passages, or state other people's ideas without
quoting.
⮚ Do not self-plagiarize, re-use research information without citation, or fragment
information about your research results for multiple publications.

Danang, July ……, 2022


Student 1 Student 2 Student 3

Nguyen Van Nghia Vo Anh Dung Phan Tran Minh

Student 4 Student 5

Nguyen Duc Trung Thuc Truong Dinh Nghia

ii
TABLE OF CONTENTS

PREFACE ........................................................................................................................... i
DECLARATION OF ACADEMIC INTEGRITY ......................................................... ii
TABLE OF CONTENTS ................................................................................................. iii
LIST OF FIGURES ......................................................................................................... vii
LIST OF TABLES ........................................................................................................... xii
LIST OF ABBREVIATIONS ........................................................................................ xiv
Chapter 1 INTRODUCTION ..................................................................................... 1
1.1 Introduction of the Danang Software Park ........................................................ 1
1.2 Need of the business .............................................................................................. 2
1.3 Introduction of robot vacuum cleaner ................................................................ 3
1.3.1 Overview ...................................................................................................... 3
1.3.2 Advantages................................................................................................... 3
1.3.3 Disadvantages .............................................................................................. 3
1.4 Project requirements ............................................................................................ 4
1.5 Structure of the project ........................................................................................ 5
1.6 Estimated parameters of the robot ...................................................................... 5
1.7 System overview .................................................................................................... 6
1.8 Chapter conclusion. .............................................................................................. 8
Chapter 2 DESIGN OF MECHANICAL SYSTEM ................................................. 9
2.1 Mechanical system overview ................................................................................ 9
2.2 Design solution selection of the prototype ........................................................ 10
2.2.1 The robot’s shape body selection .............................................................. 10
2.2.2 Material ...................................................................................................... 11
2.3 Design solution selection of the mechanisms .................................................... 11

iii
2.3.1 Steering mechanism selection .................................................................... 11
2.3.2 Motor selection .......................................................................................... 13
2.3.3 Motor calculation ....................................................................................... 14
2.3.4 Part’s components ...................................................................................... 17
2.4 Sweeping part components ................................................................................. 18
2.5 Vacuum part components .................................................................................. 20
2.6 Mopping part components ................................................................................. 22
2.7 3D printed other components............................................................................. 25
2.8 Chapter conclusion ............................................................................................. 27
Chapter 3 DESIGN OF ELECTRICAL SYSTEM................................................. 30
3.1 Electrical system overview ................................................................................. 30
3.2 Calculating power supply unit ........................................................................... 31
3.2.1 Batteries ..................................................................................................... 31
3.2.2 Balancing explain ...................................................................................... 33
3.2.3 Battery level indicator circuit .................................................................... 33
3.3 Buck converter .................................................................................................... 34
3.4 Arduino ................................................................................................................ 35
3.5 Raspberry Pi ........................................................................................................ 39
3.6 Motor driver circuit ............................................................................................ 41
3.6.1 OPTO PC817B .......................................................................................... 41
3.6.2 MOSFET overview .................................................................................... 43
3.6.3 Motor driver circuit overview .................................................................... 44
3.7 LIDAR .................................................................................................................. 47
3.7.1 Introduction ................................................................................................ 47
3.7.2 Principle ..................................................................................................... 47

iv
3.7.3 RPLIDAR A1M8 ....................................................................................... 48
3.8 HR-SC04 .............................................................................................................. 49
3.9 IR sensor .............................................................................................................. 51
3.10 Circuit schematic diagram ............................................................................. 52
3.11 Chapter conclusion ......................................................................................... 58
Chapter 4 DESIGN OF CONTROL SYSTEM ....................................................... 62
4.1 Control system overview .................................................................................... 62
4.2 Design solution selection of the robot navigation ............................................. 62
4.3 Communication methods .................................................................................... 65
4.3.1 UART......................................................................................................... 65
4.3.1.1 Introduction ....................................................................................... 65
4.3.1.2 UART standard (or TTL standard) .................................................... 66
4.3.2 ROS ............................................................................................................ 66
4.3.2.1 Introduction ....................................................................................... 66
4.3.2.2 Structure of ROS ............................................................................... 68
4.3.2.3 ROS Navigation Stack ....................................................................... 74
4.3.2.4 Package .............................................................................................. 75
4.4 Webpage navigation ............................................................................................ 94
4.4.1 React .......................................................................................................... 94
4.4.2 React router ................................................................................................ 95
4.4.3 Ros bridge .................................................................................................. 95
4.5 WIFI Connect ...................................................................................................... 96
4.6 Chapter conclusion ............................................................................................. 97
Chapter 5 CONCLUSION AND FUTURE RESEARCH .................................... 104
5.1 Results ................................................................................................................ 104

v
5.2 Future research ................................................................................................. 105
REFERENCES .............................................................................................................. 109
APPENDIX: CODE ....................................................................................................... 111

vi
LIST OF FIGURES

Figure 1.1 The organizational structure of the Danang Software Park ............................... 1
Figure 1.2 System overview of the robot ............................................................................ 6
Figure 1.3 Functions of the robot system ............................................................................ 6
Figure 2.1 Mechanical system overview ............................................................................. 9
Figure 2.2 The principal diagram of the robot prototype .................................................. 13
Figure 2.3 Force analysis ................................................................................................... 15
Figure 2.4 DC motor with encoder .................................................................................... 16
Figure 2.5 DC motor with encoder design ........................................................................ 17
Figure 2.6 Specifications of wheel motor mount .............................................................. 17
Figure 2.7 Navigation wheel ............................................................................................. 18
Figure 2.8 Specifications of Retaining ring ....................................................................... 18
Figure 2.9 Side brush ......................................................................................................... 19
Figure 2.10 Main brush ..................................................................................................... 19
Figure 2.11 Specifications of brush motor mount ............................................................. 20
Figure 2.12 Dust box ......................................................................................................... 21
Figure 2.13 Specifications of dust box .............................................................................. 21
Figure 2.14 Water pump motor ......................................................................................... 22
Figure 2.15 Specifications of water pump motor mount ................................................... 22
Figure 2.16 Floor mop ....................................................................................................... 23
Figure 2.17 Specifications of floor mop base .................................................................... 23
Figure 2.18 Water box ....................................................................................................... 23
Figure 2.19 Specifications of water box ............................................................................ 24
Figure 2.20 Head water part 1 .......................................................................................... 24
Figure 2.21 Specifications of water head part 1 ................................................................ 24

vii
Figure 2.22 Water head part 2 ........................................................................................... 25
Figure 2.23 Specifications of water head part 2 ................................................................ 25
Figure 2.24 Infrared sensor mount .................................................................................... 25
Figure 2.25 Specifications of infrared sensor mount ........................................................ 26
Figure 2.26 Ultrasonic sensor mount................................................................................. 26
Figure 2.27Specifications of ultrasonic sensor mount ...................................................... 26
Figure 2.28 Specifications of charging dock station ......................................................... 27
Figure 2.29 Dimensions of the prototype .......................................................................... 27
Figure 2.30 Under the face of the robot ............................................................................ 28
Figure 2.31 Prototype of the robot .................................................................................... 29
Figure 3.1 Electrical system overview .............................................................................. 30
Figure 3.2 Power Cell NiMH batteries have seven 1,2-volts cells (Source: Internet) ...... 31
Figure 3.3 Li-ion batteries (Source: Internet) .................................................................... 31
Figure 3.4 Battery balancing (Source: Internet) ................................................................ 33
Figure 3.5 Voltage divider bridge ..................................................................................... 33
Figure 3.6 Principal circuit of the Buck converter (Source: Internet) ............................... 34
Figure 3.7 Arduino Atmega 2560 Pro (Source: Internet) .................................................. 35
Figure 3.8 Arduino pin diagram (Source: Internet) ........................................................... 37
Figure 3.9 Raspberry Pi 4 Model B 8Gb RAM ................................................................. 39
Figure 3.10 Raspberry Pi Pins Diagram (Source: Internet) ............................................... 40
Figure 3.11 PC817B Pinout (Source: Internet) ................................................................. 42
Figure 3.12 MOSFET electrical symbols (Source: Internet) ........................................... 43
Figure 3.13 Stop mode of the basic H-bridge circuit (Source: Internet) ........................... 44
Figure 3.14 Break mode of the basic H-bridge circuit (Source: Internet) ......................... 44
Figure 3.15 Forwarding mode of the basic H-bridge circuit (Source: Internet) ............... 45

viii
Figure 3.16 Reverse mode of the basic H-bridge circuit (Source: Internet) ..................... 45
Figure 3.17 The framework of the motor driver circuit .................................................... 46
Figure 3.18 Principle of the LIDAR system (Source: Internet) ........................................ 47
Figure 3.19 RPLIDAR A1M8 ........................................................................................... 48
Figure 3.20 Module HR-SC04 .......................................................................................... 49
Figure 3.21 Principle of HR-SC04 ultrasonic sensor (Source: Internet) ........................... 50
Figure 3.22 Module IR sensor ........................................................................................... 51
Figure 3.23 12V buck converter circuit ............................................................................. 52
Figure 3.24 5V buck converter circuit ............................................................................... 52
Figure 3.25 Arduino circuit ............................................................................................... 53
Figure 3.26 Pump motor driver circuit .............................................................................. 54
Figure 3.27 Vacuum motor driver circuit .......................................................................... 54
Figure 3.28 Brush motors driver circuit ............................................................................ 55
Figure 3.29 Wheel motor driver circuit ............................................................................. 55
Figure 3.30 HR-SC04 Ultrasonic Sensors ......................................................................... 55
Figure 3.31 Infrared Sensors ............................................................................................. 56
Figure 3.32 Charging contact ............................................................................................ 56
Figure 3.33 Power supply for Raspberry Pi ...................................................................... 56
Figure 3.34 Testing buttons ............................................................................................... 56
Figure 3.35 Design the PCB layout using Proteus ............................................................ 59
Figure 3.36 Electrical system circuit with non-components ............................................. 59
Figure 3.37Electrical system circuit with components ..................................................... 59
Figure 4.1 Control system overview ................................................................................. 62
Figure 4.2 Black path on white background (Source: Internet) ........................................ 63
Figure 4.3 Magnetic path and magnetic sensor (Source: Internet) .................................... 63

ix
Figure 4.4 Electrical Inductive Path Detection Antenna (Source: Internet)...................... 63
Figure 4.5 Tracking QR code (Source: Internet) .............................................................. 64
Figure 4.6 Lidar (Source: Internet) .................................................................................... 65
Figure 4.7 One-way communication. ................................................................................ 65
Figure 4.8 Half-duplex bidirectional communication ....................................................... 66
Figure 4.9 Duplex bidirectional communication ............................................................... 66
Figure 4.10 UART communication ................................................................................... 66
Figure 4.11 The relationship between Stack and packages ............................................... 69
Figure 4.12 Parameter Server description in Master ......................................................... 70
Figure 4.13 Describing Service’s operation ...................................................................... 71
Figure 4.14 Basic Communication Model in ROS ............................................................ 71
Figure 4.15 The communication between Client and Server ............................................ 73
Figure 4.16 URDF model .................................................................................................. 73
Figure 4.17 Overview diagram of the Navigation Stack Configuration .......................... 74
Figure 4.18 The rosserial communication diagram (Source: Internet) ............................. 75
Figure 4.19 The ROS nodes’s relationship........................................................................ 78
Figure 4.20 The encoder values affect different drive robot’s motion (Source: Internet) 79
Figure 4.21 The motor’s PID controller diagram (Source: Internet) ................................ 80
Figure 4.22 Difference between odometry and amcl ........................................................ 82
Figure 4.23 tf tree .............................................................................................................. 83
Figure 4.24 Navigation Stack Setup .................................................................................. 86
Figure 4.25 Cost map......................................................................................................... 87
Figure 4.26 The relationship between the SLAM and move_base ................................... 93
Figure 4.27 ReactJS (Source: Internet) ............................................................................. 94
Figure 4.28 WiFi Connect interacts with NetworkManager (Source: Internet) ................ 96

x
Figure 4.29 Obstacle detection .......................................................................................... 97
Figure 4.30 The map created by the robot ......................................................................... 98
Figure 4.31 The robot auto localizes in the different positions ......................................... 99
Figure 4.32 The robot navigation with non-obstacles ..................................................... 100
Figure 4.33 The robot navigation with obstacles ............................................................ 101
Figure 4.34 User Interface ............................................................................................... 102
Figure 5.1 The auto-docking charging system model ..................................................... 106
Figure 5.2 The algorithm of the auto-docking charging function ................................... 107
Figure 5.3 Complete coverage path planning (Source: Internet) .................................... 108

xi
LIST OF TABLES

Table 2.1 Shape body solution .......................................................................................... 10


Table 2.2 Material solution ................................................................................................ 11
Table 2.3 Steering mechanism solution............................................................................. 12
Table 2.4 Motor solution ................................................................................................... 14
Table 2.5 Specifications of DC motor with encoder ......................................................... 17
Table 2.6 Specifications of side brush motor .................................................................... 18
Table 2.7 Specifications of main brush motor................................................................... 19
Table 2.8 Description of Slide brush ................................................................................. 19
Table 2.9 Description of main brush ................................................................................. 20
Table 2.10 Specifications of vacuum motor ...................................................................... 20
Table 2.11 Description of Dust box .................................................................................. 21
Table 2.12 Specifications of pump motor ......................................................................... 22
Table 2.13 Description of water box ................................................................................. 23
Table 2.14 The testing number for the working temperature ............................................ 28
Table 3.1 Specifications of the battery .............................................................................. 32
Table 3.2 Technical specifications of raspberry pi 4 ......................................................... 39
Table 3.3 Specifications of PC817B ................................................................................. 42
Table 3.4 The truth table of the motor driver circuit ......................................................... 46
Table 3.5 RPLIDAR A1M8 specifications ....................................................................... 48
Table 3.6 Specifications of HR-SC04 ............................................................................... 49
Table 3.7 The electronic components ................................................................................ 57
Table 3.8 Testing number for the working temperature .................................................... 60
Table 3.9 Testing number for the usage time .................................................................... 60
Table 3.10 Testing number for the charging time ............................................................. 60

xii
Table 4.1 The formulas for the controller’s calculating parameters ................................. 81
Table 4.2 The testing number about the robot function .................................................. 102

xiii
LIST OF ABBREVIATIONS

ALSM: Airbone Laser Swath Mapping ............................................................................ 47


DC motor: Direct Current Motor ......................................................................................... 7
DC: Data Center .................................................................................................................. 1
GND: Ground .................................................................................................................... 38
GPIO: General Purpose I/O pins ....................................................................................... 39
IC: Integrated Circuit ......................................................................................................... 35
IR sensor: Infrared Sensor ................................................................................................. 51
LIDAR: Light Detection And Ranging ............................................................................. 47
MAN: Metropolitan Area Network ..................................................................................... 1
PCB: Printed Circuit Board ............................................................................................... 58
PWM: Pulse-width modulation ......................................................................................... 38
ROS: Robot Operating System .......................................................................................... 66
RPC: Remote Procedure Call ............................................................................................ 67
RPS: Regulated Power Supply .......................................................................................... 37
SLAM: Simultaneous Localization And Mapping ............................................................ 81
SPI: Serial Peripheral Interface ......................................................................................... 38
TTL: Transistor-transistor Logic ....................................................................................... 38
UART: Universal Asynchronous Receiver - Transmitter ................................................. 65
URDF: Universal Robotic Description Format ................................................................. 72

xiv
Design and manufacture of a robot vacuum cleaner

Chapter 1 INTRODUCTION

1.1 Introduction of the Danang Software Park


The Danang Software Park was established under Decision No. 9885/2007/QD-
UBND issued on December 13th, 2007, of the People's Committee of Danang city - a non-
business unit directly under the information and communication facilities of Danang city.
The organizational structure of the software park:

Figure 1.1 The organizational structure of the Danang Software Park


Functions of specialized departments:
- Data department
● This department is in charge of the city's database system management and
exploitation.
● This department advises on financial activities management, asset value, and
accounting regime.
- Network department
● This department manages, operates, and exploits the city’s network
infrastructure - communication, including the Metropolitan Area Network
(MAN network), wireless connection system (Wifi network), Data Center
(DC) network infrastructure, and existing Network - Transmission
infrastructures at Danang Software Park.

1
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

● The purpose of this department is to serve the computerization work, build


e-Government, and promote the city's software development industry.
- System department
● This department is in charge of the hardware equipment and operating
systems management and operation of the city's information storage and
processing system.
● This department organizes the administration, operation, and assurance of
information security for the city's electronic information systems,
applications, and public services.
- Mechanical and electrical department
● This department helps the Director perform the functions of management,
operation, and maintenance, including the Mechanical - Thermal - Electrical
system of the Data Center (DC) and Da Nang Software Park.
- Administration and organization department
● This department is in charge of human resources, official documents, internal
and external affairs, organization work, emulation and commendation work,
basic construction, salary, regimes, and policies related to workers.
● This department advises on financial activities management, asset value, and
accounting regime.
- Planning and business department
● This department advises on the effective management and exploitation
implementation of information technology - communication infrastructure
buildings and infrastructure assigned to the Center for management and
development of the Software Industry by the city government.
● This department advises business development planning and strategy,
investment work, and investment project management.
1.2 Need of the business
Current, Software Park has some remaining issues with cleaning the building,
including:
- The cleaning process takes a lot of time.
- Cleaning workers take a lot of effort to work.

2
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Cause of the above issues


- The building has a spacious space that needs to be cleaned.
-
They have few cleaning workers.
For the above reasons, Software Park recommended a project that is Design and
manufacture of a robot vacuum cleaner. In which, the robot needs to have the following
requirements:
- The robot can sweep and mop.
- The robot can work in about 200m2-area.
- The robot can scan and save the map.
-Having an application to monitor and control the robot.
From the requirements that the business recommended, our team thinks this project
is exciting and possible, so we accept this offer to do the topic - Design and manufacture
of a robot vacuum cleaner.
1.3 Introduction of robot vacuum cleaner
1.3.1 Overview
In recent years, robot vacuum cleaners have become popular in the world in general
and gradually become more known in Vietnam.
This type of robot helps people save time, money, and effort in cleaning houses,
bringing high efficiency and benefits to modern life.
1.3.2 Advantages
-Optimizing comfort with automation technology
The robot can handle many different types of dirt and waste in the house such as
seed coats, hair, sand, grit, dust, and liquid dirt,…
- Cleaning the most difficult areas to clean
The robot is compact, and can wriggle into the nooks and crannies, under
cabinets,…
1.3.3 Disadvantages
-
Difficulty in cleaning in messy spaces
The robot’s cleaning process depends on automatically detecting and remembering
map data in the terrain on which it works.

3
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- Difficulty in cleaning in the building


Current robots haven’t yet developed the ability to climb stairs. So when the robot
cleans the building it is quite inconvenient.
- Regularly clean the dust compartment
The robot’s dust filtration feature is good, but because the structure of the robot is
compact, the dust compartment is quite limited, forcing the dust compartment to be cleaned
before it’s ready for the next work.
- The price of the robot
The price of this robot for a part of consumers is considered quite expensive and
difficult to access. It will optimize the most with objects such as companies, organizations,
and businesses…
1.4 Project requirements
- Project topic: “Design and manufacture of a robot vacuum cleaner”.
- Requirements: The robot can move automatically, starts cleaning and mopping
simultaneously, checks for obstacles, and avoids them if any,…
- Summary of the topic
⮚ Designing mechanical systems using Fusion 360 software.
⮚ Design electrical circuits to connect modules using Proteus software.
⮚ Programming Raspberry with Ubuntu operating system using Python.
⮚ Programming Arduino using Arduino IDE software using C++.
⮚ Communicate Raspberry and Arduino by UART.

4
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

1.5 Structure of the project


The structure of this project consists of 5 specific chapters
- Chapter 1: Introduction
- Chapter 2: Design of mechanical system
- Chapter 3: Design of electrical system
- Chapter 4: Design of control system
- Chapter 5: Conclusion and future research
1.6 Estimated parameters of the robot
From the required parameters provided by the customer, we have calculated and
chosen the estimated parameters of the robot:
- Cleaning Area: 200 (m2)
- Barrier Cross Height: 15 (mm)
- Suction Power: 2000 (Pa)
- Dustbin Capacity: 400 (ml)
- Side Brushes: 1
- Water Tank Capacity: 100 (ml)
- Battery Capacity: 3200 (mAh)
- Wifi Frequency Band: 2.4 (GHz)
- Weight: 5 (Kg)
- Width: 430mm x 430mm x 100mm

5
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

1.7 System overview

Figure 1.2 System overview of the robot


From above system, the robot has several functions in below diagram:

Figure 1.3 Functions of the robot system

6
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

The sensing block executes the locomotion function


- Locomotion
⮚ Autonomous
The robot can work on its own based on a premade map without needing to
be controlled by the user.
⮚ Obstacle Avoidance
The robot relies on equipped sensors to recognize surrounding objects to
avoid being bumped.
The vacuum, pump, and brushes DC motor driver block executes the sweeping and
mopping functions.
- Sweeping
⮚ Side Brush
The robot uses a side brush structure to sweep the trash in the middle.
⮚ Main Brush
After the garbage is swept in the middle, the main brush will sweep the
garbage into the storage chamber, then the suction part will suck it into the
garbage compartment.
- Mopping
⮚ Water Flow Control
Water from the water tank will flow down the mop to clean the house.
The control unit block executes the mapping and warning functions.
- Mapping
⮚ Mapping and Localization
The robot can draw a map of the work area the first time it works.
⮚ Drawing Route Traveled
The robot redraws the locations traveled to compare with the position on the
available map, thereby providing suitable control solutions to stabilize the
movement.

7
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- Warning
⮚ Low Battery Warning
The robot will issue a warning signal when the battery level is low.
- Other functions
This function is developing.
⮚ Automatically Docks and Recharges
When the robot is done working or it is working at a low battery level, it will
automatically return to the charging position to charge.
1.8 Chapter conclusion.
During the implementation of chapter 1, our group achieved the following results:
Chapter 2 Researching the overview of the vacuum cleaner and mopping robot.
Chapter 3 Choosing the estimated parameters of the robot.
Chapter 4 Building the basic structure of the system overview.

8
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Chapter 2 DESIGN OF MECHANICAL SYSTEM

2.1 Mechanical system overview

Figure 2.1 Mechanical system overview


The design of the mechanical prototype can ensure the durability and longevity of
the robot under high-intensity work. The design solution selection for prototype include:
- Shape body selection.
- Materials for making the robot’s prototype.

9
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

In addition, the overall layout of the prototype consists of 4 different mechanisms,


which work together to ensure the functions of moving, sweeping, and mopping. The
mechanisms used in the prototype include:
- Movement part (Steering mechanism selection, motor selection, motor
calculation, part’s components).
- Sweeping part (Part’s components).
- Vacuum part (Part’s components).
- Mopping part (Part’s components).
- 3D printed other components (Part’s components).
2.2 Design solution selection of the prototype
2.2.1 The robot’s shape body selection
Table 2.1 Shape body solution
(1=Bad/Complex, 5=Good/Simple)
Solutions Cleaning Mobility in Design Total
performance movement complexity
D-shaped body 5 3 2 10

Circular-shaped 3 5 4 12
body

From the above table, we chose the circular-shaped body.

10
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

2.2.2 Material
Table 2.2 Material solution
(1=Bad, 5=Good)
Solutions C1 C2 C3 C4 C5 Total
Mica 4 2 4 2 2 14

Aluminum 2 4 2 3 3 14

PLA plastic 3 3 3 5 4 18

Keys: C1: Hardness


C2: Weight
C3: Heat-resistant
C4: Machinability
C5: Cost
From the above table, we chose PLA plastic.
2.3 Design solution selection of the mechanisms
2.3.1 Steering mechanism selection
To have a suitable travel plan, we need to analyze the types of normal steering
mechanisms used for robots as follows.

11
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Table 2.3 Steering mechanism solution


(1=Bad, 5=Good)
Solutions C1 C2 C3 C4 Total
Differential drive mechanism 5 5 3 5 18

Tricycle driving mechanism 3 3 2 5 13

Synchronous steering mechanism 1 1 5 3 10

Keys: C1: Design complexity


C2: Control complexity
C3: Error
C4: Cost
From the above table, we chose the differential drive mechanism.

12
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

The principal diagram of the robot prototype:

Figure 2.2 The principal diagram of the robot prototype


2.3.2 Motor selection
Mobile self-propelled robots usually use DC motors, which have the advantage of
being compact, diverse in types, and convenient in choosing a power source. Some types
of motors use DC such as stepper motor, DC motor, and DC servo motor. Self-propelled
robots need speed control, so the DC motor must have velocity feedback (although some
DC motors can accurately control the speed, without feedback, the price will be very high).
Therefore, choosing a stepper motor or a DC servo motor is a viable option. The following
is an analysis of the advantages and disadvantages of these two types of engines, from
which it is possible to determine the type of engine that needs to be used to match the
requirements set forth.

13
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Table 2.4 Motor solution


(1=Bad, 5=Good)
Max Easy to Motor
Solutions Cost Total
speed use torque
Stepper motor 1 3 5 3 12

DC servo motor 3 3 3 2 11

DC gear motor with 5 5 2 4 16


encoder

From the above table, we chose the DC gear motor with encoder.
2.3.3 Motor calculation
The robot works on flat terrain, assuming the wheel deformation is ignored, and the
air resistance is ignored during the robot’s movement.
- Parameters of the robot
⮚ Estimated volume of robot: M = 5 (Kg)
⮚ Max speed: v = 0,15 (m/s)
- Basic parameters of the wheel
⮚ Diameter: d = 64 (mm)
⮚ Wheel width: b = 26 (mm)
⮚ Material is a plastic wheel frame and rubber tire.

14
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Force analysis

Figure 2.3 Force analysis

With: ⃗
𝑁 : Force exerted by the floor.
⃗⃗⃗⃗
𝐹𝑘 : Traction force due to engine torque.
⃗⃗⃗⃗⃗⃗⃗⃗
𝐹𝑚𝑠𝑛 : Resting friction between the wheel and the floor.
𝑃⃗ : Half of the car’s gravity.
𝑚 : Half of the total mass.
𝑀 : Motor torque.
Select the drive option as straight motion. The two driving wheels move at the same
speed forward with v = 0,15 (m/s).
Then the rotational speed of the wheel:
60 × 1000 × 𝑣 60 × 1000 × 0,15
𝑛= = = 44,76 (𝑟𝑝𝑚)
2𝜋 × 𝑟 2𝜋 × 32
Force balance equation:
⃗⃗⃗⃗⃗⃗⃗⃗
𝐹𝑚𝑠𝑛 + ⃗⃗⃗⃗
𝐹𝑘 + 𝑃⃗ + 𝑁
⃗ = 𝑚𝑎

● Where a is the acceleration of the car.


- When the car is moving uniformly.
The constant velocity is v = 0,15 (m/s), so that the acceleration a = 0 (𝑚/𝑠 2 ).

15
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Then:
𝑃1 𝑚1 × 𝑔 5 × 10
𝑁= = = = 25 (𝑁)
2 2 2
The pulling force due to the torque of the motor is:
𝐹𝑘 = 𝐹𝑚𝑠𝑛 = 𝜇𝑙 × 𝑁 = 0,4 × 25 = 10 (𝑁)
With: The coefficient of rolling friction is μl = 0,4 when moving evenly on the floor.
The power required for the vehicle to move steadily at a speed of 0,25 (m/s) is:
𝑃𝑐𝑑𝑑 = 𝐹𝑘 × 𝑣 = 10 × 0,15 = 1,5 (𝑊)
- When the car accelerates.
The car accelerates with acceleration a = 0,5 (𝑚/𝑠 2 ) so that the goods do not fall.
The pulling force due to the torque of the motor is:
𝐹𝑘 = 𝐹𝑚𝑠 − 𝑚. 𝑎 = 𝜇𝑛 . 𝑁 − 𝑚. 𝑎 = 0,9 × 25 − 2,5 × 0,5 = 21,25 (𝑁)
The required axial torque to accelerate is:
𝑀1 = 𝐹𝑘 × 𝑟 = 21,25 × 0,032 = 0,68 (𝑁𝑚)
The required power to accelerate to 0.25 (m/s) is:
𝑁𝑡𝑡 = 𝐹𝑘 . 𝑣 = 21.25 × 0,15 = 3.1875 (𝑊 )

 From there, choose the required power to be 20,375 (W). With the required power
above and the required rotational speed of 47.75 (rpm), we choose the 12V 20W
DC motor.

Figure 2.4 DC motor with encoder

16
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

With DC motor’s specifications:


Table 2.5 Specifications of DC motor with encoder

Specifications Typical Unit


Voltage 12 – 24 VDC

Gear ratio 130:1

Engine speed 6000 rpm

Speed through reducer 15300 rpm


Encoder Hall sensor 7 pulses, 2 channels A B
Moment 2 N.m
Power 20 W

2.3.4 Part’s components


We designed this mount to fix the position of the motor from displacement based
on the four mounting holes above the part matching the four threaded holes on the motor.

Figure 2.5 DC motor with encoder design

Figure 2.6 Specifications of wheel motor mount

17
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

We choose this wheel to aid navigation for the robot to move, its position is at the
top of the robot, along with two active wheels forming a triangular structure to help the
robot stay stable on the floor and non-flat positions.

Figure 2.7 Navigation wheel


The retaining ring fixes the position for the navigation wheel to prevent it from
falling off the robot.

Figure 2.8 Specifications of Retaining ring


2.4 Sweeping part components
We chose an available side brush motor and main brush motor because they are
designed for the robot vacuum cleaner and their specifications ensure the project
requirements and the robot’s specifications in Chapter 1.
With side brush motor’s specifications and main brush motor :
Table 2.6 Specifications of side brush motor
Specifications Typical Unit
Voltage 12 VDC
Rate current 1.25 A
Speed through reducer 200 rpm
Rated power 15 W

18
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Table 2.7 Specifications of main brush motor

Specifications Typical Unit


Voltage 12 VDC
Rate current 1.25 A
Speed through reducer 200 rpm
Rated power 15 W

We use an auxiliary brush placed in the corner of the robot to help sweep areas
where the main brush unit cannot reach.

Figure 2.9 Side brush


Table 2.8 Description of Slide brush

No Description Purpose
1 Broom Sweep the floor
2 DC Motor Create rotation for the broom

We use this broom to sweep trash into the dust box and this unit is located in the
center of the robot.

Figure 2.10 Main brush

19
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Table 2.9 Description of main brush

No Description Purpose
1 Main brush mount Fixed motor position
2 DC Motor Create rotation for the broom
3 Broom Sweep the floor

We designed this mount to fix the position of the brush motor on the robot by
attaching to the three mounting holes that coincide with the three thread holes on the motor.

Figure 2.11 Specifications of brush motor mount


2.5 Vacuum part components
We chose an available vacuum motor because it is designed for the robot vacuum
cleaner and their specifications ensure the project requirements and the robot’s
specifications in Chapter 1.
With vacuum motor’s specifications :
Table 2.10 Specifications of vacuum motor

Specifications Typical Unit


Voltage 12 VDC
Rate current 2 A
Speed through reducer 15300 rpm
Rated power 24 W

20
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

We have selected and designed this dust box to store garbage based on a motor and
the brush will generate suction to push the garbage into the box.

Figure 2.12 Dust box


Table 2.11 Description of Dust box

No Description Purpose
1 Jack XT60 Used to mount XT60 jack
2 Dust box mount Used to fix the position of the dust box
3 Dust box Used to hold dust
4 Vacuum motor Generates suction from the motor to draw dust into the box

Figure 2.13 Specifications of dust box

21
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

2.6 Mopping part components


We chose an available pump motor because it is designed for the robot vacuum
cleaner and their specifications ensure the project requirements and the robot’s
specifications in Chapter 1.
With pump motor’s specifications:
Table 2.12 Specifications of pump motor

Specifications Typical Unit


Voltage 12 VDC
Rate current 1 A
Speed through reducer 6200 rpm
Rated power 12 W

We choose and design this pump motor to draw water from the water tank and
deliver it to the floor mops by osmosis.

Figure 2.14 Water pump motor

Figure 2.15 Specifications of water pump motor mount

22
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

We chose this mop base to create robot floor cleaning based on the method of
osmosis through three drainage holes.

Figure 2.16 Floor mop

Figure 2.17 Specifications of floor mop base


We designed this water box to hold water to supply the mop base through three
drainage holes

Figure 2.18 Water box


Table 2.13 Description of water box

No Description Purpose
1 Button Fix the position of the water box on the robot body
2 Water coupler Plug the water inlet to suck up the water
3 Frame Water storage
4 Water supply button Pour water into the water tank when the water runs out

23
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 2.19 Specifications of water box


This detail is designed to draw water from the water tank through a small suction
plug that plugs into the bottom and will bring water from the box to the pump motor.

Figure 2.20 Head water part 1

Figure 2.21 Specifications of water head part 1

24
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

We designed this to prevent water from leaking out based on three rubber seals
pressed tightly against the frame of the water tank.

Figure 2.22 Water head part 2

Figure 2.23 Specifications of water head part 2


2.7 3D printed other components
We designed this detail to fix the position of the infrared sensor on the robot body
to help the sensor operate effectively without problems during operation.

Figure 2.24 Infrared sensor mount

25
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 2.25 Specifications of infrared sensor mount


We designed this detail to fix the position of the ultrasonic sensor on the robot body
to help the sensor operate effectively without problems during operation.

Figure 2.26 Ultrasonic sensor mount

Figure 2.27Specifications of ultrasonic sensor mount

26
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

We design this charging dock station for the robot. It help the robot to charge itself
without human help. The charging dock can be placed in many positions thanks to its
compact design.

Figure 2.28 Specifications of charging dock station


2.8 Chapter conclusion
During the implementation of chapter 2, our group achieved the following results:
- The robot has a circular design with a diameter of 43cm and a height of 10cm, so
the robot cannot enter low and narrow areas such as under tables, under cabinets,
legs of chairs, etc. In addition, the robot cannot pass barriers over 1.5 cm high.

Figure 2.29 Dimensions of the prototype

27
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- The robot works stably, with a few vibrations. In the first 30 minutes, the
temperature of the robot is about 40-50 degrees Celsius. However, if it has to operate
for longer, it may cause the robot's temperature to rise to 60 degrees Celsius. This
temperature causes 3d printed parts to begin to deform and lose stability.
- The testing number for the working temperature in the first 30 minutes is shown in
the below table:
Table 2.14 The testing number for the working temperature

Test number Temperature

1 44ºC

2 48ºC
3 46ºC

4 45ºC

- The robot can vacuum fine dust, hair, and some small and light garbage such as
paper chips, rice, snack crumbs, etc.

Figure 2.30 Under the face of the robot


- The mop is wetted by pumping water from the water tank through the pump motor
and pumped to the sprinklers located inside the water tank. Therefore, cleaning the
mop needs to be removed and washed periodically. At the same time, removing the
water tank from the robot to refill the water will also pull the water pipe to the
sprinkler out. However, 3d printing technology is limited, so we keep this design.

28
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- The exhaust head of the vacuum cleaner motor has not been designed to blow out
the robot, which causes fine dust inside the robot after a period of use. But for the
sake of time, this problem will be solved later.
- The operational noise level of the robot is about 70 dB. Equal to the noise in public
areas such as supermarkets, roads with low traffic density, etc. This noise level is
below the safe threshold of the ear, so it is acceptable.
- The actual weight of the robot after machining and assembly is 5 kg, meeting the
initially estimated parameters.

Figure 2.31 Prototype of the robot

29
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Chapter 3 DESIGN OF ELECTRICAL SYSTEM

3.1 Electrical system overview


The robot model includes a Raspberry Pi as the central controller, as well as one
ATmega auxiliary microcontroller to support Raspberry Pi. Two moving motors are fitted
with feedback encoders on each motor to receive rotational and velocity signals to the
microcontroller. Two brushing motors, one suction motor, and one water pump motor
receive signals from the microcontroller. The firmware/software of the robot can be
programmed on computers and loaded to memory of Arduino/Raspberry PI 4 by using
common connections such as USB and WIFI. New features can also be updated later using
the same connections.

Figure 3.1 Electrical system overview

30
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.2 Calculating power supply unit


3.2.1 Batteries
There are various types of battery in terms of sizes, voltages, capacities. However,
when considering their internal materials, they all fall into two categories: Li-ion (Lithium
ion) and NiMH (Nickel-Metal Hydride). Each type has different advantages.
NiMH battery packs are composed of cylindrical 1,2-volt cells, similar to the AA,
C, and D batteries that we’re all using in household appliances such as flashlights, remotes,
etc… NiMH batteries can be discharged completely without harming the battery, and they
do not need to be charged before storage.

Figure 3.2 Power Cell NiMH batteries have seven 1,2-volts cells (Source: Internet)
Li-ion battery packs are composed of flat 3,7 V cells. The cells are stacked and
enclosed in a tough, semi-rigid wrap. Batteries are offered in 2-cell (7,4 V), 3-cell (11,1
V), and 4-cell (14,8 V) configurations. Li-ion batteries have greater “energy density” than
NiMH batteries, which means they have more voltage and capacity than a NiMH battery
of the same volume. Li-ion batteries also sustain a higher voltage for a greater duration of
each run, so your model will go faster, and run longer with a LiPo than it would with a
comparable NiMH pack.

Figure 3.3 Li-ion batteries (Source: Internet)

31
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Never charge a Li-ion battery using a NiMH charger (or NiMH charging mode on
a combined NiMH/Li-ion battery charger). Li-ion batteries can be damaged by excessive
discharge. Li-ion batteries should be partially charged and a specific Li-ion charger is
required.

The required battery capacity is 12 V.


To meet the required battery capacity, the type of battery that our team has chosen
is 18650.
- Advantages
⮚ Ensure safety: Lithium-ion batteries are rated as safe for users. It’s non-polluting
and has a low risk of fire and explosion. The battery can work 2,5 times more
efficiently at low temperatures and safely operate up to 149ºF or 65ºC.
⮚ Light-weight.
⮚ The battery can be recharged many times to help the process of using and
building a robot save a lot of costs.
Actual battery voltage when installing 4 batteries in series: 4,2 × 4 = 16,8 (𝑉)
Actual battery capacity: 3000 mAh
Specifications of the battery:
Table specifications of the battery
Table 3.1 Specifications of the battery

Specifications Typical Unit

Voltage 4,2 V

Capacity 3000 mAh


Continuous discharge current 5 A

Maximum discharge current 10 A


Weight 46 gram

32
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.2.2 Balancing explain

Figure 3.4 Battery balancing (Source: Internet)


Li-ion batteries are said to be “balanced” when each cell is charged at the same
voltage. It will take longer to balance the charge but doing so ensures that you get the
longest run time from each charge. Balance charging also helps extend your Li-ion
battery’s overall life by preventing over-discharging. Low voltage detection is designed to
alert you when the battery’s voltage drops below 3,2 volts per cell. For example, if you
plug a 3-cell Li-ion into your speed controller, the speed controller will warn you if the
battery voltage drops below 9,6 volts (3,2 × 3 = 9,6). But if your battery is unbalanced, 9,6
volts could represent cell-by-cell voltages of 3,3 V, 3,3 V, and 3,0 V. The 3,0 V cell was
over-discharged, reducing the life of the pack. Charge balancing your Li-ion packs ensures
each cell is charged equally so their voltages will match when the cells discharge.
3.2.3 Battery level indicator circuit
Voltage range to be measured: 12 – 17 V

Figure 3.5 Voltage divider bridge

33
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

The circuit work on the principle of a voltage divider bridge [17]


𝑉𝑐𝑐
𝐼=
𝑅1 + 𝑅2
Vout is the measured voltage at the R2 resistance position
𝑉𝑐𝑐
𝑉𝑜𝑢𝑡1 = 𝐼 × 𝑅2 = × 𝑅2
𝑅1 +𝑅2

Because the Vout voltage will be read by the Arduino through the Analog reader,
the resistor values must be selected so that the Vout value is within the Arduino’s readable
range from 0 to 5V.
Choosing resistor values respectively are 𝑅2 = 1000𝛺 𝑎𝑛𝑑 𝑅1 = 3000𝛺, we get
the following set of parameters:
𝑉𝑖𝑛 = 17𝑉 → 𝑉𝑅1 = 12,75𝑉, 𝑉𝑜𝑢𝑡 = 4,25𝑉
𝑉𝑖𝑛 = 12𝑉 → 𝑉𝑅1 = 9𝑉, 𝑉𝑜𝑢𝑡 = 3𝑉
3.3 Buck converter
Buck converter [22] is a type of chopper circuit that is designed to perform step-
down conversion of the applied DC input signal. In the case of buck converters, the fixed
dc input signal is changed to produce a dc signal as its output that possesses a lower
magnitude than the applied input.
Buck converter is mainly designed to increase or decrease the voltage level of the
signal applied at its terminals.
The whole operation of the circuit:

Figure 3.6 Principal circuit of the Buck converter (Source: Internet)


- When the power MOSFET i.e. switch S1 is closed, so the flow of current takes
place through it. Then, the inductor in the path stores energy in the form of the
magnetic field, and the current will pass a capacitor and the load.

34
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- When the switch S1 is opened by the buck converter IC, the inductor in the
circuit will start acting as the source. The inductor releases the energy which is
stored in the previous period of operation. Here, the inductor will get reversed,
so the Flyback diode i.e. switch S2 is closed.
- As once the inductor gets completely discharged, the diode comes in reverse
biased condition leading to the opening of switch S2 and instantly switch S1 will
get closed and the cycle continues.
3.4 Arduino

Figure 3.7 Arduino Atmega 2560 Pro (Source: Internet)


Arduino [15] is an open-source platform that helps people build electronic
applications that are better able to connect and interact with each other. Arduino can be
seen as a miniature computer that helps users’ programs and executes electronic projects
without the need for specialized tools for the code loading process.
The Arduino interacts with the world around it through electronic sensors, motors,
and lights. Arduino parts include hardware and software as follows:
- Armature: Microcontroller with some open-source circuit boards for control and
programming including:
- Arduino Uno is a kind of simple board suitable for beginners. This data board
includes 14 pins, 6 pins 5 V to help resolve 1024 levels. Arduino Uno can run at
16MHz, voltage 7-12 V. The size of this board is 5,5cm×7cm
- Arduino Micro has a 20 pins compact design, is lightweight, and has a board
size of 5cm×2cm.
- New design Arduino Pro, the digital pin is not available. This type of board
usually has 2 sources of 3,3 V and 5 V.

35
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- Arduino Nano is the most compact size, and easy to install with the size of
2cm×4cm.
- Arduino Mega design part counting pins 64 pins, size 5cm×10cm.
- Arduino Leonardo does not have a USB port for programming. Design board
with small chip to control, connect via virtual COM.
- The IDE integrated development support software is responsible for editing,
compiling code, and loading chapters for the board.
- The Embedded version of the Mega 2560 CH340G/Atmega 2560 board has a
compact size of 3,8cm×5,5cm.
The Embedded version of Mega 2560 CH340G/Atmega 2560 board is compatible
with Arduino Mega 2560 board, built on Atmel Atmega2560 microcontroller and
USB-UART interface chip CH340G.
The functionality of the board is like the Arduino Mega 2560. It is an embedded
board and uses the original chip of Atmega 2560 (16MHz).
The board uses the chip CH340G as a UART-USB converter. Its function in the
frequency 12MHz leads to stable data exchange (the driver must be installed).
Mega PRO (Embedded) 2560 CH340G/Atmega 2560 can be connected to the
computer through a micro-USB cable.
For this topic, we selected the type of Arduino circuit as The Embedded version of
the Arduino Atmega 2560 board [16]. The reason why we chose The Embedded version of
the Arduino Atmega 2560 circuit is that it is more compact and has all the functions of the
Arduino Atmega 2560 Circuit.
- A large I/O system design with 16 analog and 54 digital converters that support
UART and other communication modes.
- Arduino Atmega2560 has built-in RTC and other features such as comparator,
timer, interrupt for operation control, power-saving, and faster speed with 16
Mhz quartz clock.
- JTAG support for programming, debugging, and troubleshooting.
- With large FLASH and SRAM memory, this board can handle large system
programs with ease.
- It is also compatible with different types of boards such as high-level signal (5V)
or low-level signal (3,3V) with I/O pins.

36
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- Brownout and watchdog make the system more reliable and robust.
- It supports ICSP as well as USB microcontroller programming with PCs.

Figure 3.8 Arduino pin diagram (Source: Internet)


- Power supply
The power supply of the board is via the micro-USB connector or pin headers. The
voltage regulator (LDO) can handle an input voltage of 6 V to 9 V (peak 18 V) DC. The
output current is over 800 mA at 5 V (please note that the higher the input voltage, the
lower the output current). This will provide reliable performance in the initial projects.
- Vin
The input voltage or Vin to the Arduino when it is using an external power source
is the opposite of the volts from the USB connection or another RPS (regulated power
supply). By using this pin one can supply voltage.
- 5V
RPS can be used to power microcontrollers as well as components used on Arduino
boards. This is accessible from the input voltage through a regulator.
- 3,3 V
A supply voltage of 3,3 can be generated with the onboard regulator and the peak
draw current will be 50 mA.

37
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- GND
GND pin (Ground).
- Memory
Atmega2560 MCU has a 256KB-memory.
- Input and Output
The embedded version of the Arduino ATmega2560 board has 54 digital pins that
can be used as input or output using functions such as pin Mode(), Digital Read(), and
Digital Write(). These pins can work with 5 V. Also, every digital pin can give or take
20mA and includes a 20k to 50k ohm pull-up resistor. The maximum current on any pin is
40mA. It should be noted that no current can pass to avoid damage to the microcontroller.
In addition, some of Arduino’s pins include specific functions.
- Serial pins
The Arduino board’s serial pins are TX (TXD0), RX (RXD0), D18 (TXD1), D19
(RXD1), D16 (TXD2), D17 (RXD2), D14 (TXD3), D15 (RXD3) pins and these pins can
be used for TTL serial data transmission.
- External interrupt pins
The board’s external interrupt pins are D21 (INT0), D20 (INT1), D19 (INT2), D18
(INT3), D2 (INT4), and D3 (INT5) and these pins can be arranged to trigger an interrupt
on a rising or falling edge, a value low that would otherwise change the value.
- PWM pins
The Arduino’s PWM pins are D2 to D13, D44 to D46, and D52 and the output is
8-bit PWM with the analog Write() function.
- SPI pins (Serial Peripheral Interface)
SPI pins are SS (D53), MOSI (D51), MISO (D50), SCK (D52), and some pins in
the ICSP pinout and these pins will maintain SPI communication with the help of the SPI
library.

38
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.5 Raspberry Pi

Figure 3.9 Raspberry Pi 4 Model B 8Gb RAM


The Raspberry Pi is a compact computer, about the size of an ATM card, and
running the Linux operating system. Raspberry Pi is developed by Raspberry Pi
Foundation – a non-profit organization.
Technical specifications [14]:
Table 3.2 Technical specifications of raspberry pi 4

Specifications Comments

Processor Broadcom BCM2711, Quad-core Cortex-A72 (ARM v8)


64-bit SoC @ 1.5GHz

Memory 1GB, 2GB or 4GB LPDDR4 (depending on model)

Connectivity 2.4 GHz and 5.0 GHz IEEE 802.11b/g/n/ac wireless


LAN, Bluetooth 5.0, BLE
Gigabit Ethernet
2 × USB 3.0 ports
2 × USB 2.0 ports

GPIO Standard 40-pin GPIO header (fully backwards-compatible


with previous boards)

Video & sound 2 × micro HDMI ports (up to 4Kp60 supported)


2-lane MIPI DSI display port
2-lane MIPI CSI camera port
4-pole stereo audio and composite video port

39
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Multimedia H.265 (4Kp60 decode)


H.264 (1080p60 decode, 1080p30 encode)
OpenGL ES, 3.0 graphics

SD card support Micro SD card slot for loading operating system and data
storage

Input power 5V DC via USB-C connector (minimum 3A)


5V DC via GPIO header (minimum 3A)
Power over Ethernet (PoE)–enabled (requires separate PoE
HAT)

Environment Operating temperature 0–50ºC

Figure 3.10 Raspberry Pi Pins Diagram (Source: Internet)


- Power supply pins: these pins (3V3 power, 5V power, GND - Ground) are used
to connect power lines or wiring for your electronics projects. They correspond
to the same pins as on the Arduino board and provide 5 V and 3,3 V voltages
(3,3 V limited to 50mA load). In addition, you will also find ground ones (GND
or Ground). If you are not using external power sources such as batteries or
adapters, these pins can be of great help in powering your circuit.
- DNC (Not Connected): they are pins included in some versions and have no
function, but in new boards, they have been used for a different purpose. You

40
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

will only find these in more primitive models of the Pi. In the new group 3 and
4, they will be marked as general GND, which can be integrated into the previous
group.
- The pins (GPIO - General Purpose I/O pins) are configurable: they are normal
GPIOs and they can be programmed in code as I will explain later to do what
you need.
- Special Pins: these are some for special connections or interfaces like serial
connection UART, TXD, RXD, etc., as happens with Arduino. You will even
find some like SDA, SCL, MOSI, MISO, SCLK, CE0, CE1, etc. They stand out
among them:
- PWM, the pulse width can be adjusted as we saw in a previous post. On
Raspberry Pi 3 and 4, they are GPIO12, GPIO13, GPIO18, and GPIO19.
- SPI is another communication interface that I also discussed in another article.
In the case of the new 40-pin board, they are pins (with different communication
channels as you can see):
- SPI0: MOSI (GPIO10), MISO (GPIO9), SCLK (GPIO11), CE0 (GPIO8), CE1
(GPIO7).
- SPI1: MOSI (GPIO20); MISO (GPIO19); SCLK (GPIO21); CE0 (GPIO18);
CE1 (GPIO17); CE2 (GPIO16).
- The I2C bus is made up of a data signal pin (GPIO2) and a clock pin (GPIO3).
In addition to EEPROM Data (GPIO0) and Clock EEPROM (GPIO1).
- Serial, another very practical communication with TX (GPIO14) and RX
(GPIO15) pins like those you can find on the Arduino UNO board.
3.6 Motor driver circuit
3.6.1 OPTO PC817B
Optical Coupler is also known as an optical isolator or optocoupler, and it is shortly
called the optical coupler. It is a device that transmits electrical signals through light.
Usually, the luminescent device (infrared light-emitting diode LED) and the photoreceptor
(photosensitive semiconductor tube) are encapsulated in the same shell. The main
advantages of optocoupler are one-way transmission of signal, complete electrical isolation
between input and output, no influence of output signal on the input, strong anti-

41
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

interference ability, stable operation, no contact, long service life, and high transmission
efficiency.
Table 3.3 Specifications of PC817B

- Parameter Symbol Rating Unit


- Forward current - IF - 50 - mA
- Peak forward current - IFM - 1 - A
- Input
- Reverse voltage - VR - 60 - V
- Power dissipation - P - 70 - mW
- Collector-emitter voltage - VCEO - 35 - V
- Emitter-collector voltage - VECO - 6 - V
- Output
- Collector current - IC - 50 - mA
- Collector power dissipation - PC - 150 - mW
- Total power dissipation - Ptot - 200 - mW
- Storage temperature - Tstg - -30 to 125 - ºC
- Operating temperature - Topt - -30 to 100 - ºC

PC817B pinouts [19]:

Figure 3.11 PC817B Pinout (Source: Internet)


With: (1) Anode (2) Cathode
(3) Emitter (4) Colector
The reverse voltage (Vr) is the maximum reverse voltage that the original LED can
withstand. If the value exceeds this reverse voltage, it may damage the LED. For a general

42
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

optical coupler, this parameter is only about 5 V. When using in the presence of back
voltage or oscillation, special attention should be paid to not exceeding the reverse voltage.
3.6.2 MOSFET overview
The MOSFET [20] is the most common type of transistor today. Their primary use
is to control conductivity, or how much electricity can flow, between its source and drain
terminals based on the amount of voltage applied to its gate terminal. This can be used as
a switch to turn on and off another circuit or other transistors, forming the basis of digital
logic. They can also be used to vary the amount of conductivity for analog circuits and act
as signal amplifiers. Power MOSFETs are used to control high currents or power in
circuits. These are often single transistors packaged as discrete components. These are
common in switching power supplies and motor controllers.

Figure 3.12 MOSFET electrical symbols (Source: Internet)


There are 2 types of MOSFET:
- In an N-channel MOSFET, the source is connected to the ground, the drain to
the load and the FET will turn on when a positive voltage is applied to the gate.
N-channel MOSFETs are easier to work with and are the most commonly used
type. They are also easier to manufacture, and thus are available for lower prices
with higher performance than p-channel MOSFETs.
- In a P-channel MOSFET, the source is connected to a positive voltage, and the
FET will turn on when the voltage on the gate is below the source voltage by a
certain amount (Vgs < 0).

43
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.6.3 Motor driver circuit overview


This circuit is called H-bridge because the MOSFETs form the two vertical strokes
and the motor forms the horizontal stroke of the alphabet ‘H’. It is a simple and elegant
solution to all motor driving problems. The direction can be changed easily, and the speed
can be controlled.

Figure 3.13 Stop mode of the basic H-bridge circuit (Source: Internet)
If gate G of MOSFETs 1, 2, 3, and 4 is low, the motor switches to Stop mode with
both P-channels turned on.

Figure 3.14 Break mode of the basic H-bridge circuit (Source: Internet)

44
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

If gate G of MOSFETs 1, 2, 3, and 4 is high, the motor switches to Break mode with
both N-channels turned on.

Figure 3.15 Forwarding mode of the basic H-bridge circuit (Source: Internet)
If gate G of MOSFETs 1, 3 is low; 2, 4 are high the motor switches to Forwarding
mode. Turning on Q1 and turning on Q4 to complete the current path.

Figure 3.16 Reverse mode of the basic H-bridge circuit (Source: Internet)
If gate G of MOSFETs 1, 3 is high; 2, 4 is low the motor switches to Reverse mode.
Turning on Q3 and turning on Q2 to complete the current path.

45
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 3.17 The framework of the motor driver circuit


Table 3.4 The truth table of the motor driver circuit

INPUT A INPUT B OUTPUT M+ OUTPUT M-

1 1 Brake mode

1 0 0 1

0 1 1 0

0 0 Stop mode

In the above circuit, the capacitor acts as a filter. If the power feed is from a voltage
regulator, then energy is transferred back to the power rails when switching an inductive
load or a load that can produce energy (a motor for instance), which will try and raise the
“regulated” supply voltage. This happens quite easily with a series voltage regulator
because there is no mechanism inside it to “shunt” away excess energy. This means that a
capacitor) is required to be across the voltage “rail” to "soak" up the excess energy being
returned by the load through the MOSFET parasit “cdio”es. This isn't needed with resistive
loads but inductive loads (or motors that can generate when being mechanically rotated)
will (or can) force the supply voltage higher than the supposed regulated value.

46
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.7 LIDAR
3.7.1 Introduction
LIDAR (Light Detection and Ranging) is a method for determining ranges (variable
distance) by targeting an object or a surface with a laser and measuring the time for the
reflected light to return to the receiver. It can also be used to make digital 3D
representations of areas on the Earth’s surface and ocean bottom of the intertidal and near-
coastal zone by varying the wavelength of light. It has terrestrial, airborne, and mobile
applications.
LIDAR is commonly used to make high-resolution maps, with applications in
surveying, geodesy, geomatics, archaeology, geography, geology, geomorphology,
seismology, forestry, atmospheric, physics, laser guidance, airborne laser swath mapping
(ALSM), and laser altimetry. It is also used in control and navigation for some autonomous
cars and the helicopter Ingenuity on its record-setting flights over the terrain of Mars.
3.7.2 Principle
The LIDAR system emits pulses of light energy towards the ground using a laser, it
then records the time it takes for the pulse to travel to the ground and return to the sensor.
The distance is determined by using the time of travel and calculated by using the
speed of light.
𝑆𝑝𝑒𝑒𝑑 𝑜𝑓 𝑙𝑖𝑔ℎ𝑡 × 𝑇𝑖𝑚𝑒 𝑜𝑓 𝑡𝑟𝑎𝑣𝑒𝑙
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 =
2

Figure 3.18 Principle of the LIDAR system (Source: Internet)

47
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.7.3 RPLIDAR A1M8

Figure 3.19 RPLIDAR A1M8


The specifications of RPLIDAR A1M8 [18]:
Table 3.5 RPLIDAR A1M8 specifications

Item Typical Unit Comments


Distance Range 0.15 – 6 m White objects
Angular Range 0 – 360 º
< 0.5 < 1.5 meters
Distance Resolution mm
< 1% of the distance All distance range

Angular Resolution ≤1 º 5.5Hz scan rate

Sample Duration 0.5 ms

Sample Frequency ≥ 2000 Hz

Typical value is measured


Scan Rate 5.5 Hz when RPLIDAR A1 takes 360
samples per scan
Laser wavelength 785 nm Infrared Light Band
Laser power 3 mW Peak power
Pulse length 110 µs

48
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.8 HR-SC04
Ultrasonic ranging module HC-SR04 provides 2cm – 400cm non-contact
measurement function, the ranging accuracy can reach up to 3mm. The modules include
an ultrasonic transmitter, receiver, and control circuit.

Figure 3.20 Module HR-SC04


Table 3.6 Specifications of HR-SC04

Specifications Comments
Working Voltage 5V
Working Current 15mA
Working Frequency 40Hz
Max Range 4m
Min Range 2cm
Measuring Angle 15º
Trigger Input Signal 10uS TTL pulse
Input TTL level signal and the range in
Echo Output Signal
proportion
Dimension 45mm x 20mm x 15mm

49
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 3.21 Principle of HR-SC04 ultrasonic sensor (Source: Internet)


The ultrasonic sensor works on the same principles as a radar system. An ultrasonic
sensor can convert electrical energy into acoustic waves. HC SR04 ultrasonic sensor
generates ultrasonic waves at 40kHz frequency. Typically, a microcontroller is used for
communication with an ultrasonic sensor. To begin measuring the distance, the
microcontroller sends a trigger signal to the ultrasonic sensor. The duty cycle of this trigger
signal is 10µS for the HC-SR04 ultrasonic sensor. When triggered, the ultrasonic sensor
generates eight acoustic (ultrasonic) wave bursts and initiates a time counter. As soon as
the reflected (echo) signal is received, the timer stops. The output of the ultrasonic sensor
is a high pulse with the same duration as the time difference between transmitted ultrasonic
bursts and the received echo signal.
𝑡𝑖𝑚𝑒 𝑡𝑎𝑘𝑒𝑛 × 𝑠𝑝𝑒𝑒𝑑 𝑜𝑓 𝑠𝑜𝑢𝑛𝑑
𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 =
2

50
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.9 IR sensor

Figure 3.22 Module IR sensor


The infrared obstacle sensor is adaptable to the environment, having a pair of
transmitting and receiving infrared rays. Infrared rays emit a certain frequency, when
detecting an obstacle in the direction of transmission (reflecting surface), reflected into the
infrared receiver lamp, after comparison, the blue light will light up, and at the same time,
the signal will be sent to the receiver output signal (a low-order signal).
Effective working distance 2~5cm, working voltage is 3.3V to 5V. The sensitivity
of the infrared obstacle sensor is adjusted by a potentiometer, the sensor is easy to
assemble, and easy to use, …
Can be widely used in obstacle avoidance robots, obstacle avoidance vehicles, and
road tracking…
Specifications:
- Comparator uses LM358
- Working voltage : 3,3 V – 5 V
- Distance detect : 1 – 25cm (High-quality: 2 – 5cm)
- Dimension : 3,2cm×1,4cm

51
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

3.10 Circuit schematic diagram

Figure 3.23 12V buck converter circuit

Figure 3.24 5V buck converter circuit

52
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 3.25 Arduino circuit

53
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 3.26 Pump motor driver circuit

Figure 3.27 Vacuum motor driver circuit

54
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 3.28 Brush motors driver circuit

Figure 3.29 Wheel motor driver circuit

Figure 3.30 HR-SC04 Ultrasonic Sensors

55
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 3.31 Infrared Sensors

Figure 3.32 Charging contact

Figure 3.33 Power supply for Raspberry Pi

Figure 3.34 Testing buttons

56
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Table 3.7 The electronic components

Component Description Specification


The XL4016 is a 180 kHz fixed
frequency PWM buck (step-
down) DC/DC converter,
capable of driving an 8A load ● Input voltage range: 8V ~ 40V
with high efficiency, low ● Maximum duty cycle: 100%
XL4016 12V ripple, and excellent line and ● Minimum drop-out: 0.3V
Buck DC/DC load regulation. Requiring a ● Fixed switching frequency: 180KHz
converter minimum number of external ● Output load current: 8A
components, the regulator is ● Output voltage range: 1,25V~36V
simple to use and includes ● Operating temperature: -40~125ºC
internal frequency
compensation and a fixed-
frequency oscillator.
The MBR20100CT is a dual
Schottky diode with a common
● Common-cathode type
cathode in a TO-220 package
MBR20100CT ● Forward current: 20A
for high current applications.
Dual common- ● Forward voltage drop: 0,9V
Each diode has a forward
cathode ● Peak reverse voltage: 100V
current of 10A, hence the IC
Schottky diode ● Reverse Current: 6mA
can push up to 20A through it
● Operating temperature: -55~150ºC
with a peak reverse voltage of
100V.
The LM2596 is a commonly
used step-down switching
regulator IC. The adjustable
version can take in input ● 5V regulator
voltage from 4.5V to 40V and ● Input supply Voltage: 4.5V ~ 40V
LM2596 5V
convert it to variable voltage ● Output load current: 3A
Buck DC/DC
sourcing up to 3A of ● Switching frequency: 150KHz
converter
continuous current. Because of ● Output voltage range: 1,2V ~ 37V
its high current capability it is ● Operating temperature: -40~125ºC
commonly used in power
modules to power/control
heavy loads.

57
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

OPTO ● Forward current: 50mA


PC817B ● Reverse voltage: 6V
Power ● Collector-emitter voltage: 35V
● Emitter-collector voltage: 6V
isolation
● Collector current: 50mA
integrated ● Total power dissipation: 200W
circuit ● Operation temperature: -30~100ºC
The IRF4905 is a Mosfet
available in a TO-220AB
● P-Channel
package and is based on
● Drain current: 74A
Mosfet Advanced Process Technology.
● DS voltage: 55V
IRF4905 It is mainly used for fast
● Power dissipation: 200W
switching purposes, capable of
● Operating temperature: -55~175ºC
providing ultra-low on-
resistance.

The IRFZ44N is an N-Channel


Mosfet with a high drain
current of 49A and a low Rds
● N-Channel
value of 17.5mΩ. It also has a
● Drain current: 49A
Mosfet low threshold voltage of 4V at
● DS voltage: 55V
IRFZ44N which the Mosfet will start
● Power dissipation: 110W
conducting. Hence it is
● Operating temperature: -55~175ºC
commonly used with
microcontrollers to drive with
5V.

3.11 Chapter conclusion


During the implementation of chapter 3, our group achieved the following results:
- Researching and designing of the electrical system circuit include H bridge, control
motor, power circuit and reading data from sensor using Proteus.
- Designing the PCB layout for the electrical system circuit. The circuit board is a
semicircle with a diameter of 360mm.

58
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 3.35 Design the PCB layout using Proteus


- Manufacturing 2-layers circuit:

a) Top copper b) Bottom copper


Figure 3.36 Electrical system circuit with non-components

Figure 3.37Electrical system circuit with components


- The number of tests for the robot's working temperature in 30 minutes is shown in
the below table:

59
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Table 3.8 Testing number for the working temperature

Test number Arduino Power supply `Other components

1 38ºC 41ºC 28ºC


2 41ºC 42ºC 31ºC
3 42ºC 38ºC 27ºC
4 38ºC 40ºC 31ºC

- From the testing data, the circuit has a stable working temperature. This temperature
is within the temperature limits of the components.
- The circuit works stably and with little interference. During the operation, the circuit
can be disconnected because of electrical noises.
- The usage time of the robot is shown in the below table:
Table 3.9 Testing number for the usage time

Test number Estimated time Experimental time

1 30 mins 27 mins

2 30 mins 29 mins

3 30 mins 27 mins

4 30 mins 28 mins

- From the testing data, the experimental time is equivalent to the estimated time.
- The charging time of the robot is shown in the below table:
Table 3.10 Testing number for the charging time

Test number Charging time

1 120 mins

2 125 mins

3 120 mins

4 115 mins

60
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- From the testing data, the charging time is not much different. However, the
charging time is relatively long.
- The robot has a design of a charging contact, but during operation, this contact
causes the Arduino to be damaged. So we disabled this function.
- The actual output voltage which supplies to raspberry is just below 5V, so it causes
the raspberry to degrade in performance.

61
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Chapter 4 DESIGN OF CONTROL SYSTEM

4.1 Control system overview


The robot's control system includes an Arduino controller as the processing center.
The DC motor is controlled through the encoder signal processing from the motor sent to
the processing center. Signals from the sensors are sent to the central processor through the
communication ports. All received signals will exchange data through a communication
system between ROS and the control system.

Figure 4.1 Control system overview


4.2 Design solution selection of the robot navigation
From chapter 1, we can see the types of fixed paths suitable for this topic. The
following will analyze the characteristics of common types of conductors: color, magnetic
field, electric induction wire, and QR code.
- Color path
Paste the path with a contrasting color to the floor, the robot uses optical sensors to
recognize it. The color path has the advantage that the installation, changing the color path
does not affect the floor. However, optical sensors are susceptible to interference by light
from electric lights and the sun. The surface of the path is easy to stain and wear, causing
deviations when the robot moves.

62
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 4.2 Black path on white background (Source: Internet)


- Magnetic field path
There are two ways to install the magnetic field path, which is to stick it directly on
the floor or to apply it to the floor. The floor negative magnetic field path needs machines
to install. The way the magnetic tape is applied to the floor has the advantage of being easy
to install and adjust the path. However, path life is reduced when many vehicles are
operating with heavy loads. The advantage of the magnetic path is that it is not affected by
light and dust. The disadvantage of the path is the noise caused by the magnetic field.

Figure 4.3 Magnetic path and magnetic sensor (Source: Internet)


- Electromagnetic induction path
Using a variable current to create a magnetic field around the conductor. The path
is buried under the floor surface, the robot is fitted with an antenna consisting of coils of
wire to identify the path. The advantage of this type is that many paths can be distinguished
by different frequencies. The disadvantage of the path is: that there must be a power supply
to control the current through the wire, when installing it, it needs to be cut down to the
floor surface, leading to high costs. In addition, these navigation devices are very rare in
the domestic market.

Figure 4.4 Electrical Inductive Path Detection Antenna (Source: Internet)

63
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- QR code
QR codes are a type of barcode, or scannable pattern, that contain various forms of
data, like website links, account information, phone numbers, or even coupons. QR codes
are found everywhere from menus to social media to billboards but have picked up
popularity during the pandemic for their contactless nature. To scan a QR code with your
iPhone or Android, you'll want to use the QR code lens feature of your camera or download
a QR code reader app.
Use QR codes that are affixed on the floor with equal spacing to form a dot matrix
with each point being a different QR code. The robot uses a camera or QR code scanning
module to identify and collect information from that QR code to determine the robot’s
position. The advantage of this type is that it can continuously update the position of the
robot, and can change the path of the robot easily. The downside is that the QR codes stuck
on the floor are easy to peel or get dirty, leading to the robot not recognizing the QR code.
In addition, QR codes have low costs because there is no need to invest in many devices.

Figure 4.5 Tracking QR code (Source: Internet)


- Laser Radar Sensor (Lidar)
Using a Lidar sensor capable of emitting lasers and receiving reflected rays to
determine the distance from the sensor to the obstacle. Based on the high response rate and
continuous rotation of the sensor, it is possible to create a 3d map of the area within the
sensor’s operating range, thereby determining the robot’s position. The advantage of this
type is that it does not need too many support devices attached around the work area, can
scan and update the map itself, and at the same time replaces many types of obstacle
detection sensors. The disadvantage is the high cost, and complicated software processing,
leading to difficulties in the process of repairing and updating software.

64
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 4.6 Lidar (Source: Internet)


From the above analysis and design conditions of the robot system as well as the
cost, Lidar sensor navigation was selected for this topic.
4.3 Communication methods
4.3.1 UART
4.3.1.1 Introduction
The serial port is used for bidirectional data transmission between the computer and
the peripheral.
⮚ Advantages
– Long transmission distance.
– Less wiring.
– Can transmit wirelessly by infrared.
– Can be connected with a microcontroller or PLC.
– Allow networking.
– The device can be disassembled while the computer is working.
– Can provide power for simple electrical circuits.
The signal exchange is through two pins RxD and TxD.
There are 3 modes:
⮚ One-way communication

Figure 4.7 One-way communication.

65
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

⮚ Two-way communication, not being able to communicate at the same time

Figure 4.8 Half-duplex bidirectional communication

⮚ Two-way communication, being able to communicate at the same time

Figure 4.9 Duplex bidirectional communication


4.3.1.2 UART standard (or TTL standard)
UART (Universal Asynchronous Receiver Transmitter) is an integrated circuit used
in serial data transmission between a computer and a peripheral device.

Figure 4.10 UART communication


Feature:
⮚ Transfers one bit per unit of time at a specified baud rate.
⮚ Level “0” corresponds to a voltage of 0 VDC.
⮚ Level “1” corresponds to voltage 3.3 – 5 VDC.
4.3.2 ROS
4.3.2.1 Introduction
ROS (Robot Operating System) is an open-source operating system for robot
applications. ROS has the necessary capabilities for a basic operating system such as
performing parallel tasks, communicating, exchanging data between tasks by messaging,
and managing task data… Besides, to be able to apply in the robotics field, ROS has

66
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

developed specialized concepts, libraries, and tools for data collection, processing, display,
and control… Moreover, ROS can also interact and combine with many other frameworks
such as Player (a software tool for robots and sensor applications), Orocos (term of an
intelligent control system in robotics and automation), Carmen (Robot Navigation Toolkit),
and Orca (objects for robots) …
ROS has many graph-based concepts that represent relationships between
components of ROS such as stack, package, node, topic, message, service, …
coordinate-system concepts, and coordinate-system transformations.
In terms of data exchange and communication, ROS has built-in several
communication standards synchronized according to RPC across services, transfers
asynchronous data over topics, and saves data on Parameter Server.
The ROS – operating system, supporting tools, and libraries are often released as a
ROS distribution, they provide stable software packages for users to use and develop
further, same as the Linux distribution.
ROS is an open-source operating system, so it attracts the attention and
contributions of communities around the world to build and develop robotics projects,
tools, and libraries attached. Many robot prototypes have been successfully created with
ROS.
Nowadays, ROS only works on Ubuntu and macOS. The ROS community is testing
support for other platforms such as Windows, ARM Linux, Fedora, and Gentoo.
Advantages which many robot prototypes using ROS have:
- Building a robotic application on ROS will reduce a significant amount of
programming, set up the system, and take advantage of the community’s
extremely rich open-source resources.
- With the effectiveness of ROS, the time spent on basic engineering work will be
greatly reduced. Therefore, by increasing the time for in-depth research work,
the scientific content achieved on the topic will be reduced many times.
- Some of the characteristics that make ROS worth using when researching and
developing a robot application are:
- ROS is an open-source operating system.
- Full of technical documents, manuals, and support channels.

67
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- Great community is the core problem that makes ROS so important. Resources
contributed by the community are mostly built and developed by leading
research institutes and universities in the world.
- The resources provided by ROS demonstrate strength in areas of robotics such
as:
• Visualization.
• Object recognition.
• Navigation.
• Manipulation/Grasping.
4.3.2.2 Structure of ROS
ROS has three levels of concepts: Filesystem, Computation Graph, and Community.
Moreover, ROS has some high-level concepts specificing to robot applications such
as coordinate systems, transformations, and description messages…
- ROS Filesystem Level
Filesystem is a ROS source code resource that is stored in system memory, it
includes concepts:
● Package: Packages are the main unit for organizing software in ROS. A package
may contain ROS runtime processes (nodes), a ROS-dependent library, datasets,
configuration files, or anything else that is usefully organized together. Packages
are the most atomic build item and release item in ROS. Meaning that the most
granular thing you can build and release is a package.
● Manifest: Manifest is a minimal specification about a ROS package and supports a
wide variety of tools, from compilation to documentation to distribution. In addition
to providing a minimal specification of data about your package, an important role
of manifests is to declare dependencies in a language-neutral and operating-system-
neutral manner. The presence of a manifest.xml file in a directory is significant: any
directory within your ROS package path that contains a manifest.xml file is
considered to be a package.
● Stacks: Stacks are collections of packages that coordinate with each other to
perform a specific function. Stacks also state ROS compilation methods and
information on compatible ROS versions.

68
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 4.11 The relationship between Stack and packages


● Stack Manifest: Stack Manifest provides the stack’s database description that
includes license and information on the other stack dependency.
● Dependency: Dependency is the package or stack description in manifest about
same-level files
● Message: Message descriptions, stored inmy_package/msg/MyMessageType.msg,
define the data structures for messages sent in ROS.
● Service: Service descriptions, stored in my_package/srv/MyMessageType.srv,
define the request and response data structures for services in ROS.
● Launch: Launch files are XML files that describe a collection of nodes along with
their topic remappings and parameters. These files are operated by roslaunch in
Command Terminal của Linux.
- ROS Computation Graph
The computation Graph is the peer-to-peer network of ROS processes that are
processing data together. The basic Computation Graph concepts of ROS are nodes,
Master, Parameter Server, messages, services, topics, and bags.
● Node: Nodes process that performs computation. ROS is designed to be modular at
a fine-grained scale; a robot control system usually comprises many nodes. For
example, one node controls a laser range-finder, one node controls the wheel
motors, one node performs localization, one node performs path planning, one Node

69
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

provides a graphical view of the system, and so on. A ROS node is written with the
use of a ROS client library, such as roscpp or rospy.
● Master: The ROS Master provides name registration and lookup to the rest of the
Computation Graph. Without the Master, nodes would not be able to find each other,
exchange messages, or invoke services.
● Parameter Server: The Parameter Server allows data to be stored by key in a
central location. It is currently part of the Master.

Figure 4.12 Parameter Server description in Master


● Messages: Nodes communicate with each other by passing messages. A message is
simply a data structure, comprising typed fields. Standard primitive types (integer,
floating-point, boolean, etc.) are supported, as are arrays of primitive types.
Messages can include arbitrarily nested structures and arrays (much like C structs).
● Topics: Messages are routed via a transport system with publish/subscribe
semantics. A node sends out a message by publishing it to a given topic. The topic
is a name that is used to identify the content of the message. A node that is interested
in a certain kind of data will subscribe to the appropriate topic. There may be
multiple concurrent publishers and subscribers for a single topic, and a single node
may publish and/or subscribe to multiple topics. In general, publishers and
subscribers are not aware of each other’s existence. The idea is to decouple the
production of information from its consumption. Logically, one can think of a topic
as a strongly typed message bus. Each bus has a name, and anyone can connect to
the bus to send or receive messages as long as they are the right type.
● Services: The publish/subscribe model is a very flexible communication paradigm,
but its many-to-many, one-way transport is not appropriate for request/reply
interactions, which are often required in a distributed system. Request/reply is done

70
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

via services, which are defined by a pair of message structures: one for the request
and one for the reply. A providing node offers a service under a name and a client
uses the service by sending the request message and awaiting the reply. ROS client
libraries generally present this interaction to the programmer as if it were a remote
procedure call.

Figure 4.13 Describing Service’s operation


● Bags: Bags are a format for saving and playing back ROS message data. Bags are
an important mechanism for storing data, such as sensor data, that can be difficult
to collect but is necessary for developing and testing algorithms.
This architecture allows for decoupled operation, where the names are the primary
means by which larger and more complex systems can be built. Names have a very
important role in ROS: nodes, topics, services, and parameters all have names. Every ROS
client library supports command-line remapping of names, which means a compiled
program can be reconfigured at runtime to operate in a different Computation Graph.

Figure 4.14 Basic Communication Model in ROS

71
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- ROS Community Level


The ROS Community Level concepts are ROS resources that enable separate
communities to exchange software and knowledge. These resources include:
• Distributions: ROS Distributions are collections of versioned stacks that you can
install. Distributions play a similar role to Linux distributions: they make it
easier to install a collection of software, and they also maintain consistent
versions across a set of software.
• Repositories: ROS relies on a federated network of code repositories, where
different institutions can develop and release their robot software components.
• The ROS wiki: The ROS community Wiki is the main forum for documenting
information about ROS. Anyone can sign up for an account and contribute their
documentation, provide corrections or updates, write tutorials, and more.
- ROS’s High-level Concepts
Beyond the basic concepts based on the basic structure of the Operating System,
ROS also standardizes several concepts related specifically to robot applications. In this
project, several important concepts need to be attended to such as coordinate frame, tf
(transform), message ontology, and URDF (Universal Robotic Description Format or
Unified Robot Description Format) …
• Coordinate Frame (or Transform): frame and tf (transform) related to the space
elements of the robot and the relationship between these elements, thereby
helping in the correct understanding of the data from the sensor and monitoring
and controlling robots in space. Frames in ROS follow a tree structure, which
means that each frame has at most one parent frame, and can have child frames.
For each branch in this tree, there is a transition tf between parent and child
frames. The tf package provides a distributed, ROS-based framework for
calculating the positions of multiple coordinate frames over time.
• Actions/Tasks: ROS executable programs can be called actions or tasks.
ActionLib provides functions for running an executable program in ROS.
Actions/tasks exchange data with each other through Topics. Data-processing
and data-exchanging mechanisms can be through callback or polling.

72
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 4.15 The communication between Client and Server


• Message ontology: Data is exchanged with each other by Topics. Common data
is arranged in Messages by group, specific type, and standardized in ROS. This
standardization helps to design different plugins and components that can be
developed, changed, and replaced easily and still keep the compatibility of the
whole system. The common_msgs stack provides a base message ontology for
robotic systems. It defines several classes of messages, including:
⮚ actionlib_msgs: messages for representing actions.
⮚ diagnostic_msgs: messages for sending diagnostic data.
⮚ geometry_msgs: messages for representing common geometric primitives.
⮚ nav_msgs: messages for navigation.
⮚ sensor_msgs: messages for representing sensor data.
- Universal Robot Description Format (URDF)
• This is a language that describes elements (part), and connections between
elements on robots (joint). Joints can be declared as fixed or moveable. URDF
is necessary for complex models having elements such as robot arms, Omni
robots, etc… URDF helps in simulation during robot research and development.

Figure 4.16 URDF model

73
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

4.3.2.3 ROS Navigation Stack

Figure 4.17 Overview diagram of the Navigation Stack Configuration


Navigation Stack is a fully developed application in ROS. The Navigation Stack’s
idea is quite simple, it is a program that gets the information from odometry and sensors,
and processes and exports the command as velocity down to the mobile base. When the
Navigation Stack is deployed to the computation graph level will have a full form
consisting of a move_base node and some amcl and map_server nodes as shown in the
above diagram. The white block includes necessary elements deployed, gray blocks are
supported elective blocks, and blue blocks are blocks that need to be built especially for
each robot model to be able to supply coordinated transformations, to publish the
information from the sensor in the correct Message type, and to switch control commands
for the mobile base. Next, we have to set a Navigation Stack with parameters related to the
robot structure and movement. Moreover, we need to pay attention to the mandatory
requirements when we design the robot applying Navigation Stack.
- Hardware requirements
Navigation Stack is designed to be able to apply to different drive robot and
holonomic wheeled robot. Navigation Stack requires a mobile base that allows us to control
by sending the desired velocity in the form of velocity in the x, and y directions and theta
velocity (rotational velocity).
The Navigation Stack requires the installation of a 2D laser sensor placed on the
mobile base. This sensor is used to map and position the robot. This requirement can be
satisfied with the Kinect sensor because Kinect gives us 3D distance information so the 2D
values can be extracted easily.

74
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Navigation Stack is developed on robots with square footprints, so navigation works


well on robots with square or circular symmetry with the center of the footprint coincident
with the center of rotation in place. This is the optimal model when using Navigation Stack.
However, Navigation Stack can still be applied to robots of arbitrary shape and size, we
can declare a circumscribed radius that covers the entire robot’s footprint to ensure that the
robot moves and avoids obstacles. However, there will be limitations on the flexibility of
the robot.
4.3.2.4 Package
rosserial [26]:

rosserial is a protocol to send data through a serial interface. In a client-server


rosserial implementation, a rosserial-server is a computer running ROS and a rosserial-
client is the microprocessor that receives sensors’ data and transports it to the server in the
form of ROS messages. Rosserial-server in this implementation is a publishing node while
rosserial-client is a subscriber node, although this can sometimes be the other way round.

Figure 4.18 The rosserial communication diagram (Source: Internet)


Rosserial-client package is available for several microprocessor types including
Arduino, STM32, embedded linux and others. The rosserial-server package is available in
Python or C++ versions. The number of Publishers and Subscribers are limited at 25, and
the size of serialization and deserialization buffers are limited at 512 bytes by default for
rosserial_client.

75
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

rplidar [27]:

This package provides basic device handling for 2D Laser Scanner RPLIDAR A1.
RplidarNode is a driver for RPLIDAR. It reads RPLIDAR raw scan results using
RPLIDAR’s SDK and converts them to ROS LaserScan messages.
Parameter:
- serial_port (int): serial port name used in your system.
- serial_baudrate (int): serial port baud rate.
- frame_id (string): frame ID for the device.
- inverted (bool): indicated whether the LIDAR is mounted inverted.
- angle_compensate (bool): indicated whether the driver needs to do angle
compensation.
- scan_mode (string): the scan mode of lidar.

<node name= »rplidarNode » pkg= »rplidar_ros »


type= »rplidarNode » output= »screen »>
<param name= »serial_port » type= »string »
value= »/dev/ttyUSB0 »/>
<param name= »serial_baudrate » type= »int »
value= »9600 »/>< !–A1 🡪\
<param name= »frame_id » type= »string »
value= »laser »/>
<param name= »inverted » type= »bool »
value= »false »/>
<param name= »angle_compensate » type= »bool »
value= »true »/>
</node>

map_server [28]

map_server provides the map_server ROS Node, which offers map data as a
ROS Service. It also provides the map_saver command-line utility, which allows
dynamically generated maps to be saved to file.

76
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

image: testmap.png
resolution: 0.1
origin: [0.0, 0.0, 0.0]
occupied_thresh: 0.65
free_thresh: 0.196

- image : Path to the image file containing the occupancy data; can be absolute,
or relative to the location of the YAML file
- resolution : Resolution of the map, meters / pixel
- origin : The 2-D pose of the lower-left pixel in the map, as (x, y, yaw), with
yaw as counterclockwise rotation (yaw=0 means no rotation). Many parts of the
system currently ignore yaw.
- occupied_thresh : Pixels with occupancy probability greater than this
threshold are considered completely occupied.
- free_thresh : Pixels with occupancy probability less than this threshold are
considered completely free.
differential_drive [29]
It provides some basic tools for interfacing a differential-drive robot with the ROS
navigation stack. The intent is to make this independent of specific robot implementation.
It was stacks that implemented differential drive, but they were very closely coupled
with the hardware driver. This package is an attempt to implement some of the basic
functions in a robot-independent way.
The purpose of this package is to provide an interface to the navigation stack. It
takes in a twist message from the navigation stack, and provides a lwheel and rwheel
messages to be used as motor driver strengths. The package receives wheel encoder
messages back from the hardware and generates the tf transform messages required by the
ROS navigation stack.
This package provides the following nodes:
- diff_tf: Provides the base_link transform.
- pid_velocity: A basic PID controller with a velocity target.
- twist_to_motors: Translates a twist to two motor velocity targets.

77
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- teleop_key: A controller board to control the robot.

Figure 4.19 The ROS nodes’s relationship


The differential_drive package requires the following:
- Left and right motors that respond to the power levels on topics lmotor and
rmotor.
- Provide wheel encoder messages on lwheel and rwheel. These messages need to
be the total number of ticks received for each wheel.
Parameters of diff_tf:
- rate (float): The rate at which the tf and odom messages are published
(Hz).
- base_width (float): The robot's wheel base in meters. (The distance
between the wheels)
- base_frame_id (string, default:"base_link"): The name of
the base frame of the robot.
- odom_frame_id (string, default:"odom"): The name of the
odometry reference frame.
- encoder_min (int, default:-32768); encoder_max (int,
default: 32768): The min and max value the encoder should output. Used
to calculate odometry when the values wrap around.

78
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

One-way robots determine their position in their environment is odometry.


Odometry is the use of motion sensors to determine the robot's change in position relative
to some known position. For example, if a robot is traveling in a straight line and if it knows
the diameter of its wheels, then by counting the number of wheel revolutions it can
determine how far it has traveled. Robots will often have shaft encoders attached to their
drive wheels which emit a fixed number of pulses per revolution. By counting these pulses,
the processor can estimate the distance traveled.
Odometry is a quite common position sensor for mobile robots, but it has its
limitations. Since it is a cumulative measurement, any sensing error will increase as time
passes. Robots may periodically need to use other sensors to precisely determine the robot's
position to prevent excessive error buildup. Sources of odometry error are:
- Inaccurate wheel diameter measurement
- Different wheel sizes for multiple-wheel drive systems
- Pulse counting errors in systems that use drive shaft encoders

Figure 4.20 The encoder values affect different drive robot’s motion (Source: Internet)
The above diagram shows two different motion paths for a differential drive robot
(each wheel is actuated by a separate motor). The encoder values are next to the wheels. In
the case of the left diagram, the robot travels in a straight line so the encoder values are
always equal. However, the robot on the right takes a serpentine path. At the half-way
point, the green wheel encoder reads 80 and the red wheel encoder reads 40, meaning that
the robot was executing a right turn. However, the robot then turned back to the left and
in the final position the encoders read the same value, although they are larger than the
values on the left because the robot has traveled a longer distance by tracing an s-shaped

79
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

curve. If your control software only looked at the encoders at the end position, it would
assume that the robot traveled in a straight line.
Encoders can count "ticks" while the wheel is spinning, each "tick" is just a fraction
of a rotation. Let’s assume we have a robot with two wheels with 1 meter diameter each
and one encoder in each wheel with 360 ticks per revolution (one rotation of one wheel
clockwise implies a count of 360 ticks, and counterclockwise -360 ticks)
To calculate the linear velocity of one wheel we will ask the encoder its actual tick
count. Let’s assume the encoder answers with the tickcount 300. After 1 second, we ask
again and now the answer is 390. With this information we can now calculate the linear
velocity of the wheel. We know that in an arbitrary time (let's name it "𝑡0 ") the tick count
was 300 and one second later (let's call this time "𝑡1 ") it was 390. Knowing that our encoder
would count 360 ticks per revolution, an increase of 90 ticks implies a rotation of 90º. As
duration between the two measurement is 1 second, we can easily calculate the linear speed
of the wheel:
𝑠𝑝𝑎𝑐𝑒 2𝜋 × 𝑟 × ( 𝑡𝑖𝑐𝑘𝑠 𝑡1 − 𝑡𝑖𝑐𝑘𝑠 𝑡0 )
𝑤ℎ𝑒𝑒𝑙 𝑠𝑝𝑒𝑒𝑑 = =
𝑡𝑖𝑚𝑒 𝑡1 − 𝑡0
PID controller
Besides, wheel motors are controlled by the PID controller. The PID controller uses
the input of the pulse’s number from the encoder to output the pulse width value for the
motor control power circuit.

Figure 4.21 The motor’s PID controller diagram (Source: Internet)

80
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Using the Ziegler – Nichols’s method to find the parameters for the PID controller.
Initially Ki and Kd are set to zero. Gain Kp is increased from zero until the return signal
begins to oscillate, then we reach the critical gian Kcr, the signal oscillates with period Pu.
Thereby, the gain for the controllers can be deduced from the following table:
Table 4.1 The formulas for the controller’s calculating parameters

Control Type Kp Ki Kd
P 0,5Kcr ∞ 0

PI 0,45Kcr 1,2Kp/Pu 0
PID 0,6Kcr 2Kp/Pu KpPu/8

Proceeding to program the gain of Kp of each observation motor through the IDE’s
Serial Plotter. When the speed starts to fluctuate, we will record the value Kcr. Let the motor
run with the gain just found and save the speed result. From the results, we will calculate
and give the parameters of the PID controller for the motor.
slam_karto [30]
- SLAM (Simultaneous Localization and Mapping)
SLAM is the computational problem of constructing or updating a map of an
unknown environment while simultaneously keeping track of an agent's location within it.
While this initially appears to be a chicken-and-egg problem there are several algorithms
known for solving it, at least approximately, intractable time for certain environments.
Popular approximate solution methods include the particle filter, extended Kalman filter,
covariance intersection, and GraphSLAM. SLAM algorithms are based on concepts in
computational geometry and computer vision, and are used in robot navigation, robotic
mapping and odometry for virtual reality or augmented reality.
SLAM algorithms are tailored to the available resources, hence not aimed at
perfection, but at operational compliance. Published approaches are employed in
self-driving cars, unmanned aerial vehicles, autonomous underwater vehicles, planetary
rovers, newer domestic robots and even inside the human body. In December 2021, Disney
received a patent on augmented reality technology based on SLAM techniques with an
array of external projectors, so that AR-enabled headsets or smartphones are not required.

81
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- slam_karto package
slam_karto is based on the Karto mapping library, which provides a scan matcher,
pose graph, loop detection, and occupancy grid construction. About the Karto mapping
library, it is being hosted on code.ros.org. It is also integrated into the ROS Navigation
Stack. When the Karto mapping library is combined with Willow Garage’s Sparse Pose
Adjustment (SPA), it will create a complete stand-alone library for robust 2D mapping.
Parameters:
- odom_frame (string): The frame attached to the odometry system.
- map_frame (string): The frame attached to the map.
- base_frame (string): The frame attached to the mobile base.
- map_update_interval (float): How long (in seconds) between
updates to the map.
Amcl [31]
amcl takes in a laser-based map, laser scans, and transform messages, and outputs
pose estimates. On startup, amcl initializes its particle filter according to the parameters
provided.

Figure 4.22 Difference between odometry and amcl

82
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

The drawing below shows the difference between localization using odometry and
amcl. During operation amcl estimates the transformation of the base frame
(~base_frame_id) in respect to the global frame (~global_frame_id) but it only publishes
the transform between the global frame and the odometry frame (~odom_frame_id).
Essentially, this transform accounts for the drift that occurs using Dead Reckoning.
Both odom and map are world-fixed frames. However, the pose in the odom frame
will drift due to dead reckoning. To fix this you publish a map to odom transform, which
essentially fixes the pose of the robot in the map frame.

Figure 4.23 tf tree


- odom: a world-fixed frame, its origin is positioned at the robot’s starting position
- base_footprint: base of the robot at zero height
- base_link: rotational center of the robot
- base_laser_link: base of the laser

83
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Filter Parameters:
- min_particles (int): Minimum allowed number of particles.
- max_particles (int): Maximum allowed number of particles.
- kld_err (double): Maximum error between the true distribution and the
estimated distribution.
- kld_z (double): Upper standard normal quantile for (1 – p), where p is the
probability that the error on the estimated distribution will be less than kld_err.
- update_min_d (double): Translational movement required before
performing a filter update.
- update_min_a (double): Rotational movement required before
performing a filter update.
- resample_interval (int): Number of filter updates required before
resampling.
- transform_tolerance (double): Time with which to post-date the
transform that is published, to indicate that this transform is valid into the future.
- recovery_alpha_slow (double): Exponential decay rate for the slow
average weight filter, used in deciding when to recover by adding random poses.
- recovery_alpha_fast (double): Exponential decay rate for the fast
average weight filter, used in deciding when to recover by adding random poses.
- initial_pose_x (double): Initial pose mean (x), used to initialize filters
with Gaussian distribution.
- initial_pose_y (double): Initial pose mean (y), used to initialize filters
with Gaussian distribution.
- initial_pose_a (double): Initial pose mean (yaw), used to initialize
filters with Gaussian distribution.
- initial_cov_xx (double): Initial pose covariance (x*x), used to
initialize filters with Gaussian distribution.
- initial_cov_yy (double): Initial pose covariance (y*y), used to
initialize filters with Gaussian distribution.
- initial_cov_aa (double): Initial pose covariance (yaw*yaw), used to
initialize filters with Gaussian distribution.

84
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- gui_publish_rate (double): Maximum rate (Hz) at which scans and


paths are published for visualization, -1.0 to disable.
- save_pose_rate (double): Maximum rate (Hz) at which to store the last
estimated pose and covariance to the parameter server, in the variables
~initial_pose_* and ~initial_cov_*. This saved pose will be used on subsequent
runs to initialize the filter. -1.0 to disable.
- use_map_topic (bool): When set to true, AMCL will subscribe to the
map topic rather than making a service call to receive its map.
- first_map_only (bool): When set to true, AMCL will only use the first
map it subscribes to, rather than updating each time a new one is received.
- selective_resampling (bool): When set to true, AMCL will reduce
the resampling rate when not needed and help avoid particle deprivation.
Odom model parameters:
- odom_model_type (string): Which model to use, either “diff”, “omni”,
“diff-corrected” or “omni-corrected”.
- odom_alpha1 (double): Specifies the expected noise in odometry’s
rotation estimate from the rotational component of the robot’s motion.
- odom_alpha2 (double): Specifies the expected noise in odometry’s
rotation estimate from the translational component of the robot’s motion.
- odom_alpha3 (double): Specifies the expected noise in odometry’s
translation estimate from the translational component of the robot’s motion.
- odom_alpha4 (double): Specifies the expected noise in odometry’s
translation estimate from the rotational component of the robot’s motion.
- odom_alpha5 (double): Translation-related noise parameter (only used if
the model is “omni”).
- odom_frame_id (string): Which frame to use for odometry.
- base_frame_id (string): Which frame to use for the robot base
- global_frame_id (string): The name of the coordinate frame
published by the localization system
- tf_broadcast (bool): Set this to false to prevent amcl from publishing
the transform between the global frame and the odometry frame.

85
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

move_base [32]
The move_base package provides an implementation of an action, given a goal in
the world, will attempt to reach it with a mobile base. The move_base node links together
a global and local planner to accomplish its global navigation task. The move_base node
also maintains two costmaps, one for the global planner, and one for a local planner that
are used to accomplish navigation tasks.

Figure 4.24 Navigation Stack Setup


The navigation stack uses information from sensors to avoid obstacles in the world;
it assumes that these sensors are publishing either sensor_msgs/LaserScan or
sensor_msgs/PointCloud messages over ROS.
The navigation stack requires that odometry information be published using tf and
the nav_msgs/Odometry message.
The navigation stack assumes that it can send velocity commands using a
geometry_msgs/Twist message assumed to be in the base coordinate frame of the robot on
the "cmd_vel" topic. This means there must be a node subscribing to the "cmd_vel" topic
that is capable of taking (vx, vy, vtheta) <=> (cmd_vel.linear.x, cmd_vel.linear.y,
cmd_vel.angular.z) velocities and converting them into motor commands to send to a
mobile.

86
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Cost map:

Figure 4.25 Cost map


In the picture above, the red cells represent obstacles in the costmap, the blue cells
represent obstacles inflated by the inscribed radius of the robot, and the red polygon
represents the footprint of the robot. For the robot to avoid collision, the footprint of the
robot should never intersect a red cell and the center point of the robot should never cross
a blue cell. The costmap_2d package provides a configurable structure that maintains
information about where the robot should navigate in the form of an occupancy grid. The
costmap uses sensor data and information from the static map to store and update
information about obstacles in the world.
The difference between the global and local costmap is that the global planner uses
the global costmap to generate a long-term plan while the local planner uses the local
costmap to generate a short-term plan.
The costmap automatically subscribes to sensor topics over ROS and updates itself
accordingly. Each sensor is used to either mark (insert obstacle information into the
costmap), clear (remove obstacle information from the costmap), or both.
Parameters:
- base_global_planner (string): The name of the plugin for the global
planner to use with move_base.
- base_local_planner (string): The name of the plugin for the local
planner to use with move_base.
- controller_frequency (double): The rate in Hz at which to run the
control loop and send velocity commands to the base.

87
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Global costmap:

global_costmap:
global_frame: /map
robot_base_frame: base_link
update_frequency: 5.0
static_map: true

The "global_frame" parameter defines what coordinate frame the costmap


should run in, in this case, we'll choose the /map frame. The "robot_base_frame"
parameter defines the coordinate frame the costmap should reference for the base of the
robot. The "update_frequency" parameter determines the frequency, in Hz, at which
the costmap will run its update loop. The "static_map" parameter determines whether
or not the costmap should initialize itself based on a map served by the map_server. If you
aren't using an existing map or map server, set the static_map parameter to false.
Local costmap:

local_costmap:
global_frame: odom
robot_base_frame: base_link
update_frequency: 5.0
publish_frequency: 2.0
static_map: false
rolling_window: true
width: 6.0
height: 6.0
resolution: 0.05

The "global_frame", "robot_base_frame", "update_frequency",


and "static_map" parameters are the same as described in the Global Configuration
section. The "publish_frequency" parameter determines the rate, in Hz, at which the
costmap will publish visualization information. Setting the "rolling_window"
parameter to true means that the costmap will remain centered around the robot as the robot

88
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

moves through the world. The "width", "height", and "resolution" parameters set
the width (meters), height (meters), and resolution (meters/cell) of the costmap. Note that
it's fine for the resolution of this grid to be different than the resolution of your static map,
but most of the time we tend to set them equally.
global_planner
The global planner is responsible for finding a global obstacle-free path from initial
location to the goal location using the environment map.
Global path planner must adhere to nav_core::BaseGlobalPlanner interface.
It has three built-in global planner in ROS:
- carrot_planner: Simple global planner that takes a user-specified goal point and
attempts to move the robot as close to it as possible, even when that goal point
is in an obstacle.
- navfn: This global planner uses Dijkstra's algorithm to find the global path
between any two locations.
- global_planner: It is a replacement for navfn that is more flexible and has more
options.
Parameters:
- allow_unknown (bool): Specifies whether or not to allow the planner to
create plans that traverse unknown space.
- default_tolerance (double): A tolerance on the goal point for the
planner.
- visualize_potential (bool): Specifies whether or not to visualize the
potential area computed via a PointCloud2.
- use_dijkstra (bool): If true, use dijkstra's algorithm.
- use_quadratic (bool): If true, use the quadratic approximation of the
potential. Otherwise, use a simpler calculation.
- use_grid_path (bool): If true, create a path that follows the grid
boundaries. Otherwise, use a gradient descent method.
- old_navfn_behavior (bool): If for some reason, you want
global_planner to exactly mirror the behavior of navfn, set this to true (and use
the defaults for the other boolean parameters)

89
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- lethal_cost (int): Lethal Cost (dynamic reconfigure)


- neutral_cost (int): Neutral Cost (dynamic reconfigure)
- cost_factor (double): Factor to multiply each cost from costmap by
(dynamic reconfigure)
- publish_potential (bool): Publish Potential Costmap (dynamic
reconfigure)
- orientation_mode (int): How to set the orientation of each point.
- orientation_window_size (int): What window to use to determine
the orientation based on the position derivative specified by the orientation mode
(dynamic reconfigure)
- outline_map (bool): Outlines the global costmap with lethal obstacles.
For the usage of a non static (rolling window) global costmap this needs to be
set to false.
teb_local_planner (local_planner) [34]
The teb_local_planner package implements a plugin to the base_local_planner of
the 2D navigation stack. The underlying method called Timed Elastic Band locally
optimizes the robot’s trajectory with respect to trajectory execution time, separation from
obstacles and compliance with kinodynamic constraints at runtime.
Robot configuration parameters:
- acc_lim_x (double): Maximum translational acceleration of the robot.
- acc_lim_theta (double): Maximum angular acceleration of the robot.
- max_vel_x (double): Maximum translational velocity of the robot.
- max_vel_x_backwards (double): Maximum absolute translational
velocity of the robot while driving backwards.
- max_vel_theta (double): Maximum angular velocity of the robot.
Goal tolerance parameters:
- xy_goal_tolerance (double): Allowed final euclidean distance to the
goal position.
- yaw_goal_tolerance (double): Allowed final orientation error.
- free_goal_vel (bool): Remove the goal velocity constraint such that the
robot can arrive at the goal with maximum speed.

90
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Trajectory configuration parameters:


- dt_ref (double): Desired temporal resolution of the trajectory.
- dt_hysteresis (double): Hysteresis for automatic resizing depending
on the current temporal resolution, usually approx.
- global_plan_overwrite_orientation (bool): Overwrite
orientation of local subgoals provided by the global planner.
- max_global_plan_lookahead_dist (double): Specify the
maximum length (cumulative Euclidean distances) of the subset of the global
plan taken into account for optimization. The actual length is then determined
by the logical conjunction of the local costmap size and this maximum bound.
Set to zero or negative in order to deactivate this limitation.
- feasibility_check_no_poses (int): Specify up to which pose on
the predicted plan the feasibility should be checked each sampling interval.
Obstacle parameters:
- min_obstacle_dist (double): Minimum desired separation from
obstacles in meters
- include_costmap_obstacles (bool): Specify if obstacles of the local
costmap should be taken into account. Each cell that is marked as an obstacle is
considered as a point-obstacle.
- costmap_obstacles_behind_robot_dist (double): Limit the
occupied local costmap obstacles taken into account for planning behind the
robot.
- obstacle_poses_affected (int): Each obstacle position is attached
to the closest pose on the trajectory in order to keep a distance.
Optimization parameters:
- no_inner_iterations (int): Number of actual solver iterations called
in each outer loop iteration.
- no_outer_iterations (int): Each outer loop iteration automatically
resizes the trajectory according to the desired temporal resolution dt_ref and
invokes the internal optimizer (that performs no_inner_iterations).

91
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- penalty_epsilon (double): Add a small safety margin to penalty


functions for hard-constraint approximations.
- weight_max_vel_x (double): Optimization weight for satisfying the
maximum allowed translational velocity.
- weight_max_vel_theta (double): Optimization weight for satisfying
the maximum allowed angular velocity.
- weight_acc_lim_x (double): Optimization weight for satisfying the
maximum allowed translational acceleration.
- weight_acc_lim_theta (double): Optimization weight for satisfying
the maximum allowed angular acceleration.
- weight_kinematics_nh (double): Optimization weight for satisfying
the non-holonomic kinematics.
- weight_kinematics_forward_drive (double): Optimization
weight for forcing the robot to choose only forward directions.
- weight_kinematics_turning_radius (double): Optimization
weight for enforcing a minimum turning radius.
- weight_optimaltime (double): Optimization weight for contracting
the trajectory w.r.t transition/execution time
- weight_obstacle (double): Optimization weight for keeping a
minimum distance from obstacles
- weight_viapoint (double): Optimization weight for minimizing the
distance to via-points.
- weight_inflation (double): Optimization weight for the inflation
penalty (should be small).
- weight_adapt_factor (double): Some special weights (currently
weight_obstacle) are repeatedly scaled by this factor in each outer TEB iteration.
explore_lite [35]
This package provides greedy frontier-based exploration. When a node is running,
the robot will greedily explore its environment until no frontiers could be found. Movement
commands will be sent to move_base.

92
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 4.26 The relationship between the SLAM and move_base


Depending on your environment you may achieve better results with either SLAM
map or costmap published by move_base. Advantage of move_base costmap is the inflation
which helps to deal with some very small unexplorable frontiers. When you are using a
raw map produced by SLAM you should set the min_frontier_size parameter to some
reasonable number to deal with the small frontiers. For details on both setups check the
explore.launch and explore_costmap.launch launch files
Parameters:
- robot_base_frame (string): The name of the base frame of the robot.
This is used for determining robot position on map. Mandatory.
- costmap_topic (string): Specifies topic of source
nav_msgs/OccupancyGrid. Mandatory.
- costmap_updates_topic (string): Specifies topic of source
map_msgs/OccupancyGridUpdate. Not necessary if the source of the map is
always publishing full updates, i.e. does not provide this topic.
- visualize (bool): Specifies whether or not publish visualized frontiers.
- planner_frequency (double): Rate in Hz at which new frontiers will
be computed and goal reconsidered.
- progress_timeout (double): Time in seconds. When robots do not
make any progress for progress_timeout, the current goal will be abandoned.
- potential_scale (double): Used for weighting frontiers. This
multiplicative parameter affects the frontier potential component of the frontier
weight (distance to frontier).
- orientation_scale (double): Used for weighting frontiers. This
multiplicative parameter affects the frontier orientation component of the
frontier weight. This parameter does currently nothing and is provided solely for
forward compatibility.

93
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- gain_scale (double): Used for weighting frontiers. This multiplicative


parameter affects the frontier gain component of the frontier weight (frontier
size).
- transform_tolerance (double): Transform tolerance to use when
transforming robot pose.
- min_frontier_size (double): Minimum size of the frontier to consider
the frontier as the exploration goal. In meters.
4.4 Webpage navigation
4.4.1 React
React.js is an open-source JavaScript library that is used for building user interfaces
specifically for single-page applications. It’s used for handling the view layer for web and
mobile apps. React also allows us to create reusable UI components. React code is made
of entities called components. These components are reusable and must be formed in the
SRC folder

Figure 4.27 ReactJS (Source: Internet)


- Flexible
React is very flexible. Once you've learned it, you can use it on a variety of platforms
to build quality user interfaces. React is a library, NOT a framework. Its library approach
has allowed React to grow into such a remarkable tool.
React was created with a single focus: creating components for web applications. A
React Component can be anything in your web app like a Button, Text, Label, or Grid.
- Simplicity
ReactJS is just simpler to grasp right away. The component-based approach, well-
defined lifecycle, and use of just plain JavaScript make React very simple to learn, build a
professional web (and mobile applications), and support it. React uses a special syntax
called JSX which allows you to mix HTML with JavaScript.

94
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

4.4.2 React router


In React, routers help create and navigate between the different URLs that make up
your web application. They allow your user to move between the components of your app
while preserving user state, and can provide unique URLs for these components to make
them more shareable. With routers, you can improve your app’s user experience by
simplifying site navigation.

<BrowserRouter>
<Switch>
<Route path="/"></Route>
</Switch>
</BrowserRouter>

Add the Switch component inside BrowserRouter. This component will activate the
correct route, much like the JavaScript switch statement. Inside of Switch, add a Route
component for each route. In this case, you’ll want the following routes: “/”. The Route
component will take a path as a parameter and surround a child component. The child
component will display when the route is active.
4.4.3 Ros bridge
The rosbridge protocol is a specification for sending JSON based commands to ROS
(and in theory, any other robot middleware). An example of the protocol for subscribing to
a topic:

{ "op": "subscribe",
"topic": "/cmd_vel",
"type": "geometry_msgs/Twist"
}

The specification is programming language and transport agnostic. The idea is that
any language or transport that can send JSON can talk the rosbridge protocol and interact
with ROS. The protocol covers subscribing and publishing topics, service calls, getting and
setting params, and even compressing messages and more.

95
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

The ROS bridge boasts the following features:


- Provides sensor data for LIDAR, and IMU.
- Provides object data such as transforms, traffic light status, visualization
markers, collision and lane invasion.
4.5 WIFI Connect

Figure 4.28 WiFi Connect interacts with NetworkManager (Source: Internet)


- Advertise: Device Creates Access Point
WiFi Connect detects available WiFi networks and opens an access point with a
captive portal. Connecting to this access point with a mobile phone or laptop allows new
WiFi credentials to be configured.
- Connect: User Connects Phone to Device Access Point
Connect to the opened access point on the device from your mobile phone or laptop.
The access point SSID is by default, WiFi Connect.
- Portal: Phone Shows Captive Portal to User
After connecting to the access point from a mobile phone, it will detect the captive
portal and open its web page. Opening any web page will redirect to the captive portal as
well.
- Credentials: User Enters Local WiFi Network Credentials on Phone
The captive portal provides the option to select a WiFi SSID from a list with
detected WiFi networks and enter a passphrase for the desired network.
- Connected: Device Connects to Local WiFi Network

96
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

When the network credentials have been entered, WiFi Connect will disable the
access point and try to connect to the network. If the connection fails, it will enable the
access point for another attempt. If it succeeds, the configuration will be saved by
NetworkManager.
4.6 Chapter conclusion
During the implementation of chapter 4, our group achieved the following results:
- The robot can detect obstacles, which are higher or equal to the LIDAR sensor
because the support sensors (Ultrasonic sensor and Infrared sensor) cause delays in
motor control processing. So we disabled them.

Figure 4.29 Obstacle detection


- About manual control, the robot can process and execute well from 10Hz or less. So
while controlling the robot on the webserver we only can move the joystick slowly.
If we move the joystick too fast, the webserver will send control commands to the
robot at higher 10Hz and the robot will be delayed in motion.
- About the auto-generated map function, the robot can take around 2 to 5 minutes to
create a room's map with a 20m2 area including the objects.

97
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

a) Create time: 247s b) Create time: 155s

c) Create time: 253s d) Create time: 224s


Figure 4.30 The map created by the robot
- The quality of the map over scans isn’t much different. It only different the map
directions depending on the beginning scan position. The map shape is good, has
less noise and its lines are relatively uniform.
- About the robot navigation function in the available map, the robot can almost
define its first position on the map in 40 seconds. However, for the location with
few identifying features, the robot may be tracking the wrong position, or the
direction deviates from reality shown in figure (b) and (d).

98
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

a) b)

c) d)
Figure 4.31 The robot auto localizes in the different positions
- About the robot's auto navigation function in moving to the goal position, the robot
takes around 30 to 80 seconds to reach the goal position 3 meters away with a few
position errors because of the odometry calculation errors and wheel slip. In figure,
the red line is the global plan, the green line is the local plan, and the arrow is the
goal. In figure…, the global plan lines are similar to each other.

99
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

a) Move time: 36 sec b) Move time: 41 sec

c) Move time: 73 sec d) Move time: 46 sec


Figure 4.32 The robot navigation with non-obstacles
- In case of obstacles in the robot's path, the local planner will adjust the robot's
direction based on the global plan to avoid them. It doesn't take more time than in
the non-obstacles case. However, if the obstacles appear unexpectedly, the robot
will take a long time to avoid them. It may even crash.

100
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

e) Move time: 44 sec f) Move time: 43 sec

g) Move time: 70 sec h) Move time: 40 sec


Figure 4.33 The robot navigation with obstacles
- Moreover, we also developed the webserver for the robot's convenient control. It
has some functions such as controlling the brush motor speed, controlling the
vacuum motor speed, controlling the pump motor speed, manual driving of the robot
by using a joystick to generate a map, automatic map generation, navigation, saving
the map, and displaying the battery level.

101
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Figure 4.34 User Interface


- The testing number about the robot function is shown in the below table:
Table 4.2 The testing number about the robot function

Name of Number
Success Fail Rate Reason Of Failure
function of tests
Because the serial connection of
Automatic map arduino is not stable so it cause
20 18 2 90%
generation delay in odometry calculation and
provide a wrong map
Bad arduino connection, websever
Manual map
10 8 2 80% sent control command at too high
generation
frequency
The begin position of the robot have
Automatic
12 11 1 91.67% too few identifying features so it
Localization
may need more time to localize
Navigation to
Bad arduino connection, provide
the goal
50 42 8 84% wrong parameter for AMCL and
without
local planer
Obstacle

102
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Navigation to
Provide incorrect parameter for
the goal with 22 17 5 77.27%
local planer
Obstacle
Navigation to
the goal with
Provide incorrect parameter for
Obstacles apart 12 7 5 58.33%
local planer
appear
unexpectedly
Navigation to Provide incorrect parameter for
the narrow 15 0 15 0% local planer, can't use suport sensor
position because of the delay

103
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

Chapter 5 CONCLUSION AND FUTURE RESEARCH

5.1 Results
After the process of researching, designing, and building a prototype of robot
vacuum cleaner, we have achieved certain results, solving some of the following problems:
- The robot can only work in areas higher than 10 cm and larger than 43cm and pass
barriers lower than 1,5 cm.
- The robot can only operate for a short time. If it works for longer, its components
can be deformed because of overheating.
- The robot can vacuum fine dust, hair, and some small and light garbage such as
paper chips, rice, snack crumbs, etc…
- The robot can mop. However, the mop must be periodically washed because of the
limited design.
- The robot can mop. However, the mop must be periodically washed because of the
limited design.
- The robot needs periodic maintenance.
- The operational noise level of the robot ensures the safe threshold of the ear.
- The actual weight of the robot meets the initially estimated parameters.
- The electrical system circuit size is too large, so it takes up much space and makes
the robot bulky.
- The operating temperature of the robot's electrical components ensures the
allowable temperature.
- The circuit works stably. However, the circuit can be disconnected because of
electrical noises.
- The robot operating time ensures the requirements time. However, when the robot
battery is low, the robot must charge for a long time.
- The actual output voltage which supplies to raspberry is just below 5V, so it causes
the raspberry to degrade in performance.
- The robot can only detect big obstacles.

104
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- The robot can be controlled by slowly moving the joystick on the webserver. If we
move its joystick too fast, it will delay in motion.
- The robot takes several minutes to create a new map that includes the objects. The
map quality and shape are good.
- The robot can define its first position, but sometimes it tracks the wrong position or
moves the deviated direction because of the sensor's identification limit.
- The robot can move to the goal position. In case of obstacles in the robot's path, it
can adjust the direction based on its estimated path. However, the robot will operate
incorrectly because the obstacles appear unexpectedly.
- The robot can be controlled conveniently by the user interface
5.2 Future research
In the following versions, we can try to improve several issues such as:
- Redesigning the motor structure to reduce the free space inside the robot.
- Using better quality sensors to improve handling.
- Redesigning a more compact version of the robot and making the most of the free
space inside the robot while still meeting the requirements.
- Improving the sweep and vacuum functions quality.
- Improving the vacuum function by designing a robot exit path for the exhaust head
of the vacuum motor.
- Improving the mop function by designing sprinklers outside the water tank.
- Improving the electrical system design and using several solutions to reduce the
operating temperature.
- Improving the charging function and battery capacity for the robot, in which the
charging feature needs to have a protective solution.
- Redesigning the power supply module to change the out voltage level from 5 V to
fixed 5,1 V.
- Trying to research and improve the transmission speed and the microcontroller
performance.
- Trying to improve the navigation function of the robot.
In addition, the robot can develop several new and appropriate features in the future
such as:

105
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- Improving and developing the obstacle detecting function for the robot about the
small obstacles.
- Developing a complete, convenient, and user-friendly interface.
- Developing an auto-docking charging function design.
● Operating principle
To accomplish the automatic charge docking, an approach combined with an
infrared sensor and laser sensor is developed. Specifically, the auto-docking charging
system includes two controllers. The main controller includes two microcontrollers:
The central microcontroller is used to run the ROS operating system and combines the
laser sensors to accomplish autonomous navigation; the auxiliary microcontroller is
used to control the robot's motion. The charging controller is used to receive the
charging signal and activate infrared waves.

Figure 5.1 The auto-docking charging system model


When the battery level is lower than the required minimum voltage for the
operation of the robot, the central microcontroller will send a charging instruction to
the charging controller, and then command the auxiliary microcontroller to drive the
robot back to the charging dock area. Until the infrared receiver receives infrared
waves, the auxiliary microcontroller will activate the autonomous movement mode to
drive back to the charging dock.

106
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

● The algorithm of the auto-docking charging function

Figure 5.2 The algorithm of the auto-docking charging function


The above diagram shows the algorithm of the automatic charging function
based on the specific operating principle of the robot.

107
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

- Developing the robot path planning on the map.

Figure 5.3 Complete coverage path planning (Source: Internet)

108
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

REFERENCES
[1] Morgan Quigley, Brian Gerkey, and William D. Smart (2015), “Programming
Robots with ROS” published by O’Reilly Media, Inc.
[2] TS. Đặng Phước Vinh, TS. Võ Như Thành, “Giáo trình Kỹ thuật Vi điều khiển PIC”,
Nhà xuất bản Xây dựng, 2019.
[3] Adept Technology, Inc. Pioneer 3DX-P3DX Catalog,
https://www.generationrobots.com/media/Pioneer3DX-P3DX-RevA.pdf. Last
access 7/7/2022
[4] https://vnreview.vn/thread-old/tim-hieu-ve-robot-hut-bui-lau-nha-tu-dong-uu-va-
nhuoc-diem-cua-loai-thiet-bi-nay.2892634/ Last access 7/7/2022
[5] https://en.wikipedia.org/wiki/Mobile_robot/ Last access 7/7/2022
[6] https://www.ecovacs.com/global/deebot-robotic-vacuum-cleaner/DEEBOT-
OZMO-950/ Last access 7/7/2022
[7] https://www.lg.com/us/vacuum-cleaners/lg-r975gm-robot-vacuum/ Last access
7/7/2022
[8] https://www.researchgate.net/figure/Advantages-and-disadvantages-of-vacuum-
cleaner-robots_tbl1_351141316/ Last access 7/7/2022
[9] https://en.wikipedia.org/wiki/Differential_wheeled_robot/ Last access 7/7/2022
[10] https://www.researchgate.net/figure/Mobile-robot-with-tricycle-
kinematics_fig4_220143477/ Last access 7/7/2022
[11] https://en.wikipedia.org/wiki/Automated_guided_vehicle/ Last access 7/7/2022
[12] https://questionanswer.io/what-is-a-gear-motor-wikipedia/ Last access 7/7/2022
[13] https://www.encoder.com/article-what-is-an-encoder/ Last access 7/7/2022
[14] https://www.stdio.vn/dien-tu-ung-dung/thong-so-ky-thuat-raspberry-pi-4-Eb12V
Last access 7/7/2022
[15] https://www.totolink.vn/article/531-arduino-la-gi-nhung-ung-dung-cua-arduino-
trong-doi-song-con-nguoi.html/ Last access 7/7/2022
[16] https://www.enmindustry.de/WebRoot/Store31/Shops/88169453/5FFE/0DC7/161
7/A559/78B1/0A0C/6D12/6D9F/Mega2650PRO-Datasheet.pdf Last access
7/7/2022
[17] https://en.wikipedia.org/wiki/Voltage_divider/ Last access 7/7/2022

109
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

[18] https://www.generationrobots.com/media/rplidar-a1m8-360-degree-laser-scanner-
development-kit-datasheet-1.pdf Last access 7/7/2022
[19] https://microcontrollerslab.com/pc817-optocoupler-pinout-working-examples-
datasheet/ Last access 7/7/2022
[20] https://vi.wikipedia.org/wiki/MOSFET/ Last access 7/7/2022
[21] https://www.bristolwatch.com/ele/h_bridge.htm?fbclid=IwAR16A3bQp5YDMZU
Rr4DUUWrRWFu0wGTwG2mLTL8A0ND2A80VdYN6IZ8i41k/ Last access
7/7/2022
[22] https://electronicscoach.com/buck-converter.html Last access 7/7/2022
[23] https://reactjs.org/tutorial/tutorial.html Last access 7/7/2022
[24] https://github.com/balena-os/wifi-connect?fbclid=IwAR3caajwuFGzP1VzaW
Xmp6MrhzPq_WG1yk1ImL13hTDrzh4JRe6zBu8DRHk/ Last access 7/7/2022
[25] http://wiki.ros.org/rosserial Last access 8/7/2022
[26] http://wiki.ros.org/rplidar Last access 8/7/2022
[27] http://wiki.ros.org/map_server Last access 8/7/2022
[28] http://wiki.ros.org/differential_drive Last access 8/7/2022
[29] http://wiki.ros.org/slam_karto Last access 8/7/2022
[30] http://wiki.ros.org/amcl Last access 8/7/2022
[31] http://wiki.ros.org/move_base Last access 8/7/2022
[32] http://wiki.ros.org/navigation/Tutorials/RobotSetup Last access 8/7/2022
[33] http://wiki.ros.org/teb_local_planner Last access 8/7/2022
[34] http://wiki.ros.org/explore_lite Last access 8/7/2022

110
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

APPENDIX: CODE

#include <PID_v1.h>

// ROS CONFIG
#include <ros.h>
#include <geometry_msgs/Twist.h>
#include <std_msgs/Int16.h>
#include <std_msgs/Int8.h>
#include <sensor_msgs/Range.h>
#include <ros/time.h>
ros::NodeHandle VCBOT;
float demandx=0;
float demandz=0;
unsigned long currentMillis;
unsigned long previousMillis;
unsigned long currentMillis2;
unsigned long previousMillis2;

// LEFT WHEEL
#define L_IN1 8
#define L_IN2 10
#define L_ENCA 2
#define L_ENCB 18
int L_ENCPOS_DIFF;

111
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

int L_ENCPOS_PRE;
double demand_speed_left;
double left_kp = 1.7 , left_ki = 0 , left_kd = 0.0;
double left_input = 0, left_output = 0, left_setpoint = 0;
PID leftPID(&left_input, &left_output, &left_setpoint,
left_kp, left_ki, left_kd, DIRECT);
std_msgs::Int16 L_ENCPOS;
ros::Publisher Pub_L_ENCPOS("lwheel", &L_ENCPOS);

// RIGHT WHEEL
#define R_IN1 9
#define R_IN2 11
#define R_ENCA 3
#define R_ENCB 19
int R_ENCPOS_DIFF;
int R_ENCPOS_PRE;
double demand_speed_right;
double right_kp = 1 , right_ki = 0 , right_kd = 0.0;
double right_input = 0, right_output = 0, right_setpoint = 0;
PID rightPID(&right_input, &right_output, &right_setpoint,
right_kp, right_ki, right_kd, DIRECT);
std_msgs::Int16 R_ENCPOS;
ros::Publisher Pub_R_ENCPOS("rwheel", &R_ENCPOS);

112
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

// OTHER MOTOR
#define VACUUM_MOTOR 6
#define BRUSH_MOTOR 5
#define PUMP_MOTOR 7

// BATTERY
#define BAT_LEVEL A0
#define CHARGING 52
std_msgs::Int16 BAT_PER;
ros::Publisher Pub_Batt("battery", &BAT_PER);

//RESET WIFI BUTTON


#define RESET_BTN A1
std_msgs::Int8 RESET_PRESS;
ros::Publisher Pub_Reset("reset", &RESET_PRESS);

// GET CONTROL CMD


void cmd_vel_cb( const geometry_msgs::Twist &twist)
{
demandx = twist.linear.x;
demandz = twist.angular.z;
}
ros::Subscriber<geometry_msgs::Twist> sub_cmd_vel("cmd_vel",
&cmd_vel_cb );

113
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

void brush_motor_cmd( const std_msgs::Int16 &cmd)


{
int a = cmd.data;
int b = map(a, 0, 100, 0, 255);
analogWrite(BRUSH_MOTOR, b);
}
ros::Subscriber<std_msgs::Int16> sub_brush_cmd("brush_cmd",
&brush_motor_cmd );

void pump_motor_cmd( const std_msgs::Int16 &cmd)


{
int a = cmd.data;
int b = map(a, 0, 100, 0, 255);
analogWrite(PUMP_MOTOR, b);
}
ros::Subscriber<std_msgs::Int16> sub_pump_cmd("pump_cmd",
&pump_motor_cmd );

void vacuum_motor_cmd( const std_msgs::Int16 &cmd)


{
int a = cmd.data;
int b = map(a, 0, 100, 0, 255);
analogWrite(VACUUM_MOTOR, b);
}
ros::Subscriber<std_msgs::Int16>
sub_vacuum_cmd("vacuum_cmd", &vacuum_motor_cmd );

114
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

void Control_L_Wheel(double speed)


{
if (speed <= 0)
{
analogWrite (L_IN1, 0);
analogWrite (L_IN2, abs(speed));
}
else
{
analogWrite (L_IN1, abs(speed));
analogWrite (L_IN2, 0);
}
}

void Control_R_Wheel(double speed)


{
if (speed <= 0)
{
analogWrite (R_IN1, 0);
analogWrite (R_IN2, abs(speed));
}
else
{
analogWrite (R_IN1, abs(speed));
analogWrite (R_IN2, 0);

115
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

}
}

void sensor_msg_init(sensor_msgs::Range &range_name, char


*frame_id_name)
{
range_name.radiation_type =
sensor_msgs::Range::ULTRASOUND;
range_name.header.frame_id = frame_id_name;
range_name.field_of_view = 0.26;
range_name.min_range = 0.0;
range_name.max_range = 2.0;
}

void setup()
{
// ROS CONFIG
VCBOT.getHardware()->setBaud(57600);
VCBOT.initNode();
VCBOT.subscribe(sub_cmd_vel);
VCBOT.subscribe(sub_pump_cmd);
VCBOT.subscribe(sub_brush_cmd);
VCBOT.subscribe(sub_vacuum_cmd);

116
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

// LEFT WHEEL CONFIG


pinMode(L_IN1, OUTPUT);
pinMode(L_IN2, OUTPUT);
pinMode(L_ENCA, INPUT_PULLUP);
pinMode(L_ENCB, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(L_ENCA),
do_Left_ENCA, CHANGE);
attachInterrupt(digitalPinToInterrupt(L_ENCB),
do_Left_ENCB, CHANGE);
VCBOT.advertise(Pub_L_ENCPOS);
leftPID.SetMode(AUTOMATIC);
leftPID.SetSampleTime(1);
leftPID.SetOutputLimits(-255, 255);

// RIGHT WHEEL CONFIG


pinMode(R_IN1, OUTPUT);
pinMode(R_IN2, OUTPUT);
pinMode(R_ENCA, INPUT_PULLUP);
pinMode(R_ENCB, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(R_ENCA),
do_Right_ENCA, CHANGE);
attachInterrupt(digitalPinToInterrupt(R_ENCB),
do_Right_ENCB, CHANGE);
VCBOT.advertise(Pub_R_ENCPOS);
rightPID.SetMode(AUTOMATIC);
rightPID.SetSampleTime(1);

117
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

rightPID.SetOutputLimits(-255, 255);

// OTHER MOTOR CONFIG


pinMode(VACUUM_MOTOR, OUTPUT);
pinMode(BRUSH_MOTOR, OUTPUT);
pinMode(PUMP_MOTOR, OUTPUT);

// BATTERY CONFIG
pinMode(BAT_LEVEL, INPUT);
VCBOT.advertise(Pub_Batt);

// RESET WIFI BUTTON CONFIG


pinMode(A1, INPUT_PULLUP);
VCBOT.advertise(Pub_Reset);
}

void read_bat()
{
int val = analogRead(BAT_LEVEL);
int dcval = map(val,680,920,0,100);
if (dcval >= 95) dcval = 100;
if (dcval < 95 && dcval >= 85) dcval = 90;
if (dcval < 85 && dcval >= 75) dcval = 80;
if (dcval < 75 && dcval >= 65) dcval = 70;
if (dcval < 65 && dcval >= 55) dcval = 60;

118
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

if (dcval < 55 && dcval >= 45) dcval = 50;


if (dcval < 45 && dcval >= 35) dcval = 40;
if (dcval < 35 && dcval >= 25) dcval = 30;
if (dcval < 25 && dcval >= 15) dcval = 20;
if (dcval < 15 && dcval >= 5) dcval = 10;
if (dcval < 5 ) dcval = 0;
BAT_PER.data = dcval;
}

void loop()
{
currentMillis = millis();
if (currentMillis - previousMillis >= 10)
{
previousMillis = currentMillis;

// CONTROL MOTOR
demand_speed_left = demandx - (demandz*0.1425);
demand_speed_right = demandx + (demandz*0.1425);
L_ENCPOS_DIFF = L_ENCPOS.data - L_ENCPOS_PRE;
R_ENCPOS_DIFF = R_ENCPOS.data - R_ENCPOS_PRE;
left_input = L_ENCPOS_DIFF;
right_input = R_ENCPOS_DIFF;
L_ENCPOS_PRE = L_ENCPOS.data;
R_ENCPOS_PRE = R_ENCPOS.data;

119
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

left_setpoint = demand_speed_left*192.35;
right_setpoint = demand_speed_right*192.35;
leftPID.Compute();
Control_L_Wheel(left_output);
rightPID.Compute();
Control_R_Wheel(right_output);

// ENCODER
Pub_L_ENCPOS.publish(&L_ENCPOS);
Pub_R_ENCPOS.publish(&R_ENCPOS);
}
currentMillis2 = millis();
if (currentMillis2 - previousMillis2 >= 1000)
{
previousMillis2 = currentMillis2;

// BATTERY
read_bat();
Pub_Batt.publish(&BAT_PER);

// Reset btn
if(digitalRead(A1)==1) RESET_PRESS.data =0;
else RESET_PRESS.data =1;
Pub_Reset.publish(&RESET_PRESS);
}

120
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

VCBOT.spinOnce();
}

// LEFT ENCODER INTERRUPT


void do_Left_ENCA()
{
if (digitalRead(L_ENCA) == HIGH)
{
if (digitalRead(L_ENCB) == LOW) L_ENCPOS.data++;
else L_ENCPOS.data--;
}
else
{
if (digitalRead(L_ENCB) == HIGH) L_ENCPOS.data++;
else L_ENCPOS.data--;
}
}

void do_Left_ENCB()
{
if (digitalRead(L_ENCB) == HIGH)
{
if (digitalRead(L_ENCA) == HIGH) L_ENCPOS.data++;
else L_ENCPOS.data--;
}

121
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

else
{
if (digitalRead(L_ENCA) == LOW) L_ENCPOS.data++;
else L_ENCPOS.data--;
}
}

// RIGHT ENCODER INTERRUPT

void do_Right_ENCA()
{
if (digitalRead(R_ENCA) == HIGH)
{
if (digitalRead(R_ENCB) == LOW) R_ENCPOS.data++;
else R_ENCPOS.data--;
}
else
{
if (digitalRead(R_ENCB) == HIGH) R_ENCPOS.data++;
else R_ENCPOS.data--;
}
}

void do_Right_ENCB()
{

122
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc
Design and manufacture of a robot vacuum cleaner

if (digitalRead(R_ENCB) == HIGH)
{
if (digitalRead(R_ENCA) == HIGH) R_ENCPOS.data++;
else R_ENCPOS.data--;
}
else
{
if (digitalRead(R_ENCA) == LOW) R_ENCPOS.data++;
else R_ENCPOS.data--;
}
}

123
Students: Nguyen Van Nghia – Vo Anh Dung Supervisors: Dr. Le Hoai Nam
Phan Tran Minh – Truong Dinh Nghia MSc. Tran Quang Khai
Nguyen Duc Trung Thuc

You might also like