1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Research, design and manufacture of a robot for document transportation

143 2 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Research, Design and Manufacture of a Robot for Document Transportation
Tác giả Tran Minh Duc
Người hướng dẫn Assoc. Prof. Vu Van Phong, Ph.D
Trường học Ho Chi Minh City University of Technology and Education
Chuyên ngành Mechatronics Engineering Technology
Thể loại graduation thesis
Năm xuất bản 2024
Thành phố Ho Chi Minh City
Định dạng
Số trang 143
Dung lượng 10,26 MB

Cấu trúc

  • CHAPTER 1: INTRODUCTION (20)
    • 1.1 The urgency of the research project (20)
    • 1.2 Scientific and practical significance of the research project (21)
      • 1.2.1 Scientific significance (21)
      • 1.2.2 Practical significance (21)
    • 1.3 Research objectives of the project (22)
    • 1.4 Objects and scope of research (22)
      • 1.4.1 Research objects (22)
      • 1.4.2 Scope of research (22)
    • 1.5 Research methods (23)
    • 1.6 Research content (23)
  • CHAPTER 2: OVERVIEW OF THE RESEARCH TOPIC (24)
    • 2.1. Introduction to AMR robots (24)
    • 2.2 Research situation (24)
      • 2.2.1 Research situation worldwide (24)
      • 2.2.2 Research situation in the country (26)
      • 2.2.3 Research situation at Ho Chi Minh City University of Technical Education (27)
    • 2.3. Structural features of “Mobile Robot for Document Transportation” (28)
  • CHAPTER 3: THEORETICAL BASIS (31)
    • 3.1 Kinematic model differential two-wheeled moving robot (31)
      • 3.1.1 Forward kinematics of differential two-wheeled moving robot system (31)
      • 3.1.2 Inverse kinematics of a differential drive robot (35)
    • 3.2 Introduction to ROS (Robot Operating System) (35)
      • 3.2.1 ROS filesystem level (36)
      • 3.2.2 ROS computation graph level (38)
      • 3.2.3 ROS community level (40)
    • 3.3 Theoretical basis of the web (41)
      • 3.3.1 Introduction (41)
      • 3.3.2 LAMP Server (41)
      • 3.3.3 Web programming languages (42)
      • 3.3.4 Communication between the server, ROS, and the browser (43)
    • 3.4 Algorithms used for robots (44)
      • 3.4.1 Dijkstra Algorithm (44)
      • 3.4.2 Dynamic Window Approach algorithm. [14] (45)
      • 3.4.3 Ant Colony Optimization algorithm (48)
      • 3.4.4 PID controller (50)
    • 3.5 Navigation stack package (53)
  • CHAPTER 4: HARDWARE AND MECHANICAL DESIGN (55)
    • 4.1 Mechanical design fundamentals (55)
    • 4.2 Design requirements (55)
      • 4.3.1 Lower body frame (56)
      • 4.3.2 Upper body frame (58)
      • 4.3.3 Robot casing (59)
    • 4.4 Motor calculation and selection (60)
    • 4.5 Construction Results (63)
  • CHAPTER 5 ELECTRICAL SYSTEM DESIGN (66)
    • 5.1 Technical requirements (66)
    • 5.2 Calculation and selection of equipment for the electrical-control system (66)
      • 5.2.1 Power supply block (67)
      • 5.2.2 Control block (70)
      • 5.2.3 Central processing block (74)
      • 5.2.4 Sensor block (75)
      • 5.2.5 Actuator block (78)
      • 5.2.6 Construction Results (79)
  • CHAPTER 6: SOFTWARE DEVELOPMENT (81)
    • 6.1 Overview description of the document delivery robot (81)
    • 6.2 Map building (83)
    • 6.3 Robot navigation on generated map (86)
    • 6.4 Solving the TSP (93)
    • 6.5 Building a user interface with web (99)
      • 6.5.1 Setting up an Apache server (99)
      • 6.5.2 Setting up MySQL/MariaDB database (100)
      • 6.5.3 Design and implementation: Fetching data from the web to the database (102)
      • 6.5.4 Rosbridge connection (107)
      • 6.5.5 Connecting APIs for various applications on the webpage (110)
      • 6.5.6 User interface design (111)
  • CHAPTER 7: SIMULATION AND EXPERIMENTAL RESULTS (116)
    • 7.1 Simulation results (116)
      • 7.1.1 Simulation in matlab (116)
      • 7.1.2 Simulation in Gazebo (119)
    • 7.2 Experimental Results (126)
      • 7.2.1 Wheel Speed Control Using PID Controller (126)
      • 7.2.2 Mapping with Gmapping (130)
      • 7.2.3 Robot Navigation Results (132)
      • 7.2.4 Obstacle Avoidance Capability (137)
      • 7.2.5 Results of Optimizing the TSP for the Robot (138)
  • CHAPTER 8: CONCLUSION AND FUTURE DEVELOPMENT (140)
    • 8.1 Conclusion (140)
    • 8.2 Future Development (140)

Nội dung

HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATIONGRADUATION THESIS MAJOR: MECHATRONICS ENGINEERING TECHNOLOGY INSTRUCTOR: VU VAN PHONG RESEARCH, DESIGN AND MANUFACTURE OF A ROBOT F

INTRODUCTION

The urgency of the research project

AMR robots are revolutionizing industrial automation by enhancing workflows and reducing reliance on human labor These intelligent mobile robots can autonomously navigate and operate in diverse and dynamic environments, leading to increased efficiency and minimized risks in various sectors.

In organizations with multiple departments, the transportation of documents is crucial yet often challenging Implementing transportation robots can effectively address these issues, streamlining the process and offering numerous advantages for the organization.

Transportation robots streamline the movement of documents between departments, significantly reducing the time and effort employees spend on these tasks By automating deliveries and pickups, these robots enhance productivity, allowing staff to concentrate on their work without interruptions or the need to leave their desks.

The implementation of transport robots enhances the safety and security of document delivery These robots are programmed to navigate safe routes and avoid obstacles, ensuring that documents are transported securely without the risk of loss or unauthorized access.

Shipping robots enhance shipping efficiency by streamlining processes and minimizing wait times These autonomous machines can operate around the clock without breaks, ensuring a continuous and effective document transportation system.

Utilizing transport robots for the delivery and receipt of documents within an organization significantly optimizes workflow while improving convenience and safety This innovative solution addresses the document transportation demands of contemporary office settings Consequently, our team has chosen to focus on the topic "Research, Design, and Manufacture of a Mobile Robot for Document Transportation."

Scientific and practical significance of the research project

Autonomous Mobile Robots (AMRs) play a crucial role in robotics and automation, particularly in ROS (Robot Operating System) navigation systems The creation of document transport robots expands the use of AMRs in office settings, significantly improving work efficiency and optimizing operational processes within organizations.

AMR robots can autonomously navigate and execute tasks in dynamic environments, making them excellent solutions for enhancing document transportation between departments and significantly minimizing the time and effort needed by employees.

Document transport robots utilize ROS navigation systems to autonomously determine routes and navigate their surroundings By employing Simultaneous Localization and Mapping (SLAM) algorithms, these robots enhance their ability to interact with the environment, optimizing their spatial awareness and engagement with people This advanced technology ensures the safe and accurate delivery of documents, significantly improving security and minimizing the risk of loss or unauthorized access.

Implementing AMR robots for document transportation enhances workflow efficiency and paves the way for advancements in ROS navigation technology, driving innovation in automation and robotics.

AMR robots are essential for automating document transportation within organizations, efficiently planning routes to autonomously deliver and collect documents This technology significantly reduces employee workload, enhances accuracy, and minimizes transportation errors.

In an office setting, AMR robots efficiently transport documents between departments, deliver paperwork across sections, and manage urgent delivery requests, ultimately optimizing workflow and enhancing employee productivity.

Intelligent AMR robots are increasingly vital in contemporary office settings, offering significant advantages in efficiency and productivity These robots operate continuously without breaks, facilitating an uninterrupted and effective document transportation process.

Research objectives of the project

 Bring hardware designed with SolidWorks software through the Gazebo environment to perform Robot simulation

 Kinematic analysis of differential two-wheeled mobile robot

 Manufacturing Robots for the purpose of transporting documents in buildings

 Design the mechanical model, controller, electrical system, software, and operating systems for the robot, with a total load capacity of up to 70 kg

 Building an ACO algorithm to solve the TSP problem for Robots

 Build an algorithm to avoid obstacles within the robot's range

 Ability to move autonomously across a specific environment

 Developing a Web User Interface for the robot system

 Enhance work efficiency, save time for organizations and businesses.

Objects and scope of research

 Document transport robots between departments, based on AMR (Autonomous Mobile Robot)

 The working environment of the robot

 The mechanical system of the robot

 The control system of the robot

 Used in Ho Chi Minh City University of Technology and Education

 Manufacture robots for indoor use, transporting documents

 The users are members of the departments

Research methods

 Clearly define the research objectives of the topic such as developing and evaluating control, navigation, and obstacle avoidance algorithms for the robot

 Rely on scientific articles, journals, and research topics on Mobile Robots to understand the formulas and kinematics of differential wheeled mobile robots

 Build a development environment (install ROS Noetic, simulate on Gazebo, Rviz)

 Develop and integrate software components (control programs, packages used for the robot, related algorithms)

 Write reports and publish results.

Research content

The structure of the report is as follows:

 Chapter 2: Overview of the research topic

 Chapter 4: Mechanical design, kinematics calculations, robot dynamics

 Chapter 7: Simulation and experimental results

 Chapter 8: Conclusion and future development

OVERVIEW OF THE RESEARCH TOPIC

Introduction to AMR robots

Autonomous Mobile Robots (AMRs) are advanced robots that leverage sensor data from technologies like Lidar and IMU to gather information about their movements and surroundings This information enables them to create maps, plan efficient movement routes, and navigate around obstacles The main objective of AMRs is to achieve autonomous navigation, allowing them to reach designated locations and execute tasks such as transporting goods efficiently.

The development of Autonomous Mobile Robots (AMR) must prioritize both technological innovation and practical deployment across diverse environments Creating an effective autonomous robot necessitates a strong foundation of expertise and collaborative teamwork to systematically plan, research, and design both hardware and software while addressing associated challenges.

The research process emphasizes the design and construction of the robot's shape and hardware, utilizing popular control software to reduce development time while incorporating algorithms to improve operational efficiency Furthermore, examining existing mobile robots from both domestic and international contexts, along with previous project models, will support and streamline the research efforts.

Research situation

Research on mobile robots is advancing rapidly and diversely worldwide These robots are being designed with enhanced capabilities for self-mapping and adaptive navigation, allowing them to adjust flexibly to their environments The integration of deep learning and artificial intelligence technologies is significantly improving their self-mapping and navigation functions.

Mobile robots are increasingly utilized across diverse sectors, including healthcare, transportation, agriculture, goods delivery, and customer service, expanding the potential for robotic technology applications Advances in sensors, microprocessors, and control systems have significantly enhanced the operational efficiency and robustness of mobile robots Notably, the integration of environmental interaction systems and sensors is becoming crucial for their development and functionality.

Mobile robots are gaining traction in various practical applications, including warehouse goods transportation, automated delivery services, home cleaning, and support in medical environments These innovations enhance efficiency and significantly lower costs across multiple industries.

Autonomous Mobile Robots (AMRs) are increasingly recognized in industrial automation and service sectors for their ability to self-map, self-adjust, and navigate unstructured environments without fixed positioning systems This flexibility allows for easy deployment across various applications, making AMRs a valuable solution for modern industries Notable examples of AMRs can be found from leading companies globally.

Figure 2 1: The MiR250 Hook from Mobile Industrial Robots company (MiR).[1]

Figure 2 2: Savioke Relay Service Robots Get to Work in Seven Seaview Investors

Figure 2 3: Robot from UBTECH Robotics.[3]

Figure 2 4: Matradee - Restaurant service robot from RichTech Robotic.[4] 2.2.2 Research situation in the country

Vietnam's mobile robot industry is evolving, showcasing significant development alongside untapped potential and challenges These robots are increasingly utilized in various industrial applications, including goods transportation in warehouses, cleaning and mopping in workplaces, and providing management and supervision support.

In Vietnam, numerous businesses and research organizations are increasingly focusing on the development and implementation of Autonomous Mobile Robots (AMRs) Various research initiatives and practical application projects are underway to streamline work processes and improve operational efficiency Notably, several prominent domestic corporations have introduced typical AMR products that showcase this technological advancement.

FPT Software has launched "NextAMR," an innovative Automatic Delivery Robot designed for industrial production settings, marking a significant achievement as the first product developed by Vietnamese engineers This autonomous robot excels in self-navigation, allowing it to flexibly determine routes without the need for specialized rails, while also automatically avoiding collisions with people and obstacles Additionally, NextAMR is equipped with advanced mapping capabilities, enabling it to adapt to environmental changes seamlessly.

Figure 2 5:“NextAMR” robot from FPT Corporation [5]

2.2.3 Research situation at Ho Chi Minh City University of Technical Education

At Ho Chi Minh City University of Technical Education, there is a growing interest in Mobile Robots and autonomous vehicles, with research and projects in this area capturing the attention of both students and faculty This trend is significantly contributing to the advancement and application of Robotics across various sectors.

The research and development of mobile robots and self-propelled vehicles at the school enhances students' understanding of robotics technology while providing numerous opportunities for practical application of their knowledge These initiatives are grounded in artificial intelligence, machine learning, and automatic control, leading to the creation of innovative and adaptable solutions for real-world applications.

In addition, the research and development of projects on Mobile Robots and autonomous vehicles also contributes to enhancing the position and reputation of Ho Chi

Minh City University of Technical Education in the science and technology community

The program fosters a dynamic and diverse academic atmosphere for students eager to explore Robotics and automation Key topics covered in previous courses include Mobile Robots, self-driving vehicles, and service robots for restaurants.

Table 2 1 : List of topics related to Mobile Robot from previous courses

Number Project title Group of authors Advisor Khóa

Thiết kế và thi công

Robot di động bám người vận chuyển hàng

Nguyễn Nam Du Nguyễn Lương Tâm Phạm Thái Dương

Nghiên cứu, thiết kế và chế tạo Robot

AMR ứng dụng trong nhà máy sản xuất

Nguyễn Nhĩ Thái Huỳnh Đoàn Trung Tín

Thiết kế và điều khiển mô hình Robot phục vụ thư viện

Tối ưu đường đi cho

Robot và di chuyển đa Robot theo đội hình

Lê Văn Tùng Nguyễn Xuân Sáng

Structural features of “Mobile Robot for Document Transportation”

 The structure robot comprises the following three main components:

The frame and shell system is essential for enabling the robot to endure heavy loads and ensure durability while transporting large cargoes or documents Careful calculation, design, and construction of the chassis are vital for optimal performance, while the outer shell provides necessary protection and support.

10 enhances aesthetics and protects the robot from dust and harmful elements in the working environment

The drive system is crucial for ensuring smooth and efficient movement across different environmental conditions, comprising two key components: the primary drive mechanism and omnidirectional wheels The primary drive mechanism features drive wheels connected directly to the motor shaft or via a transmission system, and selecting the right motor is vital as it greatly influences the robot's load-bearing capacity and operational efficiency.

The electrical system is the core of the robot, essential for its overall functionality It encompasses batteries that supply power to key components, including Lidar sensors, obstacle sensors, buttons, indicator lights, cameras, and embedded computers Additionally, it powers the central processing unit and motors, enabling precise control of the robot's operations.

Figure 2 6: The three main structural components of the robot

 Additional Structural Features for Completing the Document Transportation Mobile Robot

The robot features a compartment system with multiple numbered compartments, each equipped with a securely lockable door to safeguard the documents inside Designed for smooth operation, these doors can open and close either manually or automatically, based on the robot's configuration Additionally, the interiors of the compartments are lined with protective materials to ensure that documents remain secure and undamaged during transportation.

The robot features a user-friendly touchscreen interface located at the top, allowing users to input commands, monitor the robot's status, and efficiently manage document delivery tasks.

To facilitate remote monitoring and control, the robot can be equipped with Wi-Fi and Bluetooth connectivity, enabling communication with other devices and receiving commands from a central control system Furthermore, integrated speakers and a microphone enhance user interaction by providing audio alerts and enabling two-way communication for assistance.

Figure 2 7:Additional integrated components for the robot

THEORETICAL BASIS

Kinematic model differential two-wheeled moving robot

3.1.1 Forward kinematics of differential two-wheeled moving robot system

Table 3 1: Table of symbols for kinematic parameters used for calculations

Right wheel's angular velocity (rad/s) ω

Left wheel's angular velocity (rad/s) ω

Distance between the centers of the two wheels

Radius of the arc when the robot rotates around point O at an angle θ (m)

Consider the robot moving in a straight line:

Figure 3 1: Description of the robot moving in a straight line

The robot features two driving wheels and four guiding wheels, as depicted in Figure 3.1 Utilizing principles of theoretical mechanics, the linear velocities of the two driving wheels can be determined using specific formulas.

The moving velocity of the robot is calculated as the average of the linear velocities of the right and left wheels Therefore, we have:

To move in a straight line, the linear velocity of the left wheel and the linear velocity of the right wheel must be equal:

From (3.1), (3.2), and (3.4), we can establish the relationship between the robot's linear velocity and the rotational speed of the drive wheels when the robot is moving straight:

 Consider the robot moving in a circular arc:

The path distance traveled in a circular arcL T is the average of the path distances traveled by the left wheel L L and the right wheelL R :

Figure 3 2: Description of the robot moving in a circular arc

The rotation angle  of the robot is determined by the formulas:

Both L L and L R can be calculated based on the turning radius R T , the distance L between the two wheels, and the rotation angle  of the robot:

Thus, the robot's rotation angle  can be calculated based on the lengths L L as well as the distance L between the two wheels:

To have a non-zero angular velocity of the robot, the linear velocities of the left wheelv L and the right wheel v R must be different:

The angular velocity of the robot is determined as:

To simplify the kinematics of a differential drive robot, based on the articles, we can derive the following equations: cos cos 0 sin sin 0

The robot's state is represented by q = [x, y, θ]ᵀ, where (x, y) denotes its position and θ indicates the rotation angle around the z-axis The linear velocity, v, is defined by equation (2.3), while the angular velocity, ω, is determined by equation (2.15).

At time t   t the position and orientation of the robot are:

3.1.2 Inverse kinematics of a differential drive robot

Based on equations (3.1), (3.2) and (3.16), the system of equations is as follows:

From (3.18), we can derive the speeds of the left and right wheels in units of revolutions per minute as follows:

Introduction to ROS (Robot Operating System)

Robotics is rapidly emerging as a leading technology sector, with innovations like self-driving cars and humanoid robots from companies such as Tesla and Boston Dynamics capturing widespread attention This surge in interest is inspiring many individuals to delve deeper into the field or consider careers in robotics A key player in robot development today is the Robot Operating System (ROS), which is widely recognized as one of the most popular platforms for creating robotic applications.

Robot Operating System (ROS) is an open-source platform that offers essential libraries, packages, and tools for developing robot applications Since its launch over a decade ago, ROS has gained global popularity, being utilized in various fields from research to industrial applications It is particularly effective for any application requiring communication with or control of sensors and actuators Additionally, ROS is extensively used in research areas such as autonomous driving, legged robots, humanoid robots, and drones, making it a versatile choice for robotics development.

 ROS provides standard tools to facilitate communication between tasks

 ROS has an extremely large user and developer community

ROS offers a diverse range of libraries for various applications, including cutting-edge technologies in AI, computer vision, natural language processing, and control systems Users can easily download and implement state-of-the-art software developed by organizations, companies, universities, and individuals actively utilizing ROS in their projects and research.

ROS is an entirely free framework that permits use in commercial applications, making it highly appealing to companies and organizations, including large corporations Its cost-effectiveness facilitates easy testing, development, and commercialization of products.

ROS functions as a meta-operating system, offering not only development tools and libraries but also essential operating system features like hardware abstraction, package management, and a comprehensive development toolchain Its file organization on the hard drive mirrors that of traditional operating systems, enhancing its functionality and usability for developers.

ROS packages are essential building blocks of ROS software, encompassing one or more ROS programs (nodes), libraries, configuration files, and various resources, all systematically organized within a single directory.

Package Manifest: The package.xml file inside each package serves as its description file, containing information such as authors, licenses, etc

Metapackages: The term "metapackage" refers to one or more related packages that can be grouped together in a general way

The metapackage manifest in ROS is a crucial file that outlines essential details about the metapackage, including information on authors, licenses, and runtime dependencies, similar to a standard package manifest.

In ROS, messages (.msg) serve as a means of communication between different processes, allowing them to exchange information effectively Custom messages can be created by defining them within the msg directory of a package, such as my_package/msg/MyMessageType.msg.

In ROS, services (denoted as srv) facilitate Request/Response interactions between processes The message types for requests and responses can be specified in the srv directory of a package, such as my_package/srv/MyServiceType.srv.

In ROS, the term "misc" (short for miscellaneous) refers to components or files that do not fit into specific categories It serves as a storage for various files, packages, or small functionalities that are not easily classified elsewhere, providing flexibility in organizing diverse elements within the system.

In ROS, computation is facilitated through a network of processes known as ROS nodes, collectively forming the "Computation Graph." This graph comprises essential components such as ROS Nodes, Master, Parameter Server, Messages, Topics, Services, and Bags, each playing a unique role in the overall functionality of the system.

Figure 3 4: ROS Computation Graph Level

In ROS, nodes serve as essential computational processes, each developed using ROS client libraries that enable various functionalities, including inter-node communication This design allows different robot nodes to efficiently exchange information, promoting modularity by focusing on individual processes rather than a monolithic structure Upon initialization, each node registers crucial details like its name, message types, URI address, and port number, which determines its role as a publisher, subscriber, service server, or service client Nodes utilize Topics and Services to facilitate message exchange, enhancing the overall communication framework within the robotic system.

Each node can send and receive data with other nodes through topics, services, actions, or parameters Starting a ROS system requires a ROS Master, which acts as a management node

The ROS Master is essential for providing registration and lookup services for node names in a distributed system Without the ROS Master, nodes are unable to locate each other, exchange messages, or invoke services To facilitate communication among remote nodes, it is recommended to run the ROS Master on a single computer, ensuring efficient connectivity and interaction.

 Parameter server: The Parameter server allows centralized storage of data All nodes can access and modify these values The Parameter server is part of the ROS Master

Nodes in a system communicate through Messages, which are data structures that encapsulate predefined data types These Messages can contain various data sets and are sent between nodes The Robot Operating System (ROS) supports standard primitive data types such as Integer, Float, and Boolean, while also allowing the creation of custom Message types based on these standard types.

 Topics: Each Message in ROS is transported using named communication channels called Topics When a node sends a Message via a Topic, it publishes that Topic

When a node subscribes to a Topic, it receives Messages without needing to know about the publishers This allows for a decoupled system where subscriptions can occur even in the absence of active publishers Each Topic is identified by a unique name, enabling any node to access and transmit data through it, provided they utilize the appropriate Message type.

Theoretical basis of the web

The LAMP server is a widely used technology stack in web development, consisting of the Linux operating system, Apache web server, MySQL database, and PHP programming language Essential web programming languages such as HTML, CSS, and JavaScript are integral for creating the interface and functionality of websites Additionally, ROSBridge serves as a valuable tool for linking the Robot Operating System (ROS) with web applications This report will explore the theoretical aspects of LAMP servers, the foundational web programming languages, an introduction to ROSBridge, and the server's connection to the browser through the HTTP method.

Linux is an open-source operating system known for its stability, security, and high customizability It is the foundation of many web servers due to its flexibility

23 and superior performance Popular Linux distributions for web servers include

Ubuntu Server, CentOS, and Debian

Apache HTTP Server, widely known as Apache, is a leading web server renowned for efficiently managing multiple simultaneous requests It offers extensive support for various extension modules, including mod_ssl for secure connections and mod_rewrite for URL rewriting, enhancing both optimization and security features.

MySQL is a popular open-source relational database management system utilized in web applications for efficient data storage and management It features support for transactions, foreign keys, and crash recovery, making it a reliable choice for developers Additionally, MySQL seamlessly integrates with various programming languages, particularly PHP, enhancing its versatility in application development.

PHP is a server-side scripting language tailored for web development, enabling seamless integration with HTML and efficient interaction with MySQL databases This functionality supports the creation of dynamic and adaptable web pages.

HTML is a markup language essential for structuring and presenting content on web pages It utilizes tags to define various elements, including headings, paragraphs, images, and links A standard HTML document typically features key tags such as , , and .

CSS is a styling language that formats and designs web pages, enabling the separation of HTML content from its presentation This functionality allows for changes in a web page's appearance without altering its content structure CSS can be implemented directly within HTML or linked through external files.

JavaScript is a powerful client-side scripting language that enables the creation of dynamic and interactive web pages It facilitates the modification of HTML and CSS content while managing events like clicks and form submissions Additionally, JavaScript is compatible with numerous libraries and frameworks, including jQuery, React, and AngularJS, enhancing its functionality and versatility in web development.

3.3.4 Communication between the server, ROS, and the browser

Figure 3 7: Diagram of LAMP server and ROS connection.[12]

ROSBridge is an essential tool in the Robot Operating System (ROS) that facilitates communication between web applications and ROS nodes using WebSockets and JSON This functionality is crucial for creating web-based user interfaces for robots, allowing for remote monitoring and control through a web browser.

ROSBridge functions by setting up a WebSocket server on the ROS server, allowing web applications to connect and send JSON messages for communication with ROS nodes It effectively translates these JSON messages into ROS messages and vice versa, establishing a seamless connection between ROS and web applications.

HTTP (HyperText Transfer Protocol) is the essential protocol for web communication, governing the interaction between web browsers and servers through requests and responses An HTTP request from a browser specifies the resource type being requested, the HTTP method used (such as GET, POST, PUT, or DELETE), along with additional information like headers and data.

 Handling HTTP Requests with Apache and PHP

When an HTTP request reaches an Apache server, it identifies and processes the requested resource For static HTML files, Apache directly returns the file's content In contrast, if the request is for a PHP file, Apache forwards it to the PHP interpreter, which processes the PHP code and generates dynamic HTML content for the browser.

 Connecting with JavaScript via AJAX

AJAX (Asynchronous JavaScript and XML) allows sending and receiving data from the server without reloading the page This is an important technique for creating dynamic and interactive web applications.

Algorithms used for robots

Dijkstra's algorithm is utilized on an occupancy grid map by navigating through all grid cells, beginning at the robot's starting position It systematically evaluates unvisited neighboring cells and incorporates them into the potential paths This search continues throughout the map until the target destination is reached By ensuring the identification of the shortest path from the start to the destination, Dijkstra's algorithm operates effectively, provided there are no negative costs involved The execution of the algorithm follows a structured series of steps.

- Start from the source vertex, setting the initial distance to 0

- Set the distance for all other vertices to infinity (+∞)

- Create an empty set to store processed vertices

- Select the unprocessed vertex with the smallest distance (starting from the source vertex)

To optimize the distances of adjacent vertices from the current vertex, update each distance if the new path through an edge offers a shorter route than previously recorded.

- Mark the current vertex as processed

 Termination: Continue the iteration until all vertices have been processed or the distance to the destination has been optimized

The results of the shortest path algorithm from A to the other points are:

The Dynamic Window Approach (DWA) algorithm is used to find a reasonable control signal to send to the robot in order to control it to the destination safely and quickly,

The algorithm follows a structured global plan and consists of two key steps First, it narrows down the robot's velocity search space by identifying feasible speeds within kinematic constraints, eliminating those that could cause collisions with obstacles, utilizing data from sensors like lasers or LiDAR This process results in a defined range of safe and practical velocities The second step involves evaluating these potential speeds based on safety, efficiency for reaching the destination quickly, and stability for smooth movement Ultimately, the optimal velocity is selected to ensure the robot navigates effectively and safely towards its target.

The controllable velocities in the search space are reduced in the following three steps:

Circular orbits are characterized by pairs of translational velocity (v) and rotational velocity (ω), simplifying the analysis to two key velocity parameters This approach streamlines calculations, making them more manageable When a robot is limited to straight-line movement and rotation, the integration of these two movements results in the formation of a circular orbit.

To ensure safe operation, a robot's allowable velocity is defined by a pair of speeds (v, ω) that allows it to stop before colliding with obstacles This capability is crucial for preventing accidents and ensuring the robot can halt safely within the designated space.

- V a : is the set of permissible velocities (v , ) for the robot to stop before colliding with obstacles

- dist v( , ) : is the minimum distance the robot must stop to avoid a collision

- v b , b : are the acceleration limits of the linear velocity and the angular velocity, respectively, if the robot were to move and cause a collision with the obstacle.

The dynamic window approach restricts the robot's allowable velocities to those achievable within a brief timeframe, taking into account its acceleration limits This method effectively minimizes search time by focusing solely on the feasible velocities that the robot can realistically attain.

Figure 3 10: Velocity V d in dynamic window

V  v  v  v   v t v     v t       t   t (3.27) The search space is determined after performing the above three steps: r s a d

After defining the search space \( V_r \), we select linear and angular velocities from it Based on the robot's current position and orientation, we assess various factors to determine the most optimal trajectory.

The Travelling Salesman Problem (TSP) is a fundamental optimization challenge in graph theory and computer science, focused on determining the shortest route for a salesman to visit each city on a list exactly once before returning to the starting point As an NP-hard problem, TSP lacks a quick solution for all scenarios, but numerous methods exist to tackle it effectively.

Figure 3 11 :Route from all other points

Figure 3 12: Solve the TSP problem

The Ant Colony Optimization (ACO) algorithm is a nature-inspired optimization technique that mimics the foraging behavior of ant colonies It is particularly effective for solving optimization problems with graph structures, such as the Travelling Salesman Problem (TSP) ACO's flexibility allows for easy adaptation to various optimization challenges by modifying representations and updating pheromone trails Additionally, ACO can be enhanced through integration with local search algorithms and other meta-heuristic methods, leading to faster and more precise solutions These benefits position ACO as a compelling choice for addressing complex optimization issues across diverse fields, especially in transportation.

The Ant Colony Optimization algorithm mimics the behavior of ants as they navigate using pheromone trails and their experiences to identify optimal paths Through iterative updates of pheromone levels and the shortest path, this algorithm enables ants to collaboratively discover the most efficient route over multiple iterations The resulting matrix illustrates the likelihood of each ant selecting a particular path, ultimately leading to the identification of the shortest route based on the accumulated pheromone trails.

Where: k pij is the probability that ant k chooses the path ( , )i j

ijis the pheromone level on the path ( , )i j

ij is the heuristic information k

N i is the set of neighboring nodes of node i that ant k has not yet visited

 is the parameter to adjust the influence of  ij

 is the parameter to adjust the influence of  ij

Paths that ants have already traversed will have higher pheromone levels than paths that have not been traversed Therefore, the pheromone update rule is as follows:

 là hệ số bay hơi pheromone ck là khoảng cách mà con kiến đã di chuyển k 1 ij c k

  nếu con kiến đi qua đường ( , )i j , mặt khác  ij  0

Control involves gathering and processing information to influence a system toward a specific goal Automatic control refers to this process occurring without human involvement Often, the system's responses fall short of desired standards for accuracy, productivity, and economic efficiency, highlighting the need for improvement and optimization.

PID controllers are widely recognized in automatic control systems, being utilized in over 90% of industrial applications These controllers excel in both analog and digital environments, offering a versatile solution for various control needs When optimally designed, PID controllers can achieve key performance metrics, including rapid response, minimal transient time, reduced overshoot, and effective static deviation suppression This capability makes PID controllers a favored option for enhancing the performance and stability of control systems.

Figure 3 13: Block diagram of PID controller

The PID control diagram is named after its three corrective components, the sum of which forms the control variable (MV) We have:

P I D are the output components from the three terms of the PID controller, defined as follows

The proportional term, often referred to as gain, adjusts the output value in direct relation to the current error This proportional response can be fine-tuned by multiplying the error by a constant known as the proportional gain (Kp).

The proportional term is given by: out p ( )

The integral component generates a control signal that is directly proportional to the control error When the error is significant, the control signal is correspondingly large, and as the error diminishes, the control signal reduces as well Once the error reaches zero, the control signal also drops to zero However, a potential concern arises when the error changes sign, leading to a reversal in the control signal's direction.

The integral term, often referred to as reset, plays a crucial role in control systems by being proportional to both the magnitude and duration of the error By accumulating past errors over time, the integral of the error enhances the controller's response This accumulated error is then multiplied by the integral gain, K_i, and incorporated into the controller output, ensuring improved accuracy and performance.

The integral term is given by:

Navigation stack package

The ROS Navigation Stack is a comprehensive suite of software packages designed to assist robots in navigating safely from a starting point to a designated target This Navigation Stack comprises three essential packages that work together to facilitate efficient robotic navigation.

 Move_base: Helps the robot navigate on the map and move to a target pose with respect to a certain reference frame

 Mapping: Creates a map using data sent from Lidar

 AMCL: Helps determine the robot's current position on the map

The move_base package is essential for enabling robots to navigate effectively by planning their paths on a map while avoiding both static and dynamic obstacles It comprises two key components: global path planning and local path planning, which work together to ensure safe and efficient navigation The architecture of the Navigation Stack package illustrates this integrated approach.

Figure 3 14: Overview diagram of the Navigation Stack package

According to Figure 2.7, the white components are essential and have been successfully implemented, while the gray components, though optional, have also been implemented Additionally, the blue components are required to be developed for each robot.

 Sensor transforms: This component functions to transform tf coordinates between the robot's sensors and the central control system

 Sensor sources: This component contains information from sensors used for obstacle avoidance, such as Lidar, IMU, etc

 Odometry source: This component contains the position information of the robot relative to the central control system

 Base controller: This component generates Twist control data packets (including linear velocity (vx) and angular velocity (vtheta)) and publishes them on the ROS platform

 Map_server: Used to save the map and render it after using the slam_gmapping package

HARDWARE AND MECHANICAL DESIGN

Mechanical design fundamentals

Choosing appropriate materials and designing a robust frame are essential for the durability and load-bearing capacity of a robot Furthermore, an effective drive system and transmission mechanism are vital for smooth movement, particularly under heavy loads, to avoid breakdowns and failures.

The robot's frame is constructed using C45 steel plates, shaped through laser cutting, to ensure durability for practical applications like transporting documents and belongings This choice of material not only enhances the structural integrity but also simplifies the design process for the robot's 3D-printed shell, allowing for greater flexibility and adherence to the proposed design direction.

Design requirements

The initial technical requirements for calculating and designing the mechanical system are as follows:

 Terrain: The robot will move on flat surfaces such as concrete and tiled floors, without significant slopes or many obstacles

 Dimensions: The robot will have a length of 650 mm, a width of 460 mm, and a height of approximately 1400 mm, weighing between 40-50 kg, enabling easy interaction with office staff

 Maximum load capacity: The robot can carry up to 20 kg

 Operational time: At least 2 hours

 Operating range: This depends on the size of the mapped area and stable Wi-Fi connectivity

The robot's design and dimensions are informed by extensive research on similar robots currently being tested and utilized both in Vietnam and globally This approach also takes into account the actual sizes of documents and items that require transportation within buildings and offices.

4.3 3D structural design of the robot

Based on the established goals, the team proceeded to design the robot model using SolidWorks 2021, with the robot structure consisting of two main parts :

 The lower frame of the robot includes: Frame and shell system, Drive System,

 The upper part includes: Compartment System, User Interface , Communication System

Figure 4 1: Overview 3D model of the Robot 4.3.1 Lower body frame

The design of the chassis frame and the arrangement of components in the lower frame are illustrated in the figure below:

Figure 4 2: Lower frame structure and component positions

The base plate, crafted from 4mm thick C45 steel, offers a cost-effective and durable solution due to its widespread availability It features precise laser-cut external contouring, along with holes and mounting joints, facilitating seamless assembly with other components of the lower frame, including the motor assembly.

The team will utilize laser-cut C45 steel plates for the robot's lower frame, which will be assembled through MIG welding This lower frame features a two-tier design, strategically arranged to support the positioning of various system components.

- Tier 1: Houses the battery power source, voltage regulation/distribution system, and drive system components such as motors, motor drivers, wheel suspension assemblies, drive wheels, omni-directional wheels, etc

- Tier 2: Houses the central control unit and mini-PC

Figure 4 4: Inner frame of the lower body

The team discovered that the robot possesses two degrees of freedom: linear and rotational motion Consequently, they chose a differential steering configuration that includes two drive motors for the main wheels, complemented by four omni-directional wheels at each corner to ensure stability and support for heavy loads.

Figure 4 5: 3D Design of the Robot with a Differential Steering Configuration

 Based on the differential steering diagram, robot control is implemented as follows:

- Straight motion: Controls both motors to run at the same speed and in the same direction

- Circular motion: Controls both motors to run at different speeds (to move in a circular path, the motor of the wheel on the opposite side is controlled to move faster)

- Pivot around the center axis of the robot: Controls both motors to run at the same speed but in opposite directions to rotate the robot around its center axis

The robot's frame is constructed from structured aluminum bars, ensuring easy assembly and robust load-bearing capabilities The upper frame measures 440 x 360 x 1100 mm, while 1-2mm thick iron plates are employed for the document compartments and the top cover, which supports the communication membrane.

40 with users Magnetic electric locks are installed in the compartments for added security A screen is mounted on the top for user interaction

Figure 4 6: Upper Body Frame of the Robot

The robot shell, measuring 680mm x 485mm x 240mm, boasts a sleek design ideal for office settings To optimize costs, the team will utilize 3D printing with a 40% infill, and a matte finish will be applied for enhanced durability This shell is securely attached to the frame via screw holes and includes essential features like buttons and ports for seamless computer connectivity.

Motor calculation and selection

The robot features two motors that manage its primary drive wheels, complemented by four omni-directional wheels positioned at both the front and rear The team carefully chose specific types of drive wheels and omni-directional wheels to enhance the robot's mobility and versatility.

Figure 4 8: Drive Wheel- diameter:145mm [https://robotstore.vn/banh-xe-nhom-duong- kinh-145mm]

Basic specifications of the wheels:

- Wheel diameter: D = 145 mm, wheel width b = 40 mm, maximum load capacity 70 kg, axle diameter d = 15 mm

- Omnidirectional wheels: Utilizing wheels with D = 40 mm

To meet low-speed demands, the DC motor features a built-in gearbox that enhances torque for effective load handling Furthermore, an encoder will be integrated to facilitate PID feedback control The team will assess and analyze the forces on the wheels to determine the optimal motor selection for the project's needs.

Figure 4 10: Analysis of forces on the wheel

Table 4 1: Table of symbols describing system parameters

N The reaction force of the wheel on the floor (N)

Fms The friction force of the floor surface on the wheel (N)

Fk The traction force on the wheel (N)

P The gravitational force on the wheel (N) m The total weight of the robot and the maximum load 70 (kg) v The maximum speed of the robot 0.5 (m/s) d The wheel diameter 145 (mm)

To determine the resultant force acting on each wheel, which carries a weight of 35 kg, follow the positive direction indicated by the arrow in Figure 3.4 By applying Newton's second law, the equation for the resultant force can be expressed as k ms.

The force exerted by the motor can be expressed as F = μN, where μ represents the coefficient of friction and N is the normal force With a wheel diameter of 145 mm, the distance traveled by the robot during one full wheel rotation is approximately 455.5 mm or 0.4555 m Consequently, to achieve the desired speed, the motor must complete a specific number of rotations per minute.

When the robot accelerates from v 0 = 0 m/s to v = 0.5 m/s within t =1s, we have the acceleration as: v v  0  at (4.4)

The minimum power required to supply the motor for the robot to move:

The necessary torque for the motor is:

The team chose the Z5BLD200-24GU-30S brushless DC servo motor, which meets the necessary motor specifications This model operates at a supply voltage of 24 VDC and delivers a rated power of 200W, featuring an integrated gearbox for enhanced performance.

Figure 4 11: Brushless DC Motor Z5BLD200-24GU-30S

Technical specifications of the brushless DC motor Z5BLD200-24GU-30S:

 Output torque of the geared motor: 20 Nm

 Encoder: 1000 ppr (pulses per revolution).

Construction Results

 Robot base frame: The team created detailed drawings for each component to proceed with laser cutting C45 steel sheets with a thickness of 2-3mm, then used

45 the MIG welding method to assemble the parts together The team then polished and painted the frame to ensure the aesthetic quality of the model

Figure 4 12: Completed base frame of the Robot after welding and painting

The robot's upper frame was constructed using structured aluminum bars measuring 30x30 and 20x20, in accordance with the design specifications To improve its aesthetic appeal, 5mm thick aluminum plates were incorporated for surrounding cladding.

Figure 4 13: Upper frame of the Robot

The team designed comprehensive drawings for the full-size 3D printing of the robot frame, utilizing a 30% plastic infill to reduce costs To enhance both durability and aesthetic appeal, they applied a matte finish to the printed model.

 Robot completion: The team assembled small components together, installed equipment and electrical systems, and integrated LED systems to enhance the aesthetic appeal of the Robot

ELECTRICAL SYSTEM DESIGN

Technical requirements

The preliminary requirements and specifications for the design and construction of the electrical system are:

 The power supply must comply with the technical specifications of the equipment, allowing optimal operation over extended periods

 Arrange materials within the system in an organized manner to facilitate installation and replacement during maintenance or in case of malfunctions

 Install additional power switches and emergency stop buttons to quickly halt system operation in case of an emergency.

Calculation and selection of equipment for the electrical-control system

Figure 5 1: Block diagram of the electrical system The electrical system of the robot consists of six main blocks:

Below, the team will present the calculations and selection of suitable equipment for each block:

 Calculation and selection of power supply

The power supply block is crucial for delivering energy to all components within the robot's system To choose the appropriate power supply, the team meticulously calculated the power consumption of each component during real operational conditions.

The Z5BLD200-24GU-30S motor operates at a rated voltage of 24VDC When the robot travels at a speed of 0.5 m/s while carrying a load, including the robot frame and documents, each motor draws a current of 2.3A Consequently, the total power consumption for both motors amounts to 110.4 W.

 The RPLidar A1 5V 0.1A consumes a maximum power of 0.5 W

 The Mini PC T9 Plus 12V 2.5A consumes a maximum power of 30 W

 The Arduino Mega 2560 microcontroller 5V 0.05A consumes a maximum power of 0.25 W

 The 12V 0.2A electromagnet consumes a maximum power of 2.4 W

 Two meters of RGB LED strip with a power of 14.4 W/m consume 28.8 W

 The HC-SR04 ultrasonic sensor 5V 0.002A consumes a maximum power of 0.01

 Other devices have very low heat dissipation power and are thus ignored

The formula to calculate the necessary battery capacity is:

 P: Total maximum power consumption of the components in the system

 T: Continuous operation time of the devices

The total maximum power consumption of the devices is calculated to be 172.36 watts, with a supply voltage of 33V To ensure continuous operation for 2 hours, the required battery capacity must be determined based on this power consumption.

The team has chosen the ISMART BATTERY as the primary power source, backed by Indruino Technical Solutions Company, which delivers a robust output voltage of 33VDC and a substantial battery capacity of 20,000 mAh.

Figure 5 2: ISMART battery 33VDC (20000 mAh)

 The A9H4 DC-DC Buck converter module is used to step down the voltage from the ISMART battery from 33V to 24V to supply power to the two motors

Figure 5 3: 20A 300W DC-DC Buck Converter - A9H4

 The XL4015 Buck converter is used to further reduce the voltage from 24VDC to 12V to supply power to the electromagnetic locks in the document compartments

Figure 5 4: DC-DC Buck Converter XL4015

 The voltage divider provided by Indruino Company is used to step down the voltage (from 24V to 12V and 5V) to supply power to the MiniPC and the

Figure 5 5: Multi-Output P/S Module – Indruino

Figure 5 6: The general block diagram of the electrical-control system

The Arduino Mega 2560 serves as the central controller for managing and coordinating all robot activities, facilitating communication and connectivity with sensors, motors, and various devices via its I/O pins.

The HC-SR04 distance ultrasonic sensors are essential for obstacle detection in robotic applications These sensors are connected to the digital pins A0 to A5 on the Arduino Mega, while their VCC and GND pins link to the 5V power supply and ground Additionally, the TRIG and ECHO pins interface with the I/O pins of the Arduino, enabling effective communication and measurement.

The MPU 6050 Sensor delivers crucial data on the robot's acceleration and gyroscope For I2C communication, the SDA and SCL pins of the MPU 6050 are connected to pins 20 and 21 of the Arduino Mega.

Brushless DC Motors utilize motor controllers that receive PWM and DIR signals from an Arduino for precise operation To ensure accurate performance, encoders connected to the motors deliver essential feedback regarding the speed and position of the wheels Additionally, both the motors and controllers require a reliable power source for optimal functionality.

24V power supply The ENB, DIR, PWM, VCC, and GND pins of the motor controllers are connected to the corresponding pins on the Arduino

Two relays are utilized to manage the electromagnet locks, which securely fasten the document compartments Controlled by an Arduino via digital pins, the relays activate to supply power to the electromagnets from a 12V power source.

The RP LIDAR is essential for scanning and mapping the environment around a robot, efficiently connecting to a MiniPC for data processing This MiniPC operates with a 12V power supply and is grounded for optimal performance.

- 24V and 12V Power Supply: These are used to power various components of the robot

- 5V Power Supply: This is used to power the sensors and the Arduino Mega

The Arduino Mega 2560 microcontroller is utilized by the team to effectively control various actuators, including DC motors, electromagnetic locks, stepper motors, and RGB LED strips, while also reading signals from sensors and push buttons With a greater number of I/O pins than other Arduino models like the Uno and Nano, it offers enhanced flexibility for external connections and stable wiring Its reliable processing speed and multiple external interrupt pins facilitate accurate encoder readings, ensuring precise control over motor speeds.

- IC for programming and UART communication: ATmega16U2

- Power supply: 5VDC from USB port or external power source

- Number of Digital I/O pins: 54 (of which 15 can output PWM signals)

- Number of Analog Input pins: 16

- DC Current per I/O pin: 20mA

- DC Current for 3.3V pin: 50mA

- Flash Memory: 256 KB, with 8 KB used for bootloader

The DC motor driver, or Brushless DC (BLDC) motor controller, is an advanced device tailored for low-power motor control applications As electronic technology evolves, products are continually enhanced in performance and functionality This device employs large-scale integrated hardware circuits, ensuring high noise immunity and rapid response times In operational efficiency, it surpasses traditional DC motors BLDC motors provide significant benefits, including maintenance-free operation, extended lifespan, and consistent torque during use.

This device is suitable for controlling any low-voltage three-phase brushless

DC motors with a maximum current of under 15A and a supply voltage below 50V are increasingly utilized in diverse automation sectors These motors are essential in large-scale mobile robots, textile machinery, medical equipment, food industry machinery, gardening machines, and numerous other applications.

Figure 5 8: Motor Driver Explanation of symbols used on the circuit:

- GND, VCC: Power supply for the Driver (18VDC – 50VDC)

- U, V, W: Ports connected to the phase wires of the three-phase DC motor

- 5V, GND: Power supply for Hall sensors

- HA, HB, HC: Input ports for Hall sensor signals

 Connector X3 (Terminal device for input and output control signals)

- SV: Input for PWM & Analog signals

- FR: Input for direction control signal

- EN: Input for activation signal

- BK: Input for brake signal

- X1/X2/X3: Input for multi-segment speed control

Figure 5 9: Diagram of the motor driver control circuit (Taobao)

Analog/PWM SV facilitates the input of Analog or PWM signals In the BLDC_2 software, selecting 'Analog Input' or 'PWM Input' configures the input, with the value at this port representing the designated speed.

The Mini PC T9 Plus serves as the central data processing unit, acting as the brain of the robot It processes data from sensor units, allowing the robot to interact with its environment and ascertain its position on the map Additionally, the ROS system on the Mini PC facilitates communication with the Arduino Mega 2560 through the UART communication standard, enabling precise control of motor speeds.

SOFTWARE DEVELOPMENT

Overview description of the document delivery robot

Figure 6 1: Flowchart Describing the Overall Program of the Robot

 Description of Robot Operation with Users

To activate the robot, simply press the Start button Users must access the website to utilize the robot, requiring a registered login account New users can create an account directly on the website, enabling them to use the robot for document delivery after successful registration If an existing user forgets their password, they can easily retrieve it through their registered email.

The robot's primary function is to transport documents between rooms To utilize this service, senders simply visit the website, select their current room location, and click the "Call me" button The robot then promptly navigates from its Home position to the sender's room.

Track the robot's route and current location in real-time on the website, enabling users to know its estimated arrival time Upon reaching the caller's location, the robot emits a sound to notify the sender that it has arrived and is ready for document pickup.

To initiate document delivery, the sender must press the "Order" button on the robot's interface and input the recipient's details, including their name, document compartment number, email, room number, and a security password if using compartments 1 or 2 Once all recipients are added, the robot will send an email containing the necessary information, such as the recipient's name, compartment number, notes, and password After processing the "Call" and "Order" commands, the robot will determine the delivery sequence and start delivering the documents Upon arriving at the recipient's room, the robot will announce the room number and emit a sound, prompting the recipient to collect the documents The recipient must enter the correct password and press the confirm button to access the compartment; failure to enter the correct password will prevent access Once the password is verified, the compartment will unlock, allowing the recipient to retrieve the documents and confirm receipt, enabling the robot to proceed with further deliveries.

When a new sender wishes to contact the delivery robot, the robot records their information Upon arriving at the next delivery location, it adjusts its route to incorporate the new sender's address and proceeds with its deliveries This cycle continues until there are no further calls, after which the robot returns to its Home position to await the next order.

 Description of the Robot's Movement

Upon receiving orders and resolving the Traveling Salesman Problem (TSP), the robot navigates a pre-mapped area, skillfully avoiding both static and dynamic obstacles It continuously adapts by re-planning and generating new routes as needed If the robot encounters an obstruction at its destination, it will pause and wait until the obstacle is removed before proceeding to complete its journey.

Map building

To enable effective navigation and document transport on the 9th floor of the central building, we will create a 2D map utilizing the Navigation Stack package The team employs the Rplidar A1M8 for data collection, while the Gmapping package processes information from the /tf and /scan topics, integrating sensor data from encoders, IMU, and Lidar This systematic approach will facilitate the successful mapping of the area.

Set up the rplidar_ros package:

 Thiết lập cho gói rplidar_ros:

A1/A2 >

This package offers nodes and drivers for connecting to the RPLIDAR sensor, enabling users to receive valuable scan data The data comprises point clouds that illustrate the distances to objects within the LIDAR's scanning range.

The scan data from the RPLIDAR is published as a ROS topic, typically the /scan topic Other ROS nodes can subscribe to this topic to process the scan data

The "serial_port" parameter, defined as a string with the value "/dev/ttyUSB1," indicates the specific serial port connection for the RPLIDAR sensor This configuration assumes that the sensor is linked through USB1 on the MiniPC, which should already be properly set up.

Name="serial_baudrate" type="int" value="115200": This parameter specifies the baud rate of the serial connection The value 115200 is commonly used for the RPLIDAR models A1 and A2

Name="frame_id" type="string" value="base_scan": This parameter specifies the frame ID for the LaserScan data This frame ID is used for referencing within the ROS

Name="inverted" type="bool" value="false": This parameter indicates whether the scan data is inverted Here, the value false means the data is not inverted

Name="angle_compensate" type="bool" value="true":This parameter specifies whether angle compensation is applied to the scan data The value true ensures accurate angle correction

 Using the slam_gmapping Package to Collect the Map:

Figure 6 2: Model of the slam_gmapping package

- Sensor_node: This node sends the Lidar data to the /scan topic for the slam_gmapping node

- Teleop_twist_keyboard: This node sends velocity commands from the keyboard to the robot

MyRobot_core processes velocity commands from the teleop_twist_keyboard node to control the robot's movement It updates odometry and tf data using encoder and IMU signals, which are then published to the /tf topic This information is subsequently utilized by the slam_gmapping node for mapping purposes.

- Gmapping (slam_gmapping): After receiving data from the Lidar and the robot, this node creates the Occupancy Grid Map

- Map_server (map_saver): This node saves the map from the Gmapping node into map.pgm (image) and map.yaml (image information)

 Running the map_server node to save the map:

To save the map, run the following command: rosrun map_server map_saver -f ~/[name of map]

The Occupancy Grid Map (OGM), widely utilized in ROS, visually represents spatial information, as illustrated in Figure 5.3 In this map, white areas indicate free space, black areas signify occupied and inaccessible regions, while grey areas denote unknown space.

Figure 6 3: Map after collecting “tang92.pgm”

File tang92.yaml represents the information of the tang92.pgm image: image: /home/hieu/tang92.pgm resolution: 0.050000 origin: [-22.381221, -11.266477, 0.000000] negate: 0 occupied_thresh: 0.65 free_thresh: 0.196

- Image: Path to the image file containing the occupancy data; it can be absolute or relative to the YAML file location

- Resolution: The resolution of the map in meters per pixel

- Origin: The 2-D pose of the lower-left pixel in the map, given in the format (x, y, yaw), where yaw is the rotation counterclockwise in radians (yaw=0 means no rotation)

- Occupied_thresh: Pixels with an occupancy probability greater than this threshold are considered fully occupied

- Free_thresh: Pixels with an occupancy probability less than this threshold are considered free space

- Negate: If set to 0, white pixels are free space, black pixels are occupied space If set to 1, this is reversed.

Robot navigation on generated map

 Setting parameters for the move_base package:

 Setting parameters in costmap_common_params_myRobot.yaml obstacle_range: 5.0 raytrace_range: 9.5 footprint: [[0.32, -0.24], [0.32, 0.24], [-0.32, 0.24], [-0.32, -0.24]]

#robot_radius: 0.35 inflation_radius: 0.6 cost_scaling_factor: 0.1 map_type: costmap observation_sources: scan scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true}

- obstacle_range: 5.0: The range within which the robot can detect obstacles

- raytrace_range: 9.5: The range within which the robot can perform ray tracing to determine obstacle positions

- footprint: This is a list of (x, y) coordinates defining the shape of the robot on a flat surface The robot has a rectangular shape with coordinates given for the corners

- inflation_radius: 0.6: The radius within which obstacles are inflated to ensure the robot maintains a safe distance

- cost_scaling_factor: 0.1: The scaling factor for cost adjustments when approaching obstacles

- map_type: costmap: Specifies that the map type used is a costmap, commonly used for navigation and obstacle avoidance

- observation_sources: scan: Specifies that the observation source is a scan

- scan: Details about the LaserScan sensor providing obstacle data, including frame, data type, topic, marking, and clearing properties

 Setting parameters in global_costmap_params.yaml global_costmap: global_frame: map robot_base_frame: base_footprint update_frequency: 10.0 publish_frequency: 10.0 transform_tolerance: 0.5 static_map: true

- global_frame: This is the global reference frame, where the entire global costmap will be maintained This frame is usually associated with the static map of the environment

- robot_base_frame: This is the base frame of the robot, typically the reference frame attached to the robot

- update_frequency: The frequency at which the global costmap is updated, measured in Hz (times per second)

- publish_frequency: The frequency at which the global costmap is published, measured in Hz

- transform_tolerance: The allowed time to receive transformations from the

TF (transform) system before reporting an error, measured in seconds

- static_map: Using a static map means the map will not change and is used as a fixed reference map

To configure the local costmap in your robot's navigation system, adjust the parameters in the local_costmap_params.yaml file Set the global frame to "odom" and the robot base frame to "base_footprint." Ensure the update and publish frequencies are both set to 10.0 Hz, with a transform tolerance of 0.5 seconds Disable the static map option and enable the rolling window feature, while specifying the costmap dimensions with a width and height of 3 meters and a resolution of 0.05 meters.

The global frame serves as the overarching reference for the local costmap, while the odom frame reflects the robot's local coordinate system, which is sustained by the odometry system that estimates the robot's position using data from motion sensors.

- robot_base_frame: This is the base frame of the robot, typically the reference frame attached to the robot

- update_frequency: The frequency at which the local costmap is updated, measured in Hz (times per second)

- publish_frequency: The frequency at which the local costmap is published, measured in Hz

- transform_tolerance: The allowed time to receive transformations from the TF (transform) system before reporting an error, measured in seconds

- static_map: Do not use a static map for the local costmap

- rolling_window: Use a moving window for the local costmap

- width: The width of the local costmap, measured in meters

- height: The height of the local costmap, measured in meters

- resolution: The resolution of the local costmap, measured in meters per cell

 Setting parameters for move_base_params.yaml: shutdown_costmaps: false controller_frequency: 10.0 planner_patience: 5.0 controller_patience: 15.0 conservative_reset_dist: 3.0 planner_frequency: 5.0 oscillation_timeout: 10.0 oscillation_distance: 0.2

The shutdown_costmaps flag determines whether the robot's costmaps, which represent the surrounding environment and calculate movement costs, will be deactivated Setting this flag to false ensures that the costmaps remain active when the system is initiated.

- controller_frequency: This is the control frequency of the robot's controller, measured in Hz (times per second)

- planner_patience: This is the maximum time the system will wait for the planner to calculate a route before deciding to cancel the request

- controller_patience: This is the maximum time the controller will wait to complete a control cycle before deciding whether the robot has reached the goal

- conservative_reset_dist: This is the minimum distance the robot must move before the controller decides that the robot has started moving again from the beginning

- planner_frequency: This is the update frequency of the planner, measured in

- oscillation_timeout: This is the maximum time the system will wait before deciding that the robot is oscillating (moving back and forth) while moving

- oscillation_distance: This is the distance threshold used to determine if the robot is oscillating

 Setting parameters for the DWA algorithm:

# Robot Configuration Parameters max_vel_x: 0.5 min_vel_x: 0.0 max_vel_y: 0.0 min_vel_y: 0.0

# The velocity when robot is moving in a straight line max_vel_trans: 0.5 min_vel_trans: 0.05 max_vel_theta: 0.75 min_vel_theta: 0.45 acc_lim_x: 2.6

72 acc_lim_y: 0.0 acc_lim_theta: 3.3

# Goal Tolerance Parameters xy_goal_tolerance: 0.1 yaw_goal_tolerance: 0.19 latch_xy_goal_tolerance: false

# Forward Simulation Parameters sim_time: 3.0 vx_samples: 40 vy_samples: 0 vth_samples: 40 controller_frequency: 10.0

# Trajectory Scoring Parameters path_distance_bias: 32.0 goal_distance_bias: 20.0 occdist_scale: 0.02 forward_point_distance: 0.325 stop_time_buffer: 0.2 scaling_speed: 0.25 max_scaling_factor: 0.2

# Oscillation Prevention Parameters oscillation_reset_dist: 0.05

# Debugging publish_traj_pc : true

73 publish_cost_grid_pc: true

- max_vel_x, max_vel_y: Maximum velocities along the x and y axes (m/s)

- min_vel_x, min_vel_y: Minimum velocities along the x and y axes (m/s)

- max_vel_trans: Maximum velocity when the robot is moving in a straight line (m/s)

- min_vel_trans: Minimum velocity when the robot is moving in a straight line (m/s)

- max_vel_theta: Maximum angular velocity when the robot is rotating (rad/s)

- min_vel_theta: Minimum angular velocity when the robot is rotating (rad/s)

- acc_lim_x: Maximum acceleration limit along the x-axis (m/s²)

- acc_lim_y: Maximum acceleration limit along the y-axis (m/s²)

- acc_lim_theta: Maximum angular acceleration limit (rad/s²)

- xy_goal_tolerance: The minimum distance the robot must reach near the goal on the xy plane to be considered as having arrived (m)

- yaw_goal_tolerance: Allowable angular error when the robot reaches the goal (rad)

The parameter latch_xy_goal_tolerance determines whether the robot maintains a fixed xy distance to the goal after reaching it When set to true, the robot locks this distance, while a false setting allows for continuous updates to the distance as the robot moves.

- sim_time: Simulation time to evaluate trajectories (s)

- vx_samples: Number of velocity samples along the x-axis to test

- vy_samples: Number of velocity samples along the y-axis to test (0 because the robot does not move sideways)

- vth_samples: Number of angular velocity samples to test

- controller_frequency: Controller frequency (Hz)

 Declaring parameters for the move_base package:

Solving the TSP

Figure 6 4: Flowchart for the ACO Algorithm

The process of implementing the algorithm will proceed as follows:

 Step 1: Initialize ants and randomly place them in cities

Each ant in the colony is randomly assigned to a city, creating varied starting points that enhance the diversity of initial solutions This approach allows ants to begin their journey from different locations, enabling them to explore a range of unique routes.

 Step 2: Construct routes by moving through cities based on the values of α and β

Each ant will construct a route by moving from city to city This movement process is guided by two parameters, α and β

- α: This parameter adjusts the importance of the pheromone on the paths Edges with higher pheromone values will have a higher probability of being selected

- β: This parameter adjusts the importance of heuristic information, such as distance or cost between cities Cities with more attractive heuristic values will have a higher probability of being selected

 This step is the search process of the ants, where each ant tries to build a route based on the current pheromone information and heuristic information

 Step 3: Calculate the route distance for each ant

After each ant completes its route, the total distance of that route will be calculated

Calculating the route distance allows evaluating the quality of each route, helping to determine which route is more optimal

 Step 4: Increase the pheromone value on the paths based on the route distances of the ants

Once the routes are assessed, the pheromone levels on the paths will be enhanced according to the quality of the routes, with superior routes characterized by shorter distances receiving greater pheromone deposits.

This step encourages the ants in the subsequent iterations to choose better routes, thus helping to optimize the solution

 Step 5: Decrease the pheromone value on all paths based on the pheromone evaporation rate

Gradually decrease the pheromone values on all edges to prevent old pheromone from dominating the search process and to encourage exploration of new routes

Maintain a balance between exploiting known good routes and exploring new routes, avoiding premature convergence to suboptimal solutions

 Step 6: Repeat from Step 2 until the specified number of generations or target value is reached

Repeat the process from Step 2 to Step 5 until the specified number of generations is reached or the target value is achieved

Ensure that the algorithm continues to search and optimize until the desired result is obtained

The program begins by initializing several key parameters: colony_size0 represents the number of ants, while alpha (set to 1.0) and beta (set to 3.0) are coefficients that determine the significance of pheromone trails and heuristic information, respectively The pheromone evaporation coefficient, rho, is established at 0.1, influencing the rate at which pheromones dissipate Each ant deposits a constant amount of pheromone, defined by pheromone_deposit_weight, after completing its route Additionally, the initial pheromone level on each edge is set to 1.0, and steps0 indicates the total number of iterations the algorithm will perform to achieve optimization.

 The program executes the algorithm in a loop for 100 iterations: for step in range(self.steps):

In the algorithm, each ant finds its tour and calculates the distance, allowing for the addition of pheromones based on the tour's quality If an ant's distance is shorter than the global best distance, it updates the global best tour and distance Additionally, the pheromone levels on the edges are adjusted by applying a decay factor, ensuring that the pheromone concentration reflects the most efficient paths over time.

This general program includes multiple subprograms to perform tasks such as : finding the ant's route, updating the distance, and updating pheromone levels

The program utilizes the matplotlib library to visualize the algorithm's results through a plotting function This function, defined as `plot`, allows customization options such as line width, point radius, annotation size, and DPI settings It constructs lists for the x, y, z, and w coordinates based on the nodes in the global best tour, ensuring that the starting point is repeated to close the loop The coordinates are then combined into an array for further processing or visualization.

2.0))` for point representation Set the title with `plt.title(self.mode)` and annotate points using `plt.annotate(self.labels[i], (x[i], y[i]), size=annotation_size)` for clarity To save the plot, specify a filename with `name = '{0}.png'.format(self.mode)` if none is provided, and use `plt.savefig(name, dpi=dpi)` to save it at the desired resolution before displaying it with `plt.show()`.

 Main Program for Receiving Room Points from the Web: def web_data_callback(self, get_data):

To retrieve data from the web and incorporate it into an array, initialize the variable `self.dem` to 0 Use the `get_data.data` to obtain the dataset, and iterate through it in increments of four For each segment, convert the data into a tuple and check if it already exists in the data array.

To determine if `tuple_data` is already present in `self.data_array`, iterate through each `tuple_inner` in `self.data_array` If a match is found, log the message "Trùng biến" and set the variable `exists_in_data_array` to True before breaking the loop.

If `tuple_data` is not already present in `self.data_array`, it will be added to the list A success message will be logged, indicating the successful addition, followed by an update log showing the current state of `self.data_array`.

# Process data and compute the path when data is received from the web self.process_data_and_compute_path()

The web_data_callback function facilitates the reception of data transmitted via the /web_data topic, enabling ROS to process and integrate room points into the algorithm for optimal result computation.

The Robot Navigation Program utilizes an action client to communicate with the 'move_base' service, ensuring it is ready before proceeding It sets the target pose's frame ID to "map" and defines the position and orientation of the target The program sends the navigation goal and waits for the result, shutting down if the action service is unavailable.

80 else: return client.get_result()

- Actionlib SimpleActionClient is a class in the actionlib library of ROS, used to create a client to communicate with an action server

- Move_base is the name of the action server that the client will connect to

- MoveBaseAction is the type of action that the action server supports

- Client.wait_for_server() is a function that waits until the action server named 'move_base' is ready to receive goals from the client

- MoveBaseGoal() is a message type in ROS, used to define a goal for the move_base action

- Target.target_pose.header.frame_id = "map" sets the frame of the goal to

"map", meaning the coordinates of the goal will be determined in the "map" coordinate system

- Target.target_pose.pose.position.x, y are the x and y coordinates of the goal in the "map" coordinate system

- Target.target_pose.pose.orientation.z, w are the quaternion components of the orientation of the goal

- Wait = client.wait_for_result() is a function that waits for the result from the action server after the goal has been sent

- If no result is received (wait is False), the rospy.signal_shutdown() function is called to notify and terminate the program

- If a result is received, client.get_result() returns the result from the action server after the goal has been completed.

Building a user interface with web

6.5.1 Setting up an Apache server

First, we install the Apache server for the Linux operating system by running the following command in the Terminal: sudo apt-get install apache2 -y

Once the installation is successful, we open the browser and enter the server's IP address (usually localhost or 127.0.0.1) to check if the Apache server is running

Figure 6 5: Apache Server Browser Interface After Installation

When the browser displays a page similar to the one above, the Apache server has been successfully installed Next, we will install the MySQL database for the server

6.5.2 Setting up MySQL/MariaDB database

MySQL is an open-source relational database management system widely used around the world You can install it with the following command: sudo apt-get install mysql-server -y

After installing MySQL, we proceed to install MariaDB, another open-source relational database management system developed from MySQL: sudo apt install mariadb-server

To use the MySQL database, we need a user account You can create it with the following command:

CREATE USER ‘user’@'localhost' IDENTIFIED WITH mysql_native_password BY 'your password';

Replace 'user' and 'your password' with your desired username and password.

Figure 6 6: Creating a User and Password for the MySQL Database

Log in with the newly created account using the command: sudo mysql -u -p

Figure 6 7: Logging into MySQL User

To create a database, enter the following command:

Figure 6 8: Command to Create a Database

Next, access the database to start using it with the following command:

Figure 6 9: Command to Access the Database

To utilize the MySQL/MariaDB database effectively, the next step involves creating a table to store essential data from the web server To accomplish this, follow the specified structure for creating a database table.

83 column1_name column1_datatype constraints, column2_name column2_datatype constraints,

columnN_name columnN_datatype constraints

 table_name: The name of the table we want to create

 column_name: The name of each column in the table

 datatype: The data type of the column (e.g., INT, VARCHAR, DATE)

 constraints: The constraints of the column (e.g., PRIMARY KEY, NOT NULL, AUTO_INCREMENT)

Figure 6 10: Command to Create a Table in the Database

A successfully created table will have a structure that can be viewed using the command

Figure 6 11: Database Table After Creation 6.5.3 Design and implementation: Fetching data from the web to the database

 Fetching Data to the Database

To allow the website to send and receive data to and from the MySQL/MariaDB database, we use PHP code to connect them

$conn = mysqli_connect($server, $user, $password, $dbname);

Figure 6 12: PHP Code to Connect to the Database

 $server = "localhost";: This variable contains the address of the database server

 $user = "admin";: This variable contains the username (the MySQL login user) to connect to the database

 $password = "123456";: This variable contains the user’s password

 $dbname = "users";: This variable contains the name of the database to connect to

 $conn = mysqli_connect($server, $user, $password, $dbname);: This function creates a connection to the MySQL/MariaDB database

After establishing a connection to the database, we begin data collection from the website by designing a user-friendly web interface Each input field is assigned a unique ID variable, enabling the storage of data into the database using the HTTP POST method.

Next, we use PHP code to save the input values into the corresponding columns in the database :

Figure 6 15: Fetching Values from IDs

The command htmlspecialchars($_POST["user"]); fetches the user input data via POST method, converts it into special characters for data protection, and then stores it in the variable $acc

Figure 6 16: Sending Variables to the Database

The code $sql = "insert into account (user, pass) values ('$acc', '$pass')"; sends the variables into the corresponding database columns

Figure 6 17: Data After Saving to the Database

After storing the data in the database, we retrieve it on the login information page to verify the accuracy of registered accounts If the account details match, users are redirected to the main page; otherwise, an incorrect password notification is displayed.

Figure 6 18: Notification for Incorrect Password Entry

Similarly, for the order information form, we create an interface with the database table document for storage

Figure 6 20: Database Table for Order Placement

 Fetching Data from the Database to the Web

Một trong những phương pháp phổ biến để đưa dữ liệu từ cơ sở dữ liệu lên là chuyển đổi dữ liệu sang định dạng JSON.

Figure 6 21: Program to Fetch Data from the Database

The line header('Content-Type: application/json'); informs the browser that the returned data will be in JSON format

We read the data from the document table in the database and store it in the variable $result

The command json_encode($data); converts the array $data into JSON format

Then, the encoded JSON data is sent to the browser using echo json_encode($data);

Figure 6 22: Data After Conversion to JSON Format

From this, we can build the order history webpage

Data transmitted to the database enables robot control and supports various functionalities, including order security password verification, email dispatch to recipients, and transmission of room and cabinet numbers to the control computer.

First, ensure that the computer has ROS with Rosbridge installed To launch Rosbridge, use the following command:

89 roslaunch rosbridge_server rosbridge_websocket.launch

You will see that the port used to connect to Rosbridge via WebSocket is 9090

Next, we need to build a JavaScript code snippet to connect to Rosbridge:

Figure 6 25: JavaScript Code to Connect to Rosbridge

The line const ROSBRIDGE_SERVER_IP

To establish a WebSocket connection with Rosbridge, use the address `ws://${window.location.hostname}:9090`, where `{window.location.hostname}` can be substituted with a static IP address like 192.168.31.160, along with the standard port 9090.

Then, we initialize a ROSLIB.Ros object to connect to the Rosbridge server at the specified address

Figure 6 26: Connecting to Rosbridge IP

Finally, display the connection status on the webpage If the webpage is connected to Rosbridge, it will show "Connected"; otherwise, it will show "Closed"

In case the webpage automatically disconnects from Rosbridge, set up a 1-second periodic check to verify the connection

After successfully connecting to Rosbridge, the next step is to create a topic to send and receive data from ROS

 Name: The name of the topic

 Message type: The type of data to be transmitted

To send a message to a topic, use the command :

Figure 6 29: Publishing Messages to a Topic

The message is retrieved using the ROSLIB.Message function, and the "data:" contains the data to be sent

To retrieve a message from a topic, use the command:

Figure 6 30: Subscribing to Messages from a Topic

6.5.5 Connecting APIs for various applications on the webpage

Sending Emails via Elastic Email API: First, obtain an API key from an email sending platform like Elastic Email

Figure 6 31: Elastic Email API Key

Sau đó ta biết một đoạn Javascript để sử dụng gửi email thông qua API key vừa lấy

Figure 6 32: Mã kết nối API gửi email

To configure email data, the emailData object must include essential details for sending an email, such as the API key, recipient's email address, email subject, sender's email address, and the content of the email.

Send the email via Fetch API: Use fetch to send a POST request to the Elastic Email API with the configured information

Figure 6 33: Email Sent from the Webpage

 User Registration and Login Interface

The login interface allows users to access the main webpage of the robot, ensuring security and protecting the webpage from unauthorized access

Upon successful login, users will be directed to the main page, which features sections for calling the robot, checking the robot's current location on the map, reviewing transaction history, and accessing detailed robot information.

In the "Map" section, users can call the robot by clicking on the input box below the map and selecting the room they want to call

Figure 6 37: Calling the Robot and Monitoring the Robot's Route

In the "History" section, users can view the transaction history of orders, such as document names, room numbers, and sending times,…

The Order Placement Interface on the robot's screen activates when summoned by the user, allowing them to input order details For security, users must enter a password for Lockers 1 and 2, while Locker 3 remains accessible without a password for non-sensitive documents.

Users can enter multiple rooms at once, entering each room's information and clicking

"Add" to add the next room After entering all the rooms, click "Submit" to save the system and start the robot's delivery

When the robot arrives at a room with Locker 1 or Locker 2 for document security, the recipient must check their email for the password Entering the correct password unlocks the locker, allowing the recipient to retrieve the document After closing the locker, the recipient clicks "Confirm" to enable the robot to proceed.

The robot features a face interface that continuously displays various random expressions on its screen Upon arriving in the sender's room, the "Order" button will automatically appear, allowing the sender to conveniently input their order information.

Figure 6 41: "Order" Button When the robot reaches the recipient's room, the "Confirm" button will automatically appear for the recipient to confirm the order and enter the password (if any)

SIMULATION AND EXPERIMENTAL RESULTS

Simulation results

The team utilized Gazebo for simulating the robot and implemented the Ant Colony Optimization (ACO) algorithm to address the Traveling Salesman Problem (TSP) related to document transportation Furthermore, Matlab was employed to simulate the robot's kinematics alongside the ACO algorithm.

 Simulation of the Kinematics of a Differential Drive Robot

- Set the velocity parameters v0.3( / ),m s 0(rad s/ ), and based on equation (2.23), we derive  L  R  4.13( rad s / )

Figure 7 1: Robot Position and Path in Matlab for Case 1

- Result: The Matlab simulation results show the Robot's position after 5 seconds of simulation time , x3( ),m y0( ),m 0(rad)

- Set the velocity parameters v0.3( / ),m s 1.5(rad s/ ), and based on equation (2.23), we derive  L   0.7( rad s / ), R  8.9( rad s / )

Figure 7 2: Robot Position and Path in Matlab for Case 2

Result: The Matlab simulation results show the Robot's position after 5 seconds of simulation time, x 0.2( ),m y0.74( ),m 3.75(rad)

- Set the velocity parameters v0( / ),m s 1.2(rad s/ ), and based on equation (2.23) , we derive  L   3.87( rad s / ), R  3.87( rad s / )

Figure 7 3: Robot Position and Path in Matlab for Case 3

- Result: The Matlab simulation results show the Robot's position after 5 seconds of simulation time , x0( ),m y0( ),m 3(rad)

 Simulation of ACO Solving the TSP

Table 7 1: Parameters Used in the ACO Algorithm

Parameter Description Value m iter Number of iterations 100 m Number of initial ants 100

Figure 7 4: Matlab Results for ACO (4 points)

Figure 7 5: Matlab Results for ACO (5 points)

The points inputted into the ACO algorithm for Matlab were the actual points used by the team in the Gazebo environment

The ACO algorithm, when simulated in Matlab, yields results that align well with those from Gazebo By utilizing Euclidean distance in the Traveling Salesman Problem (TSP), the algorithm's efficiency and accuracy in identifying the optimal solution are effectively assessed.

The team developed a 3D simulation environment for the Robot using Gazebo, following the design of the Robot in SolidWorks They converted the SolidWorks file into a URDF file, which was then imported into Gazebo to effectively simulate and control the Robot in line with the project's requirements.

Figure 7 6: Robot Model after Conversion from SolidWorks to URDF

In Figure 5.1, the team's Robot is showcased within the Gazebo environment The team then developed a virtual World for the Robot to execute SLAM, navigation, and optimization algorithms With Gazebo's built-in support for ROS communication, the team simply ran the pre-existing nodes to initiate the simulation.

Figure 7 7: Simulation Environment in Gazebo

After transforming the Robot, the team initiated the "teleop_twist_keyboard" node to transmit velocity commands from the keyboard, effectively controlling the Robot to gather mapping data.

Figure 7 8: Performing SLAM to Collect the Map After collecting the map, the team compared the size of the collected Map with the size of the World created in Gazebo

Figure 7 9: Map Collected Using SLAM with Gmapping

During the mapping process, the team conducted multiple iterations to survey the accuracy of the collected map compared to the Gazebo simulation environment Based on the formula from [18]:

In which: x: Measured size of the map (m) y : Actual size in the Gazebo (m)

Table 7 2: Accuracy Calculation of the Map Compared to Gazebo

Measured size of the map (m)

Actual size in Gazebo (m) Accuracy (%) a 15.8 16 98.75 b 5.84 5.9 98.9 c 1.97 2 98.5 d 15.68 15.8 99.2

*Applying ACO Algorithm to Solve TSP

The team applied the ACO algorithm for document transportation in the Gazebo simulation environment

Table 7 3: Positions of Rooms in the Gazebo Simulation Environment

In the Gazebo simulation, the user can call the robot to their location to provide essential details for document delivery, including recipient information, documents, compartment numbers, and room numbers If using compartments 1 and 2, the user must also input passwords to ensure secure delivery.

104 entry on the Robot's screen, the room positions will be sent from the GUI (web) to the ACO algorithm program to calculate the optimal path for the Robot

 ACO 4 Rooms (Transport from Room 3 to Rooms 4, 5, 6, and return to Home)

The ACO algorithm results indicate the total travel cost for visiting four rooms, with the robot beginning its journey from Room 3 The optimized sequence for document transport is Room 3 (call) to Room 4, followed by Room 5, Room 6, and finally returning home.

Figure 7 12: Document Transport Process After Calculation (4 Rooms)

To compare the Robot's movement results with the algorithm's output, the team collected data on the Robot's travel path by recording its route during document delivery to the rooms

Figure 7 13: Robot Travel Path in Gazebo Simulation (4 Rooms)

 ACO 5 Rooms (Transport from Room 2 to Rooms 1, 7, 4, 3, and return to Home)

Figure 7 14: ACO Algorithm Results and Total Travel Cost (m) for 5 Rooms

The program calculates the cost and sequence of rooms to visit, beginning with Room 2 (call) The Robot then delivers documents in the order of Room 2 (call), Room 1, Room 7, Room 4, Room 3, and finally returns home.

Figure 7 15: Document Transport Process After Calculation (5 Rooms)

To evaluate the Robot's movement performance against the algorithm's predictions, the team gathered data by tracking the Robot's delivery route to various rooms.

Figure 7 16: Robot Travel Path in Gazebo Simulation (5 Rooms)

Remarks: The TSP problem has been solved by applying the ACO algorithm to document transportation, achieving the shortest total travel cost (m), reducing energy consumption, and saving time in transportation.

Experimental Results

7.2.1 Wheel Speed Control Using PID Controller

To determine the parameters 𝐾 and 𝐾 for the PID controller in managing the speed of two motors, our team employed the Ziegler-Nichols method, an empirical approach The process involves specific sequential steps to achieve accurate control.

In the initial step, the team utilized a PWM signal with a 100% duty cycle to control the motor, ensuring the control signal remained at its maximum level They subsequently monitored the motor's speed response over time and created a graph for detailed analysis.

Figure 7 17: The velocity response graph of the Right motor

Figure 7 18: The velocity response graph of the left motor

 Step 2: Determine the transfer function parameters

Here, 𝜔 is the maximum speed of the motor when the 100% PWM signal is applied, 𝑈 is the control signal (in this case, 100%)

Identify the time 𝑇 when the speed starts to increase from the response graph, the time 𝑇 when the speed reaches 63.2% of the maximum speed The time constant T is calculated as:

Figure 7 19:Determine the parameters of the transfer function of the Right motor Right motor ∶ 𝑇 = 𝑇 − 𝑇 = 68.54569 − 68.25 = 0.29569 𝑠 = 𝑇

Figure 7 20:Determine the parameters of the transfer function of the Left motor Left motor ∶ 𝑇 = 𝑇 − 𝑇 = 164.43506 − 164.141 = 0.29406𝑠 = 𝑇

 Step 3: Determine the transfer function of the DC motor

- Select the desired response time for two motor: 𝑇 = 0.1𝑠

- Use the following formulas to calculate the controller parameters

 Experimental results using the PID controller with the parameters calculated above:

Figure 7 21:Experimental results of the PID controller regulating the speed of the right motor under no-load conditions

Figure 7 22:Experimental results of the PID controller regulating the speed of the right motor under a 40kg load

Figure 7 23:Experimental results of the PID controller regulating the speed of the left motor under no-load conditions

Figure 7 24:Experimental results of the PID controller regulating the speed of the left motor under a 40kg load 7.2.2 Mapping with Gmapping

The team collected a map using Gmapping on the "9th Floor, Block A1, Central Building" after simulating on Gazebo to transport documents between rooms

Figure 7 25: Map After SLAM on the 9th Floor of the Central Building

Figure 7 27: Emergency Exit Plan and Office Locations on the 9th Floor, Block A1

Figure 7 28: Dimensions of the Collected Map

Measured size of the map (m)

Actual size of the 9th floor (m) Accuracy (%) a 14.4 14.2 98.61 b 6.05 6 99.2 c 2.25 2.23 99.1 d 28.8 28.4 98.61

Table 7 4: Comparison of Collected Map Dimensions to Actual

After gathering the map, the team assessed its dimensions against the actual measurements of the 9th floor The findings revealed a high level of accuracy, demonstrating an excellent correlation between the collected map and the real layout.

The robot is programmed to navigate to the desired position with a positional error (

, x y) of  0.1 (m) and an angular error () of  0.19 (rad)

Figure 7 29: Navigation Result for Room A1-901

The robot was navigated to room A1-901 with the target coordinates of x = -1, y = -8.5, and θ = 0 The actual position recorded was x = -1.067, y = -8.483, and θ = -0.045 The deviations observed were 0.067 meters for x, 0.017 meters for y, and 0.045 radians for θ These deviations are well within the error tolerance established by the team.

Figure 7 30: Navigation Result for Room A1-902

Result: with the desired value 5, 2, 1.57 x   y     2  , after navigating the Robot to room A1-902, the actual position of the Robot is 4.954, 2.063, 1.7 x  y   The deviation in distance for 𝑥 is 0.046 (m), for y is

0.017(m) and the angular deviation  is 0.13(rad) Therefore, this deviation completely satisfies the error tolerance set by the group

Figure 7 31: Navigation Result for Room A1-903

After navigating the robot to room A1-903 with the target coordinates of x = -2 and y = 4, the actual position recorded was x = -2.064, y = 3.947, and θ = 0.16 This resulted in a distance deviation of 0.064 meters in the x-direction and 0.053 meters in the y-direction, along with an angular deviation.

 is 0.16 (rad) Therefore, this deviation completely satisfies the error tolerance set by the group

Figure 7 32: Navigation Result for Room A1-904

After navigating the robot to room A1-904 with the target values of x = -6, y = 4, and θ = 0, the robot's actual position was recorded as x = -6.02, y = 3.95, and θ = -0.02 The deviations from the desired values were 0.02 meters for x, 0.05 meters for y, and 0.02 radians for θ These deviations fall within the error tolerance parameters established by the group.

Figure 7 33: Navigation Result for Room A1-905

Result: with the desired value x 12,y4,  3.14, after navigating the Robot to room A1-905 , the actual position of the Robot is 11.933, 3.984, 3.12 x  y  The deviation in distance for 𝑥 is 0.067 (m), for y is

0.016 (m) and the angular deviation  is 0.02 (rad) Therefore, this deviation completely satisfies the error tolerance set by the group

In the navigation result for Room A1-906, the robot was directed to the target coordinates of x = -9 and y = -2.5, with an orientation angle θ approximately equal to 3.14 Upon reaching the destination, the robot's actual position was recorded as x = -9.062, y = -2.45, and θ = 3.139 This resulted in a distance deviation of 0.062 meters in the x-coordinate and a corresponding adjustment in the y-coordinate.

0.05 (m) and the angular deviation  is 0.001 (rad) Therefore, this deviation completely satisfies the error tolerance set by the group

Figure 7 35: Navigation Result for Room A1-907

After navigating the robot to room A1-907, the actual position recorded is x = -14.007, y = -8.501, and θ = -3.08 The deviations from the desired values are minimal, with a distance deviation of 0.007 meters for x, 0.001 meters for y, and an angular deviation of 0.06 radians These results demonstrate that the deviations are well within the error tolerance established by the team.

The Dynamic Window Approach algorithm enables robots to assess potential speeds and directions, facilitating optimal decision-making for safe and efficient movement.

Figure 7 36: Robot avoiding static obstacles

Figure 7 37: Robot avoiding dynamic (moving) obstacles

The Dynamic Window Approach algorithm enhances a robot's flexibility in navigating environments by effectively avoiding both dynamic and static obstacles, thereby improving its overall navigation capabilities.

7.2.5 Results of Optimizing the TSP for the Robot

After testing on Gazebo, the team continued to solve the optimal TSP for the Robot on the 9th floor of the central building

Figure 7 38: Results of the ACO algorithm

Figure 7 39: Results of the ACO algorithm

To compare the Robot's travel results with the algorithm's results, the team collected data on the Robot's travel route by recording its path while transporting documents to the rooms

The robot's travel route on the 9th floor was optimized using the Ant Colony Optimization (ACO) algorithm to effectively solve the Traveling Salesman Problem (TSP) This optimization enhanced the robot's transportation efficiency by improving both its route selection and energy consumption.

CONCLUSION AND FUTURE DEVELOPMENT

Conclusion

Regarding the topic of "Document-Carrying Robot," after research, learning, and implementation, the team has reached several conclusions :

 Designed and constructed the model using SolidWorks software

 Designed the PCB circuit using Altium Designer software

 Calculated the dynamics of the differential-drive robot and applied it to robot control

 Simulated and evaluated the robot dynamics using Matlab

 Calculated and selected the necessary devices

 Tested and evaluated the ACO algorithm simulation on Gazebo to solve the TSP problem

 Established a database to store and retrieve data for user needs

 Developed a user-friendly and easy-to-use interface

 Successfully secured important documents with passwords

 Successfully tested and evaluated the robot on a real model.

Future Development

This topic has some limitations:

 The Lidar is placed in front with a scanning angle of 180 degrees, limiting scanning range

 The robot faces difficulties in narrow environments

 Lidar data collection still contains errors during experimental runs

 Lack of a charging station to fully charge the battery during use

 Absence of image processing applications such as facial recognition, etc

To address these limitations, the team proposes the following directions for future development:

 Develop additional charging stations and implement automatic charging for the robot

 Utilize more sensors and cameras so the robot can move between floors

[1] Rich Tech Robotics, Autonomous food service robots, https://www.richtechrobotics.com/matradee

[2] Relay Robotics, The World’s First Hospitality Service Robot, https://www.relayrobotics.com/blog/2020/2/25/the-worlds-first-hospitalityservice-robot- doubled-in-room-dining-in-one-month-emc2-chicago

[3] FUN! JAPAN Team (2019) Bạn đã gặp chú robot phục vụ phòng của khách sạn Prince ở Tokyo chưa? , https://www.fun-japan.jp/vn/articles/7605

[4] Relay Robotics, The World’s First Hospitality Service Robot, https://www.relayrobotics.com/blog/2020/2/25/the-worlds-first-hospitalityservice-robot- doubled-in-room-dining-in-one-month-emc2-chicago

[5] Hospital delivery robot, https://www.medicalexpo.com/prod/futronics/product-4579938-1111561.html

[6] Wikipedia, Differential wheeled robot, https://en.wikipedia.org/wiki/Differential_wheeled_robot

[7] Juan Angel Gonzalez-Aguirre, Ricardo Osorio-Oliveros , Karen L

RodríguezHernández , Javier Lizárraga-Iturralde , Rubén Morales Menendez , Ricardo A Ramírez-Mendoza , Mauricio Adolfo Ramírez-Moreno and Jorge de Jesús Lozoya- Santos (2021), Service Robots: Trends and Technology

[8] Wikipedia, PID controller, https://en.wikipedia.org/wiki/PID_controller

[9] PGS.TS Trịnh Chất, TS Lê Văn Uyển, Tính toán thiết kế hệ dẫn động cơ khí, Nhà xuất bản Giáo dục, 2006

[10] Autonomous Mobile Robots Worldwide, https://www.robotics247.com/article/geek_celebrates_sale_20000_autonomous_mobil e_robots_worldwide

Thuật toán Dijkstra là một phương pháp hiệu quả để giải quyết bài toán tìm đường đi ngắn nhất trong đồ thị, được ứng dụng rộng rãi trong nhiều lĩnh vực hiện nay Bài viết của Ngọc Thúy (2024) trình bày chi tiết về cách hoạt động của thuật toán này cũng như các ứng dụng thực tiễn, từ định vị GPS đến tối ưu hóa mạng lưới giao thông Việc hiểu rõ thuật toán Dijkstra không chỉ giúp cải thiện khả năng tìm đường mà còn mở ra nhiều cơ hội ứng dụng trong công nghệ thông tin và logistics.

[12] Building an AMR robot, https://www.linkedin.com/pulse/seer-robotics-one stop-amr-building-solution-unmanned-chassis-mms7c

[13] Rosserial , https://atadiat.com/en/e-rosserial-arduino-introduction/

[14] Thomas STUTZLE, Marco DORIGO IRIDIA, ACO Algorithms for theTraveling Salesman Problem, Universit´e Libre de Bruxelles, Belgium

[15] Norzam, W A S., H F Hawari, and K Kamarudin “Analysis of mobile robot indoor mapping using GMapping based SLAM with different parameter.” IOP Conference Series: Materials Science and Engineering Vol 705 No 1 IOP Publishing, 2019

[16] Open Robotics, Setup and Configuration of the Navigation Stack on a Robot, https://wiki.ros.org/navigation/Tutorials/RobotSetup.

Ngày đăng: 19/12/2024, 15:47

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w