Graduation Description
Graduation Description
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.
Student 4 Student 5
i
DECLARATION OF ACADEMIC INTEGRITY
Student 4 Student 5
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
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
xiv
Design and manufacture of a robot vacuum cleaner
Chapter 1 INTRODUCTION
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
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
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
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
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
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
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
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
Circular-shaped 3 5 4 12
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
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
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
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
DC servo motor 3 3 3 2 11
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
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:
⃗⃗⃗⃗⃗⃗⃗⃗
𝐹𝑚𝑠𝑛 + ⃗⃗⃗⃗
𝐹𝑘 + 𝑃⃗ + 𝑁
⃗ = 𝑚𝑎
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.
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
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.
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
We use an auxiliary brush placed in the corner of the robot to help sweep areas
where the main brush unit cannot reach.
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.
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
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.
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.
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
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
We choose and design this pump motor to draw water from the water tank and
deliver it to the floor mops by osmosis.
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.
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
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.
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
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.
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
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.
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.
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
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
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.
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.
Voltage 4,2 V
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
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
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:
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
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.
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
Specifications Comments
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
SD card support Micro SD card slot for loading operating system and data
storage
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
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.
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
- 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
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
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
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
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.
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
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
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
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.
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.
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
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
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
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
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.
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
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
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.
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.
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.
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
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.
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:
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
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
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
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
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
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
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
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
<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
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.
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
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
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
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
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
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.
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
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
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);
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
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
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 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
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);
// BATTERY CONFIG
pinMode(BAT_LEVEL, INPUT);
VCBOT.advertise(Pub_Batt);
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
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();
}
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--;
}
}
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